8 BIT DIVISION
ADDRESS
|
OPCODE
|
LABEL
|
MNEMONICS
|
OPERAND
|
COMMENTS
|
4100
|
|
|
MVI
|
B,00
|
Clear
B reg for quotient
|
4101
|
|
|
|
|
|
4102
|
|
|
LXI
|
H,4500
|
Initialize HL reg. to
4500H
|
4103
|
|
|
|
|
|
4104
|
|
|
|
|
|
4105
|
|
|
MOV
|
A,M
|
Transfer dividend to acc.
|
4106
|
|
|
INX
|
H
|
Increment HL reg. to point next mem. Location.
|
4107
|
|
|
SUB
|
M
|
Subtract
divisor from dividend
|
4108
|
|
|
INR
|
B
|
Increment
B reg
|
4109
|
|
|
JNC
|
|
Jump to LOOP if result does not yield borrow
|
410A
|
|
|
|
|
|
410B
|
|
|
|
|
|
410C
|
|
|
ADD
|
M
|
Add
divisor to acc.
|
410D
|
|
|
DCR
|
B
|
Decrement
B reg
|
410E
|
|
|
INX
|
H
|
Increment HL reg. to point next
mem. Location.
|
410F
|
|
|
MOV
|
M,A
|
Transfer the remainder from acc.
to memory.
|
4110
|
|
|
INX
|
H
|
Increment HL reg. to point next
mem. Location.
|
4111
|
|
|
MOV
|
M,B
|
Transfer the quotient from B
reg. to memory.
|
4112
|
|
|
HLT
|
|
Stop the program
|
Comments
Post a Comment