Statement: Subtract the contents of memory location 2001H from the contents of memory location 2000H and store the result in memory location 2002H.
Example:
(2000H) = 51H
(2001H) = 19H
(2002H) = 51H - 19H = 38H
Program:
LXI H, 2000H ; HL points the location 2000H
MOV A, M ; Move the contents of 2000H into accumulator
INX H ; HL points the location 2001H
SUB M ; Subtract second operand from the contents of accumulator
INX H ; HL points the location 2002H
MOV M, A ; Store the result at location 2002H
HLT ; Terminate program execution
Comments
Post a Comment