about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-04-03 00:45:22 -0700
committerKartik Agaram <vc@akkartik.com>2020-04-03 00:47:25 -0700
commit569ebe55e9114760edbee124627f2efccd7be660 (patch)
treeff0fe5c6ad4ff48c0c07bcdd7783d4abc328c50f
parentfc8597593d4448f82e97a2cfd60338e9ff264a43 (diff)
downloadmu-569ebe55e9114760edbee124627f2efccd7be660.tar.gz
6180
It's going to be hard work retrofitting 8-byte handles in place of 4-byte
addrs. Here we just clean up some unused args.
-rwxr-xr-xapps/surveybin50127 -> 49892 bytes
-rw-r--r--apps/survey.subx84
2 files changed, 11 insertions, 73 deletions
diff --git a/apps/survey b/apps/survey
index 58589cb5..3dbab3a0 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/survey.subx b/apps/survey.subx
index a8459130..a6e12abb 100644
--- a/apps/survey.subx
+++ b/apps/survey.subx
@@ -1874,7 +1874,7 @@ test-compute-addresses-large-segments:
 emit-output:  # in: (addr stream byte), out: (addr buffered-file), segments: (addr stream {string, segment-info}), labels: (addr stream {string, label-info})
     # pseudocode:
     #   emit-headers(out, segments, labels)
-    #   emit-segments(in, out, segments, labels)
+    #   emit-segments(in, out, labels)
     #
     # . prologue
     55/push-ebp
@@ -1906,23 +1906,22 @@ emit-output:  # in: (addr stream byte), out: (addr buffered-file), segments: (ad
 #?     # . . discard args
 #?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 #?     # }}}
-    # emit-segments(in, out, segments, labels)
+    # emit-segments(in, out, labels)
     # . . push args
     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
-    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
     # . . call
     e8/call  emit-segments/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 $emit-output:end:
     # . epilogue
     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
     5d/pop-to-ebp
     c3/return
 
-emit-segments:  # in: (addr stream byte), out: (addr buffered-file), segments: (addr stream {string, segment-info}), labels: (addr stream {string, label-info})
+emit-segments:  # in: (addr stream byte), out: (addr buffered-file), labels: (addr stream {string, label-info})
     # pseudocode:
     #   var offset-of-next-instruction = 0
     #   var line: (stream byte 512)
@@ -2232,7 +2231,7 @@ $emit-segments:check-metadata:
     68/push  "label table"/imm32
     68/push  0x10/imm32/row-size
     57/push-edi
-    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
+    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x10/disp8      .                 # push *(ebp+16)
     # . . call
     e8/call  get-slice/disp32
     # . . discard args
@@ -2577,12 +2576,6 @@ test-emit-segments-global-variable:
     e8/call  clear-stream/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-    # . var segments/ecx: (stream byte 10*16)
-    81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0xa0/imm32        # subtract from esp
-    68/push  0xa0/imm32/length
-    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 byte 512*16)
     81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0x2000/imm32      # subtract from esp
     68/push  0x2000/imm32/length
@@ -2646,26 +2639,6 @@ test-emit-segments-global-variable:
     e8/call  write/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-    # . stream-add4(segments, "code", 0x1074, 0, 9)
-    68/push  9/imm32/segment-size
-    68/push  0/imm32/file-offset
-    68/push  0x1074/imm32/start-address
-    68/push  "code"/imm32/segment-name
-    51/push-ecx
-    # . . call
-    e8/call  stream-add4/disp32
-    # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
-    # . stream-add4(segments, "data", 0x2079, 5, 2)
-    68/push  1/imm32/segment-size
-    68/push  5/imm32/file-offset
-    68/push  0x2079/imm32/start-address
-    68/push  "data"/imm32/segment-name
-    51/push-ecx
-    # . . call
-    e8/call  stream-add4/disp32
-    # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # . stream-add4(labels, "x", "data", 1, 0x207a)
     68/push  0x207a/imm32/label-address
     68/push  1/imm32/segment-offset
@@ -2677,16 +2650,15 @@ test-emit-segments-global-variable:
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # component under test
-    # . emit-segments(_test-input-stream, _test-output-buffered-file, segments, labels)
+    # . emit-segments(_test-input-stream, _test-output-buffered-file, labels)
     # . . push args
     52/push-edx
-    51/push-ecx
     68/push  _test-output-buffered-file/imm32
     68/push  _test-input-stream/imm32
     # . . call
     e8/call  emit-segments/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
     # checks
     # . flush(_test-output-buffered-file)
     # . . push args
@@ -2814,12 +2786,6 @@ test-emit-segments-code-label:
     e8/call  clear-stream/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-    # . var segments/ecx: (stream byte 10*16)
-    81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0xa0/imm32        # subtract from esp
-    68/push  0xa0/imm32/length
-    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 byte 512*16)
     81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0x2000/imm32      # subtract from esp
     68/push  0x2000/imm32/length
@@ -2867,16 +2833,6 @@ test-emit-segments-code-label:
     e8/call  write/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-    # . stream-add4(segments, "code", 0x1054, 0, 9)
-    68/push  9/imm32/segment-size
-    68/push  0/imm32/file-offset
-    68/push  0x1054/imm32/start-address
-    68/push  "code"/imm32/segment-name
-    51/push-ecx
-    # . . call
-    e8/call  stream-add4/disp32
-    # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # . stream-add4(labels, "l1", "code", 2, 0x1056)
     68/push  0x1056/imm32/label-address
     68/push  2/imm32/segment-offset
@@ -2888,16 +2844,15 @@ test-emit-segments-code-label:
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # component under test
-    # . emit-segments(_test-input-stream, _test-output-buffered-file, segments, labels)
+    # . emit-segments(_test-input-stream, _test-output-buffered-file, labels)
     # . . push args
     52/push-edx
-    51/push-ecx
     68/push  _test-output-buffered-file/imm32
     68/push  _test-input-stream/imm32
     # . . call
     e8/call  emit-segments/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
     # checks
     # . flush(_test-output-buffered-file)
     # . . push args
@@ -3016,12 +2971,6 @@ test-emit-segments-code-label-absolute:
     e8/call  clear-stream/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-    # . var segments/ecx: (stream byte 10*16)
-    81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0xa0/imm32        # subtract from esp
-    68/push  0xa0/imm32/length
-    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 byte 512*16)
     81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               0x2000/imm32      # subtract from esp
     68/push  0x2000/imm32/length
@@ -3069,16 +3018,6 @@ test-emit-segments-code-label-absolute:
     e8/call  write/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-    # . stream-add4(segments, "code", 0x1054, 0, 9)
-    68/push  9/imm32/segment-size
-    68/push  0/imm32/file-offset
-    68/push  0x1054/imm32/start-address
-    68/push  "code"/imm32/segment-name
-    51/push-ecx
-    # . . call
-    e8/call  stream-add4/disp32
-    # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # . stream-add4(labels, "l1", "code", 2, 0x1056)
     68/push  0x1056/imm32/label-address
     68/push  2/imm32/segment-offset
@@ -3090,16 +3029,15 @@ test-emit-segments-code-label-absolute:
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x14/imm32        # add to esp
     # component under test
-    # . emit-segments(_test-input-stream, _test-output-buffered-file, segments, labels)
+    # . emit-segments(_test-input-stream, _test-output-buffered-file, labels)
     # . . push args
     52/push-edx
-    51/push-ecx
     68/push  _test-output-buffered-file/imm32
     68/push  _test-input-stream/imm32
     # . . call
     e8/call  emit-segments/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
     # checks
     # . flush(_test-output-buffered-file)
     # . . push args