## Topics carried over from Exam 1 and 2

Everything!

## Old exams worth reviewing

- Exam 1
- Exam 2
- Last year’s final exam, but simpler MIPS32

## Reference material

- binary numbers reference
- PIC32 reference table
- C Reference Card — though unlikely to be useful

## More recent topics

- Memory caches as in Homework 11
- Basics of circuit connection as in Homework 12
- “Short definition” basics of GPIO and I
^{2}C as in Raspberry Pi GPIO and I^{2}C labs

### Programming questions

The assembly programming questions on this exam will be fairly simple, no more than a function with a loop and a conditional.

Be sure you know how to the following.

- Initialize a variable to a constant
- Add a constant to a variable
- Access the
`i`’th element of an integer array - Use
`lw`

and`sw`

- Implement the
*conditional*`goto`

- Access function parameters
- Return function result

## A few more things to get straight

- In C, any non-zero integer is
considered to be
`true`

and zero is considered to be`false`

. - The relational and logical operators return either 0 or 1.
- It doesn’t take many bits to address a memory location.
- In twos complement, the most significant bit has negative weight.
- Adding a positive and a negative number
*never*results in overflow. - 8 Mi / 128 is 64 ki.
- If
`V`

is an array of integers; to access`V[i]`

in MIP32 assembler, you need to do a multiplication by 4. - Shift left two places to multiply by 4.
- The
`&`

operator of C is used on an l value. - The unary
`*`

operator of C is used with a pointer. - You can subtract pointers in C if they point to elements of the same array.
- If the MIPS32 instruction starts with 000000, it’s a an R instruction.
- In MIPS32, arguments are passed in
`$a0`

to`$a3`

and values are returned in`$v0`

to`$v1`

. - Check your answers.
- Explain your reasoning.