csci 10 :: book learning challenge 9 (due mon, oct 24)

Complete this exercise on your own.

Fill in all of the "Answer" boxes, then print the answer grid that you see after you press "Prepare for printing".

Staple all pages together and submit to the instructor on the date listed above.

Questions:

1. Write the following decimal value in binary, then reverse the sign and write the resultant value in binary. Precede both binary values with % and separate each nibble with an underscore.
1
2. Write the following decimal value in binary, then reverse the sign and write the resultant value in binary. Precede both binary values with % and separate each nibble with an underscore.
-10
3. Write the following decimal value in binary, then reverse the sign and write the resultant value in binary. Precede both binary values with % and separate each nibble with an underscore.
100
4. Write the following decimal value in binary, then reverse the sign and write the resultant value in binary. Precede both binary values with % and separate each nibble with an underscore. Be sure to round to the nearest 8/16/32 bit increment as appropriate.
-1000
5. Write the HLA code to reverse the sign of the value in the register AL.
mov(1, AL);
6. Write the HLA code to reverse the sign of the value in the register AL.
mov(-1, AL);
7. Write the HLA code to display the value in AL, interpreted as a signed integer.
mov(129, AL);
8. Write the HLA code to display the value in AL, interpreted as an unsigned integer.
mov(-102, AL);
9. Does the following code cause the carry bit to be set? Write the value of AL, after the add instruction has run, in binary. Precede the binary value with % and separate each nibble with an underscore.
mov(%0111_1111, AL);
10. Does the following code cause the carry bit to be set? Write the value of AL, after the add instruction has run, in binary. Precede the binary value with % and separate each nibble with an underscore.
mov(%1111_1110, AL);
11. Does the following code cause the carry bit to be set? Write the value of AL, after the add instruction has run, in binary. Precede the binary value with % and separate each nibble with an underscore.
mov(%1010_1111, AL);
12. Does the following code cause the carry bit to be set? Write the value of AL, after the add instruction has run, in binary. Precede the binary value with % and separate each nibble with an underscore.
mov(%1110_0000, AL);
13. Does the following code cause the carry bit to be set? Write the value of AL, after the add instruction has run, in binary. Precede the binary value with % and separate each nibble with an underscore.
mov(%1111_1110, AL);