davepusey
Member
I am using the MPLAB simulator to test my program but when it compiles i get error "Register in operand not in bank 0. Ensure that bank bits are correct."
Below is my code. The lines highlighted in red is where it says the error is occuring!
BSF STATUS,5 ;Switch to Bank 1
MOVLW B'11100' ;Bitmask for port A pins (0 is Output 1 is Input)
MOVWF TRISA ;Set port A pins
MOVLW B'00001111' ;Bitmask for port B pins (0 is Output 1 is Input)
MOVWF TRISB ;Set port B pins
BCF STATUS,5 ;Switch back to Bank 0
Below is my code. The lines highlighted in red is where it says the error is occuring!
BSF STATUS,5 ;Switch to Bank 1
MOVLW B'11100' ;Bitmask for port A pins (0 is Output 1 is Input)
MOVWF TRISA ;Set port A pins
MOVLW B'00001111' ;Bitmask for port B pins (0 is Output 1 is Input)
MOVWF TRISB ;Set port B pins
BCF STATUS,5 ;Switch back to Bank 0