Assignment#1
Microprocessors and Assembly Language LAB
CSE22P3
A) Write a simple program to perform addition operation on 8085 processor
//Add two numbers
//8085 microprocessor
MVI
MVI
ADD
STA
HLT
A,34d
B,13h
B
1002
Accumulator
Register B
Register C
Register D
Register E
Register F
Memory
Flag Register
Value
35
13
00
00
00
00
3E
S
0
0
0
0
0
0
0
0
Z
0
0
0
0
0
0
0
0
*
0
1
0
0
0
0
0
1
*
0
1
1
0
0
0
0
1
AC
0
0
0
0
0
0
0
1
*
0
1
0
0
0
0
0
1
P
1
0
1
0
0
0
0
1
*
0
1
1
0
0
0
0
0
CY
0
B) Write a simple program to perform subtraction operation on 8085 processor
//Subtract two numbers
//8085 microprocessor
MVI A,34d
MVI B,13h
SUB B
STA 1002
HLT
Accumulator
Register B
Register C
Register D
Register E
Register F
Memory
Flag Register
1|Pa g e
Value
0F
13
00
00
00
00
3E
S
0
0
0
0
0
0
0
0
Z
0
0
0
0
0
0
0
0
*
0
1
0
0
0
0
0
1
*
0
1
1
0
0
0
0
1
AC
0
0
0
0
0
0
0
1
*
0
1
0
0
0
0
0
1
P
1
0
1
0
0
0
0
1
*
0
1
1
0
0
0
0
0
CY
0
FouziaNigarSulatana
ID:13-0-52-020-048
Assignment#1
Microprocessors and Assembly Language LAB
CSE22P3
C) Write a simple program to perform multiplication operation on 8085 processor
BACK:
2|Pa g e
MVI A,03h
MOV E,A
MVI D,00
MVI A, B2H
MOV C,A
LXI H, 0000 H
DAD D
DCR C
JNZ BACK
SHLD 2300H
HLT
FouziaNigarSulatana
ID:13-0-52-020-048
Assignment#1
Microprocessors and Assembly Language LAB
CSE22P3
D) Write a simple program to perform division operation on 8085 processor
MVI
MOV
MVI
INX
MVI
A,02H
B,A // Get the dividend in B - reg.
C,00
// Clear C - reg for quotient
H
// Increment HL pair of registers
A,0FH
// Get the divisor in A - reg
NEXT:
CMP B
//
JC LOOP //
SUB B
//
INR C
//
JMP NEXT
LOOP:
STA 5002
// Store the remainder in Memory
MOV A,C // Move Content of C - Reg to A - Reg
STA 5003
// Store the quotient in memory
HLT
// Terminate the program.
3|Pa g e
Compare A - reg with register B.
Jump on carry to LOOP
Subtract A - reg from B - reg.
Increment content of register C.
// Jump to NEXT
FouziaNigarSulatana
ID:13-0-52-020-048
Assignment#1
Microprocessors and Assembly Language LAB
4|Pa g e
CSE22P3
FouziaNigarSulatana
ID:13-0-52-020-048