Control Instructions: Opcode Operand Explanation of Instruction Description
Control Instructions: Opcode Operand Explanation of Instruction Description
Example: NOP
Example: HLT
Example: DI
Example: EI
Example: RIM
Example: SIM
LOGICAL INSTRUCTIONS
Opcode Operand Explanation of Description
Instruction
ANI 8-bit Logical AND The contents of the accumulator are logically
data immediate with ANDed with the
accumulator 8-bit data (operand) and the result is placed
in the
accumulator. S, Z, P are modified to reflect
the result of the
operation. CY is reset. AC is set.
Example: RLC
Example: RRC
Example: RAL
Example: RAR
Example: CMA
Example: CMC
Example: STC
BRANCHING INSTRUCTIONS
Example: RET
Example: PCHL
Restart
Instruction
Address
RST 0 0000H
RST1 0008H
RST 2 0010H
RST 3 0018H
RST 4 0020H
RST 5 0028H
RST 6 0030H
RST 7 0038H
Restart
Interrupt
Address
TRAP 0024H
RST 5.5 002CH
RST 6.5 0034H
RST 7.5 003CH
Arithmetic Instructions
Opcode Operand Explanation of Description
Instruction
ADI 8-bit data Add immediate The 8-bit data (operand) is added to the
to accumulator contents of the accumulator and the result is
stored in the accumulator. All flags are
modified to reflect the result of the addition.
ACI 8-bit data Add immediate The 8-bit data (operand) and the Carry flag
to accumulator are added to the contents of the
with carry accumulator and the result is stored in the
accumulator. All flags are modified to reflect
the result of the addition.
LXI Reg. pair, Load register The instruction loads 16-bit data in the
16-bit pair immediate register pair designated in the operand.
data
Example: LXI H, 2034H or LXI H, XYZ
DAD Reg. pair Add register The 16-bit contents of the specified register
pair to H and L pair are added to the contents of the HL
registers register and the sum is stored in the HL
register. The contents of the source register
pair are not altered. If the result is larger
than 16 bits, the CY flag is set. No other
flags are affected.
Example: DAD H
SUI 8-bit data Subtract The 8-bit data (operand) is subtracted from
immediate from the contents of the accumulator and the
accumulator result is stored in the accumulator. All flags
are modified to reflect the result of the
subtraction.
Example: XCHG
INR R Increment The contents of the designated register or
register or memory) are incremented by 1 and the
M memory by 1 result is stored in the same place. If the
operand is a memory location, its location is
specified by the contents of the HL registers.
Example: INX H
Example: DCX H
Example: DAA
MVI Rd, data Move immediate The 8-bit data is stored in the destination
8-bit register or memory. If the operand is a
M, data memory location, its location is specified
by the contents of the HL registers.
LDAX B/D Reg. Load accumulator The contents of the designated register
pair indirect pair point to a memory location. This
instruction copies the contents of that
memory location into the accumulator.
The contents of either the register pair or
the memory location are not altered.
Example: LDAX B
LXI Reg. pair, Load register pair The instruction loads 16-bit data in the
16-bit immediate register pair designated in the operand.
data
Example: LXI H, 2034H or LXI H, XYZ
STAX Reg. pair Store accumulator The contents of the accumulator are
indirect copied into the memory location
specified by the contents of the operand
(register pair). The contents of the
accumulator are not altered.
Example: STAX B
SHLD 16-bit Store H and L The contents of register L are stored into
address registers direct 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. The contents of registers HL
are not altered. This is a 3-byte
instruction, the second byte specifies the
low-order address and the third byte
specifies the high-order address.
Example: XCHG
SPHL none Copy H and L The instruction loads the contents of the
registers to the H and L registers into
stack pointer 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. The
contents of the H
and L registers are not altered.
Example: SPHL
Example: XTHL
PUSH Reg. pair Push register pair The contents of the register pair
onto stack designated in the operand are copied
onto the stack in the following sequence.
The stack pointer register is decremented
and the contents of the highorder
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.
OUT 8-bit port Output data from The contents of the accumulator are
address accumulator to a copied into the I/O port specified by the
port with 8-bit operand.
address
Example: OUT F8H
IN 8-bit port Input data to The contents of the input port designated
address accumulator from in the operand are read and loaded into
a port with 8-bit the accumulator.
address
Example: IN 8CH