Professional Documents
Culture Documents
LABORATORY
8085
INSTRUCTION SET
&
LIST OF EXPERIMENTS
1
ACI :Add immediate to accumulator with carry.
Description :The 8-bit data (operand) and the Carry flag are added to the contents
of the accumulator,and the result stored in the accumulator.
M-Cycles : 2
T-States : 7
Machine code :CE
All flags are modified.
2
ADI : Add immediate to accumulator.
Description : The 8-bit data (operand) is added to the contents of the accumulator,
and the result is placed in the accumulator.
M-Cycles : 2
T-states : 7
Machine Code : C6
All flags are modified.
3
Conditional Call to Subroutine Operand -- 16 bit Address
Mnemonics Description Flag status Machine Code M-Cycles T-states
CC Call on carry CY= 1 DC 2 9 : if condition
is
CNC Call with no carry CY= 0 D4 not true.
CP Call on positive S= 0 F4
CM Call on minus S= 1 FC 5 18 : if condition
CPE Call on parity even P= 1 EC is true.
CPO Call on parity Odd P= 0 E4
CZ Call on zero Z= 1 CC
CNZ Call on no zero Z= 0 C4
No flags are affected.
4
CPI : Compare immediate with accumulator
Description : The 8-bit data is compared with the content of the accumulator.
The values being compared remain unchanged and the results of
the comparison are indicated by setting the flags as follows:-
- If [A] < data: Carry flag is set.
- If [A] = data: Zero flag is set.
- If [A] > data: Neither Z nor C is set.
M-Cycles : 2
T-states : 7
Machine Code : FE
Flags S,P,AC are also modified in addition to Z and C.
5
Machine Code : Register Code
B 05
C 0D
D 15
E 1D
H 25
L 2D
M 35
A 3D
S, Z, P, AC are affected.CY is not modified.
DI : Disable interrupts.
Description : the Interrupt Enable flip-flop is reset and all the interrupts except the
TRAP are disabled.
M - Cycles : 1
T - States : 4
Machine Code : F3
No flags are affected.
EI : Enable interrupts.
Description : The Interrupt Enable flip-flop is set and all interrupts are enabled.
M - Cycles : 1
T - States : 4
Machine Code : FB
No flags are affected.
6
HLT : Halt and enter WAIT state.
Description : The processor executes the current instruction and halts any further
execution. An interrupt or reset is necessary to exit from the HALT state.
M - Cycles : 2 or more.
T - States : 5 or more.
Machine Code : 76
No flags are affected.
7
JMP : jump unconditionally
Description : The program sequence is transferred to the memory location specified
by the 16-bit address. This is a 3-byte instruction , the 2nd byte
specifies the low-order byte and the 3rd byte specifies the high-order
byte.
M - Cycles : 3
T - States : 10
Machine Code : C3
No flags are affected.
JUMP CONDITIONALLY
Operand : 16-bit Address
Code Description Flag status Machine code M-Cycles/T-States
JC Jump on carry CY = 1 DA 2M / 7T (if condition
JNC Jump on no carry CY = 0 D2 is not true)
JP Jump on positive S=0 F2
JM Jump on minus S=1 FA 3M / 10T (if condition
JPE Jump on parity even P = 1 EA is true)
JPO Jump on parity odd P = 0 E2
JZ Jump on zero Z=1 CA
JNZ Jump on no zero Z=0 C2
No flags are affected.
8
LHLD : Load HL pair direct.
Description : The instruction copies the contents of the memory location pointed out
by the 16-bit address in register L and copies the contents of the next
memory location in register H. The contents of source memory locations
are not altered.
M - Cycles : 5
T - States : 16
Machine Code : 2A
No flags are affected.
9
MVI : Move immediate 8-bit
Description : The 8-bit data is stored in the destination register or memory. If the operand
is a memory location , it is specified in the HL pair.
M- Cycles : 2(register) , 3(memory)
T - States : 7(register) , 10(memory)
Machine Code : Register Code
B 06
C 0E
D 16
E 1E
H 26
L 2E
M 36
A 3E
No flags are affected.
NOP : No operation
Description : No operation is performed. The instruction is fetched and decoded;
however no operation is executed.
M - Cycles : 1
T - States : 4
Machine Code : 00
No flags are affected.
10
ORI : Logically OR immediate
Description : The contents of the acc. are logically ORed with the 8-bit data in the
operand
and the results are placed in the acc.
M - Cycles : 2
T - States : 7
Machine Code : F6
Flags Z , S , P are modified . CY and AC are reset.
11
PUSH : Push register pair onto stack.
Description : The contents of the register pair designated in the operand are copied into
the stack in the following sequence. The SP register is decremented and
the contents of the high-order register (B , D , H , A) are copied into that
location. The SP register is decremented again and the contents of the low-
order register (C , E , L , flags) are copied to that location.
M - Cycles : 3
T - States : 12
Machine Code : Register Code
B C5
D D5
H E5
PSW F5
NO flags are affected.
12
RRC : Rotate accumulator right.
Description : Each bit of the acc. is rotated right by 1 position. Bit 0 is placed in the
position of bit 7 as well in the CY flag.
M - Cycles : 1
T - States : 4
Machine Code : 0F
CY is modified according to bit 0. S , Z , P , A are not affected.
RETURN CONDITIONALLY
Code Description Flag Status Machine Code M-Cycles / T-States
RC Return on carry CY = 1 D8 1 / 6 If condition is not true
RNC Return on no carry CY = 0 D0 3 /12 If condition is true
RP Return on positive S=0 F0
RM Return on minus S=1 F8 Note : If the condition is not true
RPE Return on parity even P=1 E8 it continues the sequence and
RPO Return on parity odd P=0 E0 thus requires fewer T- States.
RZ Return on zero Z=1 C8 If condition is true it returns
RNZ Return on No zero Z=0 C0 to the calling program and thus
No flags are affected requires more T- States.
13
SBB : Subtract source and borrow from accumulator
Description : The contents of the operand (register or memory) and the Borrow Flag are
subtracted from the contents of the acc. and the results are placed in the acc.
The contents of the operand are not altered; however the previous Borrow
Flag is reset.
M - Cycles : 1(register) , 2(memory)
T - states : 4(register) , 7(memory)
Machine Code : Register Code
B 98
C 99
D 9A
E 9B
H 9C
L 9D
M 9E
A 9F
All flags are altered to reflect the result of the subtraction.
14
(RST 7.5 , 6.5 , 5.5) and serial data output.
M - Cycles : 1
T - States : 4
Machine Code : 30
No flags are affected.
SPHL : Copy H & L to the SP
Description : The instruction loads the contents of the H & L registers into the stack
pointer register , the contents of H provide the high-order address and
the contents of the L register provide the low-order address. The contents
of the H & L registers are not affected.
M - Cycles : 1
T - States : 6
Machine Code : F9
No flags are affected.
15
are subtracted from the contents of the acc. , and the result placed in the acc.
The contents of the source are not altered.
M - Cycles : 1(register) , 2(memory)
T - States : 4(register) , 7(memory)
Machine Code : Register Code
B 90
C 91
D 92
E 93
H 94
L 95
M 96
A 97
All flags are affected to reflect the result of the subtraction.
16
C A9
D AA
E AB
H AC
L AD
M AE
A AF
Z , S , P are altered to reflect the result of the operation. CY and AC are reset.
17