From 01b45300ed1307c31a9792341a93e1f97a8f10c1 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 8 Jul 2019 16:38:32 -0700 Subject: colocate compute-offsets with its globals --- subx/apps/survey | Bin 37431 -> 37431 bytes subx/apps/survey.subx | 23 ++++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/subx/apps/survey b/subx/apps/survey index a76934f2..074b4ab6 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 bc1b6650..50e5a705 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -317,6 +317,20 @@ test-convert-computes-addresses: 5d/pop-to-EBP c3/return +# global scratch space for compute-offsets in the data segment +== data + +compute-offsets:curr-segment-name: 0/imm32/curr +compute-offsets:curr-segment-name:end: 0/imm32/limit +compute-offsets:file-offset: 0/imm32 +compute-offsets:segment-offset: 0/imm32 +compute-offsets:word-slice: 0/imm32/curr +compute-offsets:word-slice:end: 0/imm32/limit +compute-offsets:heap: 0/imm32/curr +compute-offsets:heap:end: 0/imm32/limit + +== code + compute-offsets: # in : (address buffered-file), segments : (address stream {string, segment-info}), labels : (address stream {string, label-info}) # pseudocode: # var curr-segment-name = 0 @@ -2698,13 +2712,4 @@ $p_align: # compute the starting address for each segment 0x1000/imm32 -compute-offsets:curr-segment-name: 0/imm32/curr -compute-offsets:curr-segment-name:end: 0/imm32/limit -compute-offsets:file-offset: 0/imm32 -compute-offsets:segment-offset: 0/imm32 -compute-offsets:word-slice: 0/imm32/curr -compute-offsets:word-slice:end: 0/imm32/limit -compute-offsets:heap: 0/imm32/curr -compute-offsets:heap:end: 0/imm32/limit - # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0