CompOrg Spring 2005 Test #2 Topics


Test #2 will be given in class on Friday, Apr 1st
The test is closed book, no notes or computers are allowed.

An IA32 Instruction reference will be distributed with the test.

Topic What to know What to expect on the test
IA32 Instructions
  • Registers
  • movl instruction
  • leal instruction
  • Addressing Modes
  • Arithmetic/Logic instructions
  • Condition Codes
  • Set instructions
  • Compare instructions
  • Jump instructions
  • Be able to decipher (explain what happens) in some small assembly language program segments that include the instructions we have covered.
  • Be able to write some assembly language given a small segment of C code.
  • Be able to do some assembly language optimization. Given some assembly language code - write a more efficient version.
  • Make sure you understand the IA32 addressing modes!
  • Be able to write/decipher code that deals with C arrays, pointers and and structures.
  • The test will include a list of the instructions we have covered (you don't need to memorize names). The complete instruction reference that will be attached to the test is here: cribsheet.pdf
  • IA32 Assembly Language Subroutines
  • Subroutines (gcc/gas calling conventions).
    • Be able to write IA32 Assembly language programs and subroutines (subroutines that will work with code generated by gcc). You may be given a description of what the code should do in English, or as a C program/function.
    • Given some IA32 Assembly language code, provide C code that does the same thing.
    The Stack
  • Stack instructions: call, ret, push pop
  • Passing parameters
  • Buffer and Stack Overflow!!!
  • Be able to describe what happens to register %esp when any of the stack instructions is executed.
  • Be able to write assembly code that calls subroutines and passes parameters. For example show the assembly code that corresponds to printf("%d\n",4);.
  • Be able to predict the changes to the stack when a buffer overflow occurs. Know what effect this will have on a subroutine that does something like this:
              pop %ebp
              ret
              
    That is, that both %ebp and %esp will get bad values...
  • Logic Design
  • Combinational circuits.
  • Decoder, Multiplexor, Ripple-carrry adder.
  • Simple Sequential circuits
  • Be able to construct simple combinational circuits from AND, OR and NOT gates. For example, create a circuit that computes XOR of two boolean inputs using only AND, OR and NOT gates. A XOR B is true if either A or B is true, but not both.
  • Be able to use decoders and multiplexors to build more complex circuits.
  • Be able to predict what the output of a circuit will be given the values of all inputs.
  • Be able to describe the difference between combinational and sequential circuits.
  • You will not be required to construct any sequential circuits.Be able to describe the operation of a ripple-carry adder. You don't need to be able to build on from scratch, just make sure you understand the basic principles.


  • Test Info, What to Study

    Practice Problems