0
votes

Compiling the following program

LADR_0x0010:
    MOVLW 0x10           ;   b'00010000'  d'016'
    BCF STATUS,RP0       ; !!Bank Register-Bank(0/1)-Select
    BCF STATUS,RP1       ; !!Bank Register-Bank(2/3)-Select
    MOVWF LRAM_0x7D

gives me syntax error on BCF lines

2
Try BCF STATUS, 5or just BCF RP0 - Mike
Have you include xc.inc? - Mike
Which IDE are you using? Which microcontroller? Did you add proper MPASM PIC16Fxxx processor include file it to your project? - GJ.
@Mike Replacing RP0 with 5 removes the error. How can I replace RP1? - Saul Chavez Sanchez
Try to answer my questions first, if you wont to know where are you! - GJ.

2 Answers

0
votes

If you are trying to build this using MPLABX v5.40 or v5.45 with the pic-as(v2.xx) tool chain this syntax works:

LADR_0x0010:
    MOVLW 0x10           ;   b'00010000'  d'016'
    BCF STATUS,STATUS_RP0_POSITION       ; !!Bank Register-Bank(0/1)-Select
    BCF STATUS,STATUS_RP1_POSITION       ; !!Bank Register-Bank(2/3)-Select
    MOVWF LRAM_0x7D
0
votes

I suppose you are using PIC12Fxxx or PIC16Fxxx microcontrollers. You can read MLAB help file in main menu press Help/Help Contens and type banksel

The help will show:

Application Example 2 - banksel

  #include p16f877a.inc   ;Include standard header file
                          ;for the selected device.
 
  banksel TRISB           ;Since this register is in bank 1,
                          ;not default bank 0, banksel is 
                          ;used to ensure bank bits are correct.
  clrf    TRISB           ;Clear TRISB. Sets PORTB to outputs.
  banksel PORTB           ;banksel used to return to bank 0,
                          ;where PORTB is located.
  movlw   0x55            ;Set PORTB value.
  movwf   PORTB
  goto    $
  end                     ;All programs must have an end.