From e8616df2031b39535e62dce1142b029e65723c95 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 11:52:21 -0300 Subject: design: the address space as one tall rectangle; aligned as a listing From the user. segments is the textbook picture: one rectangle, high addresses on top, each mapping a band in its ink (heights by the log of their size, holes folded with their size beside them), labels outside on leaders, a file's mappings bracketed as one, the stack's and the heap's growth as arrows, rsp and rip pinned in their bands. aligned is one panel: a line as the head of its instructions, line numbers and addresses in one column since both say where, a rule over every head. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- design/mock/33-aligned.svg | 318 ++++++++++++++++++--------------------------- 1 file changed, 124 insertions(+), 194 deletions(-) (limited to 'design/mock/33-aligned.svg') diff --git a/design/mock/33-aligned.svg b/design/mock/33-aligned.svg index 5c46e27..1762f33 100644 --- a/design/mock/33-aligned.svg +++ b/design/mock/33-aligned.svg @@ -1,198 +1,128 @@ - - - -list.c -each line beside the first of its instructions - - - -disassembly -reverse - - - - - - - - - - - - - - - -20 -while -( -head -) -{ -10019 -10 -test -rdi, rdi -10019 -13 -je -1001935 -10019 -15 -push -rbp -10019 -16 -mov -rbp, rsp -10019 -19 -xor -eax, eax -10019 -1b -nop -[rax + rax] -10019 -20 -mov -rcx, rax -10019 -23 -mov -rax, rdi - - - - - - -21 -struct -node -* -next -= -head -- -> -next -; -10019 -26 -mov -rdi, [rdi + 8] -1004098 - - -1004070 - - -9 -22 -head -- -> -next -= -prev -; -10019 -2a -mov -[rax + 8], rcx -20 -while (head) { -10019 -2e -test -rdi, rdi -10019 -31 -jne -1001920 -10019 -33 -pop -rbp -26 -return -prev -; -10019 -34 -ret - -10019 -35 -xor -eax, eax -10019 -37 -ret - -_init · no line -10019 -38 -endbr64 - -10019 -3c -sub -rsp, 8 -10019 -40 -mov -rax, [rip + 0x1231] -10019 -47 -test -rax, rax -10019 -4a -je -100194e -10019 -4c -call -rax -10019 -4e -add -rsp, 8 -10019 -52 -ret - -_fini · no line -10019 -54 -endbr64 - -10019 -58 -sub -rsp, 8 -10019 -5c -add -rsp, 8 -10019 -60 -ret - -strtol@plt-0x10 · no line -10019 -70 -push -[rip + 0x1222] -10019 -76 -jmp -[rip + 0x1224] -Line 20, while (head), has two runs: its test before the body -and again after it. Lines 23 to 25 have no code of their own. + + + +list.c · reverse +each line, then the instructions it compiled to · lines and addresses in one column + + +20 +while +( +head +) +{ +1001 +910 +test +rdi, rdi +1001 +913 +je +1001935 +1001 +915 +push +rbp +1001 +916 +mov +rbp, rsp +1001 +919 +xor +eax, eax +1001 +91b +nop +[rax + rax] +1001 +920 +mov +rcx, rax +1001 +923 +mov +rax, rdi + + + +21 +struct +node +* +next += +head +- +> +next +; + + + +1001 +926 +mov +rdi, [rdi + 8] +1004098 + + +1004070 + + +9 + + +22 +head +- +> +next += +prev +; +1001 +92a +mov +[rax + 8], rcx + + +20 +while (head) { again: its second run +1001 +92e +test +rdi, rdi +1001 +931 +jne +1001920 +1001 +933 +pop +rbp + + +26 +return +prev +; +1001 +934 +ret + +1001 +935 +xor +eax, eax +1001 +937 +ret + + +Line 20, while (head), comes twice: its test before the body and +again after it. Lines 23 to 25 have no code of their own: no group. -- cgit v1.3