Which of the following addressing mode is not usable in the XCH instruction of the 8051 microcontrollers?
Which of the following addressing mode is not usable in the XCH instruction of the 8051 microcontrollers? Correct Answer Immediate Addressing
Concept:
The different modes are listed below with the syntax.
|
Addressing Mode |
Function |
Syntax |
Remarks |
|
Direct |
The source and destination can be either a register or a RAM location but both can’t be the same. |
MOV A, R0 |
Direct addressing places the value 55H in the accumulator. |
|
Indirect |
Accesses the data at the address placed inside a register. We use the (@) symbol for this purpose. |
MOV R0, #55H MOV A, @ R0 |
Indirect addressing places the value 55H in R0 Places the data stored in the memory location 55H in the accumulator. |
|
Register |
The source and destination both are registers. |
MOV A, R0 |
Move the contents from R0 to the register. |
|
Immediate |
Data is directly put into registers. |
MOV A, # 50H
|
Move the data directly to the accumulator. |
Explanation:
The XCH operation and the possible modes are listed below the table.
|
Instructions |
Opcode |
Bytes |
Cycles |
Flags |
|
XCH A, @R0 |
0xC6 |
1 |
1 |
None |
|
XCH A, @ R1 |
0xC7 |
1 |
1 |
None |
|
XCH A, R0 |
0xC8 |
1 |
1 |
None |
|
XCH A, R1 |
0xC9 |
1 |
1 |
None |
|
XCH A, R2 |
0xCA |
1 |
1 |
None |
|
XCH A, R3 |
0xCB |
1 |
1 |
None |
|
XCH A, R4 |
0xCC |
1 |
1 |
None |
|
XCH A, R5 |
0xCD |
1 |
1 |
None |
|
XCH A, R6 |
0xCE |
1 |
1 |
None |
|
XCH A, R7 |
0xCF |
1 |
1 |
None |
|
XCH A, iram addr |
0xC5 |
2 |
1 |
None |
Conclusion:
Immediate addressing mode is not usable in XCH instruction of 8051 microcontroller