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:swinchen
KILLspamEECE.MAINE.EDU] wrote:
> Hello All.
>
> I have noticed that not many people are using PIC C.. so I have decided
to
{Quote hidden}> 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
{Quote hidden}> 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.