health

Technology

business posts

Instruction Set 8085

  1. Control
  2. Logical
  3. Branching
  4. Arithmetic
  5. Data Transfer
list of Control instructions with their meanings.
OpcodeOperandMeaningExplanation
NOPNoneNo operationNo operation is performed, i.e., the instruction is fetched and decoded.
HLTNoneHalt and enter wait stateThe CPU finishes executing the current instruction and stops further execution. An interrupt or reset is necessary to exit from the halt state.
DINoneDisable interruptsThe interrupt enable flip-flop is reset and all the interrupts are disabled except TRAP.
EINoneEnable interruptsThe interrupt enable flip-flop is set and all the interrupts are enabled.
RIMNoneRead interrupt maskThis instruction is used to read the status of interrupts 7.5, 6.5, 5.5 and read serial data input bit.
SIMNoneSet interrupt maskThis instruction is used to implement the interrupts 7.5, 6.5, 5.5, and serial data output.

 list of Logical instructions with their meanings.
OpcodeOperandMeaningExplanation
CMP
R
M
Compare the register or memory with the accumulatorThe contents of the operand (register or memory) are M compared with the contents of the accumulator.
CPI8-bit dataCompare immediate with the accumulatorThe second byte data is compared with the contents of the accumulator.
ANA
R
M
Logical AND register or memory with the accumulatorThe contents of the accumulator are logically AND with M the contents of the register or memory, and the result is placed in the accumulator.
ANI8-bit dataLogical AND immediate with the accumulatorThe 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 accumulatorThe contents of the accumulator are Exclusive OR with M the contents of the register or memory, and the result is placed in the accumulator.
XRI8-bit dataExclusive OR immediate with the accumulatorThe 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 accumulatorThe contents of the accumulator are logically OR with M the contents of the register or memory, and result is placed in the accumulator.
ORI8-bit dataLogical OR immediate with the accumulatorThe contents of the accumulator are logically OR with the 8-bit data and the result is placed in the accumulator.
RLCNoneRotate the accumulator leftEach 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.
RRCNoneRotate the accumulator rightEach 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.
RALNoneRotate the accumulator left through carryEach 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.
RARNoneRotate the accumulator right through carryEach 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.
CMANoneComplement accumulatorThe contents of the accumulator are complemented. No flags are affected.
CMCNoneComplement carryThe Carry flag is complemented. No other flags are affected.
STCNoneSet CarrySet Carry
 list of Branching instructions with their meanings.
OpcodeOperandMeaningExplanation
JMP16-bit addressJump unconditionallyThe program sequence is transferred to the memory address given in the operand.
OpcodeDescriptionFlag Status
JCJump on CarryCY=1
JNCJump on no CarryCY=0
JPJump on positiveS=0
JMJump on minusS=1
JZJump on zeroZ=1
JNZJump on no zeroZ=0
JPEJump on parity evenP=1
JPOJump on parity oddP=0
16-bit addressJump conditionallyThe program sequence is transferred to the memory address given in the operand based on the specified flag of the PSW.
OpcodeDescriptionFlag Status
CCCall on CarryCY=1
CNCCall on no CarryCY=0
CPCall on positiveS=0
CMCall on minusS=1
CZCall on zeroZ=1
CNZCall on no zeroZ=0
CPECall on parity evenP=1
CPOCall on parity oddP=0
16-bit addressUnconditional subroutine callThe 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.
RETNoneReturn from subroutine unconditionallyThe program sequence is transferred from the subroutine to the calling program.
OpcodeDescriptionFlag Status
RCReturn on CarryCY=1
RNCReturn on no CarryCY=0
RPReturn on positiveS=0
RMReturn on minusS=1
RZReturn on zeroZ=1
RNZReturn on no zeroZ=0
RPEReturn on parity evenP=1
RPOReturn on parity oddP=0
NoneReturn from subroutine conditionallyThe 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.
PCHLNoneLoad the program counter with HL contentsThe 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.
RST0-7RestartThe RST instruction is used as software instructions in a program to transfer the program execution to one of the following eight locations.
InstructionRestart Address
RST 00000H
RST 10008H
RST 20010H
RST 30018H
RST 40020H
RST 50028H
RST 60030H
RST 70038H
The 8085 has additionally 4 interrupts, which can generate RST instructions internally and doesn’t require any external hardware. Following are those instructions and their Restart addresses −
InterruptRestart Address
TRAP0024H
RST 5.5002CH
RST 6.50034H
RST 7.5003CH

list of Arithmetic instructions with their meanings.
OpcodeOperandMeaningExplanation
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.
OpcodeOperandMeaningExplanation
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
Store H and L registers direct
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: