Wednesday 28 September 2011

1.d. 8-BIT DIVISION.


1.d. 8-BIT DIVISION
AIM:
            To write an assembly language program for the division of two 8 – bit number.
APPARATUS REQUIRED:
                                    8085 kit, power chord
ALGORITHM:
1.      Start the program                                   
2.      Load the divisor to accumulator
3.      Load the dividend to B-register          
4.      Compare the B-register value with the accumulator                                   
5.      Jump on carry to step - 9
6.      Subtract B-register value with accumulator
7.      Increment the C-register accumulator           
8.      Jump to step – 4
9.      Store the content of accumulator and C-register
10.  Stop the program
PROGRAM:
ADDRESS
LABEL
OPCODE
MNEMONICS
OPERAND
COMMENTS
4500

3E,data
MVI
A, data1
Move dividend to   accumulator
4502

06,data
MVI
B, data2
Move divisor to B
Register.
4504

0E, 00
MVI
C, 00
Clear c register
4506
LOOP2
B8
CMP
B
Compare b reg and accumulator.
4507

DA, 0F, 45
JC
LOOP1
Jump on carry to adder
450A

90
SUB
B
Repetitive subtraction for division
450B

0C
INR
C
Increment c register
450C

C3, 06,45
JMP
LOOP2
Jump to Loop2
450F
LOOP1
32,00,50
STA
5000
Store the remainder.
4512




79
MOV
A, C
Move c reg to accumulator
4513

32,01,50
STA
5001
Store the quotient.
4516

76
HLT

Stop the process.

INPUT:  A – CD            B – AB      OUTPUT:     5001 – OD (c)           5000 – OC(R)
RESULT:
            Thus the assembly language program for 8-bit division is executed and the results are verified.

0 comments:

Post a Comment