From 7f23be0107af59f37a948151eefe9c4d39ddf96e Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 13 Jul 2019 19:48:39 -0700 Subject: . Clean up. --- subx/apps/survey.subx | 264 +++++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 132 deletions(-) (limited to 'subx/apps/survey.subx') diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx index a3c77d36..65557b20 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -135,15 +135,15 @@ convert: # in : (address buffered-file), out : (address buffered-file) -> = max) break 39/compare 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . . # compare EAX with ECX 0f 83/jump-if-greater-or-equal-unsigned $emit-headers:end/disp32 - # dump curr-segment->name {{{ - # . write(2/stderr, "about to emit ph entry: segment->name: ") - # . . push args - 68/push "about to emit ph entry: segment->name: "/imm32 - 68/push 2/imm32/stderr - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . clear-stream(Stderr+4) - # . . save EAX - 50/push-EAX - # . . push args - b8/copy-to-EAX Stderr/imm32 - 05/add-to-EAX 4/imm32 - 50/push-EAX - # . . call - e8/call clear-stream/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . . restore EAX - 58/pop-to-EAX - # . print-int32-buffered(Stderr, &curr-segment) - # . . push args - 50/push-EAX - 68/push Stderr/imm32 - # . . call - e8/call print-int32-buffered/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . flush(Stderr) - # . . push args - 68/push Stderr/imm32 - # . . call - e8/call flush/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . write(2/stderr, " -> ") - # . . push args - 68/push " -> "/imm32 - 68/push 2/imm32/stderr - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . print-int32-buffered(Stderr, curr-segment->name) - # . . push args - ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . . # push *EAX - 68/push Stderr/imm32 - # . . call - e8/call print-int32-buffered/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . flush(Stderr) - # . . push args - 68/push Stderr/imm32 - # . . call - e8/call flush/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . write(2/stderr, "\n") - # . . push args - 68/push "\n"/imm32 - 68/push 2/imm32/stderr - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # }}} - # write(2/stderr, "emit-segment-header\n") {{{ - # . . push args - 68/push "emit-segment-header\n"/imm32 - 68/push 2/imm32/stderr - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # }}} +#? # dump curr-segment->name {{{ +#? # . write(2/stderr, "about to emit ph entry: segment->name: ") +#? # . . push args +#? 68/push "about to emit ph entry: segment->name: "/imm32 +#? 68/push 2/imm32/stderr +#? # . . call +#? e8/call write/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # . clear-stream(Stderr+4) +#? # . . save EAX +#? 50/push-EAX +#? # . . push args +#? b8/copy-to-EAX Stderr/imm32 +#? 05/add-to-EAX 4/imm32 +#? 50/push-EAX +#? # . . call +#? e8/call clear-stream/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +#? # . . restore EAX +#? 58/pop-to-EAX +#? # . print-int32-buffered(Stderr, &curr-segment) +#? # . . push args +#? 50/push-EAX +#? 68/push Stderr/imm32 +#? # . . call +#? e8/call print-int32-buffered/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # . flush(Stderr) +#? # . . push args +#? 68/push Stderr/imm32 +#? # . . call +#? e8/call flush/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +#? # . write(2/stderr, " -> ") +#? # . . push args +#? 68/push " -> "/imm32 +#? 68/push 2/imm32/stderr +#? # . . call +#? e8/call write/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # . print-int32-buffered(Stderr, curr-segment->name) +#? # . . push args +#? ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . . # push *EAX +#? 68/push Stderr/imm32 +#? # . . call +#? e8/call print-int32-buffered/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # . flush(Stderr) +#? # . . push args +#? 68/push Stderr/imm32 +#? # . . call +#? e8/call flush/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +#? # . write(2/stderr, "\n") +#? # . . push args +#? 68/push "\n"/imm32 +#? 68/push 2/imm32/stderr +#? # . . call +#? e8/call write/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # }}} +#? # write(2/stderr, "emit-segment-header\n") {{{ +#? # . . push args +#? 68/push "emit-segment-header\n"/imm32 +#? 68/push 2/imm32/stderr +#? # . . call +#? e8/call write/disp32 +#? # . . discard args +#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +#? # }}} # emit-elf-program-header-entry(out, curr-segment) # . . push args 50/push-EAX -- cgit 1.4.1-2-gfad0