diff options
Diffstat (limited to 'subx/apps/dquotes.subx')
-rw-r--r-- | subx/apps/dquotes.subx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/subx/apps/dquotes.subx b/subx/apps/dquotes.subx index 4810bcad..db1073cf 100644 --- a/subx/apps/dquotes.subx +++ b/subx/apps/dquotes.subx @@ -19,33 +19,25 @@ # . op subop mod rm32 base index scale r32 # . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes -Entry: # run tests if necessary, convert stdin if not +Entry: + # initialize heap + # . Heap = new-segment(64KB) + # . . push args + 68/push Heap/imm32 + 68/push 0x10000/imm32/64KB + # . . call + e8/call new-segment/disp32 + # . . discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # for debugging: run a single test -#? # . Heap = new-segment(4096) -#? # . . push args -#? 68/push Heap/imm32 -#? 68/push 0x1000/imm32 -#? # . . call -#? e8/call new-segment/disp32 -#? # . . discard args -#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -#? # . test() #? e8/call test-convert-processes-string-literals/disp32 #? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX #? eb/jump $main:end/disp8 + # run tests if necessary, convert stdin if not # . prolog 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP - # initialize heap - # . Heap = new-segment(4096) - # . . push args - 68/push Heap/imm32 - 68/push 0x1000/imm32 - # . . call - e8/call new-segment/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # - if argc > 1 and argv[1] == "test", then return run_tests() # . argc > 1 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32 # compare *EBP @@ -1980,9 +1972,7 @@ test-next-word-returns-string-with-escapes: == data Segment-size: - # TODO: there's currently a tight size limit on segments because we aren't growing the heap - 0x100/imm32 -#? 0x1000/imm32/4KB + 0x1000/imm32/4KB Next-string-literal: # tracks the next auto-generated variable name 1/imm32 |