In 8051, consider the following instructions: MOV PSW, #18H MOV R3, #55H MOV A, R3. From which register bank is R3 selected in the instruction MOV A, R3?
Bank 3
The 8051 keeps four banks of eight general-purpose registers (R0–R7), called Bank 0, Bank 1, Bank 2 and Bank 3, occupying internal RAM addresses 00H–1FH (8 bytes per bank). Only one bank is active at a time, and the active bank is chosen by two bits inside the Program Status Word (PSW): RS1 (bit 4) and RS0 (bit 3).
The instruction MOV PSW, #18H loads the PSW with 18H. Converting to binary:
| Bit | 7 | 6 | 5 | 4 (RS1) | 3 (RS0) | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Value | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
So RS1 = 1 and RS0 = 1. The bank-select mapping is: 00 → Bank 0, 01 → Bank 1, 10 → Bank 2, 11 → Bank 3. Since RS1 RS0 = 11, the active bank is Bank 3, whose registers live at addresses 18H–1FH; here R3 corresponds to address 1BH.
Therefore MOV R3, #55H writes 55H into R3 of Bank 3, and MOV A, R3 reads that same R3 from Bank 3. That is why the correct answer is Bank 3.
Why the other options are wrong:
Which of the following statements about the Harvard architecture used in the 8051 microcontroller is correct?
What are the XTAL 1 and XTAL 2 pins numbers for 8051?
Register which is used to store values of arithmetic and logical operations is termed:
How many bytes of bit addressable memory is present in 8051 based microcontrollers?
A single instruction to clear the lower four bits of the accumulator in 8085 assembly language is-
In Microprocessor 8085 Address/Data buffer is a/an _______ buffer.