Page 138 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 138
Introduction to Microprocessors
Notes The instruction would require two memory locations to store in memory.
MVI r,data
r <— data
Example: MVI A, 30H coded as 3EH 30H as two contiguous bytes. This is an example of
immediate addressing.
ADI data
A <— A + data
OUT port
0011 1110
DATA
Where port is an 8-bit device address. (Port) <— A. Since the byte is not the data but points
directly to where it is located this is called direct addressing.
Three-Byte Instructions
In a three-byte instruction, the first byte specifies the opcode, and the following two bytes specify
the 16-bit address.
opcode + data byte + data byte
For example:
Task Op code Operand Binary Code Hex Code
Transfer the program JMP 2085H 1100 0011 C3 First byte
sequence to the 1000 0101 85 Second Byte
memory location 0010 0000 20 Third Byte
2085H.
The second byte is the low-order address and the third byte is the high-order address.
This instruction would require three memory locations to store in memory. Three byte instructions
- opcode + data byte + data byte
LXI rp, data16
rp is one of the pairs of registers BC, DE, HL used as 16-bit registers. The two data bytes are 16-bit
data in L H order of significance.
rp <— data16
Example: LXI H,0520H coded as 21H 20H 50H in three bytes. This is also immediate
addressing.
LDA addr
A <— (addr) Addr is a 16-bit address in L H order. Example: LDA 2134H coded as 3AH 34H 21H.
This is also an example of direct addressing.
132 LOVELY PROFESSIONAL UNIVERSITY