about summary refs log tree commit diff stats
path: root/index.html
Commit message (Expand)AuthorAgeFilesLines
* 3762Kartik K. Agaram2017-03-071-1/+1
* 3641Kartik K. Agaram2016-11-061-2/+3
* 3588 - documentation for filesystem and networkKartik K. Agaram2016-10-241-6/+21
* 3557Kartik K. Agaram2016-10-221-2/+2
* 3415Kartik K. Agaram2016-09-251-1/+1
* 3411Kartik K. Agaram2016-09-231-3/+0
* 3402Kartik K. Agaram2016-09-191-1/+1
* 3401Kartik K. Agaram2016-09-181-1/+1
* 3395Kartik K. Agaram2016-09-171-3/+15
* 3372Kartik K. Agaram2016-09-161-7/+9
* 3355Kartik K. Agaram2016-09-151-1/+1
* 3312Kartik K. Agaram2016-09-101-1/+1
* 3235Kartik K. Agaram2016-08-201-1/+1
* 3227Kartik K. Agaram2016-08-181-1/+4
* 3158Kartik K. Agaram2016-07-271-10/+11
* 3116Kartik K. Agaram2016-07-201-1/+1
* 3103Kartik K. Agaram2016-07-051-24/+20
* 3024Kartik K. Agaram2016-05-281-1/+1
* 3023Kartik K. Agaram2016-05-281-1/+1
* 2997 - new version of http://akkartik.name/aboutKartik K. Agaram2016-05-231-3/+3
* 2996Kartik K. Agaram2016-05-211-99/+112
* 2868Kartik K. Agaram2016-04-251-1/+1
* 2866Kartik K. Agaram2016-04-251-14/+18
* 2814Kartik K. Agaram2016-03-271-22/+22
* 2813Kartik K. Agaram2016-03-271-0/+4
* 2812Kartik K. Agaram2016-03-271-14/+22
* 2811Kartik K. Agaram2016-03-271-4/+4
* 2724 - document failures of /space:globalKartik K. Agaram2016-03-011-3/+5
* 2706 - update htmlKartik K. Agaram2016-02-251-2/+2
* 2605Kartik K. Agaram2016-01-261-10/+10
* 2545Kartik K. Agaram2015-12-151-0/+2
* 2611Kartik K. Agaram2015-11-291-2/+3
* 2430 - make room for more transformsKartik K. Agaram2015-11-131-18/+18
* 2429Kartik K. Agaram2015-11-131-7/+6
* 2423 - describe shape-shifting in html docsKartik K. Agaram2015-11-101-22/+47
* 2300 - remove callcc.mu from docs until it returnsKartik K. Agaram2015-10-281-2/+0
* 2177Kartik K. Agaram2015-09-071-28/+67
* 2175Kartik K. Agaram2015-09-061-2/+0
* 1885Kartik K. Agaram2015-07-291-15/+30
* 1818Kartik K. Agaram2015-07-181-8/+10
* 1766Kartik K. Agaram2015-07-121-4/+6
* 1548Kartik K. Agaram2015-06-091-2/+2
* 1484 - tweak utopiaKartik K. Agaram2015-05-271-13/+15
* 1473Kartik K. Agaram2015-05-261-1/+1
* 1468Kartik K. Agaram2015-05-261-3/+3
* 1467Kartik K. Agaram2015-05-261-1/+1
* 1466Kartik K. Agaram2015-05-261-4/+4
* 1465Kartik K. Agaram2015-05-261-5/+24
* 1464Kartik K. Agaram2015-05-261-0/+13
* 1463Kartik K. Agaram2015-05-261-4/+5
t;- %edx 4/r32/esp # (load-debug-symbols %edx) # destroys the heap # traverse the linked list of ebp pointers: https://wiki.osdev.org/Stack_Trace 8b/-> *ebp 3/r32/ebx { # loop termination check 81 7/subop/compare %ebx 0/imm32 0f 84/jump-if-= break/disp32 # loop body (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "\n" 0 0xc) (draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0 *(ebx+4) 0xf 0xc) (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 " " 0 0xc) (containing-function %edx *(ebx+4)) # => eax, ecx (draw-slice-wrapping-right-then-down-from-cursor-over-full-screen 0 %eax %ecx 0 0xc) # loop update 8b/-> *ebx 3/r32/ebx # e9/jump loop/disp32 } $dump-call-stack:end: # . reclaim locals 81 0/subop/add %esp 0x100c/imm32 # . restore registers 5b/pop-to-ebx 5a/pop-to-edx 59/pop-to-ecx 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return load-debug-symbols: # labels: (addr stream {start-address, label-slice}) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 50/push-eax 51/push-ecx 52/push-edx 53/push-ebx # create space for a stream on the heap, clobbering any existing data # var s/ecx: (addr stream byte) b9/copy-to-ecx 0x03000000/imm32 c7 0/subop/copy *ecx 0/imm32 # write index c7 0/subop/copy *(ecx+4) 0/imm32 # read index c7 0/subop/copy *(ecx+8) 0x01000000/imm32 # stream capacity = 16MB # load sectors starting from sector 10080 = 0x2760 (load-sectors Primary-bus-primary-drive 0x2760 0x800 %ecx) # 0x800 sectors = 1MB # - parse pointers to portions of this stream into labels # var curr/ecx: (addr byte) = s->data 81 0/subop/add %ecx 0xc/imm32 { # loop termination check b8/copy-to-eax 0/imm32 8a/byte-> *ecx 0/r32/eax 3d/compare-eax-and 0/imm32 0f 84/jump-if-= break/disp32 # loop body (skip-to-next-space %ecx) # => edx 42/increment-edx (skip-to-next-newline %edx) # => ebx (parse-hex-int-helper %edx %ebx) # => eax 43/increment-ebx (label-append *(ebp+8) %eax %ecx %edx) # loop update 89/<- %ecx 3/r32/ebx # e9/jump loop/disp32 } $load-debug-symbols:end: # . restore registers 5b/pop-to-ebx 5a/pop-to-edx 59/pop-to-ecx 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return skip-to-next-space: # curr: (addr byte) -> _/edx: (addr byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 50/push-eax # eax = 0 b8/copy-to-eax 0/imm32 # 8b/-> *(ebp+8) 2/r32/edx { 8a/byte-> *edx 0/r32/eax 3d/compare-eax-and 0x20/imm32/space 0f 84/jump-if-= break/disp32 3d/compare-eax-and 0/imm32 { 75/jump-if-!= break/disp8 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "done loading" 7 0) { eb/jump loop/disp8 } } 3d/compare-eax-and 0xa/imm32/newline { 75/jump-if-!= break/disp8 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "unexpected newline" 7 0) { eb/jump loop/disp8 } } 42/increment-edx e9/jump loop/disp32 } $skip-to-next-space:end: # . restore registers 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return skip-to-next-newline: # curr: (addr byte) -> _/ebx: (addr byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 50/push-eax # eax = 0 b8/copy-to-eax 0/imm32 # 8b/-> *(ebp+8) 3/r32/ebx { 8a/byte-> *ebx 0/r32/eax 3d/compare-eax-and 0xa/imm32/newline 0f 84/jump-if-= break/disp32 3d/compare-eax-and 0/imm32 { 75/jump-if-!= break/disp8 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "done loading" 7 0) { eb/jump loop/disp8 } } 3d/compare-eax-and 0x20/imm32/space { 75/jump-if-!= break/disp8 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "unexpected space" 7 0) { eb/jump loop/disp8 } } 43/increment-ebx e9/jump loop/disp32 } $skip-to-next-newline:end: # . restore registers 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return label-append: # labels: (addr stream {start-address, label-slice}), address: int, start: int, end: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 50/push-eax 51/push-ecx 56/push-esi # esi = labels 8b/-> *(ebp+8) 6/r32/esi # ecx = labels->write 8b/-> *esi 1/r32/ecx # labels->data[labels->write] = address 8b/-> *(ebp+0xc) 0/r32/eax 89/<- *(esi+ecx+0xc) 0/r32/eax # labels->data[labels->write+4] = start 8b/-> *(ebp+0x10) 0/r32/eax 89/<- *(esi+ecx+0x10) 0/r32/eax # labels->data[labels->write+8] = end 8b/-> *(ebp+0x14) 0/r32/eax 89/<- *(esi+ecx+0x14) 0/r32/eax # labels->write += 12 81 0/subop/add *esi 0xc/imm32 $label-append:end: # . restore registers 5e/pop-to-esi 59/pop-to-ecx 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return containing-function: # labels: (addr stream {start-address, label-slice}), address: int -> start/eax: (addr byte), end/ecx: (addr byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 52/push-edx 53/push-ebx 56/push-esi # esi = labels 8b/-> *(ebp+8) 6/r32/esi # var curr/ecx: (addr byte) = labels->data 8d/copy-address *(esi+0xc) 1/r32/ecx # var max/edx: (addr byte) = labels->data + labels->write 8b/-> *esi 2/r32/edx 01/add-to %edx 1/r32/ecx # var previous-function-name/ebx: (addr slice) = 0 bb/copy-to-ebx 0/imm32 { # abort if not found 39/compare %ecx 2/r32/edx { 0f 82/jump-if-addr< break/disp32 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "failed to find function for address " 7 0) (draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0 *(ebp+0xc) 7 0) { eb/jump loop/disp8 } } # if *curr > address, break 8b/-> *ecx 0/r32/eax 3b/compare 0/r32/eax *(ebp+0xc) 0f 87/jump-if-addr> break/disp32 # if **(curr+4) not '$' or '@', save curr to previous-function-name { 8b/-> *(ecx+4) 0/r32/eax 8a/byte-> *eax 0/r32/eax 25/and-with-eax 0xff/imm32 3d/compare-eax-and 0x24/imm32/$ 74/jump-if-= break/disp8 3d/compare-eax-and 0x40/imm32/@ 74/jump-if-= break/disp8 8d/copy-address *(ecx+4) 3/r32/ebx } # loop update 81 0/subop/add %ecx 0xc/imm32 # e9/jump loop/disp32 } 8b/-> *ebx 0/r32/eax 8b/-> *(ebx+4) 1/r32/ecx $containing-function:end: # . restore registers 5e/pop-to-esi 5b/pop-to-ebx 5a/pop-to-edx # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return # unlike variants in .mu files, this only supports ASCII draw-slice-wrapping-right-then-down-from-cursor-over-full-screen: # screen: (addr screen), start: (addr byte), end: (addr byte), color: int, background-color: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers 50/push-eax 51/push-ecx 52/push-edx # var curr/ecx: (addr byte) = start 8b/-> *(ebp+0xc) 1/r32/ecx # edx = end 8b/-> *(ebp+0x10) 2/r32/edx # eax = 0 b8/copy-to-eax 0/imm32 { # if (curr >= end) break 39/compare %ecx 2/r32/edx 73/jump-if-addr>= break/disp8 # print *curr 8a/byte-> *ecx 0/r32/eax (draw-grapheme-at-cursor-over-full-screen *(ebp+8) %eax *(ebp+0x14) *(ebp+0x18)) # 41/increment-ecx # eb/jump loop/disp8 } $draw-slice-wrapping-right-then-down-from-cursor-over-full-screen:end: # . restore registers 5a/pop-to-edx 59/pop-to-ecx 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return