diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-07-09 16:23:56 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-07-09 16:25:31 -0700 |
commit | dc7066c7bfe4bc9ea9a1c348c6b0ccec9c00e7c2 (patch) | |
tree | b9fbca861edb4ab8ffd22b9abffcee1491c16aa2 /subx | |
parent | acc83b644bda1ae6884dcf12de990f5e4df749b1 (diff) | |
download | mu-dc7066c7bfe4bc9ea9a1c348c6b0ccec9c00e7c2.tar.gz |
there's a variant of compute-width for slices
Looks like the original compute-width is now dead. But still seems useful to have around.
Diffstat (limited to 'subx')
-rw-r--r-- | subx/apps/survey.subx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx index b4d968c7..b9de2d72 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -374,7 +374,7 @@ compute-offsets: # in : (address buffered-file), segments : (address stream {st # trace("segment '", curr-segment-name, "' is at file offset 0x", seg->starting-offset) # segment-offset = 0 # else - # width = compute-width(word-slice) + # width = compute-width-of-slice(word-slice) # *segment-offset += width # *file-offset += width # @@ -635,16 +635,12 @@ $compute-offsets:construct-next-segment: c7 0/subop/copy 0/mod/indirect 5/rm32/.disp32 . . . compute-offsets:segment-offset/disp32 0/imm32 # copy to *segment-offset e9/jump $compute-offsets:line-loop/disp32 $compute-offsets:else: - # EAX = slice-to-string(curr-segment-name) + # width/EAX = compute-width-of-slice(word-slice) + # . . push args 52/push-EDX - 68/push Heap/imm32 - e8/call slice-to-string/disp32 + # . . call + e8/call compute-width-of-slice/disp32 # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # width/EAX = compute-width(word/EAX) - 50/push-EAX - e8/call compute-width/disp32 - # . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # segment-offset += width # . EBX = *segment-offset |