diff options
Diffstat (limited to 'subx/apps/assort.subx')
-rw-r--r-- | subx/apps/assort.subx | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/subx/apps/assort.subx b/subx/apps/assort.subx index 7498cc3a..49772b72 100644 --- a/subx/apps/assort.subx +++ b/subx/apps/assort.subx @@ -23,33 +23,26 @@ # . 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/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 @@ -1330,9 +1323,7 @@ _test-data-segment: _test-data-segment-end: 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 Heap: # curr |