csci 10 :: book learning challenge 7 (due mon, oct 10)
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 Art of Assembly V2 2.7:

Your name:
  1. According to your text, what is the stack in x86, and what kinds of things are stored on the stack?
    Answer:
  2. What register does an x86 processor use to control its stack?
    Answer:
  3. What instruction is used to write data onto the stack?
    Answer:
  4. What instruction is used to "remove" data from the stack?
    Answer:
  5. Can you write byte-sized registers or variables (such as AL or uns8) onto the stack?
    Answer:
  6. When data is written onto the stack, does the value of ESP increase or decrease?
    Answer:
  7. When data is "removed" from the stack, does the value of ESP increase or decrease?
    Answer:
  8. What will be the value of ESP after the following instruction is executed?
    // GIVEN: ESP value starts at $BFFF_F890
    push(eax);
    Answer:
  9. What will be the value of ESP after the following instruction is executed?
    // GIVEN: ESP value starts at $BFFF_F890
    push(ax);
    Answer:
  10. What will be the value of ESP after the following instruction is executed?
    // GIVEN: ESP value starts at $BFFF_F890
    pop(eax);
    Answer:
  11. What will be the value of ESP after the following instruction is executed?
    // GIVEN: ESP value starts at $BFFF_F890
    pop(ax);
    Answer:
  12. According to your text, should you usually use (1) 16-bit or (2) 32-bit push/pop operations to achieve maximum performance, in a 32-bit environment?
    Answer:
  13. According to your text, what is the most common use of push/pop instructions?
    Answer:
  14. Write the assembly instructions needed to preserve/restore the value of EAX in the following situation. Please be sure to also write the instructions provided below to demonstrate your understanding of the proper order of the instructions (in other words, your answer should have four (4) instructions in it, two (2) that you write and the two (2) that are provided below). Assume userInput has been properly declared as a static uns32 variable.
    stdin.getu32();
    mov(eax, userInput);
    Answer:
  15. What does LIFO stand for? What does this means in terms of the order or data that you push and pop from the stack?
    Answer:

Total points for this book learning challenge:

150 points