diff --git a/subx/apps/assort b/subx/apps/assort index 01813914..5fd51058 100755 Binary files a/subx/apps/assort and b/subx/apps/assort differ diff --git a/subx/apps/dquotes b/subx/apps/dquotes index be36b0c4..5c7ee1c0 100755 Binary files a/subx/apps/dquotes and b/subx/apps/dquotes differ diff --git a/subx/apps/hex b/subx/apps/hex index 8b903e5d..4bd5acce 100755 Binary files a/subx/apps/hex and b/subx/apps/hex differ diff --git a/subx/apps/pack b/subx/apps/pack index 792c30ba..370ced9b 100755 Binary files a/subx/apps/pack and b/subx/apps/pack differ diff --git a/subx/apps/subx-common.subx b/subx/apps/subx-common.subx index 413edc9a..27f488c9 100644 --- a/subx/apps/subx-common.subx +++ b/subx/apps/subx-common.subx @@ -1,6 +1,6 @@ -# some common helpers shared by phases of the SubX converter +# common helpers shared by phases of the SubX translator -# - buffer sizes shared by all phases +# - some limits on the programs we can translate == data # maximum memory available for allocation @@ -15,6 +15,10 @@ Segment-size: Input-size: 0x80000/imm32/512KB +# maximum size of the 'labels' table in survey.subx +Max-labels: + 0x4000/imm32/1K-labels/16KB + == code # instruction effective address register displacement immediate # . op subop mod rm32 base index scale r32 diff --git a/subx/apps/survey b/subx/apps/survey index 308c6ee8..54ed0c41 100755 Binary files a/subx/apps/survey and b/subx/apps/survey differ diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx index 9bee7e16..8af8204c 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -136,16 +136,24 @@ convert: # infile : (address buffered-file), out : (address buffered-file) -> < 68/push 0/imm32/read 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX - # var labels/EDX = stream(512 * 16) - 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x2000/imm32 # subtract from ESP - 68/push 0x2000/imm32/length + # var labels/EDX = stream(1024 * 16) + # . data + 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/ESP Max-labels/disp32 # subtract *Max-labels from ESP + # . length + ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Max-labels/disp32 # push *Max-labels + # . read 68/push 0/imm32/read + # . write 68/push 0/imm32/write 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . . # copy ESP to EDX # var in/ESI = stream(Input-size * 1) + # . data 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/ESP Input-size/disp32 # subtract *Input-size from ESP + # . length ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Input-size/disp32 # push *Input-size + # . read 68/push 0/imm32/read + # . write 68/push 0/imm32/write 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . . # copy ESP to ESI #? # dump labels->write {{{ diff --git a/subx/apps/tests b/subx/apps/tests index 20375e67..edaf4709 100755 Binary files a/subx/apps/tests and b/subx/apps/tests differ