You are on page 1of 4

8bit addition using 8085

8100H LDA 8200H 3A,00,82 Load the first data(augend) from memory
in to the accumulator
8103H MOV B,A 47 Store the data in B reg from accumulator
8104H LDA 8201H 3A,01,82 Load the second data(addend) from
memory in to the accumulator
8107H ADD B 80 Add the two data and the result in
accumulator
8108H STA 8202H 32,02,82 Store the content of accumulator in
memory location 8102H
810BH JC LOOP DA,14,81 Check the carry flag
810EH MVI A,OOH 3E,00 If CY=0,move 00H to accumulator
8110H STA 8203H 32,03,82 Store the content of accumulator(carry
status) in memory location 8103H
8113H HLT 76 Stop the program execution
8114H LOOP MVI A,01H 3E,01 If CY=1,move 01H to accumulator
8116H STA 8203H 32,03,82 Store the content of accumulator(carry
status) in memory location 8103H
8119H HLT 76 Stop the program execution
8bit division using 8085
8100H LDA 8201H 3A,01,82 Load the divisor in Accumulator
8103H MOV B,A 47 Move the divisor to B register
8104H LDA 8200H 3A,00,82 Load the dividend in Accumulator
8107H MVIC,00H 0E,00 Clear C register to store quotient
8109H LOOP1 CMP B B8 Compare the content of A and B
810AH JC LOOP2 DA,12,81 If divisor < dividend, go to LOOP2
810DH SUB B 90 Subtract divisor from dividend
81OEH INR C 0C Increment the quotient
810FH JMP LOOP1 C3,09,81 Continue the subtraction
8112H LOOP2 STA 8203H 32,03,82 Store the reminder
8115H MOV A,C 79 Move the content of C to A
8116H STA 8202H 32,02,82 Store the quotient

8119H HLT 76 Stop the program execution

Result:

Input
8200:
8201:

Output
8202:
8203:
8bit subtraction using 8085
8100H LDA 8201H 3A,01,82 Load the first data(augend) from memory
in to the accumulator
8103H MOV B,A 47 Store the data in B reg from accumulator
8104H LDA 8200H 3A,00,82 Load the second data(addend) from
memory in to the accumulator
8107H MVI C,00H 0E,00H Add the two data and the result in
accumulator
8109H SUB B 90 Store the content of accumulator in
memory location 8102H
810A JNC LOOP D2,11,81 Check the carry flag
H
810D INR C 0C If CY=0,move 00H to accumulator
H
81OE CMA 2F Store the content of accumulator(carry
H status) in memory location 8103H
810FH ADI 01H C6,01H Stop the program execution
8111H LOOP STA 8202H 32,02,82 If CY=1,move 01H to accumulator
8114H MOV A,C 79 Store the content of accumulator(carry
status) in memory location 8103H
8115H STA 8203H 32,03,82

8118H HLT 76 Stop the program execution

RESULT:

INPUT
8200:
8201:

OUTPUT
8202:
8203:
8bit multiplication using 8085
8100H LXI H,0000H 21,00,00 Load the first data(augend) from
memory in to the accumulator
8103H MOV B,00 06,00 Store the data in B reg from
accumulator
8105H LDA 8200H 3A,00,8 Load the second data(addend) from
2 memory in to the accumulator
8108H MOV C,A 4F Add the two data and the result in
accumulator
8109H LDA 8201H 3A,01,8 Store the content of accumulator in
2 memory location 8102H
810CH MOV D,A 57 Check the carry flag
810DH LOOP1 DAD B 09 If CY=0,move 00H to accumulator
810EH DCR D 15 Store the content of
accumulator(carry status) in memory
location 8103H
81OFH JZ LOOP2 CA,15,8 Stop the program execution
1
8112H JMP LOOP1 C3,0D,8 If CY=1,move 01H to accumulator
1
8115H LOOP2 SHLD 8202H 22,02,82 Store the content of
accumulator(carry status) in memory
location 8103H
8118H HLT 76 Stop the program execution

RESULT:

INPUT:
8200:
8201:

OUTPUT:
8202:
8203:

You might also like