CODE CONVERSION –HEXADECIMAL TO DECIMAL
ADDRE
SS
|
OPCO
DE
|
LABEL
|
MNEM
ONICS
|
OPER
AND
|
COMMENTS
|
8000
|
|
|
LXI
|
H,8100
|
Initialize HL reg. to
8100H
|
8001
|
|
|
|
|
|
8002
|
|
|
|
|
|
8003
|
|
|
MVI
|
A,00
|
Initialize A register.
|
8004
|
|
|
|
|
|
8005
|
|
|
MVI
|
B,00
|
Initialize
B register.
|
8006
|
|
|
|
|
|
8007
|
|
|
MVI
|
C,00
|
Initialize
C register for carry.
|
8008
|
|
|
|
|
|
8009
|
|
|
INR
|
B
|
Increment
B reg.
|
800A
|
|
|
ADI
|
01
|
Increment A reg
|
800B
|
|
|
|
|
|
800C
|
|
|
DAA
|
|
Decimal Adjust Accumulator
|
800D
|
|
|
JNC
|
NEXT
|
If there is no carry go to NEXT.
|
800E
|
|
|
|
|
|
800F
|
|
|
|
|
|
8010
|
|
|
INR
|
C
|
Increment c register.
|
8011
|
|
NEXT
|
MOV
|
D,A
|
Transfer A to D
|
8012
|
|
|
MOV
|
A,B
|
Transfer B to A
|
8013
|
|
|
CMP
|
M
|
Compare M & A
|
8014
|
|
|
MOV
|
A,D
|
Transfer D to A
|
8015
|
|
|
JNZ
|
|
If acc and given number are not equal,
then go to LOOP
|
8016
|
|
|
|
|
|
8017
|
|
|
|
|
|
8018
|
|
|
STA
|
8101
|
Store the result in a memory location.
|
8019
|
|
|
|
|
|
801A
|
|
|
|
|
|
801B
|
|
|
MOV
|
A,C
|
Transfer C to A
|
801C
|
|
|
STA
|
8102
|
Store the carry in another memory
location.
|
801D
|
|
|
|
|
|
801E
|
|
|
|
|
|
801F
|
|
|
HLT
|
|
Stop the program
|
Comments
Post a Comment