talks

Log | Files | Refs

commit 5eed6f031fb5521acbcbb4cc6e774bde5e646292
parent 737d6383066f71e032d9ae30a8741165ff21b435
Author: dwrz <dwrz@dwrz.net>
Date:   Fri, 13 Nov 2020 03:34:31 +0000

Update x86 assembly slides

Diffstat:
Mx86-assembly/slides.org | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/x86-assembly/slides.org b/x86-assembly/slides.org @@ -205,7 +205,7 @@ void exit_group(int status); * 18. Exit -[[file:src/exit/exit.s:]] +[[file:src/exit/exit.s]] * 19. Assemble, Link, Execute, Trace #+begin_src bash @@ -237,12 +237,12 @@ strace ./exit - Reverse Engineering * 22. Instructions +- Represented by numbers (opcodes). - Describe an operation the CPU should perform, e.g.: - Move data in and out of registers - Modify register contents - Modify stack - Control program flow -- Represented by numbers (opcodes). * 23. Instruction Cycle - On every tick of its internal clock, the CPU: @@ -251,6 +251,14 @@ strace ./exit - *Executes* the instruction. - Increments the instruction pointer. +#+begin_src bash +hexdump -C exit +#+end_src + +#+begin_src bash +objdump -D exit +#+end_src + * 24. Registers - Storage on the CPU (fastest storage). - Act as a scratchpad -- temporary variables. @@ -285,7 +293,7 @@ Assembly sections refer to executable's memory layout: | RODATA | --> const str = "Hello, World"; | DATA | --> var str = "Hello, World"; | BSS | --> var str; -| ↓ HEAP ↓ | +| ↓ HEAP ↓ | --> (for traditional C) | | | ↑ STACK ↑ | |-----------| @@ -385,7 +393,6 @@ node -e "" - Davy Wybiral, [[https://www.youtube.com/playlist?list=PLmxT2pVYo5LB5EzTPZGfFN0c2GDiSXgQe][Intro to x86 Assembly Language]] - Jennifer Rexford, [[https://www.cs.princeton.edu/courses/archive/fall05/cos217/][Princeton COS 217: Introduction to Programming Systems]] -- [[https://en.wikipedia.org/wiki/Objdump][objdump]] - [[https://en.wikipedia.org/wiki/Structured_program_theorem][Structured Program Theorem]] - [[https://www.gnu.org/software/gdb/][GDB]] - [[https://www.youtube.com/watch?v=tpIctyqH29Q&list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo][Crash Course: Computer Science]]