16 BIT DATA SUBTRACTION




ADDRESS
OPCODE
LABEL
MNEMO
NICS
OPER
AND
COMMENTS
8000

START
MVI
C, 00
Initialize C reg.
8001




8002


LHLD
8050H
Load the subtrahend in DE reg. Pair through HL reg. pair.
8003




8004




8005


XCHG

8006


LHLD
8052H
Load the minuend in HL reg. Pair.
8007




8008




8009


MOV
A, L
Move the content of reg. L to Acc.
800A


SUB
E
Subtract the content of  reg. E from that of acc.
800B


MOV
L, A
Move the content of Acc. to reg. L
800C


MOV
A, H
Move the content of reg. H to Acc.
800D


SBB
D
Subtract content of reg. D with that of Acc.
800E


MOV
H, A
Transfer content of acc. to reg. H
800F


SHLD
8054H
Store the content of HL pair in memory location 8504H.
8010




8011




8012


JNC
NEXT
If there is borrow, go to the instruction labeled NEXT.
8013




8014




8015


INR
C
Increment reg. C
8016

NEXT
MOV
A, C
Transfer the content of reg. C to Acc.
8017


STA
8056H
Store the content of acc. to the memory location 8506H
8018




8019




801A


HLT

Stop the program execution.

Comments

Popular posts from this blog

8086 STRING MANIPULATION –FIND AND REPLACE A WORD

Animated Circles In C++

C program to find out the sum of series 1 + 2 + …. + n.