In: Computer Science
Give the address of R4, R6 in the following program.
ORG 0H
MOV A, #92H
SETB PSW.4
MOV R4,A
SETB PSW.3.
MOV R6,A
END
I. RAM ADDRESS OF R4 = 14H and R6=1EH
II. RAM ADDRESS OF R4 = 0CH and R6=0AH
III.RAM ADDRESS OF R4= 15H and R6=02H
IV.RAM ADDRESS OF R4= 0CH and R6=0EH
We can switch to other banks by using of the PSW register
1. Bits D4 and D3 of the PSW are used to select the desired
register bank
2. Use the bit-addressable instructions SETB and CLR to access
PSW.4 and PSW.
SETB PSW.4; bank 2 is selected on condition that PSW.3 is 0 ie not set
When both the PSW.4 and PSW.3 is set then Bank 3 is considered.
When in R4, A is stored, only PSW.4 is set. So, bank 2 is selected.
Hence Ram address of R4 is 14H according to the bank address.
When in R6, A is stored, both PSW.3 and PSW.4 is set ie 1. Hence Bank 3 is selected.
So, Ram address of R6 is 1EH according to the bank address
Therefore, Option (I) is correct.