Question: Be a code detective. The assembler has a directive called BANKSEL, bank select, that makes it easier to move from bank to bank without having

Be a code detective. The assembler has a directive called BANKSEL, bank select, that makes
it easier to move from bank to bank without having to look up the location of different SFRs.
The following assembly code initializes PortB to be an output, and then writes a 1(HIGH)
to PORTB<0>.
ORG 0x0008
BANKSEL TRISB
CLRF TRISB
BANKSEL PORTB
BSF PORTB, 0
The opcodes produced by these statements are as follows (all numbers are hex):
Location Opcode
--------------
00081683
00091303
000A 0186
000B 1283
000C 1303
000D 1406
The column on the left is the location in program memory. Use the table of opcodes and other
information in the PIC16F87/88 Datasheet (on the course website) to decode the above opcodes and determine which specific PIC instructions are created by the BANKSEL directive.
You will also need to consult the register file map to figure out which SFRs are affected.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!