- Control
- Logical
- Branching
- Arithmetic
- Data Transfer
list of Control instructions with their meanings.
Opcode | Operand | Meaning | Explanation |
---|---|---|---|
NOP | None | No operation | No operation is performed, i.e., the instruction is fetched and decoded. |
HLT | None | Halt and enter wait state | The CPU finishes executing the current instruction and stops further execution. An interrupt or reset is necessary to exit from the halt state. |
DI | None | Disable interrupts | The interrupt enable flip-flop is reset and all the interrupts are disabled except TRAP. |
EI | None | Enable interrupts | The interrupt enable flip-flop is set and all the interrupts are enabled. |
RIM | None | Read interrupt mask | This instruction is used to read the status of interrupts 7.5, 6.5, 5.5 and read serial data input bit. |
SIM | None | Set interrupt mask | This instruction is used to implement the interrupts 7.5, 6.5, 5.5, and serial data output. |
list of Logical instructions with their meanings.
Opcode | Operand | Meaning | Explanation |
---|---|---|---|
CMP |
R
M
| Compare the register or memory with the accumulator | The contents of the operand (register or memory) are M compared with the contents of the accumulator. |
CPI | 8-bit data | Compare immediate with the accumulator | The second byte data is compared with the contents of the accumulator. |
ANA |
R
M
| Logical AND register or memory with the accumulator | The contents of the accumulator are logically AND with M the contents of the register or memory, and the result is placed in the accumulator. |
ANI | 8-bit data | Logical AND immediate with the accumulator | The contents of the accumulator are logically AND with the 8-bit data and the result is placed in the accumulator. |
XRA |
R
M
| Exclusive OR register or memory with the accumulator | The contents of the accumulator are Exclusive OR with M the contents of the register or memory, and the result is placed in the accumulator. |
XRI | 8-bit data | Exclusive OR immediate with the accumulator | The contents of the accumulator are Exclusive OR with the 8-bit data and the result is placed in the accumulator. |
ORA |
R
M
| Logical OR register or memory with the accumulator | The contents of the accumulator are logically OR with M the contents of the register or memory, and result is placed in the accumulator. |
ORI | 8-bit data | Logical OR immediate with the accumulator | The contents of the accumulator are logically OR with the 8-bit data and the result is placed in the accumulator. |
RLC | None | Rotate the accumulator left | Each binary bit of the accumulator is rotated left by one position. Bit D7 is placed in the position of D0 as well as in the Carry flag. CY is modified according to bit D7. |
RRC | None | Rotate the accumulator right | Each binary bit of the accumulator is rotated right by one position. Bit D0 is placed in the position of D7 as well as in the Carry flag. CY is modified according to bit D0. |
RAL | None | Rotate the accumulator left through carry | Each binary bit of the accumulator is rotated left by one position through the Carry flag. Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. CY is modified according to bit D7. |
RAR | None | Rotate the accumulator right through carry | Each binary bit of the accumulator is rotated right by one position through the Carry flag. Bit D0 is placed in the Carry flag, and the Carry flag is placed in the most significant position D7. CY is modified according to bit D0. |
CMA | None | Complement accumulator | The contents of the accumulator are complemented. No flags are affected. |
CMC | None | Complement carry | The Carry flag is complemented. No other flags are affected. |
STC | None | Set Carry | Set Carry |
list of Branching instructions with their meanings.
Opcode | Operand | Meaning | Explanation | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JMP | 16-bit address | Jump unconditionally | The program sequence is transferred to the memory address given in the operand. | ||||||||||||||||||||||||||||
| 16-bit address | Jump conditionally | The program sequence is transferred to the memory address given in the operand based on the specified flag of the PSW. | ||||||||||||||||||||||||||||
| 16-bit address | Unconditional subroutine call | The program sequence is transferred to the memory address given in the operand. Before transferring, the address of the next instruction after CALL is pushed onto the stack. | ||||||||||||||||||||||||||||
RET | None | Return from subroutine unconditionally | The program sequence is transferred from the subroutine to the calling program. | ||||||||||||||||||||||||||||
| None | Return from subroutine conditionally | The program sequence is transferred from the subroutine to the calling program based on the specified flag of the PSW and the program execution begins at the new address. | ||||||||||||||||||||||||||||
PCHL | None | Load the program counter with HL contents | The contents of registers H & L are copied into the program counter. The contents of H are placed as the high-order byte and the contents of L as the loworder byte. | ||||||||||||||||||||||||||||
RST | 0-7 | Restart | The RST instruction is used as software instructions in a program to transfer the program execution to one of the following eight locations.
|
list of Arithmetic instructions with their meanings.
Opcode | Operand | Meaning | Explanation |
---|---|---|---|
ADD
|
R
M
|
Add register or memory, to the accumulator
|
The contents of the register or memory are added to the contents of the accumulator and the result is stored in the accumulator.
Example − ADD K.
|
ADC
|
R
M
|
Add register to the accumulator with carry
|
The contents of the register or memory & M the Carry flag are added to the contents of the accumulator and the result is stored in the accumulator.
Example − ADC K
|
ADI
|
8-bit data
|
Add the immediate to the accumulator
|
The 8-bit data is added to the contents of the accumulator and the result is stored in the accumulator.
Example − ADI 55K
|
ACI
|
8-bit data
|
Add the immediate to the accumulator with carry
|
The 8-bit data and the Carry flag are added to the contents of the accumulator and the result is stored in the accumulator.
Example − ACI 55K
|
LXI
|
Reg. pair, 16bit data
|
Load the register pair immediate
|
The instruction stores 16-bit data into the register pair designated in the operand.
Example − LXI K, 3025M
|
DAD
|
Reg. pair
|
Add the register pair to H and L registers
|
The 16-bit data of the specified register pair are added to the contents of the HL register.
Example − DAD K
|
SUB
|
R
M
|
Subtract the register or the memory from the accumulator
|
The contents of the register or the memory are subtracted from the contents of the accumulator, and the result is stored in the accumulator.
Example − SUB K
|
SBB
|
R
M
|
Subtract the source and borrow from the accumulator
|
The contents of the register or the memory & M the Borrow flag are subtracted from the contents of the accumulator and the result is placed in the accumulator.
Example − SBB K
|
SUI
|
8-bit data
|
Subtract the immediate from the accumulator
|
The 8-bit data is subtracted from the contents of the accumulator & the result is stored in the accumulator.
Example − SUI 55K
|
SBI
|
8-bit data
|
Subtract the immediate from the accumulator with borrow
|
The contents of register H are exchanged with the contents of register D, and the contents of register L are exchanged with the contents of register E.
Example − XCHG
|
INR
|
R
M
|
Increment the register or the memory by 1
|
The contents of the designated register or the memory are incremented by 1 and their result is stored at the same place.
Example − INR K
|
INX
|
R
|
Increment register pair by 1
|
The contents of the designated register pair are incremented by 1 and their result is stored at the same place.
Example − INX K
|
DCR
|
R
M
|
Decrement the register or the memory by 1
|
The contents of the designated register or memory are decremented by 1 and their result is stored at the same place.
Example − DCR K
|
DCX
|
R
|
Decrement the register pair by 1
|
The contents of the designated register pair are decremented by 1 and their result is stored at the same place.
Example − DCX K
|
DAA
|
None
|
Decimal adjust accumulator
|
The contents of the accumulator are changed from a binary value to two 4-bit BCD digits.
If the value of the low-order 4-bits in the accumulator is greater than 9 or if AC flag is set, the instruction adds 6 to the low-order four bits.
If the value of the high-order 4-bits in the accumulator is greater than 9 or if the Carry flag is set, the instruction adds 6 to the high-order four bits.
Example − DAA
|
list of Data-transfer instructions with their meanings.
Opcode | Operand | Meaning | Explanation |
---|---|---|---|
MOV |
Rd, Sc
M, Sc
Dt, M
|
Copy from the source (Sc) to the destination(Dt)
|
This instruction copies the contents of the source register into the destination register without any alteration.
Example − MOV K, L
|
MVI
|
Rd, data
M, data
|
Move immediate 8-bit
|
The 8-bit data is stored in the destination register or memory.
Example − MVI K, 55L
|
LDA
|
16-bit address
|
Load the accumulator
|
The contents of a memory location, specified by a 16-bit address in the operand, are copied to the accumulator.
Example − LDA 2034K
|
LDAX
|
B/D Reg. pair
|
Load the accumulator indirect
|
The contents of the designated register pair point to a memory location. This instruction copies the contents of that memory location into the accumulator.
Example − LDAX K
|
LXI
|
Reg. pair, 16-bit data
|
Load the register pair immediate
|
The instruction loads 16-bit data in the register pair designated in the register or the memory.
Example − LXI K, 3225L
|
LHLD
|
16-bit address
|
Load H and L registers direct
|
The instruction copies the contents of the memory location pointed out by the address into register L and copies the contents of the next memory location into register H.
Example − LHLD 3225K
|
STA
|
16-bit address
|
16-bit address
|
The contents of the accumulator are copied into the memory location specified by the operand.
This is a 3-byte instruction, the second byte specifies the low-order address and the third byte specifies the high-order address.
Example − STA 325K
|
STAX
|
16-bit address
|
Store the accumulator indirect
|
The contents of the accumulator are copied into the memory location specified by the contents of the operand.
Example − STAX K
|
SHLD
|
16-bit address
|
The contents of register L are stored in the memory location specified by the 16-bit address in the operand and the contents of H register are stored into the next memory location by incrementing the operand.
This is a 3-byte instruction, the second byte specifies the low-order address and the third byte specifies the high-order address.
Example − SHLD 3225K
| |
XCHG
|
None
|
Exchange H and L with D and E
|
The contents of register H are exchanged with the contents of register D, and the contents of register L are exchanged with the contents of register E.
Example − XCHG
|
SPHL
|
None
|
Copy H and L registers to the stack pointer
|
The instruction loads the contents of the H and L registers into the stack pointer register. The contents of the H register provide the high-order address and the contents of the L register provide the low-order address.
Example − SPHL
|
XTHL
|
None
|
Exchange H and L with top of stack
|
The contents of the L register are exchanged with the stack location pointed out by the contents of the stack pointer register.
The contents of the H register are exchanged with the next stack location (SP+1).
Example − XTHL
|
PUSH
|
Reg. pair
|
Push the register pair onto the stack
|
The contents of the register pair designated in the operand are copied onto the stack in the following sequence.
The stack pointer register is decremented and the contents of the high order register (B, D, H, A) are copied into that location.
The stack pointer register is decremented again and the contents of the low-order register (C, E, L, flags) are copied to that location.
Example − PUSH K
|
POP
|
Reg. pair
|
Pop off stack to the register pair
|
The contents of the memory location pointed out by the stack pointer register are copied to the low-order register (C, E, L, status flags) of the operand.
The stack pointer is incremented by 1 and the contents of that memory location are copied to the high-order register (B, D, H, A) of the operand.
The stack pointer register is again incremented by 1.
Example − POPK
|
OUT
|
8-bit port address
|
Output the data from the accumulator to a port with 8bit address
|
The contents of the accumulator are copied into the I/O port specified by the operand.
Example − OUT K9L
|
IN
|
8-bit port address
|
Input data to accumulator from a port with 8-bit address
|
The contents of the input port designated in the operand are read and loaded into the accumulator.
Example − IN5KL
|
No comments: