MP Div A 10045 Atharva Borikar
MP Div A 10045 Atharva Borikar
MP Div A 10045 Atharva Borikar
1. Immediate addressing:
Data is present in the instruction. Load the immediate data to the destination
provided.
Example: MVI R,data
2. Register addressing
Data is provided through the registers.
Example: MOV Rd, Rs
3. Direct addressing
Used to accept data from outside devices to store in the accumulator or send the data
stored in the accumulator to the outside device. Accept the data from the port 00H and
store them into the accumulator or Send the data from the accumulator to the port 01H.
Example: IN 00H or OUT 01H
8085 Microprocessor Lab Manual
4. Indirect Addressing
This means that the Effective Address is calculated by the processor. And the contents of the
address (and the one following) are used to form a second address. The second address is
where the data is stored. Note that this requires several memory accesses; two accesses to
retrieve the 16-bit address and a further access (or accesses) to retrieve the data which is to
be loaded into the register.
Example: ADD A,M
Program: -
MVI A , 50H
MOV B, A
MOV C, A
MOV D, A
MOV E, A
MOV H, A
MOV L, A
HLT
Result:-
Flags:
S=0
Z=0
AC = 0
P=0
C=0
B.E.
A 00
BC 00 00
CD 00 00
HL 00 00
A.E.
A 50
BC 50 50
DE 50 50
HL 50 50
Program: -
LXI H 3100H
MOV A, M
INX H
ADD M
INX H
MOV M, A
HLT
Result:-
Flags:
S=0
Z=0
AC = 1
C=0
B.E.
2100 = 12
2101 = 36
2102 = ?
A.E.
2100 = 12
2101 = 36
2102 = 48
Conclusion:- We add the two 8 bits numbers and result is 8 bits with help of 8085 simulator.
MP PRACTICAL
EXPERIMENT NO. 3
Program: -
LXI H 3100H
MOV A, M
INX H
ADD M
INX H
MOV M, A
HLT
RESULT:
Flags:
S=1
Z=0
AC = 0
C=1
B.E.
3100 = 82
3101 = 36
3102 =?
A.E.
3100 = 82
3101 = 36
3102 = 46
Conclusion:- -We subtract 8 bits numbers and result is 8 bits with the help of 8085 simulator
MP PRACTICAL
EXPERIMENT NO. 4
Title:-Addition of two 8 bits numbers and result is 16 bits
Aim: -Write an assembly language program to add two 8 bits numbers. First 8 bits number is
stored in the memory location 2100H and second 8 bits number is stored in the memory
location 2101H.After addition the result will be stored in the memory location 2102H and
2103H
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, GNU 8085 simulator
Theory: -
Branching Instructions
1. JMP 16-bit address
• Jump unconditionally
• The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand.
Example: JMP 2034 H.
2. JZ 16-bit address
• Jump conditionally
• The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand based on the specified flag of the PSW.
Example: JZ 2034 H.
Program: -
LXI H, 3000H
MOV A,M
INX H
MOV B, M
MVI C, 00H
ADD B
JNC UP
INR C
UP:INX H
MOV M, A
INX H
MOV M,C
HLT
RESULT:
Flags:
S=0
Z=0
AC = 1
P=1
C=0
B.E.
3000 = 15
3001 = 99
3002 =?
A.E.
3000 = 15
3001 = 99
3002 = 114
Conclusion:- We add of two 8 bits numbers and result is 16 bits via 8085 simulator
MP PRACTICAL
EXPERIMENT NO. 5
Title:-Subtraction of two 8 bits numbers and result is 16 bits
Aim: -Write an assembly language program to subtract two 8 bits numbers. First 8 bits
number is stored in the memory location 2100H and second 8 bits number is stored in the
memory location 2101H.After subtraction the result will be stored in the memory location
2102H and 2103H.
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, GNU 8085 simulator
Theory: -
Branching Instructions
3. JMP 16-bit address
• Jump unconditionally
• The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand.
Example: JMP 2034 H.
4. JC 16-bit address
• Jump conditionally
• The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand based on the specified flag of the PSW.
Example: JC 2034 H
Program: -
LXI H, 3000H
MOV A,M
INX H
MOV B, M
MVI C, 00H
SUB B
JNC AB
INR C
AB:INX H
MOV M, A
INX H
MOV M, C
HLT
Flags:
S=0
Z=0
AC = 0
P=0
C=1
B.E.
3000 = 69
3001 = 99
3002 =?
A.E.
3000 = 69
3001 = 99
3002 = 226
3003 = 1
Conclusion:- We Subtract of two 8 bits numbers and result is 16 bits with help of 8085
simulator.
MP PRACTICAL
EXPERIMENT NO. 6
Title:-Addition of two 16 bits numbers and result is 16 bits
Aim: -Write an assembly language program to add two 16 bits numbers. First 16 bits number
is stored in the memory location 2100H and 2101H. Second 16 bits number is stored in the
memory location 2102H AND 2103H .After 16 bits addition the result will be stored in the
memory location 2104H and 2105H
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, GNU 8085 simulator
Theory: -
1. LHLD (Load H and L register direct):
•The contents of register L are stored into 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.
•LHLD 3000H (the content of location 3000h is copied into the HL reg pair)
2. DAD Reg. pair
• Add register pair to H-L pair.
• The 16-bit contents of the register pair are added to the contents of H-L pair.
• The result is stored in H-L pair.
Example: DAD B
3. SHLD(store H and L register direct): - The contents of register L are stored into 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.
Program: -
LHLD 1100H
XCHG
LHLD 1102H
DAD D
SHLD 1104H
HLT
RESULT:
Flags:
S=0
Z=0
AC = 0
P=0
C=0
B.E.
1100 = 10
1101 = 15
1102 = 5
1103= 20
1104=?
1105=?
A.E.
2100 = 10
2101 = 15
2102 = 5
2103= 20
2104= 15
2105= 35
Conclusion:- We add the two 16 bits numbers and result is 16 bits with the help of 8085
simulator
MP PRACTICAL
EXPERIMENT NO. 7
Title:- Subtraction of two 16 bits numbers and result is 16 bits
Aim: -Write an assembly language program to subtract two 16 bits numbers. First 16 bits
number is stored in the memory location 2100H and 2101H. Second 16 bits number is stored
in the memory location 2102H AND 2103H .After 16 bits subtraction the result will be stored
in the memory location 2104H and 2105H
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, GNU 8085 simulator
Theory: -
1. LXI(Load register pair immediate): -
• The instruction loads 16-bit data in the register pair designated in the operand.
• LXI H, 2034H (2034H is stored in HL pair so that it act as memory pointer)
2. XCHG
• Exchange H-L with D-E
• The contents of register H are exchanged with the contents register D.
• The contents of register L are exchanged with the contents of register E.
• Example: XCHG
Program: -
LXI H 3100H
MOV B,M
INX H
MOV C,M
INX H
MOV D,M
INX H
MOV E,M
MOV A,M
SUB D
STA 3104H
MOV A,C
SBB E
STA 3105H
HLT
RESULT:
Flags:
S=0
Z=0
AC = 0
P=0
C=0
B.E.
3100 = 14
3101 = 52
3102 = 23
3103= 10
3104=?
3105=?
A.E.
3100 = 24
3101 = 46
3102 = 36
3103= 62
3104=243
3105=41
Conclusion:- We subtract two 16 bits numbers and result is 16 bits with the the help of 8085
simulator
MP PRACTICAL
EXPERIMENT NO. 8
Title:- Addition of two 8 bits BCD numbers and result is 8 bits
Aim: - Write an assembly language program to add two 8 bits BCD numbers. First 8 bits
number is
stored in the memory location 2100H and second 8 bits number is stored in the memory
location
2101H.After addition the result will be stored in the memory location 2102H
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, PC, GNU 8085 simulator
Theory:-
1. MVI Rd, Data
• Move immediate 8-bit
• The 8-bit data is stored in the destination register or memory.
• If the operand is a memory location, its location is specified by the contents of the H-L
registers.
Example: MVI B, 57H or MVI M, 57H
2. DAA (Decimal Adjust Accumulator)
•The contents of the accumulator are changed from a binary value to two 4-bit binary coded
decimal (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
Program: -
LXI H 3000H
MOV A, M
INX H
ADD M
DAA
INX H
MOV M, A
HLT
RESULT:
Flags:-
S=0
Z=0
AC = 1
P=0
C=0
B.E.
2100 = 12
2101 = 32
2102 = ?
A.E.
2100 = 12
2101 = 32
2102 = 50
Conclusion :- We add two 8 bits BCD numbers and result is 8 bits with the help of 8085
simulator.
MP PRACTICAL
EXPERIMENT NO. 9
Title:- Find out the Largest of two numbers
Aim: - Write an assembly language program to find out the largest of two numbers. First 8
bits
number is stored in the memory location 2100H and second 8 bits number is stored in the
memory
location 2101H.
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, PC, GNU 8085 simulator
Theory:-
1. CMP R (Compare register with accumulator)
•Any 8-bit data, or the contents of register, can be compares for:
o Equality
o Greater Than
o Less Than
•With the contents of accumulator.
The result is reflected in status flag
Program: -
LXI H 2100H
MOV A, M
INX H
CMP M JNC
DOWN
MOV A, M
DOWN: STA 2102H
HLT
Flags:-
S=0
Z=0
AC = 0
P=1
C=0
RESULT :-
B.E.
2100 = 45
2101 = 12
2102 = ?
A.E
2100 = 45
2101 = 12
2102 = 45
Conclusion :- We find out the Largest of two numbers with help of 8085 simulator.
MP PRACTICAL
EXPERIMENT NO. 10
Title:- Find out the Smallest of two numbers
Aim: - Write an assembly language program to find out the Smallest of two numbers. First 8
bits
number is stored in the memory location 2100H and second 8 bits number is stored in the
memory location 2101H.
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, PC, GNU 8085 simulator
Theory:-
2. CMP M (Compare memory with accumulator)
•Any 8-bit data, or the contents of register, can be compares for:
o Equality
o Greater Than
o Less Than
•With the contents of accumulator.
The result is reflected in status flags
Program: -
LXI H 3000H
MOV A, M
INX H
CMP M
JC AA
MOV A,
M
AA: STA 3002H
HLT
RESULT :-
Flags:-
S=1
Z=0
AC = 0
P=0
C=1
B.E.
2100 = 15
2101 = 35
2102 = ?
A.E.
2100 = 15
2101 = 35
2102 = 15
Conclusion :- We find out the Smallest of two numbers with the help of 8085 simulator.
MP PRACTICAL
EXPERIMENT NO. 11
Title:- Find out the largest number from an array of numbers
Aim: - Write an assembly language program to find out the largest number from an array of
numbers. The count value of numbers is stored in Register C directly and the numbers are
stored in the memory location from 2100h to 2106H. The largest number will be stored in
2107H location.
Apparatus: -
8085 microprocessor Kit, power supply, op-code sheet, PC, GNU 8085 simulator
Theory:-
3. CMP M (Compare memory with accumulator)
•Any 8-bit data, or the contents of register, can be compares for:
o Equality
o Greater Than
o Less Than
•With the contents of accumulator.
The result is reflected in status flags
Program: -
MVI C,06H
LXI H 2000H
MOV A, M
UP:INX H
CMP M
JNC DOWN
MOV A, M
DOWN: DCR C
JNZ UP
STA 2006H
HLT
Result:
Flags:-
S=0
Z=1
AC = 0
P=1
C=0
B.E.
2100 = 25
2101 = 45
2102 = 85
2103 = 96
2104 = 21
2105 = 32
2106 = ?
A.E.
2100 = 25
2101 = 45
2102 = 85
2103 = 96
2104 = 21
2105 = 32
2106 = 96
Conclusion :- We find out the largest number from an array of numbers with the help of
8085 Simulator.