Problem 3 : Math Operations
- Suppose AL and BL hold 8-bit, two's complement (signed) integers.
For this problem, we wish to compute an 8-bit, two's complement
(signed) result.
- Write the valid 80x86 command(s) which performs the given operation.
- State which register holds the 8-bit portion of the result.
- Pick values for AL and BL such that the result will be wrong
(i.e., cannot be correctly represented using 8-bit,
two's complement notation) or undefined.
- Assume that all other registers hold undefined values.
- Specify numbers in decimal (base 10).
- The first row is given as an example
| Operation |
80x86 Command(s) to perform 8-bit, 2's complement, signed operation |
Register holding 8-bit portion of result |
Wrong or undefined result occurs when |
| AL= | BL= |
| AL + BL
| ADD BL,AL | BL | 97 | 97 |
| AL - BL
| | | | |
| AL x BL
| | | | |
AL / BL (division)
| | | | |
AL % BL (remainder)
| | | | |
-AL (negation)
| | | |
(20 pts)