For this programming assignment, you should ONLY use these instructions:
1) mov (regular/standard move)
2) add
3) sub
Operands for instructions should be registers or memory locations. An exception is that you can use the immediate values 0, 1, -1, 0Fh, or 0FFh where it would make sense.
For phase 2, you need to store the contents of var1, var2, var3, and var4 altogether in register eax. More specifically, var1 will be stored in the highest byte of eax, var2 will be stored in the second highest byte, var3 will be stored in the second lowest byte, and var4 will be stored in the lowest byte.
HINT: Think about how add instructions could be used to achieve shifting. For example, suppose we have the following 8-bit binary number:
00000011
After shifting this binary number two times to the left, we have:
00001100
PHASE 3:
1) Subtract the number from 15
2) Add 1
For example, the 'D' (44h) is stored in the highest byte of eax, so the two's complement of 44h will be stored in the highest byte of ebx. The two's complement of 44h is:
1) 15 - 4 = B (11) and
15 - 4 = B (11)
So we get BBh after step 1
After phase 3 is completed, register ebx should look like this:
Phase 3 is approximately twenty-one (21) instructions
PROGRAM FINAL OUTPUTS
To recap, this is what you should have after the entire program is finished: