From 4862e778af7779bbdb047b9c71adfb62add319b2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 14:17:43 -0300 Subject: design: the disassembly stays under the source; the graph as a track From the user, on the sort render. Registers a scene never changes fold three to a row, so the stack is twelve to fifteen slots and the disassembly keeps its place under the source with eleven to seventeen rows; a blocks lens has no view. The graph leaves the layered picture of the reverse-engineering tools: blocks are pills on one line in the order they run, a loop an arch over its blocks with the turn count at its centre, every bend a quarter circle; sort's eleven blocks and both loops are seen whole across the band. Sheets 42 and 43 set the layouts and the graph's forms side by side. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- design/mock/25-blocks-lens.svg | 1279 ++++++++++++++++++++++++++-------------- 1 file changed, 849 insertions(+), 430 deletions(-) (limited to 'design/mock/25-blocks-lens.svg') diff --git a/design/mock/25-blocks-lens.svg b/design/mock/25-blocks-lens.svg index 3504f8e..5041b62 100644 --- a/design/mock/25-blocks-lens.svg +++ b/design/mock/25-blocks-lens.svg @@ -1,294 +1,259 @@ - - + + the blocks of sort -its blocks · the visits · the path - - - - - - - - - - - - - - - - - - -×5 - - -×5 - - -+0 -×1 - - -+17 -×6 - - -+1f -×5 - - -+5f -×11 - - -+65 -×11 - - -+9a -×5 - - -+9e -×6 - - -+aa - - - -disassembly -sort · +84 to +a1 -4011 -c7 -12 -lea -rcx, [rax*4] - -4011 -cf -lea -rax, [rip + 0x2e4a] - -4011 -d6 -mov -eax, [rcx + rax*1] -404034 -◂ -5 - -4011 -d9 -cmp -edx, eax -17 - : -5 - -zf - sf - of - - - -4011 -db -jg -401162 -taken - · reads zf sf of -4011 -dd -10 -add -[rbp - 8] - - - - -, 1 -4011 -e1 -mov -eax, [rbp - 8] - - - -sort.c -lines 1 to 21 of 22 -1 -int -a -[ -8 -] -= -{ -4 -, -9 -, -17 -, -31 -, -12 -, -26 -, -5 -, -20 -} -; -2 -3 -void -swap -( -int -* -x -, -int -* -y -) -{ -4 -int -t -= -* -x -; -5 -* -x -= -* -y -; -6 -* -y -= -t -; -7 -} -8 -9 -void -sort -( -int -n -) -{ -10 -for -( -int -i -= -1 -; -i -< -n -; -i -+ -+ -) -{ -11 -int -j -= -i -; - - -12 -while -( -j -> -0 -& -& -a -[ -j -- -1 -] -> -a -[ -j -] -) -{ - -13 -swap -( -& -a -[ -j -- -1 -] -, -& -a -[ -j -] -) -; - -14 -j -- -- -; -15 -} -16 -} -17 -} -18 -19 -int -main -( -void -) -{ -20 -sort -( -8 -) -; -21 -return -0 -; +its blocks · the visits · the path · the loops' turns + + + + + + + + + + + + + + + + + + + + + + + + + + +×5 +×5 + ++0 +×1 + ++12 +×6 + ++1e +×6 + ++24 +×11 + ++2f +×11 + ++56 +×11 + ++5f +×5 + +swap + ++5d +×5 + ++97 +×5 + ++99 +×5 + ++a7 + + + +sort.c +lines 8 to 15 of 22 +8 +9 +void +sort +( +int +n +) +{ +10 +for +( +int +i += +1 +; +i +< +n +; +i ++ ++ +) +{ +11 +int +j += +i +; + + +12 +while +( +j +> +0 +& +& +a +[ +j +- +1 +] +> +a +[ +j +] +) +{ + +13 +swap +( +& +a +[ +j +- +1 +] +, +& +a +[ +j +] +) +; + +14 +j +- +- +; +15 +} + + + +disassembly +sort +4011 +92 +12 +movsxd +rdx, [rbp - 0xc] + + + + + +4011 +96 +lea +rcx, [rip + 0x2e73] +4011 +9d +cmp +eax, [rcx + rdx*4] +4011 +a0 +setg +al + +4011 +a3 +mov +[rbp - 0xd], al +7fffffffecd3 +◂ +1 + +4011 +a6 +mov +al, [rbp - 0xd] +7fffffffecd3 +◂ +1 + +4011 +a9 +test +al, 1 +1 + : +1 + +zf + + + +4011 +ab +jne +4011af +taken + · reads zf +4011 +ad +jmp +4011e7 +4011 +af +13 +mov +eax, [rbp - 0xc] +4011 +b2 +sub +eax, 1 +4011 +b5 +cdqe + +4011 +b7 +lea +rdi, [rip + 0x2e52] +4011 +be +shl +rax, 2 +4011 +c2 +add +rdi, rax + +×11 + +×5 + +×5 - + registers stack @@ -298,167 +263,621 @@ rwx read-only + +rbx +0 +r8 +7ffff7e19680 +r9 +7ffff7e1afa0 +r10 +7fffffffea60 + + + + + +r11 +7ffff7ffca90 + + + + + +r12 +7fffffffee38 + + + + + +r13 +1 +r14 +7ffff7ffd000 + + + + + +r15 +403e10 + + + + + rax -5 - -rbx -0 -rcx -0x10 -16 -rdx -0x11 -17 - -rsi -404034 +1 +rcx +404010 + + +0x900000004 +rdx +4 +rsi +404024 + + +0x1f0000001a +rdi +404020 -0x1f0000001a -rdi -404030 - - -0x1a00000005 -rbp -7fffffffecf0 - - -7fffffffed00 - - -7fffffffedb0 - - -7fffffffee10 - - -0 -rsp -7fffffffecd8 - - -0x800000000 -r8 -7ffff7e19680 -r9 -7ffff7e1afa0 -r10 -7fffffffea60 - - -0 -r11 -7ffff7ffca90 - - -0x786843bb9f54c5c1 -r12 -7fffffffee38 - - -7fffffffefea - - -"./sort" -r13 -1 -r14 -7ffff7ffd000 - - -7ffff7ffe3c0 - - -0 -r15 -403e10 - - -4010e0 -__do_global_dtors_aux - - -rip -4011db -sort+152 -cf - -PF - -AF -zf -sf - -IF -df -of - - - -stack -six words from rsp · the frames they belong to -rsp - -+0 +0x1a00000005 +rbp +7fffffffece0 + + +7fffffffed00 + + +7fffffffedb0 + + +7fffffffee10 + + +0 +rsp +7fffffffecd0 + + +0x401000000 + + +rip +4011ab +sort+91 +cf + +pf + +af +zf +sf + +IF +df +of + + + +stack +twelve words from rsp · the frames they belong to +rsp + ++0 +j, high half +7fffffffe +cd0 + + +0x401000000 ++8 +i, n +7fffffffe +cd8 + + +0x800000006 +rbp + ++10 +saved rbp +7fffffffe +ce0 + + +7fffffffed00 + + + + + ++18 +7fffffffe +ce8 + + +401219 +main+25 ++20 +7fffffffe +cf0 + + +0 ++28 +7fffffffe +cf8 + + +0 ++30 +saved rbp 7fffffffe -cd8 - - -0x800000000 -+8 +d00 + + +7fffffffedb0 + + + + + ++38 7fffffffe -ce0 - - -0 -+10 -i, j +d08 + + +7ffff7c27781 +libc+27781 ++40 7fffffffe -ce8 - - -0x400000006 -rbp - -+18 -saved rbp +d10 + + +7ffff7fe0c60 +ld.so+22c60 ++48 7fffffffe -cf0 +d18 -7fffffffed00 +7fffffffee38 -+20 ++50 7fffffffe -cf8 - - -4011ff -main+14 -+28 +d20 + + +0x1f7fbe000 ++58 7fffffffe -d00 +d28 -7fffffffedb0 - - -7fffffffee10 - - -0 - - - -sort(8) - - -moment 370 of 465 -The sixth pass, its third compare: 17 : 5, so jg goes back to the swap. -The swap has run 5 times so far; the outer loop has turned 5. +401200 +main+0 + + + +sort + + + +main + + +libc.so.6+27781 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +moment 434 of 1905 +The sixth pass, its third compare: 17 > 5, so jne takes the swap. +The swap has run 5 times so far, and each loop has turned 5. -- cgit v1.3