Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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:rolleyes: 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.

Latest threads

New Articles From Microcontroller Tips

Back
Top