; 2000H = 21H
; 2001H = 12H
; 2002H = 21H
; 2003H = 43H
; RESULT = 1221H - 4321H
; = 3100H
; 2004H = 00H LOWER 2 BYTES
; 2005H = 31H HIGHER 2 BYTES
LHLD 2000H ; LOAD FIRST 16 BIT INTO HL PAIR H=12H L=21H
XCHG ; SAVE IT IN DE PAIR
LHLD 2002H ; LOAD SECOND 16 BIT INTO HL PAIR H=21H L=43H
MOV A, E ; LOAD LOWER BYTE OF FIRST NUMBER IN ACCUMULATOR
SUB L ; SUBTRACT 2 LOWER BYTES
MOV L, A ; STORE RESULT
MOV A, D ; LOAD HIGHER BYTE INTO ACCUMULATOR
SBB H ; SUBTRACT HIGHER BYTE OF SECOND NUMBER WITH BORROW OF PREVIOUS SUBTRACTION
MOV H, A ; A = A - H - CY
SHLD 2004H ; STORE RESULT
HLT ;
Thanks...
ReplyDeleteFine & simple . If subtrahend is greater than minuend how can we get the result?
ReplyDeleteBOGAS PROGRAM DELET IT
ReplyDeleteSorry not familiar with the acronym BOGAS....
Deletemeans chu
DeleteBOGAS PROGRAM DELET IT
ReplyDeleteOk but poor orientation.
ReplyDeleteThere are no standard orientation in assembly coding... Everything is shown in portrait...
DeleteI dont get what you mean by orientation...
Ok but poor orientation.
ReplyDeletePlease add the program for carry. if carry is come.
ReplyDeletePlease add carry