https://github.com/akkartik/mu/blob/master/subx/apps/pack.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 == code
19
20
21
22
23
24
25
26
27
28
29
30 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
31
32
33 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
34 7e/jump-if-lesser-or-equal $run-main/disp8
35
36
37 68/push "test"/imm32
38 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
39
40 e8/call kernel-string-equal?/disp32
41
42 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
43
44 3d/compare-EAX 1/imm32
45 75/jump-if-not-equal $run-main/disp8
46
47 e8/call run-tests/disp32
48 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
49 eb/jump $main:end/disp8
50 $run-main:
51
52
53 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
54 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
55
56
57 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
58
59
60 50/push-EAX/ed
61 68/push Stderr/imm32
62 68/push Stdout/imm32
63 68/push Stdin/imm32
64
65 e8/call convert/disp32
66
67 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
68
69 bb/copy-to-EBX 0/imm32
70 $main:end:
71 b8/copy-to-EAX 1/imm32/exit
72 cd/syscall 0x80/imm8
73
74
75
76
77
78
79
80
81
82
83
84
85 convert:
86
87
88
89
90
91
92
93
94
95
96 55/push-EBP
97 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
98
99 51/push-ECX
100
101 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
102 68/push 0x200/imm32/length
103 68/push 0/imm32/read
104 68/push 0/imm32/write
105 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
106 $convert:loop:
107
108
109 51/push-ECX
110
111 e8/call clear-stream/disp32
112
113 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
114
115
116 51/push-ECX
117 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
118
119 e8/call convert-instruction/disp32
120
121 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
122
123 3d/compare-with-EAX 0xffffffff/imm32
124 74/jump-if-equal $convert:break/disp8
125
126
127 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
128 51/push-ECX
129
130 e8/call convert-instruction/disp32
131
132 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
133 $convert:break:
134
135
136 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
137
138 e8/call flush/disp32
139
140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
141 $convert:end:
142
143 59/pop-to-ECX
144
145 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
146 5d/pop-to-EBP
147 c3/return
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 convert-instruction:
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213 55/push-EBP
214 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
215
216 51/push-ECX
217
218 68/push 0/imm32/end
219 68/push 0/imm32/start
220 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
221
222
223 51/push-ECX
224 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
225
226 e8/call next-word/disp32
227
228 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
229 $convert-instruction:pass-line-through:
230
231
232 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
233 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
234
235 e8/call write-stream-buffered/disp32
236
237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
238 $convert-instruction:end:
239
240 59/pop-to-ECX
241
242 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
243 5d/pop-to-EBP
244 c3/return
245
246 test-convert-instruction-passes-comments-through:
247
248
249 55/push-EBP
250 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
251
252
253
254 68/push _test-stream/imm32
255
256 e8/call clear-stream/disp32
257
258 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
259
260
261 b8/copy-to-EAX _test-buffered-file/imm32
262 05/add-to-EAX 4/imm32
263 50/push-EAX
264
265 e8/call clear-stream/disp32
266
267 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
268
269
270 68/push _test-tmp-stream/imm32
271
272 e8/call clear-stream/disp32
273
274 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
275
276
277
278 68/push "# abcd"/imm32
279 68/push _test-tmp-stream/imm32
280
281 e8/call write/disp32
282
283 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
284
285
286 68/push _test-buffered-file/imm32
287 68/push _test-tmp-stream/imm32
288
289 e8/call convert-instruction/disp32
290
291 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
292
293
294
295 68/push _test-buffered-file/imm32
296
297 e8/call flush/disp32
298
299 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
300
301
302 68/push "F - test-convert-instruction-passes-comments-through"/imm32
303 68/push "# abcd"/imm32
304 68/push _test-stream/imm32
305
306 e8/call check-stream-equal/disp32
307
308 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
309
310 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
311 5d/pop-to-EBP
312 c3/return
313
314 test-convert-instruction-passes-segment-headers-through:
315
316
317 55/push-EBP
318 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
319
320
321
322 68/push _test-stream/imm32
323
324 e8/call clear-stream/disp32
325
326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
327
328
329 b8/copy-to-EAX _test-buffered-file/imm32
330 05/add-to-EAX 4/imm32
331 50/push-EAX
332
333 e8/call clear-stream/disp32
334
335 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
336
337
338 68/push _test-tmp-stream/imm32
339
340 e8/call clear-stream/disp32
341
342 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
343
344
345
346 68/push "== abcd"/imm32
347 68/push _test-tmp-stream/imm32
348
349 e8/call write/disp32
350
351 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
352
353
354 68/push _test-buffered-file/imm32
355 68/push _test-tmp-stream/imm32
356
357 e8/call convert-instruction/disp32
358
359 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
360
361
362
363 68/push _test-buffered-file/imm32
364
365 e8/call flush/disp32
366
367 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
368
369
370 68/push "F - test-convert-instruction-passes-segment-headers-through"/imm32
371 68/push "== abcd"/imm32
372 68/push _test-stream/imm32
373
374 e8/call check-stream-equal/disp32
375
376 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
377
378 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
379 5d/pop-to-EBP
380 c3/return
381
382 test-convert-instruction-passes-empty-lines-through:
383
384
385 55/push-EBP
386 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
387
388
389
390 68/push _test-stream/imm32
391
392 e8/call clear-stream/disp32
393
394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
395
396
397 b8/copy-to-EAX _test-buffered-file/imm32
398 05/add-to-EAX 4/imm32
399 50/push-EAX
400
401 e8/call clear-stream/disp32
402
403 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
404
405
406 68/push _test-tmp-stream/imm32
407
408 e8/call clear-stream/disp32
409
410 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
411
412
413
414 68/push _test-buffered-file/imm32
415 68/push _test-tmp-stream/imm32
416
417 e8/call convert-instruction/disp32
418
419 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
420
421
422
423 68/push _test-buffered-file/imm32
424
425 e8/call flush/disp32
426
427 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
428
429
430 68/push "F - test-convert-instruction-passes-empty-lines-through"/imm32
431 68/push ""/imm32
432 68/push _test-stream/imm32
433
434 e8/call check-stream-equal/disp32
435
436 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
437
438 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
439 5d/pop-to-EBP
440 c3/return
441
442 test-convert-instruction-passes-lines-with-just-whitespace-through:
443
444
445 55/push-EBP
446 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
447
448
449
450 68/push _test-stream/imm32
451
452 e8/call clear-stream/disp32
453
454 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
455
456
457 b8/copy-to-EAX _test-buffered-file/imm32
458 05/add-to-EAX 4/imm32
459 50/push-EAX
460
461 e8/call clear-stream/disp32
462
463 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
464
465
466 68/push _test-tmp-stream/imm32
467
468 e8/call clear-stream/disp32
469
470 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
471
472
473
474 68/push " "/imm32
475 68/push _test-tmp-stream/imm32
476
477 e8/call write/disp32
478
479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
480
481
482 68/push _test-buffered-file/imm32
483 68/push _test-tmp-stream/imm32
484
485 e8/call convert-instruction/disp32
486
487 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
488
489
490
491 68/push _test-buffered-file/imm32
492
493 e8/call flush/disp32
494
495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
496
497
498 68/push "F - test-convert-instruction-passes-with-just-whitespace-through"/imm32
499 68/push " "/imm32
500 68/push _test-stream/imm32
501
502 e8/call check-stream-equal/disp32
503
504 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
505
506 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
507 5d/pop-to-EBP
508 c3/return
509
510 test-convert-instruction-passes-labels-through:
511
512
513 55/push-EBP
514 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
515
516
517
518 68/push _test-stream/imm32
519
520 e8/call clear-stream/disp32
521
522 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
523
524
525 b8/copy-to-EAX _test-buffered-file/imm32
526 05/add-to-EAX 4/imm32
527 50/push-EAX
528
529 e8/call clear-stream/disp32
530
531 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
532
533
534 68/push _test-tmp-stream/imm32
535
536 e8/call clear-stream/disp32
537
538 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
539
540
541
542 68/push "ab: # cd"/imm32
543 68/push _test-tmp-stream/imm32
544
545 e8/call write/disp32
546
547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
548
549
550 68/push _test-buffered-file/imm32
551 68/push _test-tmp-stream/imm32
552
553 e8/call convert-instruction/disp32
554
555 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
556
557
558
559 68/push _test-buffered-file/imm32
560
561 e8/call flush/disp32
562
563 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
564
565
566 68/push "F - test-convert-instruction-passes-labels-through"/imm32
567 68/push "ab: # cd"/imm32
568 68/push _test-stream/imm32
569
570 e8/call check-stream-equal/disp32
571
572 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
573
574 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
575 5d/pop-to-EBP
576 c3/return
577
578
579 next-word:
580
581 55/push-EBP
582 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
583
584 50/push-EAX
585 51/push-ECX
586 56/push-ESI
587 57/push-EDI
588
589 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
590
591 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
592
593
594 68/push 0x20/imm32/space
595 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
596
597 e8/call skip-chars-matching/disp32
598
599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
600
601 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
602 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
603 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
604
605
606 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
607 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
608
609 3d/compare-EAX-with 0x23/imm32/pound
610 75/jump-if-not-equal $next-word:not-comment/disp8
611
612 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
613 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
614 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
615
616 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
617
618 eb/jump $next-word:end/disp8
619 $next-word:not-comment:
620
621
622 68/push 0x20/imm32/space
623 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
624
625 e8/call skip-chars-not-matching/disp32
626
627 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
628
629 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
630 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
631 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
632 $next-word:end:
633
634 5f/pop-to-EDI
635 5e/pop-to-ESI
636 59/pop-to-ECX
637 58/pop-to-EAX
638
639 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
640 5d/pop-to-EBP
641 c3/return
642
643 test-next-word:
644
645 55/push-EBP
646 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
647
648
649
650 68/push _test-stream/imm32
651
652 e8/call clear-stream/disp32
653
654 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
655
656 68/push 0/imm32/end
657 68/push 0/imm32/start
658 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
659
660
661 68/push " ab"/imm32
662 68/push _test-stream/imm32
663
664 e8/call write/disp32
665
666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
667
668
669 51/push-ECX
670 68/push _test-stream/imm32
671
672 e8/call next-word/disp32
673
674 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
675
676
677
678 68/push "F - test-next-word: start"/imm32
679 68/push 0xe/imm32
680
681 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
682 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
683 50/push-EAX
684
685 e8/call check-ints-equal/disp32
686
687 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
688
689
690
691 68/push "F - test-next-word: end"/imm32
692 68/push 0x10/imm32
693
694 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
695 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
696 50/push-EAX
697
698 e8/call check-ints-equal/disp32
699
700 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
701
702 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
703 5d/pop-to-EBP
704 c3/return
705
706 test-next-word-returns-whole-comment:
707
708 55/push-EBP
709 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
710
711
712
713 68/push _test-stream/imm32
714
715 e8/call clear-stream/disp32
716
717 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
718
719 68/push 0/imm32/end
720 68/push 0/imm32/start
721 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
722
723
724 68/push " # a"/imm32
725 68/push _test-stream/imm32
726
727 e8/call write/disp32
728
729 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
730
731
732 51/push-ECX
733 68/push _test-stream/imm32
734
735 e8/call next-word/disp32
736
737 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
738
739
740
741 68/push "F - test-next-word-returns-whole-comment: start"/imm32
742 68/push 0xe/imm32
743
744 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
745 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
746 50/push-EAX
747
748 e8/call check-ints-equal/disp32
749
750 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
751
752
753
754 68/push "F - test-next-word-returns-whole-comment: end"/imm32
755 68/push 0x11/imm32
756
757 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
758 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
759 50/push-EAX
760
761 e8/call check-ints-equal/disp32
762
763 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
764
765 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
766 5d/pop-to-EBP
767 c3/return
768
769 has-metadata?:
770
771
772
773
774
775
776
777
778
779
780 55/push-EBP
781 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
782
783 51/push-ECX
784 52/push-EDX
785 56/push-ESI
786 57/push-EDI
787
788 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
789
790 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
791
792 68/push 0/imm32/end
793 68/push 0/imm32/start
794 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
795
796
797 57/push-EDI
798 68/push 0x2f/imm32/slash
799 52/push-EDX
800 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
801
802 e8/call next-token-from-slice/disp32
803
804 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
805
806 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
807 $has-metadata?:loop:
808
809
810 57/push-EDI
811 68/push 0x2f/imm32/slash
812 52/push-EDX
813 51/push-ECX
814
815 e8/call next-token-from-slice/disp32
816
817 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
818
819
820
821 57/push-EDI
822
823 e8/call slice-empty?/disp32
824
825 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
826
827 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
828 75/compare-if-not-equal $has-metadata?:false/disp8
829
830
831
832 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
833 57/push-EDI
834
835 e8/call slice-equal?/disp32
836
837 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
838
839 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
840 75/compare-if-not-equal $has-metadata?:true/disp8
841
842 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
843 eb/jump $has-metadata?:loop/disp8
844 $has-metadata?:true:
845 b8/copy-to-EAX 1/imm32/true
846 eb/jump $has-metadata?:end/disp8
847 $has-metadata?:false:
848 b8/copy-to-EAX 0/imm32/false
849 $has-metadata?:end:
850
851 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
852
853 5f/pop-to-EDI
854 5e/pop-to-ESI
855 5a/pop-to-EDX
856 59/pop-to-ECX
857
858 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
859 5d/pop-to-EBP
860 c3/return
861
862 test-has-metadata-true:
863
864 55/push-EBP
865 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
866
867 b8/copy-to-EAX "ab/c"/imm32
868 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
869 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
870 05/add-to-EAX 4/imm32
871
872 51/push-ECX
873 50/push-EAX
874 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
875
876
877 68/push "c"/imm32
878 56/push-ESI
879
880 e8/call has-metadata?/disp32
881
882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
883
884
885 68/push "F - test-has-metadata-true"/imm32
886 68/push 1/imm32/true
887 50/push-EAX
888
889 e8/call check-ints-equal/disp32
890
891 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
892
893 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
894 5d/pop-to-EBP
895 c3/return
896
897 test-has-metadata-false:
898
899 55/push-EBP
900 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
901
902 b8/copy-to-EAX "ab/c"/imm32
903 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
904 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
905 05/add-to-EAX 4/imm32
906
907 51/push-ECX
908 50/push-EAX
909 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
910
911
912 68/push "d"/imm32
913 56/push-ESI
914
915 e8/call has-metadata?/disp32
916
917 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
918
919
920 68/push "F - test-has-metadata-false"/imm32
921 68/push 0/imm32/false
922 50/push-EAX
923
924 e8/call check-ints-equal/disp32
925
926 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
927
928 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
929 5d/pop-to-EBP
930 c3/return
931
932 test-has-metadata-ignore-name:
933
934 55/push-EBP
935 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
936
937 b8/copy-to-EAX "a/b"/imm32
938 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
939 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
940 05/add-to-EAX 4/imm32
941
942 51/push-ECX
943 50/push-EAX
944 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
945
946
947 68/push "a"/imm32
948 56/push-ESI
949
950 e8/call has-metadata?/disp32
951
952 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
953
954
955 68/push "F - test-has-metadata-ignore-name"/imm32
956 68/push 0/imm32/false
957 50/push-EAX
958
959 e8/call check-ints-equal/disp32
960
961 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
962
963 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
964 5d/pop-to-EBP
965 c3/return
966
967 test-has-metadata-multiple-true:
968
969 55/push-EBP
970 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
971
972 b8/copy-to-EAX "a/b/c"/imm32
973 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
974 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
975 05/add-to-EAX 4/imm32
976
977 51/push-ECX
978 50/push-EAX
979 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
980
981
982 68/push "c"/imm32
983 56/push-ESI
984
985 e8/call has-metadata?/disp32
986
987 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
988
989
990 68/push "F - test-has-metadata-multiple-true"/imm32
991 68/push 1/imm32/true
992 50/push-EAX
993
994 e8/call check-ints-equal/disp32
995
996 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
997
998 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
999 5d/pop-to-EBP
1000 c3/return
1001
1002 test-has-metadata-multiple-false:
1003
1004 55/push-EBP
1005 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1006
1007 b8/copy-to-EAX "a/b/c"/imm32
1008 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1009 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1010 05/add-to-EAX 4/imm32
1011
1012 51/push-ECX
1013 50/push-EAX
1014 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1015
1016
1017 68/push "d"/imm32
1018 56/push-ESI
1019
1020 e8/call has-metadata?/disp32
1021
1022 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
1023
1024
1025 68/push "F - test-has-metadata-multiple-false"/imm32
1026 68/push 0/imm32/false
1027 50/push-EAX
1028
1029 e8/call check-ints-equal/disp32
1030
1031 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1032
1033 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1034 5d/pop-to-EBP
1035 c3/return
1036
1037
1038
1039 emit:
1040
1041 55/push-EBP
1042 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1043
1044 50/push-EAX
1045 56/push-ESI
1046 57/push-EDI
1047
1048 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
1049
1050 68/push 0/imm32/end
1051 68/push 0/imm32/start
1052 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
1053
1054
1055 57/push-EDI
1056 68/push 0x2f/imm32/slash
1057 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
1058 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
1059
1060 e8/call next-token-from-slice/disp32
1061
1062 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1063
1064
1065
1066 57/push-EDI
1067
1068 e8/call is-hex-int?/disp32
1069
1070 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1071
1072 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
1073 75/jump-if-not-equal $emit:hex-int/disp8
1074
1075
1076 56/push-ESI
1077 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1078
1079 e8/call write-slice/disp32
1080
1081 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1082
1083 eb/jump $emit:end/disp8
1084
1085 $emit:hex-int:
1086
1087
1088 57/push-EDI
1089
1090 e8/call parse-hex-int/disp32
1091
1092 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1093
1094
1095 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
1096 50/push-EAX
1097 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1098
1099 e8/call emit-hex/disp32
1100
1101 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1102 $emit:end:
1103
1104 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1105
1106 5f/pop-to-EDI
1107 5e/pop-to-ESI
1108 58/pop-to-EAX
1109
1110 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1111 5d/pop-to-EBP
1112 c3/return
1113
1114 test-emit-number:
1115
1116 55/push-EBP
1117 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1118
1119
1120
1121 68/push _test-stream/imm32
1122
1123 e8/call clear-stream/disp32
1124
1125 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1126
1127
1128 b8/copy-to-EAX _test-buffered-file/imm32
1129 05/add-to-EAX 4/imm32
1130 50/push-EAX
1131
1132 e8/call clear-stream/disp32
1133
1134 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1135
1136 68/push _test-slice-negative-two-end/imm32/end
1137 68/push _test-slice-negative-two/imm32/start
1138 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1139
1140
1141 68/push 2/imm32
1142 51/push-ECX
1143 68/push _test-buffered-file/imm32
1144
1145 e8/call emit/disp32
1146
1147 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1148
1149
1150 68/push _test-buffered-file/imm32
1151
1152 e8/call flush/disp32
1153
1154 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1155
1156
1157
1158 68/push "F - test-emit-number/1"/imm32
1159 68/push 0x66206566/imm32
1160
1161 b8/copy-to-EAX _test-stream/imm32
1162 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1163
1164 e8/call check-ints-equal/disp32
1165
1166 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1167
1168
1169 68/push "F - test-emit-number/2"/imm32
1170 68/push 0x2066/imm32
1171
1172 b8/copy-to-EAX _test-stream/imm32
1173 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1174
1175 e8/call check-ints-equal/disp32
1176
1177 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1178
1179 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1180 5d/pop-to-EBP
1181 c3/return
1182
1183 test-emit-number-with-metadata:
1184
1185 55/push-EBP
1186 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1187
1188
1189
1190 68/push _test-stream/imm32
1191
1192 e8/call clear-stream/disp32
1193
1194 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1195
1196
1197 b8/copy-to-EAX _test-buffered-file/imm32
1198 05/add-to-EAX 4/imm32
1199 50/push-EAX
1200
1201 e8/call clear-stream/disp32
1202
1203 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1204
1205 68/push _test-slice-negative-two-metadata-end/imm32/end
1206 68/push _test-slice-negative-two/imm32/start
1207 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1208
1209
1210 68/push 2/imm32
1211 51/push-ECX
1212 68/push _test-buffered-file/imm32
1213
1214 e8/call emit/disp32
1215
1216 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1217
1218
1219 68/push _test-buffered-file/imm32
1220
1221 e8/call flush/disp32
1222
1223 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1224
1225
1226
1227
1228 68/push "F - test-emit-number-with-metadata/1"/imm32
1229 68/push 0x66206566/imm32
1230
1231 b8/copy-to-EAX _test-stream/imm32
1232 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1233
1234 e8/call check-ints-equal/disp32
1235
1236 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1237
1238
1239 68/push "F - test-emit-number-with-metadata/2"/imm32
1240 68/push 0x2066/imm32
1241
1242 b8/copy-to-EAX _test-stream/imm32
1243 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1244
1245 e8/call check-ints-equal/disp32
1246
1247 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1248
1249 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1250 5d/pop-to-EBP
1251 c3/return
1252
1253 test-emit-non-number:
1254
1255 55/push-EBP
1256 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1257
1258
1259
1260 68/push _test-stream/imm32
1261
1262 e8/call clear-stream/disp32
1263
1264 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1265
1266
1267 b8/copy-to-EAX _test-buffered-file/imm32
1268 05/add-to-EAX 4/imm32
1269 50/push-EAX
1270
1271 e8/call clear-stream/disp32
1272
1273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1274
1275 68/push _test-slice-non-number-word-end/imm32/end
1276 68/push _test-slice-non-number-word/imm32/start
1277 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1278
1279
1280 68/push 2/imm32
1281 51/push-ECX
1282 68/push _test-buffered-file/imm32
1283
1284 e8/call emit/disp32
1285
1286 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1287
1288
1289 68/push _test-buffered-file/imm32
1290
1291 e8/call flush/disp32
1292
1293 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1294
1295
1296
1297 68/push "F - test-emit-non-number"/imm32
1298 68/push 0x7a7978/imm32
1299
1300 b8/copy-to-EAX _test-stream/imm32
1301 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1302
1303 e8/call check-ints-equal/disp32
1304
1305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1306
1307 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1308 5d/pop-to-EBP
1309 c3/return
1310
1311 test-emit-non-number-with-metadata:
1312
1313 55/push-EBP
1314 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1315
1316
1317
1318 68/push _test-stream/imm32
1319
1320 e8/call clear-stream/disp32
1321
1322 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1323
1324
1325 b8/copy-to-EAX _test-buffered-file/imm32
1326 05/add-to-EAX 4/imm32
1327 50/push-EAX
1328
1329 e8/call clear-stream/disp32
1330
1331 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1332
1333 68/push _test-slice-non-number-word-metadata-end/imm32/end
1334 68/push _test-slice-non-number-word/imm32/start
1335 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1336
1337
1338 68/push 2/imm32
1339 51/push-ECX
1340 68/push _test-buffered-file/imm32
1341
1342 e8/call emit/disp32
1343
1344 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1345
1346
1347 68/push _test-buffered-file/imm32
1348
1349 e8/call flush/disp32
1350
1351 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1352
1353
1354
1355 68/push "F - test-emit-non-number-with-metadata"/imm32
1356 68/push 0x2f7a7978/imm32
1357
1358 b8/copy-to-EAX _test-stream/imm32
1359 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1360
1361 e8/call check-ints-equal/disp32
1362
1363 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1364
1365 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1366 5d/pop-to-EBP
1367 c3/return
1368
1369
1370 emit-hex:
1371
1372 55/push-EBP
1373 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1374
1375 50/push-EAX
1376 51/push-ECX
1377 52/push-EDX
1378 53/push-EBX
1379 57/push-EDI
1380
1381 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
1382
1383 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
1384
1385 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0x10/disp8 .
1386
1387 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
1388 $emit-hex:loop:
1389
1390 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
1391 7d/jump-if-greater-or-equal $emit-hex:end/disp8
1392
1393
1394 53/push-EBX
1395 57/push-EDI
1396
1397 e8/call print-byte/disp32
1398
1399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1400
1401
1402 68/push 0x20/imm32/space
1403 57/push-EDI
1404
1405 e8/call write-byte/disp32
1406
1407 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1408
1409 c1/shift 5/subop/logic-right 3/mod/direct 3/rm32/EBX . . . . . 8/imm8
1410
1411 41/increment-ECX
1412 eb/jump $emit-hex:loop/disp8
1413 $emit-hex:end:
1414
1415 5f/pop-to-EDI
1416 5b/pop-to-EBX
1417 5a/pop-to-EAX
1418 59/pop-to-ECX
1419 58/pop-to-EAX
1420
1421 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1422 5d/pop-to-EBP
1423 c3/return
1424
1425 test-emit-hex-single-byte:
1426
1427
1428
1429 68/push _test-stream/imm32
1430
1431 e8/call clear-stream/disp32
1432
1433 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1434
1435
1436 b8/copy-to-EAX _test-buffered-file/imm32
1437 05/add-to-EAX 4/imm32
1438 50/push-EAX
1439
1440 e8/call clear-stream/disp32
1441
1442 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1443
1444
1445 68/push 1/imm32
1446 68/push 0xab/imm32
1447 68/push _test-buffered-file/imm32
1448
1449 e8/call emit-hex/disp32
1450
1451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1452
1453
1454 68/push _test-buffered-file/imm32
1455
1456 e8/call flush/disp32
1457
1458 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1459
1460
1461 68/push "F - test-emit-hex-single-byte"/imm32
1462 68/push 0x206261/imm32
1463
1464 b8/copy-to-EAX _test-stream/imm32
1465 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1466
1467 e8/call check-ints-equal/disp32
1468
1469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1470
1471 c3/return
1472
1473 test-emit-hex-multiple-byte:
1474
1475
1476
1477 68/push _test-stream/imm32
1478
1479 e8/call clear-stream/disp32
1480
1481 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1482
1483
1484 b8/copy-to-EAX _test-buffered-file/imm32
1485 05/add-to-EAX 4/imm32
1486 50/push-EAX
1487
1488 e8/call clear-stream/disp32
1489
1490 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1491
1492
1493 68/push 2/imm32
1494 68/push 0x1234/imm32
1495 68/push _test-buffered-file/imm32
1496
1497 e8/call emit-hex/disp32
1498
1499 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1500
1501
1502 68/push _test-buffered-file/imm32
1503
1504 e8/call flush/disp32
1505
1506 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1507
1508
1509
1510 68/push "F - test-emit-hex-multiple-byte/1"/imm32
1511 68/push 0x31203433/imm32
1512
1513 b8/copy-to-EAX _test-stream/imm32
1514 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1515
1516 e8/call check-ints-equal/disp32
1517
1518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1519
1520
1521 68/push "F - test-emit-hex-multiple-byte/2"/imm32
1522 68/push 0x2032/imm32
1523
1524 b8/copy-to-EAX _test-stream/imm32
1525 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1526
1527 e8/call check-ints-equal/disp32
1528
1529 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1530
1531 c3/return
1532
1533 test-emit-hex-zero-pad:
1534
1535
1536
1537 68/push _test-stream/imm32
1538
1539 e8/call clear-stream/disp32
1540
1541 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1542
1543
1544 b8/copy-to-EAX _test-buffered-file/imm32
1545 05/add-to-EAX 4/imm32
1546 50/push-EAX
1547
1548 e8/call clear-stream/disp32
1549
1550 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1551
1552
1553 68/push 2/imm32
1554 68/push 0xab/imm32
1555 68/push _test-buffered-file/imm32
1556
1557 e8/call emit-hex/disp32
1558
1559 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1560
1561
1562 68/push _test-buffered-file/imm32
1563
1564 e8/call flush/disp32
1565
1566 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1567
1568
1569
1570 68/push "F - test-emit-hex-zero-pad/1"/imm32
1571 68/push 0x30206261/imm32
1572
1573 b8/copy-to-EAX _test-stream/imm32
1574 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1575
1576 e8/call check-ints-equal/disp32
1577
1578 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1579
1580
1581 68/push "F - test-emit-hex-zero-pad/2"/imm32
1582 68/push 0x2030/imm32
1583
1584 b8/copy-to-EAX _test-stream/imm32
1585 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1586
1587 e8/call check-ints-equal/disp32
1588
1589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1590
1591 c3/return
1592
1593 test-emit-hex-negative:
1594
1595
1596
1597 68/push _test-stream/imm32
1598
1599 e8/call clear-stream/disp32
1600
1601 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1602
1603
1604 b8/copy-to-EAX _test-buffered-file/imm32
1605 05/add-to-EAX 4/imm32
1606 50/push-EAX
1607
1608 e8/call clear-stream/disp32
1609
1610 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1611
1612
1613 68/push 2/imm32
1614 68/push -1/imm32
1615 68/push _test-buffered-file/imm32
1616
1617 e8/call emit-hex/disp32
1618
1619 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1620
1621
1622 68/push _test-buffered-file/imm32
1623
1624 e8/call flush/disp32
1625
1626 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1627
1628
1629
1630 68/push "F - test-emit-hex-negative/1"/imm32
1631 68/push 0x66206666/imm32
1632
1633 b8/copy-to-EAX _test-stream/imm32
1634 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1635
1636 e8/call check-ints-equal/disp32
1637
1638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1639
1640
1641 68/push "F - test-emit-hex-negative/2"/imm32
1642 68/push 0x2066/imm32
1643
1644 b8/copy-to-EAX _test-stream/imm32
1645 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1646
1647 e8/call check-ints-equal/disp32
1648
1649 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1650
1651 c3/return
1652
1653 == data
1654
1655 _test-slice-negative-two:
1656 2d/- 32/2
1657 _test-slice-negative-two-end:
1658 2f/slash 66/f 6f/o 6f/o
1659 _test-slice-negative-two-metadata-end:
1660
1661 _test-slice-non-number-word:
1662 78/x 79/y 7a/z
1663 _test-slice-non-number-word-end:
1664 2f/slash
1665 _test-slice-non-number-word-metadata-end:
1666
1667