Question: Write an assembly code that subtract two numbers using 2s complement. In this case, we are performing the subtraction 10 7 = 3. 1) Store

Write an assembly code that subtract two numbers using 2s complement. In this case, we are performing the subtraction

10 7 = 3.

1) Store number 10 decimal in address 30H

2) Store number 3 decimal in address 31H

3) Copy the content of address 31H to A

4) Find the complement A, and store in A

5) Add 1 to A, and store in A (this is the 2s complement of A)

6) Add A and the content of address 30H(which is 10), and store in A

7) Move the content of A to address 32H (should be a 7)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!