DESCENDING ORDER
ADDRE
SS
|
OPCO
DE
|
LABEL
|
MNEM
ONICS
|
OPER
AND
|
COMMENTS
|
|
8000
|
|
|
MVI
|
B,04
|
Initialize B reg with number of
comparisons (n-1)
|
|
8001
|
|
|
|
|
||
8002
|
|
|
LXI
|
H,8100
|
Initialize HL reg. to
8100H
|
|
8003
|
|
|
|
|
||
8004
|
|
|
|
|
||
8005
|
|
|
MVI
|
C,04
|
Initialize C reg with no. of
comparisons(n-1)
|
|
8006
|
|
|
|
|
||
8007
|
|
LOOP2
|
MOV
|
A,M
|
Transfer
first data to acc.
|
|
8008
|
|
|
INX
|
H
|
Increment
HL reg. to point next memory location
|
|
8009
|
|
|
CMP
|
M
|
Compare M & A
|
|
800A
|
|
|
JNC
|
LOOP1
|
If A is greater than M then go to loop1
|
|
800B
|
|
|
|
|
||
800C
|
|
|
|
|
||
800D
|
|
|
MOV
|
D,M
|
Transfer data from M to D reg
|
|
800E
|
|
|
MOV
|
M,A
|
Transfer data from acc to M
|
|
800F
|
|
|
DCX
|
H
|
Decrement HL pair
|
|
8010
|
|
|
MOV
|
M,D
|
Transfer data from D to M
|
|
8011
|
|
|
INX
|
H
|
Increment HL pair
|
|
8012
|
|
LOOP1
|
DCR
|
C
|
Decrement C reg
|
|
8013
|
|
|
JNZ
|
LOOP2
|
If C is not zero go to loop2
|
|
8014
|
|
|
|
|
||
8015
|
|
|
|
|
||
8016
|
|
|
DCR
|
B
|
Decrement B reg
|
|
8017
|
|
|
JNZ
|
LOOP3
|
If B is not Zero go to loop3
|
|
8018
|
|
|
|
|
||
8019
|
|
|
|
|
||
801A
|
|
|
HLT
|
|
Stop the program
|
Comments
Post a Comment