about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-10 11:57:08 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-10 11:57:08 -0700
commit538f24c296f6ddd0688c3d312db08cfe48919cdd (patch)
tree6c8d788920f69fc51da6986f0250a6f22b0883db /subx
parent551112ff88c9ebc8b4058351bdc53b6914bfa0de (diff)
downloadmu-538f24c296f6ddd0688c3d312db08cfe48919cdd.tar.gz
.
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/apps/surveybin39564 -> 39573 bytes
-rw-r--r--subx/apps/survey.subx10
2 files changed, 7 insertions, 3 deletions
diff --git a/subx/apps/survey b/subx/apps/survey
index 1c70d7a5..e50905f4 100755
--- a/subx/apps/survey
+++ b/subx/apps/survey
Binary files differdiff --git a/subx/apps/survey.subx b/subx/apps/survey.subx
index dcdfe659..26d863cb 100644
--- a/subx/apps/survey.subx
+++ b/subx/apps/survey.subx
@@ -354,8 +354,8 @@ compute-offsets:  # in : (address buffered-file), segments : (address stream {st
     #       if slice-starts-with?(word-slice, "#")  # comment
     #         continue
     #       if is-label?(word-slice)
-    #         x : (address number) = get-or-insert(labels, name)
-    #         *x = segment-offset
+    #         x : (address label-info) = get-or-insert(labels, name)
+    #         x->segment-offset = segment-offset
     #         trace("label '", word-slice, "' is in segment '", curr-segment-name, "'")
     #         trace("label '", word-slice, "' is at offset 0x", file-offset)
     #         # labels occupy no space, so no need to increment offsets
@@ -474,7 +474,11 @@ $compute-offsets:label:
     e8/call  get-or-insert-slice/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
-    # TODO: *x = segment-offset
+    # x->segment-offset = segment-offset
+    # . EBX = segment-offset
+    8f          0/subop/pop         0/mod/indirect  5/rm32/.disp32            .             .           .           compute-offsets:segment-offset/disp32
+    # . x->segment-offset = EBX
+    89/copy                         1/mod/*+disp8   0/rm32/EAX    .           .             .           3/r32/EBX   4/disp8         .                 # copy EBX to *(EAX+4)
     # trace-slsls("label '" word-slice/EDX "' is in segment '" current-segment-name "'")
     # . . push args
     68/push  "'"/imm32