CSC 211: Exam 2

CSC 211 - Computer Organization and Architecture - Weinman

1  Learning Outcomes

At the end of this unit you should be able to
  1. Trace the execution of a MIPS assembly program
  2. Translate C code to MIPS assembly, including
    1. Assignment statements
    2. Basic arithmetic (+,-) and bitwise operations (~, &, | , < <, and > >)
    3. Array accesses (reads and writes)
    4. Pointer arithmetic and dereferencing
    5. if-else statements and the ternary conditional operator ( ? : )
    6. for, while, and do-while loops
    7. Boolean logical expressions (&&, | | , !)
    8. Function calls with parameters and return values
  3. Identify the value of a load byte operation on a big-endian or little-endian MIPS architecture after a store word operation
  4. Convert between a MIPS assembly instruction and its machine code representation
  5. Identify the format of a given MIPS instruction (e.g., R, I, or J)
  6. Distinguish MIPS instructions from pseudoinstructions
  7. Write MIPS procedures that obey calling conventions
  8. Save/retrieve values onto/from the call stack
  9. Identify the addressing mode of any MIPS instruction that changes the PC
  10. Identify the range of addresses available to a jump or branch instruction
  11. Calculate the numerical value of BranchAddr for a branch address in a branch instruction, given MIPS assembly code including the target label
  12. Explain the tasks of the compiler, assembler, and linker (respectively)
  13. Provide the contents of the relocation and symbol tables in an object file, given a C or MIPS program

2  Study Problems

The following exercises are from Patterson and Hennessy (Fifth Edition)
Chapter 2
1-5, 7, 9-36, 38-42
The following exercises are from Patterson and Hennessy (Sixth Edition)
Chapter 2
1-5, 7-33, 35