Swayam Sir Micro
Swayam Sir Micro
1 Write a Program Using 8085 & Verify for Addition of Two 8-Bit Numbers.
Flowchart:
Code:
;<Addition of Two-8 Bit Numbers without carry>
LXI H,0000H
MOV A,M
INX H
ADD M
INX H
MOV M,A
HLT
Code screenshot & output:
2. Write a Program Using 8085 & Verify for Addition of Two 16-Bit Numbers.
(With Carry)
Flowchart:
Code:
;<Addition of Two-16 Bit Numbers with carry>
LHLD 0000H
XCHG
LHLD 0002H
MVI C,00
DAD D
JNC out
INR C
out:SHLD 0004H
MOV A,C
STA 0006H
HLT
Code screenshot & output:
3.Write a Program Using 8085 & Verify for Subtraction of Two 8-Bit Numbers.
(Display Of Borrow)
Flowchart:
Code:
;<Subtraction of Two-8 Bit Numbers>
LXI H,0000H
MOV A,M
INX H
SUB M
INX H
MOV M,A
HLT
Code screenshot & output:
4. Write a Program Using 8085 & Verify for Subtraction of Two 16-Bit
Numbers. (Display Of Borrow)
Flowchart:
Code:
;<Subtraction of two 16 Bit Numbers>
LHLD 0000H
XCHG
LHLD 0002H
MOV A,E
SUB L
MOV L,A
MOV A,D
SBB H
MOV H,A
SHLD 0004H
HLT
Code:
;<Multiplication>
LHLD 0000H
XCHG
LDA 0002H
LXI H,0000H
MVI C,08H
up:DAD H
RAL
JNC down
DAD D
down: DCR C
JNZ up
SHLD 0004H
HLT
Code screenshot & output:
6 Write a Program Using 8085 & Test for Typical Data Division of Two 8-Bit
Numbers by Repeated Subtraction Method
Flowchart:
Code:
;<Division>
LDA 0000H
MOV B,A
LDA 0002H
MVI C,00H
CMP B
JC down
up:SUB B
INR C
CMP B
JNC up
MOV A,C
STA 0004H
HLT
Code screenshot & output:
7 Write a Program Using 8085 for Finding Square-Root of a Number &Verify.
Flowchart:
Code:
;<Finding Square root of a number>
MVI C,01h
MVI B,01h
MVI A,24h
up:SUB B
JZ down
INR C
INR B
INR B
JMP up
STA 000H
HLT
Code:
;<Moving a Block Of Data>
MVI D,06H
LXI H, 0000H
LXI B, 0020H
up:MOV A,M
STAX B
INX H
INX B
DCR D
JNZ up
HLT
Code:
;<Arranging number in ascending order>
LDA 0000H
DCR A
MOV C,A
MOV B,C
LXI H,0010H
up:MOV A,M
INX H
CMP M
JC down
MOV D,M
MOV M,A
DCX H
MOV M,D
INX H
down:DCR B
JNZ up
DCR C
JNZ 0015H
HLT
Q10) Write a Program to Check Number of 1’s and 0’s in Given Number
Using 8085 & verify.
Flowchart:
Code:
;<0 ands 1>
LXI H,000H
MOV A,M
MVI C,00h
MVI D,00h
MVI B,00h
up:RLC
JNC down
INR D
JMP shift
down:INR C
shift:DCR B
JNZ up
MOV A,C
STA 0001H
MOV A,D
STA 0002H
HLT
Code screenshot & output:
11 Write a Program to Find GCD Of Two Numbers Using 8085 & verify.
Flowchart:
Code:
Code screenshot and output:
12 Write a Program to Find LCM Of Two Numbers Using 8085 & verify.
Flowchart:
Code:
Code screenshot and output:
13 Write a Program to Add ‘N’ Two Digit BCD Numbers Using 8085 & verify.
Flowchart:
Code: