csci 10 :: book learning challenge 8 (due mon, oct 17)
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.7, binary addition and answer the following:

Your name:
  1. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1111_0000, al);
    and(%0000_1111, al);
    Answer:
  2. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1010_1010, al);
    and(%0101_0101, al);
    Answer:
  3. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1001_1001, al);
    and(%0000_0001, al);
    Answer:
  4. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1111_0000, al);
    or(%0000_1111, al);
    Answer:
  5. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1010_1010, al);
    or(%0101_0101, al);
    Answer:
  6. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%0000_0000, al);
    or(%0000_0001, al);
    Answer:
  7. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1010_1010, al);
    xor(%0101_0101, al);
    Answer:
  8. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1111_0000, al);
    xor(%0000_1111, al);
    Answer:
  9. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%0101_0101, al);
    xor(%0101_0101, al);
    Answer:
  10. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%0000_0000, al);
    not(al);
    Answer:
  11. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1100_0011, al);
    not(al);
    Answer:
  12. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%1010_1010, al);
    add(%0000_0011, al);
    Answer:
  13. What is the value of AL after the following instructions? Write your answer in binary, preceding the binary value with % and separating each nibble with an underscore.
    mov(%0000_1111, al);
    add(%0000_1111, al);
    Answer:
  14. What is the output of the following code?
    mov(%1111_1111, al);
    add(%0000_0001, al);
    if (@c) then
         stdout.put("OVERFLOW ");
    endif;
    stdout.put(al);
    Answer:
  15. What is the output of the following code? If the output is not the same as in #14 above, briefly explain the reason for the difference.
    mov(%1111_1111, al);
    add(%0000_0001, al);
    stdout.put(al);
    if (@c) then
         stdout.put(" OVERFLOW");
    endif;
    Answer:

Total points for this book learning challenge:

150 points