about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-28 23:30:13 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-28 23:30:13 -0800
commit8836afbcbd997a0ddcb7c6260dc8fa0dae89bf39 (patch)
tree33c1199aa12a4c14774b2ad5fb072c527874fa45
parent286faf6f0b035bb81cf3a900fcbcc331645b580c (diff)
downloadmu-8836afbcbd997a0ddcb7c6260dc8fa0dae89bf39.tar.gz
7457
-rwxr-xr-xapps/survey_elfbin56298 -> 56302 bytes
-rw-r--r--apps/survey_elf.subx24
2 files changed, 14 insertions, 10 deletions
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 8dd47697..2b8a47cd 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
@@ -1871,7 +1880,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)
     #
@@ -1895,10 +1903,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:
@@ -2081,9 +2085,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
@@ -2102,7 +2106,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
@@ -2129,7 +2133,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
@@ -2334,7 +2338,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
>69f3fb0a ^
0acfaaef ^
ac0e9db5 ^


69f3fb0a ^




6ea73c22 ^
7284d503 ^
dd994cda ^






363be37f ^
dd994cda ^
88be3dbc ^
dd994cda ^
bc643692 ^


afa42503 ^
dd994cda ^


88be3dbc ^
dd994cda ^
bc643692 ^


afa42503 ^
dd994cda ^


6ea73c22 ^


363be37f ^
dd994cda ^

e4630643 ^



0487a30e ^
ac0e9db5 ^
18e626df ^



363be37f ^
eefde1b9 ^
e4630643 ^
eefde1b9 ^


e4630643 ^
eefde1b9 ^

ac0e9db5 ^
0487a30e ^
ac0e9db5 ^
0487a30e ^
dd994cda ^

0487a30e ^
dd994cda ^
cfb142b9 ^
827898fc ^
dd994cda ^

b98d3876 ^

















02a55f71 ^








bc643692 ^


02a55f71 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151