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

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:

Read AoA V1 3.2 and answer the following:

Your name:
  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
    Answer:
  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
    Answer:
  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
    Answer:
  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
    Answer:
  5. Write the HLA code to reverse the sign of the value in the register AL.
    mov(1, AL);
    Answer:
  6. Write the HLA code to reverse the sign of the value in the register AL.
    mov(-1, AL);
    Answer:
  7. Write the HLA code to display the value in AL, interpreted as a signed integer.
    mov(129, AL);
    Answer:
  8. Write the HLA code to display the value in AL, interpreted as an unsigned integer.
    mov(-102, AL);
    Answer:
  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);
    add(%0000_0001, AL);
    Answer:
  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);
    add(%0000_0001, AL);
    Answer:
  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);
    add(%0000_0011, AL);
    Answer:
  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);
    add(%0011_1111, AL);
    Answer:
  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);
    add(%0000_0011, AL);
    Answer:
  14. What is the output of the following code?
    mov(%1111_1111, AL);
    stdout.put((type uns8 AL), nl);
    Answer:
  15. What is the output of the following code?
    mov(%1111_1111, AL);
    stdout.put((type int8 AL), nl);
    Answer:

Total points for this book learning challenge:

150 points