For each add instruction in this problem, assume that EAX contains the given contents before the instruction is executed, and give the contents of EAX as well as the values of the CF, OF, SF, and ZF flags after the instruction is executed: EAX before (a) 00 00 00 45 (b) FF FF FF 45 (c) 00 00 00 45 (d) FF FF FF 45 (e) FF FF FF FF (f) 7F FF FF FF (g) 00 00 00 99 (h) 00 00 03 AF Instruction add eax, 45 add eax, 45 add eax, -45 add eax, -45 dd eax, 1 add eax, 100 add eax, 1 add eax, 10
Assembly Language Programming
- The numbers in the EAX are in hexadecimal form.
- The negative and positive numbers in the instructions are all in decimal form.
- The result should be in hexadecimal.
Write on paper if possible. Tysm
Here are the results of each instruction:
(a) EAX before: 00 00 00 45
Instruction: add eax, 45
EAX after: 00 00 00 8A
CF: 0 OF: 0 SF: 0 ZF: 0
(b) EAX before: FF FF FF 45
Instruction: add eax, 45
EAX after: 00 00 00 8A
CF: 0 OF: 1 SF: 0 ZF: 0
(c) EAX before: 00 00 00 45
Instruction: add eax, -45
EAX after: 00 00 00 00
CF: 0 OF: 0 SF: 0 ZF: 1
(d) EAX before: FF FF FF 45
Instruction: add eax, -45
EAX after: FF FF FF 00
CF: 0 OF: 1 SF: 0 ZF: 1
(e) EAX before: FF FF FF FF
Instruction: add eax, 1
EAX after: 00 00 00 00
CF: 0 OF: 1 SF: 0 ZF: 1
(f) EAX before: 7F FF FF FF
Instruction: add eax, 100
EAX after: 80 00 00 63
CF: 0 OF: 0 SF: 0 ZF: 0
(g) EAX before: 00 00 00 99
Instruction: add eax, 1
EAX after: 00 00 00 9A
CF: 0 OF: 0 SF: 0 ZF: 0
(h) EAX before: 00 00 03 AF
Instruction: add eax, 10
EAX after: 00 00 03 B9
CF: 0 OF: 0 SF: 0 ZF: 0
Trending now
This is a popular solution!
Step by step
Solved in 2 steps