4.9.3 Bankisel Directive
The
BANKISEL
directive is used to generate code that
ensures the correct data bank will be selected for indirect access of the operand's memory
location. The operand should be the symbol or numeric address of an object that resides in
data memory, for
examplePROCESSOR 12F510
#include <xc.inc>
PSECT udata_bank1
myVar:
DS 1
PSECT code
setMode:
movlw myVar
movwf FSR ;Load the address of myVar info FSR
BANKISEL myVar ;Select the correct bank for myVar
movlw 055h
movwf INDF ;Indirectly write to myVar
This directive will set the IRP bit (Mid-range) or STATUS bits (Baseline) appropriately for
the symbol argument. For all other devices, this directive will be ignored.