about summary refs log tree commit diff stats
path: root/subx/examples/ex10
Commit message (Collapse)AuthorAgeFilesLines
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-0/+0
|
* 5410 - 4 examples passingKartik Agaram2019-07-171-0/+0
| | | | | Clean up other examples as well to satisfy the requirements in commit 5404.
* 4888Kartik Agaram2018-12-291-0/+0
| | | | We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
* 4661Kartik Agaram2018-10-041-0/+0
| | | | | Make segment management a little more consistent between initial segments and add-on segments (using `mmap`).
* 4516Kartik K. Agaram2018-09-241-0/+0
| | | | | | | More calling convention tweaks. Use EBP to get consistently at parameters and locals. Always put the first function argument closest to EBP.
* 4585Kartik Agaram2018-09-211-0/+0
|
* 4584 - discrepancy between SubX and native x86Kartik Agaram2018-09-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | One of the more painful things I had to debug with machine code. Tricks I used can be seen in ex10.subx: - printing argv[1] in various places - printing a single 'X' in various places to count how many times we get to different instructions - exiting with the current value of EAX in various places I repeatedly went down the wrong trail in several ways: - forgetting that the problem lay in native runs, and accidentally switching to subx runs during debugging. - forgetting to pass commandline args, because ex10 doesn't check its argv - writing the wrong comment for an instruction, and then miscalculating the set of registers that need to be saved. - forgetting that syscalls clobber EAX. Debugging native runs is hard, because you have to write non-trivial code to instrument the binary, and instrumentation can itself be buggy. When we finally tracked it down, I recognized the problem immediately. I'd meant to confirm the behavior of opcode 8a against bare metal, and then forgot. In any case, opcode 8a was inconsistent with 88. Sloppy.
* 4582Kartik Agaram2018-09-211-0/+0
| | | | subx/examples/ex10 doesn't currently run natively. Grr..
* 4579Kartik Agaram2018-09-211-0/+0
New example program: ascii null-terminated string comparison I'd hoped this would be a stepping stone to supporting general ascii comparison, but we're planning to use size-prefixed rather than null-terminated arrays everywhere. The only exception is commandline arguments, which will remain null-terminated to interoperate with Linux. So I'm going to need separate functions for "compare with argv" and for general string comparison.
gt; 2015-08-13 16:53:32 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-08-13 16:53:32 -0700 1990 - extra ingredient for 'trace' depth' href='/akkartik/mu/commit/029tools.cc?h=main&id=65b3db5d597d7478be7bd6c38708ddc857719503'>65b3db5d ^
3a538211 ^


9edabeaa ^





166e3c0d ^



9edabeaa ^





e00d4854 ^
9edabeaa ^










086acf39 ^
9edabeaa ^





086acf39 ^
9edabeaa ^





086acf39 ^
9edabeaa ^


4082acd2 ^
9edabeaa ^



3a538211 ^
5f98a10c ^
3a538211 ^
5f98a10c ^
166e3c0d ^
5f98a10c ^
166e3c0d ^

3a538211 ^
5f98a10c ^

3a538211 ^



5f98a10c ^
3a538211 ^
5f98a10c ^
166e3c0d ^
5f98a10c ^
166e3c0d ^

3a538211 ^
5f98a10c ^

3a538211 ^



e00d4854 ^
3a538211 ^
e00d4854 ^
166e3c0d ^
e00d4854 ^
166e3c0d ^

3a538211 ^
e00d4854 ^
3a538211 ^
e00d4854 ^
3a538211 ^







166e3c0d ^



3a538211 ^














166e3c0d ^



3a538211 ^








5f98a10c ^
3a538211 ^
bc643692 ^
3a538211 ^
5f98a10c ^
3a538211 ^




5fdd8e96 ^
3a538211 ^
5fdd8e96 ^
5f98a10c ^
3a538211 ^

5fdd8e96 ^
5f98a10c ^
3a538211 ^

5fdd8e96 ^
5f98a10c ^
3a538211 ^

5fdd8e96 ^



3a538211 ^
5f98a10c ^
3a538211 ^









166e3c0d ^



3a538211 ^













4082acd2 ^
3a538211 ^









166e3c0d ^



3a538211 ^









5fdd8e96 ^
3a538211 ^
5f98a10c ^

3a538211 ^

5fdd8e96 ^



aa088845 ^
cfb142b9 ^
3a538211 ^









166e3c0d ^



3a538211 ^




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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285