Course Review for Midterm
CS 301 Lecture, Dr. Lawlor
Super-compressed version of things to know:
- Bits, hex, bytes. What bitwise operators do. How many bits & bytes in a byte, word, dword, qword.
- Machine code: concept of bytes representing instructions. (exact bytes used for x86 are not important for the test)
- Registers: rax, eax, ax, etc. Saved/preserved vs temporary/scratch registers.
- Arithmetic: how to use "add", "sub", "imul", and the bitwise instructions. Overflow.
- Pointers: how to allocate space on the stack, the heap (with
malloc), or statically (with section .data); how to access memory with
DWORD[ptr] or QWORD[ptr]. Pointer arithmetic for arrays, classes, and the stack.
- Stack: how to allocate space, what functions expect, how to save
& restore registers, how to clean up stack. How "push" and
"pop" instructions work.
- Branches: how to convert "if", "for", "while", etc into assembly.
- Functions: How "call" and "ret" instructions work. "extern" and "global" declarations. How parameters go in, and come out.
Stuff that won't appear on the test:
- Writing long pieces of assembly code. However, short segments (2-3 lines) are extremely likely.
- Large amounts of hand arithmetic. Short or simple arithmetic and bitwise operations are likely.