CS208 Introduction to Computer Systems Friday, 3 Feb 2023 + Two goals [8:30] - walk through the assembly version of function-calling - demonstrate getting started on the bomb-defusing assignment + functions.c [8:31] - what it does - why we're looking at it + The system stack [8:34] - what's a "stack frame"? - what goes in a stack frame? - rsp - rbp? + Addressing modes [8:37] https://web.stanford.edu/class/archive/cs/cs107/cs107.1224/guide/x86-64.html#addressing-modes - register just the name of a register MOV rdi, rax - immediate a literal number MOV 0x23, rax - direct address is specified as a literal JNE 0x555555555200 - indirect - indirect with displacement Contents of the specified register, add to displacement, use the result as an address. Go to that address and get what you find there. mov 0x8(%rsi),%rdi - indirect with displacement and scaled index + Walk through functions.c, C mode [8:42] - run/r - break/br - next/n - step/s - print - info reg/i r + Walk through functions.c, asm mode [8:52] - Keep track of the stack frames - Keep track of rsp - Keep track of rip + Looking at the bombs assignment [9:10] - How to get your bomb - What to do with it - Sample bomb, etc.