https://github.com/akkartik/mu/blob/master/apps/subx-common.subx
1
2
3
4 == data
5
6
7 Heap-size:
8 0x200000/imm32/2MB
9
10
11 Segment-size:
12 0x80000/imm32/512KB
13
14
15 Input-size:
16 0x100000/imm32/1MB
17
18
19 Max-labels:
20 0x10000/imm32/4K-labels/64KB
21
22 == code
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 get:
54
55
56
57
58
59
60
61
62
63
64 55/push-EBP
65 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
66
67 51/push-ECX
68 52/push-EDX
69 56/push-ESI
70
71 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
72
73 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 0xc/disp8 .
74
75 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
76 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX . .
77 $get:search-loop:
78
79 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
80 73/jump-if-greater-or-equal-unsigned $get:abort/disp8
81
82
83
84 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
85 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
86
87 e8/call string-equal?/disp32
88
89 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
90
91 3d/compare-EAX-and 0/imm32
92 74/jump-if-equal $get:mismatch/disp8
93 8d/copy-address 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
94 eb/jump $get:end/disp8
95 $get:mismatch:
96
97 03/add 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 0x10/disp8 .
98
99 eb/jump $get:search-loop/disp8
100 $get:end:
101
102 5e/pop-to-ESI
103 5a/pop-to-EDX
104 59/pop-to-ECX
105
106 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
107 5d/pop-to-EBP
108 c3/return
109
110 $get:abort:
111
112
113 68/push "get: key not found: "/imm32
114 68/push 2/imm32/stderr
115
116 e8/call _write/disp32
117
118 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
119
120
121 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
122 68/push 2/imm32/stderr
123
124 e8/call _write/disp32
125
126 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
127
128
129 68/push "\n"/imm32
130 68/push 2/imm32/stderr
131
132 e8/call _write/disp32
133
134 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
135
136 bb/copy-to-EBX 1/imm32
137 b8/copy-to-EAX 1/imm32/exit
138 cd/syscall 0x80/imm8
139
140
141 test-get:
142
143 55/push-EBP
144 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
145
146
147 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
148 68/push 0x10/imm32/length
149 68/push 0/imm32/read
150 68/push 0/imm32/write
151 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
152
153
154 68/push 8/imm32/row-size
155 68/push "code"/imm32
156 51/push-ECX
157
158 e8/call get-or-insert/disp32
159
160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
161
162
163 68/push 8/imm32/row-size
164 68/push "data"/imm32
165 51/push-ECX
166
167 e8/call get-or-insert/disp32
168
169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
170 $test-get:check1:
171
172
173 68/push 8/imm32/row-size
174 68/push "code"/imm32
175 51/push-ECX
176
177 e8/call get/disp32
178
179 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
180
181
182
183 68/push "F - test-get/0"/imm32
184 68/push 0x10/imm32
185 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
186 50/push-EAX
187
188 e8/call check-ints-equal/disp32
189
190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
191 $test-get:check2:
192
193
194 68/push 8/imm32/row-size
195 68/push "data"/imm32
196 51/push-ECX
197
198 e8/call get/disp32
199
200 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
201
202
203
204 68/push "F - test-get/1"/imm32
205 68/push 0x18/imm32
206 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
207 50/push-EAX
208
209 e8/call check-ints-equal/disp32
210
211 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
212 $test-get:end:
213
214 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
215 5d/pop-to-EBP
216 c3/return
217
218
219
220
221
222
223 get-slice:
224
225
226
227
228
229
230
231
232
233
234 55/push-EBP
235 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
236
237 51/push-ECX
238 52/push-EDX
239 56/push-ESI
240
241 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
242
243 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 0xc/disp8 .
244
245 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
246 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX . .
247 $get-slice:search-loop:
248
249 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
250 73/jump-if-greater-or-equal-unsigned $get-slice:abort/disp8
251
252
253
254 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
255 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
256
257 e8/call slice-equal?/disp32
258
259 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
260
261 3d/compare-EAX-and 0/imm32
262 74/jump-if-equal $get-slice:mismatch/disp8
263 8d/copy-address 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
264 eb/jump $get-slice:end/disp8
265 $get-slice:mismatch:
266
267 03/add 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 0x10/disp8 .
268
269 eb/jump $get-slice:search-loop/disp8
270 $get-slice:end:
271
272 5e/pop-to-ESI
273 5a/pop-to-EDX
274 59/pop-to-ECX
275
276 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
277 5d/pop-to-EBP
278 c3/return
279
280 $get-slice:abort:
281
282
283 68/push "get-slice: key not found: "/imm32
284 68/push 2/imm32/stderr
285
286 e8/call _write/disp32
287
288 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
289
290
291 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
292 68/push Stderr/imm32
293
294 e8/call write-slice-buffered/disp32
295
296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
297
298
299 68/push Stderr/imm32
300
301 e8/call flush/disp32
302
303 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
304
305
306 68/push "\n"/imm32
307 68/push 2/imm32/stderr
308
309 e8/call _write/disp32
310
311 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
312
313 bb/copy-to-EBX 1/imm32
314 b8/copy-to-EAX 1/imm32/exit
315 cd/syscall 0x80/imm8
316
317
318 test-get-slice:
319
320 55/push-EBP
321 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
322
323
324 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
325 68/push 0x10/imm32/length
326 68/push 0/imm32/read
327 68/push 0/imm32/write
328 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
329
330
331 68/push 8/imm32/row-size
332 68/push "code"/imm32
333 51/push-ECX
334
335 e8/call get-or-insert/disp32
336
337 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
338
339
340 68/push 8/imm32/row-size
341 68/push "data"/imm32
342 51/push-ECX
343
344 e8/call get-or-insert/disp32
345
346 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
347 $test-get-slice:check1:
348
349 b8/copy-to-EAX "code"/imm32
350 8b/copy 0/mod/indirect 0/rm32/EAX . . . 2/r32/EDX . .
351 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 2/index/EDX . 2/r32/EDX 4/disp8 .
352 05/add-to-EAX 4/imm32
353
354 52/push-EDX
355 50/push-EAX
356 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
357
358
359 68/push 8/imm32/row-size
360 52/push-EDX
361 51/push-ECX
362
363 e8/call get-slice/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
366
367
368
369 68/push "F - test-get-slice/0"/imm32
370 68/push 0x10/imm32
371 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
372 50/push-EAX
373
374 e8/call check-ints-equal/disp32
375
376 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
377 $test-get-slice:check2:
378
379 b8/copy-to-EAX "data"/imm32
380 8b/copy 0/mod/indirect 0/rm32/EAX . . . 2/r32/EDX . .
381 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 2/index/EDX . 2/r32/EDX 4/disp8 .
382 05/add-to-EAX 4/imm32
383
384 52/push-EDX
385 50/push-EAX
386 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
387
388
389 68/push 8/imm32/row-size
390 52/push-EDX
391 51/push-ECX
392
393 e8/call get-slice/disp32
394
395 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
396
397
398
399 68/push "F - test-get-slice/1"/imm32
400 68/push 0x18/imm32
401 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
402 50/push-EAX
403
404 e8/call check-ints-equal/disp32
405
406 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
407 $test-get-slice:end:
408
409 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
410 5d/pop-to-EBP
411 c3/return
412
413
414
415
416
417
418
419
420
421
422 get-or-insert:
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438 55/push-EBP
439 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
440
441 51/push-ECX
442 52/push-EDX
443 56/push-ESI
444
445 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
446
447 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 0xc/disp8 .
448
449 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
450 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX . .
451 $get-or-insert:search-loop:
452
453 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
454 73/jump-if-greater-or-equal-unsigned $get-or-insert:not-found/disp8
455
456
457
458 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
459 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
460
461 e8/call string-equal?/disp32
462
463 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
464
465 3d/compare-EAX-and 0/imm32
466 74/jump-if-equal $get-or-insert:mismatch/disp8
467 8d/copy-address 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
468 eb/jump $get-or-insert:end/disp8
469 $get-or-insert:mismatch:
470
471 03/add 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 0x10/disp8 .
472
473 eb/jump $get-or-insert:search-loop/disp8
474 $get-or-insert:not-found:
475
476 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
477
478 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
479 3b/compare 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 8/disp8 .
480 73/jump-if-greater-or-equal-unsigned $get-or-insert:abort/disp8
481
482
483 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
484 52/push-EDX
485
486 e8/call zero-out/disp32
487
488 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
489
490
491 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0xc/disp8 .
492
493 89/copy 0/mod/indirect 2/rm32/EDX . . . 0/r32/EAX . .
494
495
496 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0x10/disp8 .
497
498 01/add 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
499
500
501 89/copy 3/mod/direct 0/rm32/EAX . . . 2/r32/EDX . .
502
503 05/add-to-EAX 4/imm32
504 $get-or-insert:end:
505
506 5e/pop-to-ESI
507 5a/pop-to-EDX
508 59/pop-to-ECX
509
510 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
511 5d/pop-to-EBP
512 c3/return
513
514 $get-or-insert:abort:
515
516
517 68/push "get-or-insert: table is full\n"/imm32
518 68/push 2/imm32/stderr
519
520 e8/call _write/disp32
521
522 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
523
524 bb/copy-to-EBX 1/imm32
525 b8/copy-to-EAX 1/imm32/exit
526 cd/syscall 0x80/imm8
527
528
529 test-get-or-insert:
530
531 55/push-EBP
532 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
533
534 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
535 68/push 0x10/imm32/length
536 68/push 0/imm32/read
537 68/push 0/imm32/write
538 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
539 $test-get-or-insert:first-call:
540
541
542
543 68/push 8/imm32/row-size
544 68/push "code"/imm32
545 51/push-ECX
546
547 e8/call get-or-insert/disp32
548
549 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
550
551
552
553 68/push "F - test-get-or-insert/0"/imm32
554 68/push 0x10/imm32
555 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
556 50/push-EAX
557
558 e8/call check-ints-equal/disp32
559
560 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
561 $test-get-or-insert:check2:
562
563
564 68/push "F - test-get-or-insert/1"/imm32
565 68/push 8/imm32/row-size
566 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
567
568 e8/call check-ints-equal/disp32
569
570 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
571
572
573 68/push "F - test-get-or-insert/2"/imm32
574 68/push "code"/imm32
575 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0xc/disp8 .
576
577 e8/call check-string-equal/disp32
578
579 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
580 $test-get-or-insert:second-call:
581
582
583
584 68/push 8/imm32/row-size
585 68/push "code"/imm32
586 51/push-ECX
587
588 e8/call get-or-insert/disp32
589
590 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
591
592
593
594 68/push "F - test-get-or-insert/3"/imm32
595 68/push 0x10/imm32
596 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
597 50/push-EAX
598
599 e8/call check-ints-equal/disp32
600
601 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
602
603
604
605 68/push "F - test-get-or-insert/4"/imm32
606 68/push 8/imm32/row-size
607 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
608
609 e8/call check-ints-equal/disp32
610
611 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
612
613
614 68/push "F - test-get-or-insert/5"/imm32
615 68/push "code"/imm32
616 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0xc/disp8 .
617
618 e8/call check-string-equal/disp32
619
620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
621 $test-get-or-insert:third-call:
622
623
624
625 68/push 8/imm32/row-size
626 68/push "data"/imm32
627 51/push-ECX
628
629 e8/call get-or-insert/disp32
630
631 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
632
633
634
635
636 68/push "F - test-get-or-insert/6"/imm32
637 68/push 0x18/imm32
638 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
639 50/push-EAX
640
641 e8/call check-ints-equal/disp32
642
643 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
644
645
646 68/push "F - test-get-or-insert/7"/imm32
647 68/push 0x10/imm32/two-rows
648 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
649
650 e8/call check-ints-equal/disp32
651
652 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
653
654
655
656 68/push "F - test-get-or-insert/8"/imm32
657 68/push "data"/imm32
658 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0x14/disp8 .
659
660 e8/call check-string-equal/disp32
661
662 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
663 $test-get-or-insert:end:
664
665 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
666 5d/pop-to-EBP
667 c3/return
668
669
670
671
672
673
674
675
676
677 leaky-get-or-insert-slice:
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693 55/push-EBP
694 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
695
696 51/push-ECX
697 52/push-EDX
698 56/push-ESI
699
700 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
701
702 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 0xc/disp8 .
703
704 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
705 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX . .
706 $leaky-get-or-insert-slice:search-loop:
707
708 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
709 73/jump-if-greater-or-equal-unsigned $leaky-get-or-insert-slice:not-found/disp8
710
711
712
713 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
714 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
715
716 e8/call slice-equal?/disp32
717
718 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
719
720 3d/compare-EAX-and 0/imm32
721 74/jump-if-equal $leaky-get-or-insert-slice:mismatch/disp8
722 8d/copy-address 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
723 eb/jump $leaky-get-or-insert-slice:end/disp8
724 $leaky-get-or-insert-slice:mismatch:
725
726 03/add 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 0x10/disp8 .
727
728 eb/jump $leaky-get-or-insert-slice:search-loop/disp8
729 $leaky-get-or-insert-slice:not-found:
730
731 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
732
733 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
734 3b/compare 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 8/disp8 .
735 7d/jump-if-greater-or-equal $leaky-get-or-insert-slice:abort/disp8
736
737
738 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
739 52/push-EDX
740
741 e8/call zero-out/disp32
742
743 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
744
745
746
747 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
748 68/push Heap/imm32
749
750 e8/call slice-to-string/disp32
751
752 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
753
754 89/copy 0/mod/indirect 2/rm32/EDX . . . 0/r32/EAX . .
755
756
757 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0x10/disp8 .
758
759 01/add 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
760
761
762 89/copy 3/mod/direct 0/rm32/EAX . . . 2/r32/EDX . .
763
764 05/add-to-EAX 4/imm32
765 $leaky-get-or-insert-slice:end:
766
767 5e/pop-to-ESI
768 5a/pop-to-EDX
769 59/pop-to-ECX
770
771 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
772 5d/pop-to-EBP
773 c3/return
774
775 $leaky-get-or-insert-slice:abort:
776
777
778 68/push "leaky-get-or-insert-slice: table is full\n"/imm32
779 68/push 2/imm32/stderr
780
781 e8/call _write/disp32
782
783 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
784
785 bb/copy-to-EBX 1/imm32
786 b8/copy-to-EAX 1/imm32/exit
787 cd/syscall 0x80/imm8
788
789
790 test-leaky-get-or-insert-slice:
791
792 55/push-EBP
793 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
794
795 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
796 68/push 0x10/imm32/length
797 68/push 0/imm32/read
798 68/push 0/imm32/write
799 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
800
801 b8/copy-to-EAX "code"/imm32
802 8b/copy 0/mod/indirect 0/rm32/EAX . . . 2/r32/EDX . .
803 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 2/index/EDX . 2/r32/EDX 4/disp8 .
804 05/add-to-EAX 4/imm32
805
806 52/push-EDX
807 50/push-EAX
808 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
809 $test-leaky-get-or-insert-slice:first-call:
810
811
812
813 68/push 8/imm32/row-size
814 52/push-EDX
815 51/push-ECX
816
817 e8/call leaky-get-or-insert-slice/disp32
818
819 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
820
821
822
823 68/push "F - test-leaky-get-or-insert-slice/0"/imm32
824 68/push 0x10/imm32
825 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
826 50/push-EAX
827
828 e8/call check-ints-equal/disp32
829
830 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
831 $test-leaky-get-or-insert-slice:check2:
832
833
834 68/push "F - test-leaky-get-or-insert-slice/1"/imm32
835 68/push 8/imm32/row-size
836 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
837
838 e8/call check-ints-equal/disp32
839
840 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
841
842
843 68/push "F - test-leaky-get-or-insert-slice/2"/imm32
844 68/push "code"/imm32
845 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0xc/disp8 .
846
847 e8/call check-string-equal/disp32
848
849 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
850 $test-leaky-get-or-insert-slice:second-call:
851
852
853
854 68/push 8/imm32/row-size
855 52/push-EDX
856 51/push-ECX
857
858 e8/call leaky-get-or-insert-slice/disp32
859
860 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
861
862
863
864 68/push "F - test-leaky-get-or-insert-slice/3"/imm32
865 68/push 0x10/imm32
866 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
867 50/push-EAX
868
869 e8/call check-ints-equal/disp32
870
871 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
872
873
874
875 68/push "F - test-leaky-get-or-insert-slice/4"/imm32
876 68/push 8/imm32/row-size
877 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
878
879 e8/call check-ints-equal/disp32
880
881 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
882
883
884 68/push "F - test-leaky-get-or-insert-slice/5"/imm32
885 68/push "code"/imm32
886 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0xc/disp8 .
887
888 e8/call check-string-equal/disp32
889
890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
891 $test-leaky-get-or-insert-slice:third-call:
892
893
894 b8/copy-to-EAX "data"/imm32
895 8b/copy 0/mod/indirect 0/rm32/EAX . . . 2/r32/EDX . .
896 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 2/index/EDX . 2/r32/EDX 4/disp8 .
897 05/add-to-EAX 4/imm32
898
899 52/push-EDX
900 50/push-EAX
901 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
902
903
904 68/push 8/imm32/row-size
905 52/push-EDX
906 51/push-ECX
907
908 e8/call leaky-get-or-insert-slice/disp32
909
910 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
911
912
913
914
915 68/push "F - test-leaky-get-or-insert-slice/6"/imm32
916 68/push 0x18/imm32
917 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
918 50/push-EAX
919
920 e8/call check-ints-equal/disp32
921
922 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
923
924
925 68/push "F - test-leaky-get-or-insert-slice/7"/imm32
926 68/push 0x10/imm32/two-rows
927 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
928
929 e8/call check-ints-equal/disp32
930
931 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
932
933
934
935 68/push "F - test-leaky-get-or-insert-slice/8"/imm32
936 68/push "data"/imm32
937 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 0x14/disp8 .
938
939 e8/call check-string-equal/disp32
940
941 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
942 $test-leaky-get-or-insert-slice:end:
943
944 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
945 5d/pop-to-EBP
946 c3/return
947
948
949
950 next-word:
951
952 55/push-EBP
953 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
954
955 50/push-EAX
956 51/push-ECX
957 56/push-ESI
958 57/push-EDI
959
960 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
961
962 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
963
964
965 68/push 0x20/imm32/space
966 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
967
968 e8/call skip-chars-matching/disp32
969
970 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
971 $next-word:check0:
972
973
974 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
975
976 3b/compare 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
977 7c/jump-if-lesser $next-word:check-for-comment/disp8
978
979 c7 0/subop/copy 0/mod/direct 7/rm32/EDI . . . . . 0/imm32
980 c7 0/subop/copy 1/mod/*+disp8 7/rm32/EDI . . . . 4/disp8 0/imm32
981 eb/jump $next-word:end/disp8
982 $next-word:check-for-comment:
983
984 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
985 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
986 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
987
988
989 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
990 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
991
992 3d/compare-EAX-and 0x23/imm32/pound
993 75/jump-if-not-equal $next-word:regular-word/disp8
994 $next-word:comment:
995
996 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
997 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
998 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
999
1000 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
1001
1002 eb/jump $next-word:end/disp8
1003 $next-word:regular-word:
1004
1005
1006 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1007
1008 e8/call skip-chars-not-matching-whitespace/disp32
1009
1010 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1011
1012 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1013 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
1014 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
1015 $next-word:end:
1016
1017 5f/pop-to-EDI
1018 5e/pop-to-ESI
1019 59/pop-to-ECX
1020 58/pop-to-EAX
1021
1022 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1023 5d/pop-to-EBP
1024 c3/return
1025
1026 test-next-word:
1027
1028 55/push-EBP
1029 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1030
1031
1032
1033 68/push _test-stream/imm32
1034
1035 e8/call clear-stream/disp32
1036
1037 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1038
1039 68/push 0/imm32/end
1040 68/push 0/imm32/start
1041 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1042
1043
1044 68/push " ab"/imm32
1045 68/push _test-stream/imm32
1046
1047 e8/call write/disp32
1048
1049 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1050
1051
1052 51/push-ECX
1053 68/push _test-stream/imm32
1054
1055 e8/call next-word/disp32
1056
1057 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1058
1059
1060
1061 68/push "F - test-next-word: start"/imm32
1062 68/push 0xe/imm32
1063
1064 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1065 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
1066 50/push-EAX
1067
1068 e8/call check-ints-equal/disp32
1069
1070 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1071
1072
1073
1074 68/push "F - test-next-word: end"/imm32
1075 68/push 0x10/imm32
1076
1077 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1078 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
1079 50/push-EAX
1080
1081 e8/call check-ints-equal/disp32
1082
1083 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1084
1085 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1086 5d/pop-to-EBP
1087 c3/return
1088
1089 test-next-word-returns-whole-comment:
1090
1091 55/push-EBP
1092 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1093
1094
1095
1096 68/push _test-stream/imm32
1097
1098 e8/call clear-stream/disp32
1099
1100 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1101
1102 68/push 0/imm32/end
1103 68/push 0/imm32/start
1104 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1105
1106
1107 68/push " # a"/imm32
1108 68/push _test-stream/imm32
1109
1110 e8/call write/disp32
1111
1112 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1113
1114
1115 51/push-ECX
1116 68/push _test-stream/imm32
1117
1118 e8/call next-word/disp32
1119
1120 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1121
1122
1123
1124 68/push "F - test-next-word-returns-whole-comment: start"/imm32
1125 68/push 0xe/imm32
1126
1127 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1128 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
1129 50/push-EAX
1130
1131 e8/call check-ints-equal/disp32
1132
1133 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1134
1135
1136
1137 68/push "F - test-next-word-returns-whole-comment: end"/imm32
1138 68/push 0x11/imm32
1139
1140 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1141 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
1142 50/push-EAX
1143
1144 e8/call check-ints-equal/disp32
1145
1146 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1147
1148 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1149 5d/pop-to-EBP
1150 c3/return
1151
1152 test-next-word-returns-empty-string-on-eof:
1153
1154 55/push-EBP
1155 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1156
1157
1158
1159 68/push _test-stream/imm32
1160
1161 e8/call clear-stream/disp32
1162
1163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1164
1165 68/push 0/imm32/end
1166 68/push 0/imm32/start
1167 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1168
1169
1170
1171 51/push-ECX
1172 68/push _test-stream/imm32
1173
1174 e8/call next-word/disp32
1175
1176 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1177
1178
1179 68/push "F - test-next-word-returns-empty-string-on-eof"/imm32
1180 68/push 0/imm32
1181
1182 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1183 2b/subtract 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1184 50/push-EAX
1185
1186 e8/call check-ints-equal/disp32
1187
1188 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1189
1190 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1191 5d/pop-to-EBP
1192 c3/return
1193
1194
1195
1196
1197
1198
1199 write-stream-data:
1200
1201 55/push-EBP
1202 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1203
1204 50/push-EAX
1205 51/push-ECX
1206 56/push-ESI
1207
1208 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
1209
1210
1211 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1212 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
1213 50/push-EAX
1214
1215 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 0xc/disp8 .
1216 50/push-EAX
1217
1218 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1219
1220
1221 51/push-ECX
1222 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1223
1224 e8/call write-slice-buffered/disp32
1225
1226 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1227 $write-stream-data:end:
1228
1229 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1230
1231 5e/pop-to-ESI
1232 59/pop-to-ECX
1233 58/pop-to-EAX
1234
1235 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1236 5d/pop-to-EBP
1237 c3/return
1238
1239 test-write-stream-data:
1240
1241 55/push-EBP
1242 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1243
1244
1245
1246 68/push _test-output-stream/imm32
1247
1248 e8/call clear-stream/disp32
1249
1250 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1251
1252
1253 b8/copy-to-EAX _test-output-buffered-file/imm32
1254 05/add-to-EAX 4/imm32
1255 50/push-EAX
1256
1257 e8/call clear-stream/disp32
1258
1259 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1260
1261
1262 68/push _test-input-stream/imm32
1263
1264 e8/call clear-stream/disp32
1265
1266 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1267
1268
1269
1270 68/push "abcd"/imm32
1271 68/push _test-input-stream/imm32
1272
1273 e8/call write/disp32
1274
1275 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1276
1277
1278 68/push _test-input-stream/imm32
1279 68/push _test-output-buffered-file/imm32
1280
1281 e8/call write-stream-data/disp32
1282
1283 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1284
1285
1286
1287 68/push _test-output-buffered-file/imm32
1288
1289 e8/call flush/disp32
1290
1291 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1292
1293
1294 68/push "F - test-write-stream-data"/imm32
1295 68/push "abcd"/imm32
1296 68/push _test-output-stream/imm32
1297
1298 e8/call check-stream-equal/disp32
1299
1300 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1301
1302 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1303 5d/pop-to-EBP
1304 c3/return
1305
1306 has-metadata?:
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317 55/push-EBP
1318 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1319
1320 51/push-ECX
1321 52/push-EDX
1322 56/push-ESI
1323 57/push-EDI
1324
1325 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
1326
1327 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
1328
1329 68/push 0/imm32/end
1330 68/push 0/imm32/start
1331 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
1332
1333
1334 57/push-EDI
1335 68/push 0x2f/imm32/slash
1336 52/push-EDX
1337 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
1338
1339 e8/call next-token-from-slice/disp32
1340
1341 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1342
1343 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
1344 $has-metadata?:loop:
1345
1346
1347 57/push-EDI
1348 68/push 0x2f/imm32/slash
1349 52/push-EDX
1350 51/push-ECX
1351
1352 e8/call next-token-from-slice/disp32
1353
1354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1355
1356
1357
1358 57/push-EDI
1359
1360 e8/call slice-empty?/disp32
1361
1362 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1363
1364 3d/compare-EAX-and 0/imm32
1365 75/jump-if-not-equal $has-metadata?:false/disp8
1366
1367
1368
1369 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1370 57/push-EDI
1371
1372 e8/call slice-equal?/disp32
1373
1374 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1375
1376 3d/compare-EAX-and 0/imm32
1377 75/jump-if-not-equal $has-metadata?:true/disp8
1378
1379 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
1380 eb/jump $has-metadata?:loop/disp8
1381 $has-metadata?:true:
1382 b8/copy-to-EAX 1/imm32/true
1383 eb/jump $has-metadata?:end/disp8
1384 $has-metadata?:false:
1385 b8/copy-to-EAX 0/imm32/false
1386 $has-metadata?:end:
1387
1388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1389
1390 5f/pop-to-EDI
1391 5e/pop-to-ESI
1392 5a/pop-to-EDX
1393 59/pop-to-ECX
1394
1395 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1396 5d/pop-to-EBP
1397 c3/return
1398
1399 test-has-metadata-true:
1400
1401 55/push-EBP
1402 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1403
1404 b8/copy-to-EAX "ab/imm32"/imm32
1405 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1406 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1407 05/add-to-EAX 4/imm32
1408
1409 51/push-ECX
1410 50/push-EAX
1411 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1412
1413
1414 68/push "imm32"/imm32
1415 56/push-ESI
1416
1417 e8/call has-metadata?/disp32
1418
1419 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1420
1421
1422 68/push "F - test-has-metadata-true"/imm32
1423 68/push 1/imm32/true
1424 50/push-EAX
1425
1426 e8/call check-ints-equal/disp32
1427
1428 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1429
1430 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1431 5d/pop-to-EBP
1432 c3/return
1433
1434 test-has-metadata-false:
1435
1436 55/push-EBP
1437 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1438
1439 b8/copy-to-EAX "ab/c"/imm32
1440 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1441 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1442 05/add-to-EAX 4/imm32
1443
1444 51/push-ECX
1445 50/push-EAX
1446 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1447
1448
1449 68/push "d"/imm32
1450 56/push-ESI
1451
1452 e8/call has-metadata?/disp32
1453
1454 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1455
1456
1457 68/push "F - test-has-metadata-false"/imm32
1458 68/push 0/imm32/false
1459 50/push-EAX
1460
1461 e8/call check-ints-equal/disp32
1462
1463 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1464
1465 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1466 5d/pop-to-EBP
1467 c3/return
1468
1469 test-has-metadata-ignore-name:
1470
1471 55/push-EBP
1472 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1473
1474 b8/copy-to-EAX "a/b"/imm32
1475 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1476 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1477 05/add-to-EAX 4/imm32
1478
1479 51/push-ECX
1480 50/push-EAX
1481 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1482
1483
1484 68/push "a"/imm32
1485 56/push-ESI
1486
1487 e8/call has-metadata?/disp32
1488
1489 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1490
1491
1492 68/push "F - test-has-metadata-ignore-name"/imm32
1493 68/push 0/imm32/false
1494 50/push-EAX
1495
1496 e8/call check-ints-equal/disp32
1497
1498 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1499
1500 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1501 5d/pop-to-EBP
1502 c3/return
1503
1504 test-has-metadata-multiple-true:
1505
1506 55/push-EBP
1507 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1508
1509 b8/copy-to-EAX "a/b/c"/imm32
1510 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1511 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1512 05/add-to-EAX 4/imm32
1513
1514 51/push-ECX
1515 50/push-EAX
1516 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1517
1518
1519 68/push "c"/imm32
1520 56/push-ESI
1521
1522 e8/call has-metadata?/disp32
1523
1524 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1525
1526
1527 68/push "F - test-has-metadata-multiple-true"/imm32
1528 68/push 1/imm32/true
1529 50/push-EAX
1530
1531 e8/call check-ints-equal/disp32
1532
1533 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1534
1535 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1536 5d/pop-to-EBP
1537 c3/return
1538
1539 test-has-metadata-multiple-false:
1540
1541 55/push-EBP
1542 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1543
1544 b8/copy-to-EAX "a/b/c"/imm32
1545 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1546 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1547 05/add-to-EAX 4/imm32
1548
1549 51/push-ECX
1550 50/push-EAX
1551 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1552
1553
1554 68/push "d"/imm32
1555 56/push-ESI
1556
1557 e8/call has-metadata?/disp32
1558
1559 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1560
1561
1562 68/push "F - test-has-metadata-multiple-false"/imm32
1563 68/push 0/imm32/false
1564 50/push-EAX
1565
1566 e8/call check-ints-equal/disp32
1567
1568 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1569
1570 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1571 5d/pop-to-EBP
1572 c3/return
1573
1574
1575
1576
1577
1578 emit:
1579
1580 55/push-EBP
1581 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1582
1583 50/push-EAX
1584 56/push-ESI
1585 57/push-EDI
1586
1587 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
1588
1589 68/push 0/imm32/end
1590 68/push 0/imm32/start
1591 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
1592
1593
1594 57/push-EDI
1595 68/push 0x2f/imm32/slash
1596 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
1597 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
1598
1599 e8/call next-token-from-slice/disp32
1600
1601 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1602
1603
1604
1605 57/push-EDI
1606
1607 e8/call is-valid-name?/disp32
1608
1609 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1610
1611 3d/compare-EAX-and 0/imm32
1612 74/jump-if-equal $emit:hex-int/disp8
1613 $emit:name:
1614
1615
1616 56/push-ESI
1617 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1618
1619 e8/call write-slice-buffered/disp32
1620
1621 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1622
1623
1624 68/push " "/imm32
1625 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1626
1627 e8/call write-buffered/disp32
1628
1629 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1630
1631 eb/jump $emit:end/disp8
1632
1633
1634
1635
1636
1637 $emit:hex-int:
1638
1639
1640 57/push-EDI
1641
1642 e8/call parse-hex-int/disp32
1643
1644 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1645
1646
1647 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
1648 50/push-EAX
1649 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1650
1651 e8/call emit-hex/disp32
1652
1653 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1654 $emit:end:
1655
1656 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1657
1658 5f/pop-to-EDI
1659 5e/pop-to-ESI
1660 58/pop-to-EAX
1661
1662 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1663 5d/pop-to-EBP
1664 c3/return
1665
1666 test-emit-number:
1667
1668 55/push-EBP
1669 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1670
1671
1672
1673 68/push _test-output-stream/imm32
1674
1675 e8/call clear-stream/disp32
1676
1677 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1678
1679
1680 b8/copy-to-EAX _test-output-buffered-file/imm32
1681 05/add-to-EAX 4/imm32
1682 50/push-EAX
1683
1684 e8/call clear-stream/disp32
1685
1686 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1687
1688 b8/copy-to-EAX "30"/imm32
1689 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1690 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1691 05/add-to-EAX 4/imm32
1692
1693 51/push-ECX
1694 50/push-EAX
1695 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1696
1697
1698 68/push 1/imm32
1699 51/push-ECX
1700 68/push _test-output-buffered-file/imm32
1701
1702 e8/call emit/disp32
1703
1704 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1705
1706
1707 68/push _test-output-buffered-file/imm32
1708
1709 e8/call flush/disp32
1710
1711 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1712
1713
1714 68/push "F - test-emit-number/1"/imm32
1715 68/push "30 "/imm32
1716 68/push _test-output-stream/imm32
1717
1718 e8/call check-stream-equal/disp32
1719
1720 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1721
1722 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1723 5d/pop-to-EBP
1724 c3/return
1725
1726 test-emit-negative-number:
1727
1728
1729 55/push-EBP
1730 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1731
1732
1733
1734 68/push _test-output-stream/imm32
1735
1736 e8/call clear-stream/disp32
1737
1738 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1739
1740
1741 b8/copy-to-EAX _test-output-buffered-file/imm32
1742 05/add-to-EAX 4/imm32
1743 50/push-EAX
1744
1745 e8/call clear-stream/disp32
1746
1747 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1748
1749 b8/copy-to-EAX "-2"/imm32
1750 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1751 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1752 05/add-to-EAX 4/imm32
1753
1754 51/push-ECX
1755 50/push-EAX
1756 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1757
1758
1759 68/push 2/imm32
1760 51/push-ECX
1761 68/push _test-output-buffered-file/imm32
1762
1763 e8/call emit/disp32
1764
1765 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1766
1767
1768 68/push _test-output-buffered-file/imm32
1769
1770 e8/call flush/disp32
1771
1772 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1773
1774
1775 68/push "F - test-emit-number/1"/imm32
1776 68/push "fe ff "/imm32
1777 68/push _test-output-stream/imm32
1778
1779 e8/call check-stream-equal/disp32
1780
1781 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1782
1783 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1784 5d/pop-to-EBP
1785 c3/return
1786
1787 test-emit-number-with-metadata:
1788
1789 55/push-EBP
1790 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1791
1792
1793
1794 68/push _test-output-stream/imm32
1795
1796 e8/call clear-stream/disp32
1797
1798 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1799
1800
1801 b8/copy-to-EAX _test-output-buffered-file/imm32
1802 05/add-to-EAX 4/imm32
1803 50/push-EAX
1804
1805 e8/call clear-stream/disp32
1806
1807 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1808
1809 b8/copy-to-EAX "-2/foo"/imm32
1810 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1811 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1812 05/add-to-EAX 4/imm32
1813
1814 51/push-ECX
1815 50/push-EAX
1816 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1817
1818
1819 68/push 2/imm32
1820 51/push-ECX
1821 68/push _test-output-buffered-file/imm32
1822
1823 e8/call emit/disp32
1824
1825 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1826
1827
1828 68/push _test-output-buffered-file/imm32
1829
1830 e8/call flush/disp32
1831
1832 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1833
1834
1835
1836 68/push "F - test-emit-number-with-metadata"/imm32
1837 68/push "fe ff "/imm32
1838 68/push _test-output-stream/imm32
1839
1840 e8/call check-stream-equal/disp32
1841
1842 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1843
1844 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1845 5d/pop-to-EBP
1846 c3/return
1847
1848 test-emit-non-number:
1849
1850 55/push-EBP
1851 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1852
1853
1854
1855 68/push _test-output-stream/imm32
1856
1857 e8/call clear-stream/disp32
1858
1859 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1860
1861
1862 b8/copy-to-EAX _test-output-buffered-file/imm32
1863 05/add-to-EAX 4/imm32
1864 50/push-EAX
1865
1866 e8/call clear-stream/disp32
1867
1868 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1869
1870 b8/copy-to-EAX "xyz"/imm32
1871 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1872 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1873 05/add-to-EAX 4/imm32
1874
1875 51/push-ECX
1876 50/push-EAX
1877 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1878
1879
1880 68/push 2/imm32
1881 51/push-ECX
1882 68/push _test-output-buffered-file/imm32
1883
1884 e8/call emit/disp32
1885
1886 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1887
1888
1889 68/push _test-output-buffered-file/imm32
1890
1891 e8/call flush/disp32
1892
1893 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1894
1895
1896 68/push "F - test-emit-non-number"/imm32
1897 68/push "xyz "/imm32
1898 68/push _test-output-stream/imm32
1899
1900 e8/call check-stream-equal/disp32
1901
1902 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1903
1904 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1905 5d/pop-to-EBP
1906 c3/return
1907
1908 test-emit-non-number-with-metadata:
1909
1910 55/push-EBP
1911 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1912
1913
1914
1915 68/push _test-output-stream/imm32
1916
1917 e8/call clear-stream/disp32
1918
1919 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1920
1921
1922 b8/copy-to-EAX _test-output-buffered-file/imm32
1923 05/add-to-EAX 4/imm32
1924 50/push-EAX
1925
1926 e8/call clear-stream/disp32
1927
1928 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1929
1930 b8/copy-to-EAX "xyz/"/imm32
1931 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1932 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1933 05/add-to-EAX 4/imm32
1934
1935 51/push-ECX
1936 50/push-EAX
1937 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1938
1939
1940 68/push 2/imm32
1941 51/push-ECX
1942 68/push _test-output-buffered-file/imm32
1943
1944 e8/call emit/disp32
1945
1946 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1947
1948
1949 68/push _test-output-buffered-file/imm32
1950
1951 e8/call flush/disp32
1952
1953 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1954
1955
1956 68/push "F - test-emit-non-number-with-metadata"/imm32
1957 68/push "xyz/ "/imm32
1958 68/push _test-output-stream/imm32
1959
1960 e8/call check-stream-equal/disp32
1961
1962 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1963
1964 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1965 5d/pop-to-EBP
1966 c3/return
1967
1968 test-emit-non-number-with-all-hex-digits-and-metadata:
1969
1970 55/push-EBP
1971 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1972
1973
1974
1975 68/push _test-output-stream/imm32
1976
1977 e8/call clear-stream/disp32
1978
1979 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1980
1981
1982 b8/copy-to-EAX _test-output-buffered-file/imm32
1983 05/add-to-EAX 4/imm32
1984 50/push-EAX
1985
1986 e8/call clear-stream/disp32
1987
1988 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1989
1990 b8/copy-to-EAX "abcd/xyz"/imm32
1991 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1992 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1993 05/add-to-EAX 4/imm32
1994
1995 51/push-ECX
1996 50/push-EAX
1997 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1998
1999
2000 68/push 2/imm32
2001 51/push-ECX
2002 68/push _test-output-buffered-file/imm32
2003
2004 e8/call emit/disp32
2005
2006 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2007
2008
2009 68/push _test-output-buffered-file/imm32
2010
2011 e8/call flush/disp32
2012
2013 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2014 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
2040
2041
2042 68/push "F - test-emit-non-number-with-all-hex-digits"/imm32
2043 68/push "abcd/xyz "/imm32
2044 68/push _test-output-stream/imm32
2045
2046 e8/call check-stream-equal/disp32
2047
2048 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2049
2050 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2051 5d/pop-to-EBP
2052 c3/return
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062 is-valid-name?:
2063
2064 55/push-EBP
2065 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2066
2067 51/push-ECX
2068 56/push-ESI
2069
2070 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
2071
2072 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
2073
2074 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
2075 $is-valid-name?:check0:
2076
2077 39/compare 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2078 73/jump-if-greater-or-equal-unsigned $is-valid-name?:false/disp8
2079 $is-valid-name?:check1:
2080
2081 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
2082
2083 3d/compare-EAX-and 2/imm32
2084 74/jump-if-equal $is-valid-name?:false/disp8
2085 $is-valid-name?:check2:
2086
2087 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2088 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
2089
2090 3d/compare-EAX-and 2d/imm32/-
2091 74/jump-if-equal $is-valid-name?:false/disp8
2092 $is-valid-name?:check3a:
2093
2094 3d/compare-EAX-with 30/imm32/0
2095 7c/jump-if-lesser $is-valid-name?:true/disp8
2096 $is-valid-name?:check3b:
2097
2098 3d/compare-EAX-with 39/imm32/9
2099 7f/jump-if-greater $is-valid-name?:true/disp8
2100 $is-valid-name?:false:
2101
2102 b8/copy-to-EAX 0/imm32/false
2103 eb/jump $is-valid-name?:end/disp8
2104 $is-valid-name?:true:
2105
2106 b8/copy-to-EAX 1/imm32/true
2107 $is-valid-name?:end:
2108
2109 5e/pop-to-ESI
2110 59/pop-to-ECX
2111
2112 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2113 5d/pop-to-EBP
2114 c3/return
2115
2116 test-is-valid-name-digit-prefix:
2117
2118 55/push-EBP
2119 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2120
2121 b8/copy-to-EAX "34"/imm32
2122 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2123 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2124 05/add-to-EAX 4/imm32
2125
2126 51/push-ECX
2127 50/push-EAX
2128 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2129
2130
2131 51/push-ECX
2132
2133 e8/call is-valid-name?/disp32
2134
2135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2136
2137
2138 68/push "F - test-is-valid-name-digit-prefix"/imm32
2139 68/push 0/imm32/false
2140 50/push-EAX
2141
2142 e8/call check-ints-equal/disp32
2143
2144 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2145
2146 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2147 5d/pop-to-EBP
2148 c3/return
2149
2150 test-is-valid-name-negative-prefix:
2151
2152 55/push-EBP
2153 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2154
2155 b8/copy-to-EAX "-0x34"/imm32
2156 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2157 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2158 05/add-to-EAX 4/imm32
2159
2160 51/push-ECX
2161 50/push-EAX
2162 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2163
2164
2165 51/push-ECX
2166
2167 e8/call is-valid-name?/disp32
2168
2169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2170
2171
2172 68/push "F - test-is-valid-name-negative-prefix"/imm32
2173 68/push 0/imm32/false
2174 50/push-EAX
2175
2176 e8/call check-ints-equal/disp32
2177
2178 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2179
2180 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2181 5d/pop-to-EBP
2182 c3/return
2183
2184 test-is-valid-name-0x-prefix:
2185
2186 55/push-EBP
2187 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2188
2189 b8/copy-to-EAX "0x34"/imm32
2190 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2191 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2192 05/add-to-EAX 4/imm32
2193
2194 51/push-ECX
2195 50/push-EAX
2196 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2197
2198
2199 51/push-ECX
2200
2201 e8/call is-valid-name?/disp32
2202
2203 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2204
2205
2206 68/push "F - test-is-valid-name-0x-prefix"/imm32
2207 68/push 0/imm32/false
2208 50/push-EAX
2209
2210 e8/call check-ints-equal/disp32
2211
2212 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2213
2214 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2215 5d/pop-to-EBP
2216 c3/return
2217
2218 test-is-valid-name-starts-with-pre-digit:
2219
2220 55/push-EBP
2221 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2222
2223 b8/copy-to-EAX "/03"/imm32
2224 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2225 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2226 05/add-to-EAX 4/imm32
2227
2228 51/push-ECX
2229 50/push-EAX
2230 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2231
2232
2233 51/push-ECX
2234
2235 e8/call is-valid-name?/disp32
2236
2237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2238
2239
2240 68/push "F - test-is-valid-name-starts-with-pre-digit"/imm32
2241 68/push 1/imm32/true
2242 50/push-EAX
2243
2244 e8/call check-ints-equal/disp32
2245
2246 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2247
2248 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2249 5d/pop-to-EBP
2250 c3/return
2251
2252 test-is-valid-name-starts-with-post-digit:
2253
2254 55/push-EBP
2255 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2256
2257 b8/copy-to-EAX "q34"/imm32
2258 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2259 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2260 05/add-to-EAX 4/imm32
2261
2262 51/push-ECX
2263 50/push-EAX
2264 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2265
2266
2267 51/push-ECX
2268
2269 e8/call is-valid-name?/disp32
2270
2271 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2272
2273
2274 68/push "F - test-is-valid-name-starts-with-post-digit"/imm32
2275 68/push 1/imm32/true
2276 50/push-EAX
2277
2278 e8/call check-ints-equal/disp32
2279
2280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2281
2282 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2283 5d/pop-to-EBP
2284 c3/return
2285
2286 test-is-valid-name-starts-with-digit:
2287
2288 55/push-EBP
2289 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2290
2291 b8/copy-to-EAX "0x34"/imm32
2292 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2293 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2294 05/add-to-EAX 4/imm32
2295
2296 51/push-ECX
2297 50/push-EAX
2298 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2299
2300
2301 51/push-ECX
2302
2303 e8/call is-valid-name?/disp32
2304
2305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2306
2307
2308 68/push "F - test-is-valid-name-starts-with-digit"/imm32
2309 68/push 0/imm32/false
2310 50/push-EAX
2311
2312 e8/call check-ints-equal/disp32
2313
2314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2315
2316 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2317 5d/pop-to-EBP
2318 c3/return
2319
2320
2321 emit-hex:
2322
2323 55/push-EBP
2324 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2325
2326 50/push-EAX
2327 51/push-ECX
2328 52/push-EDX
2329 53/push-EBX
2330 57/push-EDI
2331
2332 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
2333
2334 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
2335
2336 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0x10/disp8 .
2337
2338 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
2339 $emit-hex:loop:
2340
2341 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
2342 7d/jump-if-greater-or-equal $emit-hex:end/disp8
2343
2344
2345 53/push-EBX
2346 57/push-EDI
2347
2348 e8/call print-byte-buffered/disp32
2349
2350 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2351
2352
2353 68/push 0x20/imm32/space
2354 57/push-EDI
2355
2356 e8/call write-byte-buffered/disp32
2357
2358 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2359
2360 c1/shift 5/subop/logic-right 3/mod/direct 3/rm32/EBX . . . . . 8/imm8
2361 $emit-hex:continue:
2362
2363 41/increment-ECX
2364 eb/jump $emit-hex:loop/disp8
2365 $emit-hex:end:
2366
2367 5f/pop-to-EDI
2368 5b/pop-to-EBX
2369 5a/pop-to-EDX
2370 59/pop-to-ECX
2371 58/pop-to-EAX
2372
2373 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2374 5d/pop-to-EBP
2375 c3/return
2376
2377 test-emit-hex-single-byte:
2378
2379
2380
2381 68/push _test-output-stream/imm32
2382
2383 e8/call clear-stream/disp32
2384
2385 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2386
2387
2388 b8/copy-to-EAX _test-output-buffered-file/imm32
2389 05/add-to-EAX 4/imm32
2390 50/push-EAX
2391
2392 e8/call clear-stream/disp32
2393
2394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2395
2396
2397 68/push 1/imm32
2398 68/push 0xab/imm32
2399 68/push _test-output-buffered-file/imm32
2400
2401 e8/call emit-hex/disp32
2402
2403 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2404
2405
2406 68/push _test-output-buffered-file/imm32
2407
2408 e8/call flush/disp32
2409
2410 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2411
2412
2413 68/push "F - test-emit-hex-single-byte"/imm32
2414 68/push 0x206261/imm32
2415
2416 b8/copy-to-EAX _test-output-stream/imm32
2417 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
2418
2419 e8/call check-ints-equal/disp32
2420
2421 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2422
2423 c3/return
2424
2425 test-emit-hex-multiple-byte:
2426
2427
2428
2429 68/push _test-output-stream/imm32
2430
2431 e8/call clear-stream/disp32
2432
2433 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2434
2435
2436 b8/copy-to-EAX _test-output-buffered-file/imm32
2437 05/add-to-EAX 4/imm32
2438 50/push-EAX
2439
2440 e8/call clear-stream/disp32
2441
2442 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2443
2444
2445 68/push 2/imm32
2446 68/push 0x1234/imm32
2447 68/push _test-output-buffered-file/imm32
2448
2449 e8/call emit-hex/disp32
2450
2451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2452
2453
2454 68/push _test-output-buffered-file/imm32
2455
2456 e8/call flush/disp32
2457
2458 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2459
2460
2461 68/push "F - test-emit-hex-multiple-byte/1"/imm32
2462 68/push "34 12 "/imm32
2463 68/push _test-output-stream/imm32
2464
2465 e8/call check-stream-equal/disp32
2466
2467 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2468
2469 c3/return
2470
2471 test-emit-hex-zero-pad:
2472
2473
2474
2475 68/push _test-output-stream/imm32
2476
2477 e8/call clear-stream/disp32
2478
2479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2480
2481
2482 b8/copy-to-EAX _test-output-buffered-file/imm32
2483 05/add-to-EAX 4/imm32
2484 50/push-EAX
2485
2486 e8/call clear-stream/disp32
2487
2488 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2489
2490
2491 68/push 2/imm32
2492 68/push 0xab/imm32
2493 68/push _test-output-buffered-file/imm32
2494
2495 e8/call emit-hex/disp32
2496
2497 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2498
2499
2500 68/push _test-output-buffered-file/imm32
2501
2502 e8/call flush/disp32
2503
2504 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2505
2506
2507 68/push "F - test-emit-hex-zero-pad/1"/imm32
2508 68/push "ab 00 "/imm32
2509 68/push _test-output-stream/imm32
2510
2511 e8/call check-stream-equal/disp32
2512
2513 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2514
2515 c3/return
2516
2517 test-emit-hex-negative:
2518
2519
2520
2521 68/push _test-output-stream/imm32
2522
2523 e8/call clear-stream/disp32
2524
2525 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2526
2527
2528 b8/copy-to-EAX _test-output-buffered-file/imm32
2529 05/add-to-EAX 4/imm32
2530 50/push-EAX
2531
2532 e8/call clear-stream/disp32
2533
2534 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2535
2536
2537 68/push 2/imm32
2538 68/push -1/imm32
2539 68/push _test-output-buffered-file/imm32
2540
2541 e8/call emit-hex/disp32
2542
2543 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2544
2545
2546 68/push _test-output-buffered-file/imm32
2547
2548 e8/call flush/disp32
2549
2550 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2551
2552
2553 68/push "F - test-emit-hex-negative/1"/imm32
2554 68/push "ff ff "/imm32
2555 68/push _test-output-stream/imm32
2556
2557 e8/call check-stream-equal/disp32
2558
2559 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2560
2561 c3/return
2562
2563
2564 emit-hex-array:
2565
2566 55/push-EBP
2567 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2568
2569 50/push-EAX
2570 51/push-ECX
2571 52/push-EDX
2572 57/push-EDI
2573
2574 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
2575
2576 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0xc/disp8 .
2577
2578 8d/copy-address 1/mod/*+disp8 2/rm32/EDX . . . 1/r32/ECX 4/disp8 .
2579
2580 8b/copy 0/mod/indirect 2/rm32/EDX . . . 2/r32/EDX . .
2581 01/add 3/mod/direct 2/rm32/EDX . . . 1/r32/ECX . .
2582
2583 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2584 $emit-hex-array:loop:
2585
2586 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
2587 73/jump-if-greater-or-equal-unsigned $emit-hex-array:end/disp8
2588
2589
2590 68/push 1/imm32/width
2591 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
2592 50/push-EAX
2593 57/push-EDI
2594
2595 e8/call emit-hex/disp32
2596
2597 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2598
2599 41/increment-ECX
2600 eb/jump $emit-hex-array:loop/disp8
2601 $emit-hex-array:end:
2602
2603 5f/pop-to-EDI
2604 5a/pop-to-EDX
2605 59/pop-to-ECX
2606 58/pop-to-EAX
2607
2608 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2609 5d/pop-to-EBP
2610 c3/return
2611
2612 test-emit-hex-array:
2613
2614 55/push-EBP
2615 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2616
2617
2618
2619 68/push _test-output-stream/imm32
2620
2621 e8/call clear-stream/disp32
2622
2623 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2624
2625
2626 b8/copy-to-EAX _test-output-buffered-file/imm32
2627 05/add-to-EAX 4/imm32
2628 50/push-EAX
2629
2630 e8/call clear-stream/disp32
2631
2632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2633
2634 68/push 0x00030201/imm32
2635 68/push 3/imm32/length
2636 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2637
2638
2639 51/push-ECX
2640 68/push _test-output-buffered-file/imm32
2641
2642 e8/call emit-hex-array/disp32
2643
2644 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2645
2646
2647 68/push _test-output-buffered-file/imm32
2648
2649 e8/call flush/disp32
2650
2651 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2652 +-- 33 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
2685
2686
2687 68/push "F - test-emit-hex-array"/imm32
2688 68/push "01 02 03 "/imm32
2689 68/push _test-output-stream/imm32
2690
2691 e8/call check-next-stream-line-equal/disp32
2692
2693 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2694
2695 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2696 5d/pop-to-EBP
2697 c3/return
2698
2699 compute-width:
2700
2701 55/push-EBP
2702 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2703
2704 51/push-ECX
2705
2706 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 8/disp8 .
2707
2708 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2709 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2710
2711 05/add-to-EAX 4/imm32
2712
2713 51/push-ECX
2714 50/push-EAX
2715 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2716
2717
2718 51/push-ECX
2719
2720 e8/call compute-width-of-slice/disp32
2721
2722 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2723 $compute-width:end:
2724
2725 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2726
2727 59/pop-to-ECX
2728
2729 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2730 5d/pop-to-EBP
2731 c3/return
2732
2733 compute-width-of-slice:
2734
2735 55/push-EBP
2736 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2737
2738 51/push-ECX
2739
2740 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
2741
2742
2743
2744 68/push "imm32"/imm32
2745 51/push-ECX
2746
2747 e8/call has-metadata?/disp32
2748
2749 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2750
2751 3d/compare-EAX-and 0/imm32
2752 b8/copy-to-EAX 4/imm32
2753 75/jump-if-not-equal $compute-width-of-slice:end/disp8
2754
2755
2756
2757 68/push "disp32"/imm32
2758 51/push-ECX
2759
2760 e8/call has-metadata?/disp32
2761
2762 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2763
2764 3d/compare-EAX-and 0/imm32
2765 b8/copy-to-EAX 4/imm32
2766 75/jump-if-not-equal $compute-width-of-slice:end/disp8
2767
2768
2769
2770 68/push "imm16"/imm32
2771 51/push-ECX
2772
2773 e8/call has-metadata?/disp32
2774
2775 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2776
2777 3d/compare-EAX-and 0/imm32
2778 b8/copy-to-EAX 2/imm32
2779 75/jump-if-not-equal $compute-width-of-slice:end/disp8
2780
2781
2782
2783 68/push "disp16"/imm32
2784 51/push-ECX
2785
2786 e8/call has-metadata?/disp32
2787
2788 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2789
2790 3d/compare-EAX-and 0/imm32
2791 b8/copy-to-EAX 2/imm32
2792 75/jump-if-not-equal $compute-width-of-slice:end/disp8
2793
2794 b8/copy-to-EAX 1/imm32
2795 $compute-width-of-slice:end:
2796
2797 59/pop-to-ECX
2798
2799 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2800 5d/pop-to-EBP
2801 c3/return
2802
2803 test-compute-width:
2804
2805 55/push-EBP
2806 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2807 $test-compute-width:imm8:
2808
2809
2810 68/push "0x2/imm8"/imm32
2811
2812 e8/call compute-width/disp32
2813
2814 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2815
2816
2817 68/push "F - test-compute-width: 0x2/imm8"/imm32
2818 50/push-EAX
2819 68/push 1/imm32
2820
2821 e8/call check-ints-equal/disp32
2822
2823 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2824 $test-compute-width:imm16:
2825
2826
2827 68/push "4/imm16"/imm32
2828
2829 e8/call compute-width/disp32
2830
2831 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2832
2833
2834 68/push "F - test-compute-width: 4/imm16"/imm32
2835 50/push-EAX
2836 68/push 2/imm32
2837
2838 e8/call check-ints-equal/disp32
2839
2840 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2841 $test-compute-width:imm32:
2842
2843
2844 68/push "4/imm32"/imm32
2845
2846 e8/call compute-width/disp32
2847
2848 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2849
2850
2851 68/push "F - test-compute-width: 4/imm32"/imm32
2852 50/push-EAX
2853 68/push 4/imm32
2854
2855 e8/call check-ints-equal/disp32
2856
2857 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2858 $test-compute-width:disp8:
2859
2860
2861 68/push "foo/disp8"/imm32
2862
2863 e8/call compute-width/disp32
2864
2865 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2866
2867
2868 68/push "F - test-compute-width: foo/disp8"/imm32
2869 50/push-EAX
2870 68/push 1/imm32
2871
2872 e8/call check-ints-equal/disp32
2873
2874 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2875 $test-compute-width:disp16:
2876
2877
2878 68/push "foo/disp16"/imm32
2879
2880 e8/call compute-width/disp32
2881
2882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2883
2884
2885 68/push "F - test-compute-width: foo/disp16"/imm32
2886 50/push-EAX
2887 68/push 2/imm32
2888
2889 e8/call check-ints-equal/disp32
2890
2891 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2892 $test-compute-width:disp32:
2893
2894
2895 68/push "foo/disp32"/imm32
2896
2897 e8/call compute-width/disp32
2898
2899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2900
2901
2902 68/push "F - test-compute-width: foo/disp32"/imm32
2903 50/push-EAX
2904 68/push 4/imm32
2905
2906 e8/call check-ints-equal/disp32
2907
2908 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2909 $test-compute-width:no-metadata:
2910
2911
2912 68/push "45"/imm32
2913
2914 e8/call compute-width/disp32
2915
2916 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2917
2918
2919 68/push "F - test-compute-width: 45 (no metadata)"/imm32
2920 50/push-EAX
2921 68/push 1/imm32
2922
2923 e8/call check-ints-equal/disp32
2924
2925 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2926
2927 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2928 5d/pop-to-EBP
2929 c3/return
2930
2931 is-label?:
2932
2933 55/push-EBP
2934 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2935
2936 51/push-ECX
2937
2938 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
2939
2940 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 1/r32/ECX 4/disp8 .
2941
2942
2943 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2944
2945 8a/copy-byte 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/AL -1/disp8 .
2946
2947 3d/compare-EAX-and 0x3a/imm32/colon
2948 b8/copy-to-EAX 1/imm32/true
2949 74/jump-if-equal $is-label?:end/disp8
2950 b8/copy-to-EAX 0/imm32/false
2951 $is-label?:end:
2952
2953 59/pop-to-ECX
2954
2955 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2956 5d/pop-to-EBP
2957 c3/return
2958
2959 test-is-label?:
2960
2961 55/push-EBP
2962 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2963 $test-is-label?:true:
2964
2965 b8/copy-to-EAX "AAA:"/imm32
2966 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2967 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2968 05/add-to-EAX 4/imm32
2969
2970 51/push-ECX
2971 50/push-EAX
2972 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2973
2974
2975 51/push-ECX
2976
2977 e8/call is-label?/disp32
2978
2979 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2980
2981
2982 68/push "F - test-is-label?:true"/imm32
2983 68/push 1/imm32
2984 50/push-EAX
2985
2986 e8/call check-ints-equal/disp32
2987
2988 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2989 $test-is-label?:false:
2990
2991 b8/copy-to-EAX "AAA"/imm32
2992 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2993 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2994 05/add-to-EAX 4/imm32
2995
2996 51/push-ECX
2997 50/push-EAX
2998 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2999
3000
3001 51/push-ECX
3002
3003 e8/call is-label?/disp32
3004
3005 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3006
3007
3008 68/push "F - test-is-label?:false"/imm32
3009 68/push 0/imm32
3010 50/push-EAX
3011
3012 e8/call check-ints-equal/disp32
3013
3014 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3015
3016 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3017 5d/pop-to-EBP
3018 c3/return
3019
3020 == data
3021
3022 _test-input-stream:
3023
3024 0/imm32
3025
3026 0/imm32
3027
3028 0x100/imm32
3029
3030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3031 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3032 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3033 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3034 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3035 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3036 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3037 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3038 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3039 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3041 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3042 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3043 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3044 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3045 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3046
3047
3048 _test-input-buffered-file:
3049
3050 _test-input-stream/imm32
3051
3052 0/imm32
3053
3054 0/imm32
3055
3056 6/imm32
3057
3058 00 00 00 00 00 00
3059
3060 _test-output-stream:
3061
3062 0/imm32
3063
3064 0/imm32
3065
3066 0x200/imm32
3067
3068 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3069 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3071 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3072 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3073 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3074 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3075 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3076 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3077 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3078 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3079 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3081 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3082 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3083 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3084 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3085 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3086 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3087 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3088 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3089 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3091 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3092 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3093 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3094 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3095 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3096 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3097 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3098 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3099 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3100
3101
3102 _test-output-buffered-file:
3103
3104 _test-output-stream/imm32
3105
3106 0/imm32
3107
3108 0/imm32
3109
3110 6/imm32
3111
3112 00 00 00 00 00 00
3113
3114 _test-data-segment:
3115 64/d 61/a 74/t 61/a
3116 _test-data-segment-end:
3117
3118