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?
An 8086 address bus is a/an _____ -bit bus
Match the columns.
Pin | Description |
a. D 0-D 7 | 1. Reset Input |
b. RESET | 2. Data Lines |
c. A 0,A 1 | 3. Internal Address |
An 8 bit microcontroller has an external RAM with the memory map from 8000 H to 9FFF H. How many number of bytes can this RAM store?
In 8085 microprocessor, initially the number decimal 8 is stored. If instruction RAL is executed twice on this number, the final number stored will be
Which of the following 8085 microprocessor instructions occupies 3 bytes in memory?