Subtraction of Two 8 Bit Number

Sunny Bhaskar

11/6/20241 min read

Algorithm
  1. Load the first number (04H) into the accumulator.

  2. Subtract the second number (02H) from the contents of the accumulator.

  3. Store the result in a specified memory location (e.g., 2051H).

  4. 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

Address

Prayagraj Phaphamau

Contacts

7518998334
sunnygamingyt298@gmail.com

Subscribe to our newsletter