diff options
-rwxr-xr-x | apps/survey_baremetal | bin | 56298 -> 56302 bytes | |||
-rw-r--r-- | apps/survey_baremetal.subx | 24 | ||||
-rwxr-xr-x | apps/survey_elf | bin | 56298 -> 56302 bytes | |||
-rw-r--r-- | apps/survey_elf.subx | 24 |
4 files changed, 28 insertions, 20 deletions
diff --git a/apps/survey_baremetal b/apps/survey_baremetal index 6a9257c6..7af84283 100755 --- a/apps/survey_baremetal +++ b/apps/survey_baremetal Binary files differdiff --git a/apps/survey_baremetal.subx b/apps/survey_baremetal.subx index 3807254d..cfdfe712 100644 --- a/apps/survey_baremetal.subx +++ b/apps/survey_baremetal.subx @@ -1813,6 +1813,15 @@ $emit-output:end: 5d/pop-to-ebp c3/return +# global scratch space for emit-segments +== data + +emit-segments:datum: # slice + 0/imm32/start + 0/imm32/end + +== code + emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {(handle array byte), label-info}) # pseudocode: # var offset-of-next-instruction = 0 @@ -1865,7 +1874,6 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # line: ecx # word-slice: edx # offset-of-next-instruction: ebx - # datum: edi # info: esi (inner loop only) # temporaries: eax, esi (outer loop) # @@ -1889,10 +1897,6 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx - # var datum/edi: slice - 68/push 0/imm32/end - 68/push 0/imm32/start - 89/copy 3/mod/direct 7/rm32/edi . . . 4/r32/esp . . # copy esp to edi # offset-of-next-instruction/ebx = 0 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx $emit-segments:line-loop: @@ -2075,9 +2079,9 @@ $emit-segments:2-character: e9/jump $emit-segments:word-loop/disp32 $emit-segments:check-metadata: # - if we get here, 'word-slice' must be a label to be looked up - # datum/edi = next-token-from-slice(word-slice->start, word-slice->end, "/") + # datum = next-token-from-slice(word-slice->start, word-slice->end, "/") # . . push args - 57/push-edi + 68/push emit-segments:datum/imm32 68/push 0x2f/imm32/slash ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # push *(edx+4) ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx @@ -2096,7 +2100,7 @@ $emit-segments:check-metadata: #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # . write-slice-buffered(Stderr, datum) #? # . . push args -#? 57/push-edi +#? 68/push emit-segments:datum/imm32 #? 68/push Stderr/imm32 #? # . . call #? e8/call write-slice-buffered/disp32 @@ -2123,7 +2127,7 @@ $emit-segments:check-metadata: # . . push args 68/push "label table"/imm32 68/push 0x18/imm32/row-size - 57/push-edi + 68/push emit-segments:datum/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) # . . call e8/call get-slice/disp32 @@ -2328,7 +2332,7 @@ $emit-segments:next-line: e9/jump $emit-segments:line-loop/disp32 $emit-segments:end: # . reclaim locals - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x21c/imm32 # add to esp + 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32 # add to esp # . restore registers 5f/pop-to-edi 5e/pop-to-esi diff --git a/apps/survey_elf b/apps/survey_elf index 6a9257c6..7af84283 100755 --- a/apps/survey_elf +++ b/apps/survey_elf Binary files differdiff --git a/apps/survey_elf.subx b/apps/survey_elf.subx index b8d3a392..f84ca2b1 100644 --- a/apps/survey_elf.subx +++ b/apps/survey_elf.subx @@ -1820,6 +1820,15 @@ $emit-output:end: 5d/pop-to-ebp c3/return +# global scratch space for emit-segments +== data + +emit-segments:datum: # slice + 0/imm32/start + 0/imm32/end + +== code + emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {(handle array byte), label-info}) # pseudocode: # var offset-of-next-instruction = 0 @@ -1872,7 +1881,6 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # line: ecx # word-slice: edx # offset-of-next-instruction: ebx - # datum: edi # info: esi (inner loop only) # temporaries: eax, esi (outer loop) # @@ -1896,10 +1904,6 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad 68/push 0/imm32/end 68/push 0/imm32/start 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx - # var datum/edi: slice - 68/push 0/imm32/end - 68/push 0/imm32/start - 89/copy 3/mod/direct 7/rm32/edi . . . 4/r32/esp . . # copy esp to edi # offset-of-next-instruction/ebx = 0 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx $emit-segments:line-loop: @@ -2082,9 +2086,9 @@ $emit-segments:2-character: e9/jump $emit-segments:word-loop/disp32 $emit-segments:check-metadata: # - if we get here, 'word-slice' must be a label to be looked up - # datum/edi = next-token-from-slice(word-slice->start, word-slice->end, "/") + # datum = next-token-from-slice(word-slice->start, word-slice->end, "/") # . . push args - 57/push-edi + 68/push emit-segments:datum/imm32 68/push 0x2f/imm32/slash ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # push *(edx+4) ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . . # push *edx @@ -2103,7 +2107,7 @@ $emit-segments:check-metadata: #? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp #? # . write-slice-buffered(Stderr, datum) #? # . . push args -#? 57/push-edi +#? 68/push emit-segments:datum/imm32 #? 68/push Stderr/imm32 #? # . . call #? e8/call write-slice-buffered/disp32 @@ -2130,7 +2134,7 @@ $emit-segments:check-metadata: # . . push args 68/push "label table"/imm32 68/push 0x18/imm32/row-size - 57/push-edi + 68/push emit-segments:datum/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) # . . call e8/call get-slice/disp32 @@ -2335,7 +2339,7 @@ $emit-segments:next-line: e9/jump $emit-segments:line-loop/disp32 $emit-segments:end: # . reclaim locals - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x21c/imm32 # add to esp + 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32 # add to esp # . restore registers 5f/pop-to-edi 5e/pop-to-esi |