This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ; Program name : Subtraction using add only ;Programmer : Joe B ;Last Modified : Sep 16 2003 load R1, 1 ;1 added for computing 2's complement load R2, FFh ;mask for flipping the bits load R3,first_number ; load R4, second_number ; xor R5, R4,R2 ; flip the 0's and 1's in the second number addi R5,R5,R1 ; add 1 to the flipped bits to get the 2's complement addi R5,R5,R3 ; add the numbers to obtain A - B halt first_number: db 8 ;A in A-B second_number: db 5 ;B in A-B...
View Full Document
This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.
- Fall '05