Header Ads Widget

Ticker

6/recent/ticker-posts

Write an Assembly Language Program to perform the subtraction of two 8-bit numbers.

LXI H, 2501H   :  "Get address of first number in H-L pair. Now H-L points to 2501H"  
MOV A, M       :  "Get first operand in accumulator"  
INX H          :  "Increment content of H-L pair. Now, H-L points 2502H"  
SUB M          :  "Subtract first to second operand"  
INX H          :  "H-L points 4002H"  
MOV M, A       :  "Store result at 2503H"  

HLT            :  "Stop"   

Post a Comment

0 Comments