Subtraction of Two 8 Bit Number
Sunny Bhaskar
11/6/20241 min read
Algorithm
Load the first number (04H) into the accumulator.
Subtract the second number (02H) from the contents of the accumulator.
Store the result in a specified memory location (e.g., 2051H).
Halt the program.
Program
MVI A, 04H ; Load 04H into accumulator A
SUI 02H ; Subtract 02H from A
STA 2051H ; Store the result (02H) at memory location 2051H
HLT ; Halt the program