Banksel. Good practice?

Status
Not open for further replies.

HerbertMunch

New Member
Hi all,

Just wondering why people always seem to use RPO to change to banks, when banksel directive will change banks for you?

i.e

Code:
	bsf 	STATUS,		RP0  ;bank 1

Is it not to be trusted or does it produce slower code than doing it by hand?
many thanks
 
Last edited:
Banksel produces two lines, like the example below, as long as you know what bank you're already in you don't need to use both lines - so it's slightly less efficient.

Code:
            BSF     STATUS    , RP0
            BCF     STATUS    , RP1
            MOVLW   0x06
            MOVWF   ADCON1
            BCF     STATUS    , RP0
            BCF     STATUS    , RP1
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…