Question: Consider the following initial values for the registers and memory. Values are reset back to the values shown in the table before each operation. Determine
Consider the following initial values for the registers and memory. Values are reset back to the values shown in the table before each operation. Determine the result of the following operations and state where the result is stored.
Destination should be formatted after doing all address calculations in order to be counted for full credit
Result should match the size specified by the destination
| Register | Value |
|---|---|
| %rax | 0xFEDCBA9876543210 |
| %rbx | 0x0000000012345678 |
| %r8 | 0xFFFFFFFFFFFFFFFE |
| Memory Address | Value |
|---|---|
| 0xFEDCBA9876543209 | 0xC3 |
| 0xFEDCBA987654320A | 0xA8 |
| 0xFEDCBA987654320B | 0x2B |
| 0xFEDCBA987654320C | 0x98 |
| 0xFEDCBA987654320D | 0x7D |
| 0xFEDCBA987654320E | 0x02 |
| 0xFEDCBA987654320F | 0x4C |
| 0xFEDCBA9876543210 | 0x64 |
| 0xFEDCBA9876543211 | 0x38 |
| 0xFEDCBA9876543212 | 0x91 |
| 0xFEDCBA9876543213 | 0x7A |
| 0xFEDCBA9876543214 | 0x23 |
| 0xFEDCBA9876543215 | 0x61 |
| 0xFEDCBA9876543216 | 0xAB |
| 0xFEDCBA9876543217 | 0xCF |
| 0xFEDCBA9876543218 | 0x3F |
| 0xFEDCBA9876543219 | 0x19 |
| 0xFEDCBA987654321A | 0xD3 |
Q2.1 Given the command, State the destination and the result
Command: decl %ebx
Destination:
Result:
Command: incb 9(%rax)
Destination:
Result:
Command: negq %rax
Destination:
Result:
Command: xorq %rbx,%rax
Destination:
Result:
Command: sarl $3, %ebx
Destination:
Result:
Command: xorw $5, -0x4(%rax)
Destination:
Result:
Command: subw -6(%rax),%bx
Destination:
Result:
Command: shrw $2,12(%rax,%r8,4)
Destination:
Result:
Command: movw 12(%rax,%r8,4),%ax
Destination:
Result:
Command: movb 2(%rax,%r8,2), %bl
Destination:
Result:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
