You are on page 1of 7

Experiment No: 2 ROLL NUMBER: 18BEE105

Aim: - To apply the arithmetic and logical instructions of 8085


microprocessor.

Arithmetic and Logical Instructions:


Type Name Function
Addition ADD R Content of R is
added with the
content of A and the
result is stored in A.
(1-byte instruction)
ADI 8-bit Add the 8-bit data
immediately into the
A. (2-byte
instruction)
ADC R Add data of R and A
and carry; the result
is stored in the A. (1-
byte instruction)
ACI 8-BIT Add the 8-bit data
immediately into the
A and also adds
carry. (2-byte
instruction)
Subtraction SUB R Content of R is
subtracted with the
content of A and the
result is stored in A.
(1-byte instruction)
SUI 8-bit Subtracts the 8-bit
data immediately
from data of the A.
(2-byte instruction)
SBB R Data of R and carry is
subtracted from the
A.
SBI 8-bit 8-bit data and carry
is immediately
subtracted from the
A.
Increment INR R Data of R is
increased by 01H.
INX Rp Memory location of
register pair is
increased by 01H.
Decrement DCR R Data of R is
decreased by 01H.
DCX Rp Memory location of
register pair is
decreased by 01H.
AND ANA R Data of A is AND
with data of R.
ANI 8-bit 8-bit number is AND
with data of A.
OR ORA R Data of A is OR with
data of R.
ORI 8-bit 8-bit number is OR
with data of A.
XOR XRA R Data of A is XOR with
data of R.
XRI 8-bit 8-bit number is XOR
with data of A.
NOT CMA Data of A is
complemented.
1. To add 76H in to the contents of register C and decrement it by
one.

Memory Location Instruction Opcode(H)


1000 MVI C,00H 0E
1001 00
1002 MOV A, C 79
1003 ADI 76H C6
1004 76
1005 DCR A 3D
1006 HLT 76

2. To subtract three hexadecimal numbers 4FH, 2E and 54H from


the content of memory location 1030H. Store the result in M.L.
1031H.

Memory Location Instruction Opcode(H)


1000 LDA 1030H 3A
1001 30
1002 10
1003 SUI 4FH D6
1004 4F
1005 SUI 2EH D6
1006 2E
1007 SUI 54H D6
1008 54
1009 STA 1031H 32
100A 31
100B 10
100C HLT 76

3. To add three hexadecimal number 22H, 44H and CCH stored in


three memory locations 1050H, 1051H and 1052H and store
the result in M.L.1053H.

Memory Location Instruction Opcode(H)


1000 LXI H,1050H 21
1001 50
1002 10
1003 MOV A, M 7E
1004 INX H 23
1005 ADD M 86
1006 INX H 23
1007 ADD M 86
1008 INX H 23
1009 MOV M, A 77
100A HLT 76
4. Place the least significant four bits of the contents of memory
location 1050H in memory location 1051H.

Memory Location Instruction Opcode(H)


1000 LDA 1050H 3A
1001 50
1002 10
1003 ANI 0FH F6
1004 0F
1005 STA 1051H 32
1006 51
1007 10
1008 HLT 76

5. Place the two`s complement of the contents of memory


location 1030H in to memory location 1031H.

Memory Location Instruction Opcode(H)


1000 LDA 1030H 3A
1001 30
1002 10
1003 CMA 2F
1004 INR A 3C
1005 STA 1031H 32
1006 31
1007 10
1008 HLT 76

6. To display the EX-OR operation of two hexadecimal numbers


2FH and F2H stored in two registers i.e. B and C without using
Ex-Or instruction.

Memory Location Instruction Opcode(H)


1000 MVI B,2FH 06
1001 2F
1002 MVI C, F2H 0E
1003 F2
1004 MOV A, B 78
1005 CMA 2F
1006 MOV D, A A1
1007 MOV A, C 57
1008 79
1009 CMA 2F
100A ANA B A0
100B ORA D B2
100C HLT 76

You might also like