Searching \ for 'Learningssembly' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=learningssembly
Search entire site for: 'Learningssembly'.

Truncated match.
PICList Thread
'Learningssembly'
2000\05\16@132456 by Samuel Ace Winchenbach

flavicon
face
Hello All.

I have noticed that not many people are using PIC C.. so I have decided to
teach myself assembly.  I have a number of very quick, small questions.
Here is the code I have come up with so far:
;============================================
       list    p=16f84
TMR0    EQU     0x01
OREG    EQU     0x81
PORTA   EQU     0x05
TRISA   EQU     0x85
STATUS  EQU     0x03
RP0     EQU     5
W       EQU     0

       ORG     0x000
BEGIN:
       BSF     STATUS, RP0             ;Bank 1
       MOVLW   b'11011000'
       MOVWF   OREG                    ;Setup Option Register
     MOVLW     b'0000'
     MOVWF     TRISA                   ;Make PORTA outputs


LOOP:                           ;Do loop stuff in here.

       GOTO    LOOP
       END
;============================================
When I compile this using MPLAB I get the following warnings:

Message[302] C:\WINDOWS\DESKTOP\LED.ASM 14 : Register in operand not in bank
0.  Ensure that bank bits are correct.
Message[302] C:\WINDOWS\DESKTOP\LED.ASM 16 : Register in operand not in bank
0.  Ensure that bank bits are correct.

My code sets the option register to bank 1...  so why would I get these
warnings?
also.. how do you deal with registers that are in both banks? (STATUS,
INTCON, PCLATH,FSR)  I just equated the STATUS register to the lowest HEX
value (0x03)

and my final small question is this... which way is better to set a
variable, load a literal into W and then store it in "f" like I did in my
code, or like the following:
       MOVF    b'11011000',OREG

Thanks for any and all help, sorry to be a pest.

2000\05\16@134402 by Don Campbell

flavicon
face
<snip>

> When I compile this using MPLAB I get the following warnings:
>
> Message[302] C:\WINDOWS\DESKTOP\LED.ASM 14 : Register in operand not in bank
> 0.  Ensure that bank bits are correct.
> Message[302] C:\WINDOWS\DESKTOP\LED.ASM 16 : Register in operand not in bank
> 0.  Ensure that bank bits are correct.
>
> My code sets the option register to bank 1...  so why would I get these
> warnings?

It's normal...the assembler just gives the warning anyway.  There is a way to
turn it off, you can most likely find it in the help/manual. (ot maybe the
archives....)

> also.. how do you deal with registers that are in both banks? (STATUS,
> INTCON, PCLATH,FSR)  I just equated the STATUS register to the lowest HEX
> value (0x03)

That's exactly what you do...there is an include file for each processor that
has all the register definitions set up so you don't have to.  These should be
in the mplab directory.

> and my final small question is this... which way is better to set a
> variable, load a literal into W and then store it in "f" like I did in my
> code, or like the following:
>         MOVF    b'11011000',OREG

The only(?) way to do it is to use the W method as you did in your code, the
above instruction will not compile (as far as I know) it isn't a standard
operation.  Mplab may expand this into the two lines that would normally be
used, but I'd just stick to the proper intraction to begin with

> Thanks for any and all help, sorry to be a pest.

No problem,
Don

2000\05\16@163326 by Henrik Nielsen

flavicon
face
look at this it will kill you problem
----- Original Message -----
From: "Samuel Ace Winchenbach" <spam_OUTswinchenTakeThisOuTspamEECE.MAINE.EDU>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Tuesday, May 16, 2000 7:22 PM
Subject: Learningssembly


{Quote hidden}

2000\05\17@123012 by pandersn

flavicon
face
Sam....

Last question first: you cannot move one ram location to another, you must
first move it to W and then from W to f.

As I recall, you can ask the asemble to eliminate the "302" potential
assembly error. I ignor it. It will not affect your code, just a warning.

As I recall, you can access a register shown in the table as either bank 0
or bank 1 from either bank your code is executed in.

I recommend the basic book by John Peatman, "Design with PIC
Microcontrollers." You can order from the on-line bookstores. He's a prof
at Georgia Tech. Good read, and reasonably quick.

Phil Anderson. Good Luck!

On Tuesday, May 16, 2000 12:22 PM, Samuel Ace Winchenbach
[SMTP:swinchenspamKILLspamEECE.MAINE.EDU] wrote:
> Hello All.
>
> I have noticed that not many people are using PIC C.. so I have decided
to
{Quote hidden}

bank
> 0.  Ensure that bank bits are correct.
> Message[302] C:\WINDOWS\DESKTOP\LED.ASM 16 : Register in operand not in
bank
{Quote hidden}

2000\05\17@123558 by pandersn
flavicon
face
I question your assumption of most are NOT doing C.

Where is your data on this issue. Ya, I'm interested, curious on what data you used to base your comment? Assembly or C?

Phil Anderson

On Tuesday, May 16, 2000 3:41 PM, Henrik Nielsen [SMTP:.....hnhjKILLspamspam.....MAIL1.STOFANET.DK] wrote:
> look at this it will kill you problem
> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...