CMSI 488/588
Homework #3

Read chapters 5 and 14 in Scott. Do all of the exercises marked "Check Your Understanding"in a social setting with classmates or friends, but do not turn these in. Also skim the first two volumes of the Intel Software Developement Manuals for the Pentium Family of Processors, and the NASM documentation (online, linked from the syllabus).

Turn in solutions to:

  1. Under what circumstances would using a double precision floating point variable in a C program for an integer counter make sense?
  2. Problem 5.5 in [Scott].
  3. Problem 5.10 in [Scott].
  4. Problem 5.14 in [Scott].
  5. Problem 14.3 in [Scott].
  6. Problem 14.4 in [Scott].
  7. Problem 14.6 in [Scott].
  8. Problem 14.9 in [Scott].
  9. Write a NASM program that determines whether it is given one command line argument that is a positive integer, and if so, whether that argument is prime.
  10. I have handed out, in class, some code for a Hana compile, though I have left four analyze() methods for you to implement (currently they throw UnsupportedOperationException). Also,
    1. Please note that I have supplied 63 test cases but coverage is nowhere near complete; please add five interesting test cases. Try to cover parts of the language definition that I did not.
    2. Document bugs you find in my implementation and supply corrections. You should be able to find at least two. Missing functionality is counted as a "bug".
    3. Suggest two improvements to my implementation. They could be critiques of the actual Java coding (no nitpicking, though, about things like undercommenting), or they could be suggestions to add new tuples to squid.