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 == code
17
18
19
20
21 Entry:
22
23
24
25
26
27
28
29 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
30
31
32 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
33 7e/jump-if-lesser-or-equal $run-main/disp8
34
35
36 68/push "test"/imm32
37 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
38
39 e8/call kernel-string-equal?/disp32
40
41 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
42
43 3d/compare-EAX-and 1/imm32
44 75/jump-if-not-equal $run-main/disp8
45
46 e8/call run-tests/disp32
47 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
48 eb/jump $main:end/disp8
49 $run-main:
50
51
52 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
53 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
54
55
56 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
57
58
59 50/push-EAX/ed
60 68/push Stderr/imm32
61 68/push Stdout/imm32
62 68/push Stdin/imm32
63
64 e8/call convert/disp32
65
66 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
67
68 bb/copy-to-EBX 0/imm32
69 $main:end:
70 b8/copy-to-EAX 1/imm32/exit
71 cd/syscall 0x80/imm8
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93 convert:
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117 55/push-EBP
118 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
119
120 50/push-EAX
121 51/push-ECX
122 52/push-EDX
123 53/push-EBX
124
125 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
126 68/push 0x200/imm32/length
127 68/push 0/imm32/read
128 68/push 0/imm32/write
129 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
130
131 68/push 0/imm32/end
132 68/push 0/imm32/curr
133 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
134
135 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
136 $convert:loop:
137
138
139 51/push-ECX
140
141 e8/call clear-stream/disp32
142
143 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
144
145
146 51/push-ECX
147 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
148
149 e8/call read-line/disp32
150
151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
152 $convert:check0:
153
154 81 7/subop/compare 0/mod/indirect 1/rm32/ECX . . . . . 0/imm32
155 0f 84/jump-if-equal $convert:break/disp32
156 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
182
183
184 52/push-EDX
185 51/push-ECX
186
187 e8/call next-word/disp32
188
189 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
190 $convert:check1:
191
192
193
194 52/push-EDX
195
196 e8/call slice-empty?/disp32
197
198 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
199
200 3d/compare-EAX-and 0/imm32
201 0f 85/jump-if-not-equal $convert:pass-through/disp32
202 $convert:check2:
203 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
245
246
247
248
249
250
251 68/push "=="/imm32
252 52/push-EDX
253
254 e8/call slice-equal?/disp32
255
256 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
257
258 3d/compare-EAX-and 0/imm32
259 0f 84/jump-if-equal $convert:check3/disp32
260
261
262 52/push-EDX
263 51/push-ECX
264
265 e8/call next-word/disp32
266
267 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
268 +-- 42 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------
310
311
312 68/push "code"/imm32
313 52/push-EDX
314
315 e8/call slice-equal?/disp32
316
317 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
318
319 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
320
321 eb/jump $convert:pass-through/disp8
322 $convert:check3:
323
324
325
326 51/push-ECX
327
328 e8/call rewind-stream/disp32
329
330 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
331
332 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0/imm32
333 74/jump-if-equal $convert:data/disp8
334 $convert:code:
335
336
337 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
338 51/push-ECX
339
340 e8/call convert-instruction/disp32
341
342 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
343
344 e9/jump $convert:loop/disp32
345 $convert:data:
346
347
348 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
349 51/push-ECX
350
351 e8/call convert-data/disp32
352
353 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
354
355 e9/jump $convert:loop/disp32
356 $convert:pass-through:
357
358
359 51/push-ECX
360 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
361
362 e8/call write-stream-data/disp32
363
364 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
365
366 e9/jump $convert:loop/disp32
367 $convert:break:
368
369
370 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
371
372 e8/call flush/disp32
373
374 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
375 $convert:end:
376
377 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
378
379 5b/pop-to-EBX
380 5a/pop-to-EDX
381 59/pop-to-ECX
382 58/pop-to-EAX
383
384 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
385 5d/pop-to-EBP
386 c3/return
387
388 test-convert-passes-empty-lines-through:
389
390
391 55/push-EBP
392 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
393
394
395
396 68/push _test-input-stream/imm32
397
398 e8/call clear-stream/disp32
399
400 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
401
402
403 b8/copy-to-EAX _test-input-buffered-file/imm32
404 05/add-to-EAX 4/imm32
405 50/push-EAX
406
407 e8/call clear-stream/disp32
408
409 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
410
411
412 68/push _test-output-stream/imm32
413
414 e8/call clear-stream/disp32
415
416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
417
418
419 b8/copy-to-EAX _test-output-buffered-file/imm32
420 05/add-to-EAX 4/imm32
421 50/push-EAX
422
423 e8/call clear-stream/disp32
424
425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
426
427
428
429 68/push _test-output-buffered-file/imm32
430 68/push _test-input-buffered-file/imm32
431
432 e8/call convert/disp32
433
434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
435
436
437
438 68/push _test-output-buffered-file/imm32
439
440 e8/call flush/disp32
441
442 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
443
444
445 68/push "F - test-convert-passes-empty-lines-through"/imm32
446 68/push ""/imm32
447 68/push _test-output-stream/imm32
448
449 e8/call check-stream-equal/disp32
450
451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
452
453 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
454 5d/pop-to-EBP
455 c3/return
456
457 test-convert-passes-lines-with-just-whitespace-through:
458
459
460 55/push-EBP
461 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
462
463
464
465 68/push _test-input-stream/imm32
466
467 e8/call clear-stream/disp32
468
469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
470
471
472 b8/copy-to-EAX _test-input-buffered-file/imm32
473 05/add-to-EAX 4/imm32
474 50/push-EAX
475
476 e8/call clear-stream/disp32
477
478 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
479
480
481 68/push _test-output-stream/imm32
482
483 e8/call clear-stream/disp32
484
485 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
486
487
488 b8/copy-to-EAX _test-output-buffered-file/imm32
489 05/add-to-EAX 4/imm32
490 50/push-EAX
491
492 e8/call clear-stream/disp32
493
494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
495
496
497
498 68/push " "/imm32
499 68/push _test-input-stream/imm32
500
501 e8/call write/disp32
502
503 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
504
505
506 68/push _test-output-buffered-file/imm32
507 68/push _test-input-buffered-file/imm32
508
509 e8/call convert/disp32
510
511 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
512
513
514
515 68/push _test-output-buffered-file/imm32
516
517 e8/call flush/disp32
518
519 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
520
521
522 68/push "F - test-convert-passes-with-just-whitespace-through"/imm32
523 68/push " "/imm32
524 68/push _test-output-stream/imm32
525
526 e8/call check-next-stream-line-equal/disp32
527
528 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
529
530 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
531 5d/pop-to-EBP
532 c3/return
533
534 test-convert-passes-segment-headers-through:
535
536
537 55/push-EBP
538 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
539
540
541
542 68/push _test-input-stream/imm32
543
544 e8/call clear-stream/disp32
545
546 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
547
548
549 b8/copy-to-EAX _test-input-buffered-file/imm32
550 05/add-to-EAX 4/imm32
551 50/push-EAX
552
553 e8/call clear-stream/disp32
554
555 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
556
557
558 68/push _test-output-stream/imm32
559
560 e8/call clear-stream/disp32
561
562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
563
564
565 b8/copy-to-EAX _test-output-buffered-file/imm32
566 05/add-to-EAX 4/imm32
567 50/push-EAX
568
569 e8/call clear-stream/disp32
570
571 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
572
573
574
575 68/push "== abcd"/imm32
576 68/push _test-input-stream/imm32
577
578 e8/call write/disp32
579
580 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
581
582
583 68/push _test-output-buffered-file/imm32
584 68/push _test-input-buffered-file/imm32
585
586 e8/call convert/disp32
587
588 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
589
590
591
592 68/push _test-output-buffered-file/imm32
593
594 e8/call flush/disp32
595
596 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
597
598
599 68/push "F - test-convert-passes-segment-headers-through"/imm32
600 68/push "== abcd"/imm32
601 68/push _test-output-stream/imm32
602
603 e8/call check-stream-equal/disp32
604
605 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
606
607 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
608 5d/pop-to-EBP
609 c3/return
610
611 test-convert-in-data-segment:
612
613
614 55/push-EBP
615 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
616
617
618
619 68/push _test-input-stream/imm32
620
621 e8/call clear-stream/disp32
622
623 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
624
625
626 b8/copy-to-EAX _test-input-buffered-file/imm32
627 05/add-to-EAX 4/imm32
628 50/push-EAX
629
630 e8/call clear-stream/disp32
631
632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
633
634
635 68/push _test-output-stream/imm32
636
637 e8/call clear-stream/disp32
638
639 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
640
641
642 b8/copy-to-EAX _test-output-buffered-file/imm32
643 05/add-to-EAX 4/imm32
644 50/push-EAX
645
646 e8/call clear-stream/disp32
647
648 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
649
650
651
652
653
654
655 68/push "== code\n"/imm32
656 68/push _test-input-stream/imm32
657
658 e8/call write/disp32
659
660 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
661
662
663 68/push "== data\n"/imm32
664 68/push _test-input-stream/imm32
665
666 e8/call write/disp32
667
668 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
669
670
671 68/push "3 4/imm32\n"/imm32
672 68/push _test-input-stream/imm32
673
674 e8/call write/disp32
675
676 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
677
678
679 68/push _test-output-buffered-file/imm32
680 68/push _test-input-buffered-file/imm32
681
682 e8/call convert/disp32
683
684 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
685
686 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
712
713
714 68/push _test-output-buffered-file/imm32
715
716 e8/call flush/disp32
717
718 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
719
720
721 68/push "F - test-convert-in-data-segment/0"/imm32
722 68/push "== code"/imm32
723 68/push _test-output-stream/imm32
724
725 e8/call check-next-stream-line-equal/disp32
726
727 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
728
729
730 68/push "F - test-convert-in-data-segment/1"/imm32
731 68/push "== data"/imm32
732 68/push _test-output-stream/imm32
733
734 e8/call check-next-stream-line-equal/disp32
735
736 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
737
738
739 68/push "F - test-convert-in-data-segment/2"/imm32
740 68/push "03 04 00 00 00 "/imm32
741 68/push _test-output-stream/imm32
742
743 e8/call check-next-stream-line-equal/disp32
744
745 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
746
747 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
748 5d/pop-to-EBP
749 c3/return
750
751 test-convert-code-and-data-segments:
752
753
754 55/push-EBP
755 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
756
757
758
759 68/push _test-input-stream/imm32
760
761 e8/call clear-stream/disp32
762
763 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
764
765
766 b8/copy-to-EAX _test-input-buffered-file/imm32
767 05/add-to-EAX 4/imm32
768 50/push-EAX
769
770 e8/call clear-stream/disp32
771
772 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
773
774
775 68/push _test-output-stream/imm32
776
777 e8/call clear-stream/disp32
778
779 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
780
781
782 b8/copy-to-EAX _test-output-buffered-file/imm32
783 05/add-to-EAX 4/imm32
784 50/push-EAX
785
786 e8/call clear-stream/disp32
787
788 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
789
790
791
792
793
794
795
796
797 68/push "== code\n"/imm32
798 68/push _test-input-stream/imm32
799
800 e8/call write/disp32
801
802 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
803
804
805 68/push "e8/call 20/disp32\n"/imm32
806 68/push _test-input-stream/imm32
807
808 e8/call write/disp32
809
810 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
811
812
813 68/push "68/push 0x20/imm8\n"/imm32
814 68/push _test-input-stream/imm32
815
816 e8/call write/disp32
817
818 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
819
820
821 68/push "== data\n"/imm32
822 68/push _test-input-stream/imm32
823
824 e8/call write/disp32
825
826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
827
828
829 68/push "3 4/imm32\n"/imm32
830 68/push _test-input-stream/imm32
831
832 e8/call write/disp32
833
834 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
835
836
837 68/push _test-output-buffered-file/imm32
838 68/push _test-input-buffered-file/imm32
839
840 e8/call convert/disp32
841
842 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
843
844
845
846
847
848
849 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
875
876
877 68/push _test-output-buffered-file/imm32
878
879 e8/call flush/disp32
880
881 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
882
883
884 68/push "F - test-convert-code-and-data-segments/0"/imm32
885 68/push "== code"/imm32
886 68/push _test-output-stream/imm32
887
888 e8/call check-next-stream-line-equal/disp32
889
890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
891
892
893 68/push "F - test-convert-code-and-data-segments/1"/imm32
894 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
895 68/push _test-output-stream/imm32
896
897 e8/call check-next-stream-line-equal/disp32
898
899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
900
901
902 68/push "F - test-convert-code-and-data-segments/2"/imm32
903 68/push "68 20 # 68/push 0x20/imm8"/imm32
904 68/push _test-output-stream/imm32
905
906 e8/call check-next-stream-line-equal/disp32
907
908 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
909
910
911 68/push "F - test-convert-code-and-data-segments/3"/imm32
912 68/push "== data"/imm32
913 68/push _test-output-stream/imm32
914
915 e8/call check-next-stream-line-equal/disp32
916
917 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
918
919
920 68/push "F - test-convert-code-and-data-segments/4"/imm32
921 68/push "03 04 00 00 00 "/imm32
922 68/push _test-output-stream/imm32
923
924 e8/call check-next-stream-line-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 convert-data:
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
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 52/push-EDX
958
959 68/push 0/imm32/end
960 68/push 0/imm32/start
961 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
962 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
988 $convert-data:loop:
989
990
991 51/push-ECX
992 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
993
994 e8/call next-word/disp32
995
996 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
997 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
1039 $convert-data:check0:
1040
1041
1042
1043 51/push-ECX
1044
1045 e8/call slice-empty?/disp32
1046
1047 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1048
1049 3d/compare-EAX-and 0/imm32
1050 0f 85/jump-if-not-equal $convert-data:break/disp32
1051 $convert-data:check-for-comment:
1052
1053
1054 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
1055
1056 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1057 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
1058
1059 3d/compare-EAX-and 0x23/imm32/hash
1060 75/jump-if-not-equal $convert-data:check-for-label/disp8
1061 $convert-data:comment:
1062
1063
1064 51/push-ECX
1065 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1066
1067 e8/call write-slice/disp32
1068
1069 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1070
1071 75/jump-if-not-equal $convert-data:break/disp8
1072 $convert-data:check-for-label:
1073
1074
1075 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
1076
1077 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1078 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
1079
1080 3d/compare-EAX-and 0x3a/imm32/colon
1081 75/jump-if-not-equal $convert-data:check-for-imm32/disp8
1082 $convert-data:label:
1083
1084
1085 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1086 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1087
1088 e8/call write-stream-data/disp32
1089
1090 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1091
1092 75/jump-if-not-equal $convert-data:break/disp8
1093 $convert-data:check-for-imm32:
1094
1095
1096
1097 68/push "imm32"/imm32
1098 51/push-ECX
1099
1100 e8/call has-metadata?/disp32
1101
1102 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1103
1104 3d/compare-EAX-and 0/imm32
1105 74/jump-if-equal $convert-data:single-byte/disp8
1106 $convert-data:imm32:
1107
1108
1109 68/push 4/imm32
1110 51/push-ECX
1111 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1112
1113 e8/call emit/disp32
1114
1115 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1116 e9/jump $convert-data:loop/disp32
1117 $convert-data:single-byte:
1118
1119
1120 68/push 1/imm32
1121 51/push-ECX
1122 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1123
1124 e8/call emit/disp32
1125
1126 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1127 e9/jump $convert-data:loop/disp32
1128 $convert-data:break:
1129 $convert-data:end:
1130
1131 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1132
1133 5a/pop-to-EDX
1134 59/pop-to-ECX
1135 58/pop-to-EAX
1136
1137 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1138 5d/pop-to-EBP
1139 c3/return
1140
1141 test-convert-data-passes-comments-through:
1142
1143
1144 55/push-EBP
1145 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1146
1147
1148
1149 68/push _test-input-stream/imm32
1150
1151 e8/call clear-stream/disp32
1152
1153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1154
1155
1156 68/push _test-output-stream/imm32
1157
1158 e8/call clear-stream/disp32
1159
1160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1161
1162
1163 b8/copy-to-EAX _test-output-buffered-file/imm32
1164 05/add-to-EAX 4/imm32
1165 50/push-EAX
1166
1167 e8/call clear-stream/disp32
1168
1169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1170
1171
1172
1173 68/push "# abcd"/imm32
1174 68/push _test-input-stream/imm32
1175
1176 e8/call write/disp32
1177
1178 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1179
1180
1181 68/push _test-output-buffered-file/imm32
1182 68/push _test-input-stream/imm32
1183
1184 e8/call convert-data/disp32
1185
1186 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1187
1188
1189
1190 68/push _test-output-buffered-file/imm32
1191
1192 e8/call flush/disp32
1193
1194 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1195 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1221
1222
1223 68/push "F - test-convert-data-passes-comments-through"/imm32
1224 68/push "# abcd"/imm32
1225 68/push _test-output-stream/imm32
1226
1227 e8/call check-stream-equal/disp32
1228
1229 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1230
1231 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1232 5d/pop-to-EBP
1233 c3/return
1234
1235 test-convert-data-passes-labels-through:
1236
1237
1238 55/push-EBP
1239 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1240
1241
1242
1243 68/push _test-input-stream/imm32
1244
1245 e8/call clear-stream/disp32
1246
1247 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1248
1249
1250 68/push _test-output-stream/imm32
1251
1252 e8/call clear-stream/disp32
1253
1254 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1255
1256
1257 b8/copy-to-EAX _test-output-buffered-file/imm32
1258 05/add-to-EAX 4/imm32
1259 50/push-EAX
1260
1261 e8/call clear-stream/disp32
1262
1263 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1264
1265
1266
1267 68/push "ab: # cd"/imm32
1268 68/push _test-input-stream/imm32
1269
1270 e8/call write/disp32
1271
1272 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1273
1274
1275 68/push _test-output-buffered-file/imm32
1276 68/push _test-input-stream/imm32
1277
1278 e8/call convert-data/disp32
1279
1280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1281
1282
1283
1284 68/push _test-output-buffered-file/imm32
1285
1286 e8/call flush/disp32
1287
1288 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1289
1290
1291 68/push "F - test-convert-data-passes-labels-through"/imm32
1292 68/push "ab: # cd"/imm32
1293 68/push _test-output-stream/imm32
1294
1295 e8/call check-stream-equal/disp32
1296
1297 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1298
1299 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1300 5d/pop-to-EBP
1301 c3/return
1302
1303 test-convert-data-passes-names-through:
1304
1305
1306
1307 55/push-EBP
1308 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1309
1310
1311
1312 68/push _test-input-stream/imm32
1313
1314 e8/call clear-stream/disp32
1315
1316 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1317
1318
1319 68/push _test-output-stream/imm32
1320
1321 e8/call clear-stream/disp32
1322
1323 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1324
1325
1326 b8/copy-to-EAX _test-output-buffered-file/imm32
1327 05/add-to-EAX 4/imm32
1328 50/push-EAX
1329
1330 e8/call clear-stream/disp32
1331
1332 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1333
1334
1335
1336 68/push "abcd/imm32"/imm32
1337 68/push _test-input-stream/imm32
1338
1339 e8/call write/disp32
1340
1341 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1342
1343
1344 68/push _test-output-buffered-file/imm32
1345 68/push _test-input-stream/imm32
1346
1347 e8/call convert-data/disp32
1348
1349 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1350
1351
1352
1353 68/push _test-output-buffered-file/imm32
1354
1355 e8/call flush/disp32
1356
1357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1358
1359
1360 68/push "F - test-convert-data-passes-names-through"/imm32
1361 68/push "abcd/imm32 "/imm32
1362 68/push _test-output-stream/imm32
1363
1364 e8/call check-stream-equal/disp32
1365
1366 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1367
1368 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1369 5d/pop-to-EBP
1370 c3/return
1371
1372 test-convert-data-handles-imm32:
1373
1374
1375 55/push-EBP
1376 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1377
1378
1379
1380 68/push _test-input-stream/imm32
1381
1382 e8/call clear-stream/disp32
1383
1384 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1385
1386
1387 68/push _test-output-stream/imm32
1388
1389 e8/call clear-stream/disp32
1390
1391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1392
1393
1394 b8/copy-to-EAX _test-output-buffered-file/imm32
1395 05/add-to-EAX 4/imm32
1396 50/push-EAX
1397
1398 e8/call clear-stream/disp32
1399
1400 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1401
1402
1403
1404 68/push "30/imm32"/imm32
1405 68/push _test-input-stream/imm32
1406
1407 e8/call write/disp32
1408
1409 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1410
1411
1412 68/push _test-output-buffered-file/imm32
1413 68/push _test-input-stream/imm32
1414
1415 e8/call convert-data/disp32
1416
1417 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1418
1419
1420
1421 68/push _test-output-buffered-file/imm32
1422
1423 e8/call flush/disp32
1424
1425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1426
1427
1428 68/push "F - test-convert-data-handles-imm32"/imm32
1429 68/push "30 00 00 00 "/imm32
1430 68/push _test-output-stream/imm32
1431
1432 e8/call check-stream-equal/disp32
1433
1434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1435
1436 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1437 5d/pop-to-EBP
1438 c3/return
1439
1440 test-convert-data-handles-single-byte:
1441
1442
1443
1444 55/push-EBP
1445 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1446
1447
1448
1449 68/push _test-input-stream/imm32
1450
1451 e8/call clear-stream/disp32
1452
1453 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1454
1455
1456 68/push _test-output-stream/imm32
1457
1458 e8/call clear-stream/disp32
1459
1460 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1461
1462
1463 b8/copy-to-EAX _test-output-buffered-file/imm32
1464 05/add-to-EAX 4/imm32
1465 50/push-EAX
1466
1467 e8/call clear-stream/disp32
1468
1469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1470
1471
1472
1473 68/push "30/imm16"/imm32
1474 68/push _test-input-stream/imm32
1475
1476 e8/call write/disp32
1477
1478 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1479
1480
1481 68/push _test-output-buffered-file/imm32
1482 68/push _test-input-stream/imm32
1483
1484 e8/call convert-data/disp32
1485
1486 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1487
1488
1489
1490 68/push _test-output-buffered-file/imm32
1491
1492 e8/call flush/disp32
1493
1494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1495
1496
1497 68/push "F - test-convert-data-handles-single-byte"/imm32
1498 68/push "30 "/imm32
1499 68/push _test-output-stream/imm32
1500
1501 e8/call check-stream-equal/disp32
1502
1503 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1504
1505 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1506 5d/pop-to-EBP
1507 c3/return
1508
1509 test-convert-data-multiple-bytes:
1510
1511
1512 55/push-EBP
1513 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1514
1515
1516
1517 68/push _test-input-stream/imm32
1518
1519 e8/call clear-stream/disp32
1520
1521 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1522
1523
1524 68/push _test-output-stream/imm32
1525
1526 e8/call clear-stream/disp32
1527
1528 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1529
1530
1531 b8/copy-to-EAX _test-output-buffered-file/imm32
1532 05/add-to-EAX 4/imm32
1533 50/push-EAX
1534
1535 e8/call clear-stream/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1538
1539
1540
1541 68/push "1 2"/imm32
1542 68/push _test-input-stream/imm32
1543
1544 e8/call write/disp32
1545
1546 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1547
1548
1549 68/push _test-output-buffered-file/imm32
1550 68/push _test-input-stream/imm32
1551
1552 e8/call convert-data/disp32
1553
1554 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1555
1556
1557
1558 68/push _test-output-buffered-file/imm32
1559
1560 e8/call flush/disp32
1561
1562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1563
1564
1565 68/push "F - test-convert-data-multiple-bytes"/imm32
1566 68/push "01 02 "/imm32
1567 68/push _test-output-stream/imm32
1568
1569 e8/call check-stream-equal/disp32
1570
1571 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1572
1573 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1574 5d/pop-to-EBP
1575 c3/return
1576
1577 test-convert-data-byte-then-name:
1578
1579
1580 55/push-EBP
1581 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1582
1583
1584
1585 68/push _test-input-stream/imm32
1586
1587 e8/call clear-stream/disp32
1588
1589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1590
1591
1592 68/push _test-output-stream/imm32
1593
1594 e8/call clear-stream/disp32
1595
1596 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1597
1598
1599 b8/copy-to-EAX _test-output-buffered-file/imm32
1600 05/add-to-EAX 4/imm32
1601 50/push-EAX
1602
1603 e8/call clear-stream/disp32
1604
1605 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1606
1607
1608
1609 68/push "30 abcd/o"/imm32
1610 68/push _test-input-stream/imm32
1611
1612 e8/call write/disp32
1613
1614 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1615
1616
1617 68/push _test-output-buffered-file/imm32
1618 68/push _test-input-stream/imm32
1619
1620 e8/call convert-data/disp32
1621
1622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1623
1624
1625
1626 68/push _test-output-buffered-file/imm32
1627
1628 e8/call flush/disp32
1629
1630 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1631
1632
1633 68/push "F - test-convert-data-byte-then-name"/imm32
1634 68/push "30 abcd/o "/imm32
1635 68/push _test-output-stream/imm32
1636
1637 e8/call check-stream-equal/disp32
1638
1639 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1640
1641 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1642 5d/pop-to-EBP
1643 c3/return
1644
1645 test-convert-data-multiple-words:
1646
1647
1648 55/push-EBP
1649 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1650
1651
1652
1653 68/push _test-input-stream/imm32
1654
1655 e8/call clear-stream/disp32
1656
1657 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1658
1659
1660 68/push _test-output-stream/imm32
1661
1662 e8/call clear-stream/disp32
1663
1664 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1665
1666
1667 b8/copy-to-EAX _test-output-buffered-file/imm32
1668 05/add-to-EAX 4/imm32
1669 50/push-EAX
1670
1671 e8/call clear-stream/disp32
1672
1673 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1674
1675
1676
1677 68/push "30 abcd/o 42e1/imm32"/imm32
1678 68/push _test-input-stream/imm32
1679
1680 e8/call write/disp32
1681
1682 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1683
1684
1685 68/push _test-output-buffered-file/imm32
1686 68/push _test-input-stream/imm32
1687
1688 e8/call convert-data/disp32
1689
1690 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1691
1692
1693
1694 68/push _test-output-buffered-file/imm32
1695
1696 e8/call flush/disp32
1697
1698 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1699 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1725
1726
1727 68/push "F - test-convert-data-multiple-words"/imm32
1728 68/push "30 abcd/o e1 42 00 00 "/imm32
1729 68/push _test-output-stream/imm32
1730
1731 e8/call check-stream-equal/disp32
1732
1733 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1734
1735 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1736 5d/pop-to-EBP
1737 c3/return
1738
1739 test-convert-data-trailing-comment:
1740
1741
1742 55/push-EBP
1743 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1744
1745
1746
1747 68/push _test-input-stream/imm32
1748
1749 e8/call clear-stream/disp32
1750
1751 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1752
1753
1754 68/push _test-output-stream/imm32
1755
1756 e8/call clear-stream/disp32
1757
1758 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1759
1760
1761 b8/copy-to-EAX _test-output-buffered-file/imm32
1762 05/add-to-EAX 4/imm32
1763 50/push-EAX
1764
1765 e8/call clear-stream/disp32
1766
1767 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1768
1769
1770
1771 68/push "30/imm32 # comment"/imm32
1772 68/push _test-input-stream/imm32
1773
1774 e8/call write/disp32
1775
1776 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1777
1778
1779 68/push _test-output-buffered-file/imm32
1780 68/push _test-input-stream/imm32
1781
1782 e8/call convert-data/disp32
1783
1784 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1785
1786
1787
1788 68/push _test-output-buffered-file/imm32
1789
1790 e8/call flush/disp32
1791
1792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1793 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1819
1820
1821 68/push "F - test-convert-data-trailing-comment"/imm32
1822 68/push "30 00 00 00 # comment"/imm32
1823 68/push _test-output-stream/imm32
1824
1825 e8/call check-stream-equal/disp32
1826
1827 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1828
1829 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1830 5d/pop-to-EBP
1831 c3/return
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843 convert-instruction:
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865 55/push-EBP
1866 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1867
1868 50/push-EAX
1869 51/push-ECX
1870 52/push-EDX
1871
1872 68/push 0/imm32/end
1873 68/push 0/imm32/start
1874 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1875
1876
1877 51/push-ECX
1878 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1879
1880 e8/call next-word/disp32
1881
1882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1883 $convert-instruction:check0:
1884
1885
1886
1887 51/push-ECX
1888
1889 e8/call slice-empty?/disp32
1890
1891 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1892
1893 3d/compare-EAX-and 0/imm32
1894 75/jump-if-not-equal $convert-instruction:pass-through/disp8
1895 $convert-instruction:check1:
1896
1897
1898 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
1899
1900 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1901 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
1902
1903 3d/compare-EAX-and 0x23/imm32/hash
1904 74/jump-if-equal $convert-instruction:pass-through/disp8
1905 $convert-instruction:check2:
1906
1907
1908 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
1909
1910 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1911 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
1912
1913 3d/compare-EAX-and 0x3a/imm32/colon
1914 75/jump-if-not-equal $convert-instruction:really-convert/disp8
1915 $convert-instruction:pass-through:
1916
1917
1918 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1919 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1920
1921 e8/call write-stream-data/disp32
1922
1923 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1924
1925 eb/jump $convert-instruction:end/disp8
1926 $convert-instruction:really-convert:
1927
1928
1929 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1930 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1931
1932 e8/call emit-opcodes/disp32
1933
1934 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1935
1936
1937 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1938 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1939
1940 e8/call emit-modrm/disp32
1941
1942 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1943
1944
1945 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1946 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1947
1948 e8/call emit-sib/disp32
1949
1950 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1951
1952
1953 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1954 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1955
1956 e8/call emit-disp/disp32
1957
1958 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1959
1960
1961 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1962 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1963
1964 e8/call emit-imm/disp32
1965
1966 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1967
1968
1969 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1970 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1971
1972 e8/call emit-line-in-comment/disp32
1973
1974 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1975 $convert-instruction:end:
1976
1977 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1978
1979 5a/pop-to-EDX
1980 59/pop-to-ECX
1981 58/pop-to-EAX
1982
1983 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1984 5d/pop-to-EBP
1985 c3/return
1986
1987 emit-opcodes:
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021 55/push-EBP
2022 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2023
2024 50/push-EAX
2025 51/push-ECX
2026 52/push-EDX
2027 53/push-EBX
2028
2029 68/push 0/imm32/end
2030 68/push 0/imm32/start
2031 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2032
2033 68/push 0/imm32/end
2034 68/push 0/imm32/start
2035 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
2036
2037
2038 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2039
2040 e8/call rewind-stream/disp32
2041
2042 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2043 $emit-opcodes:op1:
2044
2045
2046 51/push-ECX
2047 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2048
2049 e8/call next-word/disp32
2050
2051 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2052
2053
2054
2055 51/push-ECX
2056
2057 e8/call slice-empty?/disp32
2058
2059 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2060
2061 3d/compare-EAX-and 0/imm32
2062 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2063
2064
2065 8b/copy 0/mod/indirect 1/rm32/ECX . . . 3/r32/EBX . .
2066
2067 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2068 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2069
2070 3d/compare-EAX-and 0x23/imm32/hash
2071 0f 84/jump-if-equal $emit-opcodes:end/disp32
2072
2073
2074 51/push-ECX
2075 68/push 0x2f/imm32/slash
2076 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 .
2077 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
2078
2079 e8/call next-token-from-slice/disp32
2080
2081 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2082
2083
2084 51/push-ECX
2085 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2086
2087 e8/call write-slice/disp32
2088
2089 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2090
2091
2092 68/push " "/imm32
2093 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2094
2095 e8/call write-buffered/disp32
2096
2097 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2098
2099
2100
2101 68/push "0f"/imm32
2102 51/push-ECX
2103
2104 e8/call slice-equal?/disp32
2105
2106 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2107
2108 3d/compare-EAX-and 0/imm32
2109 75/jump-if-not-equal $emit-opcodes:op2/disp8
2110
2111
2112
2113 68/push "f2"/imm32
2114 51/push-ECX
2115
2116 e8/call slice-equal?/disp32
2117
2118 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2119
2120 3d/compare-EAX-and 0/imm32
2121 75/jump-if-not-equal $emit-opcodes:op2/disp8
2122
2123
2124
2125 68/push "f3"/imm32
2126 51/push-ECX
2127
2128 e8/call slice-equal?/disp32
2129
2130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2131
2132 3d/compare-EAX-and 0/imm32
2133 75/jump-if-not-equal $emit-opcodes:op2/disp8
2134
2135 e9/jump $emit-opcodes:end/disp32
2136 $emit-opcodes:op2:
2137
2138
2139 52/push-EDX
2140 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2141
2142 e8/call next-word/disp32
2143
2144 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2145
2146
2147
2148 52/push-EDX
2149
2150 e8/call slice-empty?/disp32
2151
2152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2153
2154 3d/compare-EAX-and 0/imm32
2155 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2156
2157
2158 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2159
2160 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2161 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2162
2163 3d/compare-EAX-and 0x23/imm32/hash
2164 0f 84/jump-if-equal $emit-opcodes:end/disp32
2165
2166
2167 52/push-EDX
2168 68/push 0x2f/imm32/slash
2169 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2170 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2171
2172 e8/call next-token-from-slice/disp32
2173
2174 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2175
2176
2177 52/push-EDX
2178 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2179
2180 e8/call write-slice/disp32
2181
2182 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2183
2184
2185 68/push " "/imm32
2186 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2187
2188 e8/call write-buffered/disp32
2189
2190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2191
2192
2193
2194 68/push "0f"/imm32
2195 51/push-ECX
2196
2197 e8/call slice-equal?/disp32
2198
2199 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2200
2201 3d/compare-EAX-and 0/imm32
2202 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2203
2204
2205
2206 68/push "0f"/imm32
2207 52/push-EDX
2208
2209 e8/call slice-equal?/disp32
2210
2211 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2212
2213 3d/compare-EAX-and 0/imm32
2214 0f 84/jump-if-equal $emit-opcodes:end/disp32
2215 $emit-opcodes:op3:
2216
2217
2218 52/push-EDX
2219 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2220
2221 e8/call next-word/disp32
2222
2223 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2224
2225
2226
2227 52/push-EDX
2228
2229 e8/call slice-empty?/disp32
2230
2231 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2232
2233 3d/compare-EAX-and 0/imm32
2234 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2235
2236
2237 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2238
2239 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2240 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2241
2242 3d/compare-EAX-and 0x23/imm32/hash
2243 0f 84/jump-if-equal $emit-opcodes:end/disp32
2244
2245
2246 52/push-EDX
2247 68/push 0x2f/imm32/slash
2248 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2249 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2250
2251 e8/call next-token-from-slice/disp32
2252
2253 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2254
2255
2256 52/push-EDX
2257 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2258
2259 e8/call write-slice/disp32
2260
2261 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2262
2263
2264 68/push " "/imm32
2265 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2266
2267 e8/call write-buffered/disp32
2268
2269 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2270 $emit-opcodes:end:
2271
2272 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2273
2274 5b/pop-to-EBX
2275 5a/pop-to-EDX
2276 59/pop-to-ECX
2277 58/pop-to-EAX
2278
2279 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2280 5d/pop-to-EBP
2281 c3/return
2282
2283 emit-modrm:
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310 55/push-EBP
2311 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2312
2313 50/push-EAX
2314 51/push-ECX
2315 52/push-EDX
2316 53/push-EBX
2317 56/push-ESI
2318 57/push-EDI
2319
2320 68/push 0/imm32/end
2321 68/push 0/imm32/start
2322 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2323
2324 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2325
2326 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2327
2328 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2329
2330 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2331
2332
2333 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2334
2335 e8/call rewind-stream/disp32
2336
2337 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2338 $emit-modrm:loop:
2339 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2365
2366
2367 51/push-ECX
2368 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2369
2370 e8/call next-word/disp32
2371
2372 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2373 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2415 $emit-modrm:check0:
2416
2417
2418
2419 51/push-ECX
2420
2421 e8/call slice-empty?/disp32
2422
2423 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2424
2425 3d/compare-EAX-and 0/imm32
2426 0f 85/jump-if-not-equal $emit-modrm:break/disp32
2427 $emit-modrm:check1:
2428
2429
2430 52/push-EDX
2431
2432 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2433
2434 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2435 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2436
2437 5a/pop-to-EDX
2438
2439 3d/compare-EAX-and 0x23/imm32/hash
2440 0f 84/jump-if-equal $emit-modrm:break/disp32
2441 $emit-modrm:check-for-mod:
2442
2443
2444
2445 68/push "mod"/imm32
2446 51/push-ECX
2447
2448 e8/call has-metadata?/disp32
2449
2450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2451
2452 3d/compare-EAX-and 0/imm32
2453 74/jump-if-equal $emit-modrm:check-for-rm32/disp8
2454 $emit-modrm:mod:
2455
2456
2457
2458 51/push-ECX
2459
2460 e8/call parse-datum-of-word/disp32
2461
2462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2463
2464 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2465
2466 ba/copy-to-EDX 1/imm32/true
2467
2468 e9/jump $emit-modrm:loop/disp32
2469 $emit-modrm:check-for-rm32:
2470
2471
2472
2473 68/push "rm32"/imm32
2474 51/push-ECX
2475
2476 e8/call has-metadata?/disp32
2477
2478 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2479
2480 3d/compare-EAX-and 0/imm32
2481 74/jump-if-equal $emit-modrm:check-for-r32/disp8
2482 $emit-modrm:rm32:
2483
2484
2485
2486 51/push-ECX
2487
2488 e8/call parse-datum-of-word/disp32
2489
2490 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2491
2492 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2493
2494 ba/copy-to-EDX 1/imm32/true
2495
2496 e9/jump $emit-modrm:loop/disp32
2497 $emit-modrm:check-for-r32:
2498
2499
2500
2501 68/push "r32"/imm32
2502 51/push-ECX
2503
2504 e8/call has-metadata?/disp32
2505
2506 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2507
2508 3d/compare-EAX-and 0/imm32
2509 74/jump-if-equal $emit-modrm:check-for-subop/disp8
2510 $emit-modrm:r32:
2511
2512
2513
2514 51/push-ECX
2515
2516 e8/call parse-datum-of-word/disp32
2517
2518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2519
2520 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2521
2522 ba/copy-to-EDX 1/imm32/true
2523
2524 e9/jump $emit-modrm:loop/disp32
2525 $emit-modrm:check-for-subop:
2526
2527
2528
2529 68/push "subop"/imm32
2530 51/push-ECX
2531
2532 e8/call has-metadata?/disp32
2533
2534 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2535
2536 3d/compare-EAX-and 0/imm32
2537 0f 84/jump-if-equal $emit-modrm:loop/disp32
2538 $emit-modrm:subop:
2539
2540
2541
2542 51/push-ECX
2543
2544 e8/call parse-datum-of-word/disp32
2545
2546 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2547
2548 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2549
2550 ba/copy-to-EDX 1/imm32/true
2551
2552 e9/jump $emit-modrm:loop/disp32
2553 $emit-modrm:break:
2554
2555 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
2556 74/jump-if-equal $emit-modrm:end/disp8
2557 $emit-modrm:calculate:
2558
2559 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
2560
2561 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 2/imm8
2562
2563 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
2564 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
2565
2566 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2567
2568 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
2569 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
2570 $emit-modrm:emit:
2571
2572
2573 68/push 1/imm32
2574 53/push-EBX
2575 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2576
2577 e8/call emit-hex/disp32
2578
2579 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2580 $emit-modrm:end:
2581
2582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2583
2584 5f/pop-to-EDI
2585 5e/pop-to-ESI
2586 5b/pop-to-EBX
2587 5a/pop-to-EDX
2588 59/pop-to-ECX
2589 58/pop-to-EAX
2590
2591 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2592 5d/pop-to-EBP
2593 c3/return
2594
2595 emit-sib:
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621 55/push-EBP
2622 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2623
2624 50/push-EAX
2625 51/push-ECX
2626 52/push-EDX
2627 53/push-EBX
2628 56/push-ESI
2629 57/push-EDI
2630
2631 68/push 0/imm32/end
2632 68/push 0/imm32/start
2633 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2634
2635 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2636
2637 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2638
2639 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2640
2641 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2642
2643
2644 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2645
2646 e8/call rewind-stream/disp32
2647
2648 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2649 $emit-sib:loop:
2650 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2676
2677
2678 51/push-ECX
2679 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2680
2681 e8/call next-word/disp32
2682
2683 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2684 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2726 $emit-sib:check0:
2727
2728
2729
2730 51/push-ECX
2731
2732 e8/call slice-empty?/disp32
2733
2734 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2735
2736 3d/compare-EAX-and 0/imm32
2737 0f 85/jump-if-not-equal $emit-sib:break/disp32
2738 $emit-sib:check1:
2739
2740
2741 52/push-EDX
2742
2743 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2744
2745 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2746 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2747
2748 5a/pop-to-EDX
2749
2750 3d/compare-EAX-and 0x23/imm32/hash
2751 0f 84/jump-if-equal $emit-sib:break/disp32
2752 $emit-sib:check-for-scale:
2753
2754
2755
2756 68/push "scale"/imm32
2757 51/push-ECX
2758
2759 e8/call has-metadata?/disp32
2760
2761 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2762
2763 3d/compare-EAX-and 0/imm32
2764 74/jump-if-equal $emit-sib:check-for-base/disp8
2765 $emit-sib:scale:
2766
2767
2768
2769 51/push-ECX
2770
2771 e8/call parse-datum-of-word/disp32
2772
2773 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2774
2775 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2776
2777 ba/copy-to-EDX 1/imm32/true
2778
2779 e9/jump $emit-sib:loop/disp32
2780 $emit-sib:check-for-base:
2781
2782
2783
2784 68/push "base"/imm32
2785 51/push-ECX
2786
2787 e8/call has-metadata?/disp32
2788
2789 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2790
2791 3d/compare-EAX-and 0/imm32
2792 74/jump-if-equal $emit-sib:check-for-index/disp8
2793 $emit-sib:base:
2794
2795
2796
2797 51/push-ECX
2798
2799 e8/call parse-datum-of-word/disp32
2800
2801 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2802
2803 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2804
2805 ba/copy-to-EDX 1/imm32/true
2806
2807 e9/jump $emit-sib:loop/disp32
2808 $emit-sib:check-for-index:
2809
2810
2811
2812 68/push "index"/imm32
2813 51/push-ECX
2814
2815 e8/call has-metadata?/disp32
2816
2817 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2818
2819 3d/compare-EAX-and 0/imm32
2820 0f 84/jump-if-equal $emit-sib:loop/disp32
2821 $emit-sib:index:
2822
2823
2824
2825 51/push-ECX
2826
2827 e8/call parse-datum-of-word/disp32
2828
2829 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2830
2831 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2832
2833 ba/copy-to-EDX 1/imm32/true
2834
2835 e9/jump $emit-sib:loop/disp32
2836 $emit-sib:break:
2837
2838 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
2839 74/jump-if-equal $emit-sib:end/disp8
2840 $emit-sib:calculate:
2841
2842 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
2843
2844 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 2/imm8
2845
2846 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
2847 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
2848
2849 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2850
2851 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
2852 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
2853 $emit-sib:emit:
2854
2855
2856 68/push 1/imm32
2857 53/push-EBX
2858 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2859
2860 e8/call emit-hex/disp32
2861
2862 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2863 $emit-sib:end:
2864
2865 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2866
2867 5f/pop-to-EDI
2868 5e/pop-to-ESI
2869 5b/pop-to-EBX
2870 5a/pop-to-EDX
2871 59/pop-to-ECX
2872 58/pop-to-EAX
2873
2874 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2875 5d/pop-to-EBP
2876 c3/return
2877
2878 emit-disp:
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897 55/push-EBP
2898 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2899
2900 50/push-EAX
2901 51/push-ECX
2902 52/push-EDX
2903
2904 68/push 0/imm32/end
2905 68/push 0/imm32/start
2906 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2907
2908
2909 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2910
2911 e8/call rewind-stream/disp32
2912
2913 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2914 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2940 $emit-disp:loop:
2941
2942
2943 51/push-ECX
2944 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2945
2946 e8/call next-word/disp32
2947
2948 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2949 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2991 $emit-disp:check0:
2992
2993
2994
2995 51/push-ECX
2996
2997 e8/call slice-empty?/disp32
2998
2999 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3000
3001 3d/compare-EAX-and 0/imm32
3002 0f 85/jump-if-not-equal $emit-disp:break/disp32
3003 $emit-disp:check1:
3004
3005
3006 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3007
3008 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3009 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3010
3011 3d/compare-EAX-and 0x23/imm32/hash
3012 0f 84/jump-if-equal $emit-disp:break/disp32
3013 $emit-disp:check-for-disp32:
3014
3015
3016
3017 68/push "disp32"/imm32
3018 51/push-ECX
3019
3020 e8/call has-metadata?/disp32
3021
3022 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3023
3024 3d/compare-EAX-and 0/imm32
3025 74/jump-if-equal $emit-disp:check-for-disp16/disp8
3026 $emit-disp:disp32:
3027
3028
3029 68/push 4/imm32
3030 51/push-ECX
3031 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3032
3033 e8/call emit/disp32
3034
3035 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3036
3037 e9/jump $emit-disp:break/disp32
3038 $emit-disp:check-for-disp16:
3039
3040
3041
3042 68/push "disp16"/imm32
3043 51/push-ECX
3044
3045 e8/call has-metadata?/disp32
3046
3047 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3048
3049 3d/compare-EAX-and 0/imm32
3050 74/jump-if-equal $emit-disp:check-for-disp8/disp8
3051 $emit-disp:disp16:
3052
3053
3054 68/push 2/imm32
3055 51/push-ECX
3056 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3057
3058 e8/call emit/disp32
3059
3060 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3061
3062 e9/jump $emit-disp:break/disp32
3063 $emit-disp:check-for-disp8:
3064
3065
3066
3067 68/push "disp8"/imm32
3068 51/push-ECX
3069
3070 e8/call has-metadata?/disp32
3071
3072 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3073
3074 3d/compare-EAX-and 0/imm32
3075 0f 84/jump-if-equal $emit-disp:loop/disp32
3076 $emit-disp:disp8:
3077
3078
3079 68/push 1/imm32
3080 51/push-ECX
3081 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3082
3083 e8/call emit/disp32
3084
3085 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3086
3087 $emit-disp:break:
3088
3089 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3090
3091 5a/pop-to-EDX
3092 59/pop-to-ECX
3093 58/pop-to-EAX
3094
3095 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3096 5d/pop-to-EBP
3097 c3/return
3098
3099 emit-imm:
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118 55/push-EBP
3119 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3120
3121 50/push-EAX
3122 51/push-ECX
3123 52/push-EDX
3124
3125 68/push 0/imm32/end
3126 68/push 0/imm32/start
3127 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3128
3129
3130 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3131
3132 e8/call rewind-stream/disp32
3133
3134 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3135 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
3161 $emit-imm:loop:
3162
3163
3164 51/push-ECX
3165 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3166
3167 e8/call next-word/disp32
3168
3169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3170 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3212 $emit-imm:check0:
3213
3214
3215
3216 51/push-ECX
3217
3218 e8/call slice-empty?/disp32
3219
3220 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3221
3222 3d/compare-EAX-and 0/imm32
3223 0f 85/jump-if-not-equal $emit-imm:break/disp32
3224 $emit-imm:check1:
3225
3226
3227 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3228
3229 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3230 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3231
3232 3d/compare-EAX-and 0x23/imm32/hash
3233 0f 84/jump-if-equal $emit-imm:break/disp32
3234 $emit-imm:check-for-imm32:
3235
3236
3237
3238 68/push "imm32"/imm32
3239 51/push-ECX
3240
3241 e8/call has-metadata?/disp32
3242
3243 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3244
3245 3d/compare-EAX-and 0/imm32
3246 74/jump-if-equal $emit-imm:check-for-imm16/disp8
3247 $emit-imm:imm32:
3248
3249
3250 68/push 4/imm32
3251 51/push-ECX
3252 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3253
3254 e8/call emit/disp32
3255
3256 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3257
3258 e9/jump $emit-imm:break/disp32
3259 $emit-imm:check-for-imm16:
3260
3261
3262
3263 68/push "imm16"/imm32
3264 51/push-ECX
3265
3266 e8/call has-metadata?/disp32
3267
3268 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3269
3270 3d/compare-EAX-and 0/imm32
3271 74/jump-if-equal $emit-imm:check-for-imm8/disp8
3272 $emit-imm:imm16:
3273
3274
3275 68/push 2/imm32
3276 51/push-ECX
3277 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3278
3279 e8/call emit/disp32
3280
3281 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3282
3283 e9/jump $emit-imm:break/disp32
3284 $emit-imm:check-for-imm8:
3285
3286
3287
3288 68/push "imm8"/imm32
3289 51/push-ECX
3290
3291 e8/call has-metadata?/disp32
3292
3293 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3294
3295 3d/compare-EAX-and 0/imm32
3296 0f 84/jump-if-equal $emit-imm:loop/disp32
3297 $emit-imm:imm8:
3298
3299
3300 68/push 1/imm32
3301 51/push-ECX
3302 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3303
3304 e8/call emit/disp32
3305
3306 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3307
3308 $emit-imm:break:
3309
3310 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3311
3312 5a/pop-to-EDX
3313 59/pop-to-ECX
3314 58/pop-to-EAX
3315
3316 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3317 5d/pop-to-EBP
3318 c3/return
3319
3320 emit-line-in-comment:
3321
3322 55/push-EBP
3323 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3324
3325
3326 68/push " # "/imm32
3327 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3328
3329 e8/call write-buffered/disp32
3330
3331 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3332
3333
3334 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3335 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3336
3337 e8/call write-stream-data/disp32
3338
3339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3340 $emit-line-in-comment:end:
3341
3342 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3343 5d/pop-to-EBP
3344 c3/return
3345
3346 test-convert-instruction-passes-comments-through:
3347
3348
3349 55/push-EBP
3350 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3351
3352
3353
3354 68/push _test-input-stream/imm32
3355
3356 e8/call clear-stream/disp32
3357
3358 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3359
3360
3361 68/push _test-output-stream/imm32
3362
3363 e8/call clear-stream/disp32
3364
3365 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3366
3367
3368 b8/copy-to-EAX _test-output-buffered-file/imm32
3369 05/add-to-EAX 4/imm32
3370 50/push-EAX
3371
3372 e8/call clear-stream/disp32
3373
3374 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3375
3376
3377
3378 68/push "# abcd"/imm32
3379 68/push _test-input-stream/imm32
3380
3381 e8/call write/disp32
3382
3383 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3384
3385
3386 68/push _test-output-buffered-file/imm32
3387 68/push _test-input-stream/imm32
3388
3389 e8/call convert-instruction/disp32
3390
3391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3392
3393
3394
3395 68/push _test-output-buffered-file/imm32
3396
3397 e8/call flush/disp32
3398
3399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3400
3401
3402 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3403 68/push "# abcd"/imm32
3404 68/push _test-output-stream/imm32
3405
3406 e8/call check-stream-equal/disp32
3407
3408 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3409
3410 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3411 5d/pop-to-EBP
3412 c3/return
3413
3414 test-convert-instruction-passes-labels-through:
3415
3416
3417 55/push-EBP
3418 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3419
3420
3421
3422 68/push _test-input-stream/imm32
3423
3424 e8/call clear-stream/disp32
3425
3426 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3427
3428
3429 68/push _test-output-stream/imm32
3430
3431 e8/call clear-stream/disp32
3432
3433 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3434
3435
3436 b8/copy-to-EAX _test-output-buffered-file/imm32
3437 05/add-to-EAX 4/imm32
3438 50/push-EAX
3439
3440 e8/call clear-stream/disp32
3441
3442 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3443
3444
3445
3446 68/push "ab: # cd"/imm32
3447 68/push _test-input-stream/imm32
3448
3449 e8/call write/disp32
3450
3451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3452
3453
3454 68/push _test-output-buffered-file/imm32
3455 68/push _test-input-stream/imm32
3456
3457 e8/call convert-instruction/disp32
3458
3459 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3460
3461
3462
3463 68/push _test-output-buffered-file/imm32
3464
3465 e8/call flush/disp32
3466
3467 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3468
3469
3470 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3471 68/push "ab: # cd"/imm32
3472 68/push _test-output-stream/imm32
3473
3474 e8/call check-stream-equal/disp32
3475
3476 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3477
3478 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3479 5d/pop-to-EBP
3480 c3/return
3481
3482 test-convert-instruction-handles-single-opcode:
3483
3484
3485 55/push-EBP
3486 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3487
3488
3489
3490 68/push _test-input-stream/imm32
3491
3492 e8/call clear-stream/disp32
3493
3494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3495
3496
3497 68/push _test-output-stream/imm32
3498
3499 e8/call clear-stream/disp32
3500
3501 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3502
3503
3504 b8/copy-to-EAX _test-output-buffered-file/imm32
3505 05/add-to-EAX 4/imm32
3506 50/push-EAX
3507
3508 e8/call clear-stream/disp32
3509
3510 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3511
3512
3513
3514 68/push "ab/cd # comment"/imm32
3515 68/push _test-input-stream/imm32
3516
3517 e8/call write/disp32
3518
3519 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3520
3521
3522 68/push _test-output-buffered-file/imm32
3523 68/push _test-input-stream/imm32
3524
3525 e8/call convert-instruction/disp32
3526
3527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3528
3529
3530
3531 68/push _test-output-buffered-file/imm32
3532
3533 e8/call flush/disp32
3534
3535 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3536 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3562
3563
3564 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3565 68/push "ab # ab/cd # comment"/imm32
3566 68/push _test-output-stream/imm32
3567
3568 e8/call check-stream-equal/disp32
3569
3570 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3571
3572 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3573 5d/pop-to-EBP
3574 c3/return
3575
3576 test-convert-instruction-handles-0f-opcode:
3577
3578
3579 55/push-EBP
3580 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3581
3582
3583
3584 68/push _test-input-stream/imm32
3585
3586 e8/call clear-stream/disp32
3587
3588 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3589
3590
3591 68/push _test-output-stream/imm32
3592
3593 e8/call clear-stream/disp32
3594
3595 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3596
3597
3598 b8/copy-to-EAX _test-output-buffered-file/imm32
3599 05/add-to-EAX 4/imm32
3600 50/push-EAX
3601
3602 e8/call clear-stream/disp32
3603
3604 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3605
3606
3607
3608 68/push "0f/m1 ab/m2 # comment"/imm32
3609 68/push _test-input-stream/imm32
3610
3611 e8/call write/disp32
3612
3613 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3614
3615
3616 68/push _test-output-buffered-file/imm32
3617 68/push _test-input-stream/imm32
3618
3619 e8/call convert-instruction/disp32
3620
3621 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3622
3623
3624
3625 68/push _test-output-buffered-file/imm32
3626
3627 e8/call flush/disp32
3628
3629 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3630 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3656
3657
3658 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3659 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3660 68/push _test-output-stream/imm32
3661
3662 e8/call check-stream-equal/disp32
3663
3664 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3665
3666 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3667 5d/pop-to-EBP
3668 c3/return
3669
3670 test-convert-instruction-handles-f2-opcode:
3671
3672
3673 55/push-EBP
3674 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3675
3676
3677
3678 68/push _test-input-stream/imm32
3679
3680 e8/call clear-stream/disp32
3681
3682 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3683
3684
3685 68/push _test-output-stream/imm32
3686
3687 e8/call clear-stream/disp32
3688
3689 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3690
3691
3692 b8/copy-to-EAX _test-output-buffered-file/imm32
3693 05/add-to-EAX 4/imm32
3694 50/push-EAX
3695
3696 e8/call clear-stream/disp32
3697
3698 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3699
3700
3701
3702 68/push "f2/m1 ab/m2 # comment"/imm32
3703 68/push _test-input-stream/imm32
3704
3705 e8/call write/disp32
3706
3707 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3708
3709
3710 68/push _test-output-buffered-file/imm32
3711 68/push _test-input-stream/imm32
3712
3713 e8/call convert-instruction/disp32
3714
3715 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3716
3717
3718
3719 68/push _test-output-buffered-file/imm32
3720
3721 e8/call flush/disp32
3722
3723 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3724 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3750
3751
3752 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3753 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3754 68/push _test-output-stream/imm32
3755
3756 e8/call check-stream-equal/disp32
3757
3758 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3759
3760 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3761 5d/pop-to-EBP
3762 c3/return
3763
3764 test-convert-instruction-handles-f3-opcode:
3765
3766
3767 55/push-EBP
3768 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3769
3770
3771
3772 68/push _test-input-stream/imm32
3773
3774 e8/call clear-stream/disp32
3775
3776 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3777
3778
3779 68/push _test-output-stream/imm32
3780
3781 e8/call clear-stream/disp32
3782
3783 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3784
3785
3786 b8/copy-to-EAX _test-output-buffered-file/imm32
3787 05/add-to-EAX 4/imm32
3788 50/push-EAX
3789
3790 e8/call clear-stream/disp32
3791
3792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3793
3794
3795
3796 68/push "f3/m1 ab/m2 # comment"/imm32
3797 68/push _test-input-stream/imm32
3798
3799 e8/call write/disp32
3800
3801 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3802
3803
3804 68/push _test-output-buffered-file/imm32
3805 68/push _test-input-stream/imm32
3806
3807 e8/call convert-instruction/disp32
3808
3809 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3810
3811
3812
3813 68/push _test-output-buffered-file/imm32
3814
3815 e8/call flush/disp32
3816
3817 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3818 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3844
3845
3846 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3847 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3848 68/push _test-output-stream/imm32
3849
3850 e8/call check-stream-equal/disp32
3851
3852 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3853
3854 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3855 5d/pop-to-EBP
3856 c3/return
3857
3858 test-convert-instruction-handles-f2-0f-opcode:
3859
3860
3861 55/push-EBP
3862 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3863
3864
3865
3866 68/push _test-input-stream/imm32
3867
3868 e8/call clear-stream/disp32
3869
3870 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3871
3872
3873 68/push _test-output-stream/imm32
3874
3875 e8/call clear-stream/disp32
3876
3877 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3878
3879
3880 b8/copy-to-EAX _test-output-buffered-file/imm32
3881 05/add-to-EAX 4/imm32
3882 50/push-EAX
3883
3884 e8/call clear-stream/disp32
3885
3886 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3887
3888
3889
3890 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
3891 68/push _test-input-stream/imm32
3892
3893 e8/call write/disp32
3894
3895 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3896
3897
3898 68/push _test-output-buffered-file/imm32
3899 68/push _test-input-stream/imm32
3900
3901 e8/call convert-instruction/disp32
3902
3903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3904
3905
3906
3907 68/push _test-output-buffered-file/imm32
3908
3909 e8/call flush/disp32
3910
3911 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3912 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3938
3939
3940 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
3941 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
3942 68/push _test-output-stream/imm32
3943
3944 e8/call check-stream-equal/disp32
3945
3946 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3947
3948 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3949 5d/pop-to-EBP
3950 c3/return
3951
3952 test-convert-instruction-handles-f3-0f-opcode:
3953
3954
3955 55/push-EBP
3956 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3957
3958
3959
3960 68/push _test-input-stream/imm32
3961
3962 e8/call clear-stream/disp32
3963
3964 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3965
3966
3967 68/push _test-output-stream/imm32
3968
3969 e8/call clear-stream/disp32
3970
3971 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3972
3973
3974 b8/copy-to-EAX _test-output-buffered-file/imm32
3975 05/add-to-EAX 4/imm32
3976 50/push-EAX
3977
3978 e8/call clear-stream/disp32
3979
3980 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3981
3982
3983
3984 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
3985 68/push _test-input-stream/imm32
3986
3987 e8/call write/disp32
3988
3989 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3990
3991
3992 68/push _test-output-buffered-file/imm32
3993 68/push _test-input-stream/imm32
3994
3995 e8/call convert-instruction/disp32
3996
3997 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3998
3999
4000
4001 68/push _test-output-buffered-file/imm32
4002
4003 e8/call flush/disp32
4004
4005 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4006 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4032
4033
4034 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
4035 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
4036 68/push _test-output-stream/imm32
4037
4038 e8/call check-stream-equal/disp32
4039
4040 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4041
4042 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4043 5d/pop-to-EBP
4044 c3/return
4045
4046 test-convert-instruction-handles-unused-opcodes:
4047
4048
4049 55/push-EBP
4050 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4051
4052
4053
4054 68/push _test-input-stream/imm32
4055
4056 e8/call clear-stream/disp32
4057
4058 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4059
4060
4061 68/push _test-output-stream/imm32
4062
4063 e8/call clear-stream/disp32
4064
4065 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4066
4067
4068 b8/copy-to-EAX _test-output-buffered-file/imm32
4069 05/add-to-EAX 4/imm32
4070 50/push-EAX
4071
4072 e8/call clear-stream/disp32
4073
4074 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4075
4076
4077
4078 68/push "ab/m1 cd/m2 # comment"/imm32
4079 68/push _test-input-stream/imm32
4080
4081 e8/call write/disp32
4082
4083 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4084
4085
4086 68/push _test-output-buffered-file/imm32
4087 68/push _test-input-stream/imm32
4088
4089 e8/call convert-instruction/disp32
4090
4091 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4092
4093
4094
4095 68/push _test-output-buffered-file/imm32
4096
4097 e8/call flush/disp32
4098
4099 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4100 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4126
4127
4128 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4129 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4130 68/push _test-output-stream/imm32
4131
4132 e8/call check-stream-equal/disp32
4133
4134 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4135
4136 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4137 5d/pop-to-EBP
4138 c3/return
4139
4140 test-convert-instruction-handles-unused-second-opcodes:
4141
4142
4143 55/push-EBP
4144 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4145
4146
4147
4148 68/push _test-input-stream/imm32
4149
4150 e8/call clear-stream/disp32
4151
4152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4153
4154
4155 68/push _test-output-stream/imm32
4156
4157 e8/call clear-stream/disp32
4158
4159 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4160
4161
4162 b8/copy-to-EAX _test-output-buffered-file/imm32
4163 05/add-to-EAX 4/imm32
4164 50/push-EAX
4165
4166 e8/call clear-stream/disp32
4167
4168 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4169
4170
4171
4172 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4173 68/push _test-input-stream/imm32
4174
4175 e8/call write/disp32
4176
4177 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4178
4179
4180 68/push _test-output-buffered-file/imm32
4181 68/push _test-input-stream/imm32
4182
4183 e8/call convert-instruction/disp32
4184
4185 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4186
4187
4188
4189 68/push _test-output-buffered-file/imm32
4190
4191 e8/call flush/disp32
4192
4193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4194 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4220
4221
4222 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4223 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4224 68/push _test-output-stream/imm32
4225
4226 e8/call check-stream-equal/disp32
4227
4228 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4229
4230 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4231 5d/pop-to-EBP
4232 c3/return
4233
4234 test-convert-instruction-handles-unused-second-opcodes-2:
4235
4236
4237 55/push-EBP
4238 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4239
4240
4241
4242 68/push _test-input-stream/imm32
4243
4244 e8/call clear-stream/disp32
4245
4246 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4247
4248
4249 68/push _test-output-stream/imm32
4250
4251 e8/call clear-stream/disp32
4252
4253 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4254
4255
4256 b8/copy-to-EAX _test-output-buffered-file/imm32
4257 05/add-to-EAX 4/imm32
4258 50/push-EAX
4259
4260 e8/call clear-stream/disp32
4261
4262 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4263
4264
4265
4266 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4267 68/push _test-input-stream/imm32
4268
4269 e8/call write/disp32
4270
4271 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4272
4273
4274 68/push _test-output-buffered-file/imm32
4275 68/push _test-input-stream/imm32
4276
4277 e8/call convert-instruction/disp32
4278
4279 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4280
4281
4282
4283 68/push _test-output-buffered-file/imm32
4284
4285 e8/call flush/disp32
4286
4287 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4288 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4314
4315
4316 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4317 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4318 68/push _test-output-stream/imm32
4319
4320 e8/call check-stream-equal/disp32
4321
4322 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4323
4324 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4325 5d/pop-to-EBP
4326 c3/return
4327
4328 test-convert-instruction-emits-modrm-byte:
4329
4330
4331 55/push-EBP
4332 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4333
4334
4335
4336 68/push _test-input-stream/imm32
4337
4338 e8/call clear-stream/disp32
4339
4340 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4341
4342
4343 68/push _test-output-stream/imm32
4344
4345 e8/call clear-stream/disp32
4346
4347 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4348
4349
4350 b8/copy-to-EAX _test-output-buffered-file/imm32
4351 05/add-to-EAX 4/imm32
4352 50/push-EAX
4353
4354 e8/call clear-stream/disp32
4355
4356 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4357
4358
4359
4360 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4361 68/push _test-input-stream/imm32
4362
4363 e8/call write/disp32
4364
4365 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4366
4367
4368 68/push _test-output-buffered-file/imm32
4369 68/push _test-input-stream/imm32
4370
4371 e8/call convert-instruction/disp32
4372
4373 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4374
4375
4376
4377 68/push _test-output-buffered-file/imm32
4378
4379 e8/call flush/disp32
4380
4381 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4382 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4408
4409
4410 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4411 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4412 68/push _test-output-stream/imm32
4413
4414 e8/call check-stream-equal/disp32
4415
4416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4417
4418 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4419 5d/pop-to-EBP
4420 c3/return
4421
4422 test-convert-instruction-emits-modrm-byte-from-subop:
4423
4424
4425 55/push-EBP
4426 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4427
4428
4429
4430 68/push _test-input-stream/imm32
4431
4432 e8/call clear-stream/disp32
4433
4434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4435
4436
4437 68/push _test-output-stream/imm32
4438
4439 e8/call clear-stream/disp32
4440
4441 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4442
4443
4444 b8/copy-to-EAX _test-output-buffered-file/imm32
4445 05/add-to-EAX 4/imm32
4446 50/push-EAX
4447
4448 e8/call clear-stream/disp32
4449
4450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4451
4452
4453
4454 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4455 68/push _test-input-stream/imm32
4456
4457 e8/call write/disp32
4458
4459 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4460
4461
4462 68/push _test-output-buffered-file/imm32
4463 68/push _test-input-stream/imm32
4464
4465 e8/call convert-instruction/disp32
4466
4467 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4468
4469
4470
4471 68/push _test-output-buffered-file/imm32
4472
4473 e8/call flush/disp32
4474
4475 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4476 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4502
4503
4504 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4505 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4506 68/push _test-output-stream/imm32
4507
4508 e8/call check-stream-equal/disp32
4509
4510 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4511
4512 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4513 5d/pop-to-EBP
4514 c3/return
4515
4516 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4517
4518
4519 55/push-EBP
4520 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4521
4522
4523
4524 68/push _test-input-stream/imm32
4525
4526 e8/call clear-stream/disp32
4527
4528 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4529
4530
4531 68/push _test-output-stream/imm32
4532
4533 e8/call clear-stream/disp32
4534
4535 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4536
4537
4538 b8/copy-to-EAX _test-output-buffered-file/imm32
4539 05/add-to-EAX 4/imm32
4540 50/push-EAX
4541
4542 e8/call clear-stream/disp32
4543
4544 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4545
4546
4547
4548 68/push "8b/copy 0/rm32 1/r32"/imm32
4549 68/push _test-input-stream/imm32
4550
4551 e8/call write/disp32
4552
4553 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4554
4555
4556 68/push _test-output-buffered-file/imm32
4557 68/push _test-input-stream/imm32
4558
4559 e8/call convert-instruction/disp32
4560
4561 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4562
4563
4564
4565 68/push _test-output-buffered-file/imm32
4566
4567 e8/call flush/disp32
4568
4569 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4570 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4596
4597
4598 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4599 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4600 68/push _test-output-stream/imm32
4601
4602 e8/call check-stream-equal/disp32
4603
4604 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4605
4606 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4607 5d/pop-to-EBP
4608 c3/return
4609
4610 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4611
4612
4613 55/push-EBP
4614 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4615
4616
4617
4618 68/push _test-input-stream/imm32
4619
4620 e8/call clear-stream/disp32
4621
4622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4623
4624
4625 68/push _test-output-stream/imm32
4626
4627 e8/call clear-stream/disp32
4628
4629 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4630
4631
4632 b8/copy-to-EAX _test-output-buffered-file/imm32
4633 05/add-to-EAX 4/imm32
4634 50/push-EAX
4635
4636 e8/call clear-stream/disp32
4637
4638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4639
4640
4641
4642 68/push "8b/copy 0/mod 1/r32"/imm32
4643 68/push _test-input-stream/imm32
4644
4645 e8/call write/disp32
4646
4647 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4648
4649
4650 68/push _test-output-buffered-file/imm32
4651 68/push _test-input-stream/imm32
4652
4653 e8/call convert-instruction/disp32
4654
4655 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4656
4657
4658
4659 68/push _test-output-buffered-file/imm32
4660
4661 e8/call flush/disp32
4662
4663 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4664 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4690
4691
4692 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4693 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4694 68/push _test-output-stream/imm32
4695
4696 e8/call check-stream-equal/disp32
4697
4698 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4699
4700 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4701 5d/pop-to-EBP
4702 c3/return
4703
4704 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4705
4706
4707 55/push-EBP
4708 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4709
4710
4711
4712 68/push _test-input-stream/imm32
4713
4714 e8/call clear-stream/disp32
4715
4716 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4717
4718
4719 68/push _test-output-stream/imm32
4720
4721 e8/call clear-stream/disp32
4722
4723 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4724
4725
4726 b8/copy-to-EAX _test-output-buffered-file/imm32
4727 05/add-to-EAX 4/imm32
4728 50/push-EAX
4729
4730 e8/call clear-stream/disp32
4731
4732 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4733
4734
4735
4736 68/push "8b/copy 0/mod 0/rm32"/imm32
4737 68/push _test-input-stream/imm32
4738
4739 e8/call write/disp32
4740
4741 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4742
4743
4744 68/push _test-output-buffered-file/imm32
4745 68/push _test-input-stream/imm32
4746
4747 e8/call convert-instruction/disp32
4748
4749 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4750
4751
4752
4753 68/push _test-output-buffered-file/imm32
4754
4755 e8/call flush/disp32
4756
4757 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4758 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4784
4785
4786 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4787 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4788 68/push _test-output-stream/imm32
4789
4790 e8/call check-stream-equal/disp32
4791
4792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4793
4794 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4795 5d/pop-to-EBP
4796 c3/return
4797
4798 test-convert-instruction-emits-sib-byte:
4799
4800
4801 55/push-EBP
4802 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4803
4804
4805
4806 68/push _test-input-stream/imm32
4807
4808 e8/call clear-stream/disp32
4809
4810 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4811
4812
4813 68/push _test-output-stream/imm32
4814
4815 e8/call clear-stream/disp32
4816
4817 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4818
4819
4820 b8/copy-to-EAX _test-output-buffered-file/imm32
4821 05/add-to-EAX 4/imm32
4822 50/push-EAX
4823
4824 e8/call clear-stream/disp32
4825
4826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4827
4828
4829
4830 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4831 68/push _test-input-stream/imm32
4832
4833 e8/call write/disp32
4834
4835 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4836
4837
4838 68/push _test-output-buffered-file/imm32
4839 68/push _test-input-stream/imm32
4840
4841 e8/call convert-instruction/disp32
4842
4843 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4844
4845
4846
4847 68/push _test-output-buffered-file/imm32
4848
4849 e8/call flush/disp32
4850
4851 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4852 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4878
4879
4880 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
4881 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4882 68/push _test-output-stream/imm32
4883
4884 e8/call check-stream-equal/disp32
4885
4886 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4887
4888 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4889 5d/pop-to-EBP
4890 c3/return
4891
4892 test-convert-instruction-emits-sib-byte-with-missing-base:
4893
4894
4895 55/push-EBP
4896 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4897
4898
4899
4900 68/push _test-input-stream/imm32
4901
4902 e8/call clear-stream/disp32
4903
4904 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4905
4906
4907 68/push _test-output-stream/imm32
4908
4909 e8/call clear-stream/disp32
4910
4911 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4912
4913
4914 b8/copy-to-EAX _test-output-buffered-file/imm32
4915 05/add-to-EAX 4/imm32
4916 50/push-EAX
4917
4918 e8/call clear-stream/disp32
4919
4920 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4921
4922
4923
4924 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4925 68/push _test-input-stream/imm32
4926
4927 e8/call write/disp32
4928
4929 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4930
4931
4932 68/push _test-output-buffered-file/imm32
4933 68/push _test-input-stream/imm32
4934
4935 e8/call convert-instruction/disp32
4936
4937 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4938
4939
4940
4941 68/push _test-output-buffered-file/imm32
4942
4943 e8/call flush/disp32
4944
4945 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4946 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4972
4973
4974 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
4975 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4976 68/push _test-output-stream/imm32
4977
4978 e8/call check-stream-equal/disp32
4979
4980 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4981
4982 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4983 5d/pop-to-EBP
4984 c3/return
4985
4986 test-convert-instruction-emits-sib-byte-with-missing-index:
4987
4988
4989 55/push-EBP
4990 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4991
4992
4993
4994 68/push _test-input-stream/imm32
4995
4996 e8/call clear-stream/disp32
4997
4998 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4999
5000
5001 68/push _test-output-stream/imm32
5002
5003 e8/call clear-stream/disp32
5004
5005 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5006
5007
5008 b8/copy-to-EAX _test-output-buffered-file/imm32
5009 05/add-to-EAX 4/imm32
5010 50/push-EAX
5011
5012 e8/call clear-stream/disp32
5013
5014 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5015
5016
5017
5018 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5019 68/push _test-input-stream/imm32
5020
5021 e8/call write/disp32
5022
5023 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5024
5025
5026 68/push _test-output-buffered-file/imm32
5027 68/push _test-input-stream/imm32
5028
5029 e8/call convert-instruction/disp32
5030
5031 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5032
5033
5034
5035 68/push _test-output-buffered-file/imm32
5036
5037 e8/call flush/disp32
5038
5039 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5040 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5066
5067
5068 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5069 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5070 68/push _test-output-stream/imm32
5071
5072 e8/call check-stream-equal/disp32
5073
5074 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5075
5076 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5077 5d/pop-to-EBP
5078 c3/return
5079
5080 test-convert-instruction-emits-sib-byte-with-missing-scale:
5081
5082
5083 55/push-EBP
5084 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5085
5086
5087
5088 68/push _test-input-stream/imm32
5089
5090 e8/call clear-stream/disp32
5091
5092 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5093
5094
5095 68/push _test-output-stream/imm32
5096
5097 e8/call clear-stream/disp32
5098
5099 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5100
5101
5102 b8/copy-to-EAX _test-output-buffered-file/imm32
5103 05/add-to-EAX 4/imm32
5104 50/push-EAX
5105
5106 e8/call clear-stream/disp32
5107
5108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5109
5110
5111
5112 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5113 68/push _test-input-stream/imm32
5114
5115 e8/call write/disp32
5116
5117 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5118
5119
5120 68/push _test-output-buffered-file/imm32
5121 68/push _test-input-stream/imm32
5122
5123 e8/call convert-instruction/disp32
5124
5125 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5126
5127
5128
5129 68/push _test-output-buffered-file/imm32
5130
5131 e8/call flush/disp32
5132
5133 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5134 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5160
5161
5162 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5163 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5164 68/push _test-output-stream/imm32
5165
5166 e8/call check-stream-equal/disp32
5167
5168 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5169
5170 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5171 5d/pop-to-EBP
5172 c3/return
5173
5174 test-convert-instruction-handles-disp32-operand:
5175
5176
5177 55/push-EBP
5178 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5179
5180
5181
5182 68/push _test-input-stream/imm32
5183
5184 e8/call clear-stream/disp32
5185
5186 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5187
5188
5189 68/push _test-output-stream/imm32
5190
5191 e8/call clear-stream/disp32
5192
5193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5194
5195
5196 b8/copy-to-EAX _test-output-buffered-file/imm32
5197 05/add-to-EAX 4/imm32
5198 50/push-EAX
5199
5200 e8/call clear-stream/disp32
5201
5202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5203
5204
5205
5206 68/push "e8/call 20/disp32"/imm32
5207 68/push _test-input-stream/imm32
5208
5209 e8/call write/disp32
5210
5211 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5212
5213
5214 68/push _test-output-buffered-file/imm32
5215 68/push _test-input-stream/imm32
5216
5217 e8/call convert-instruction/disp32
5218
5219 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5220
5221
5222
5223 68/push _test-output-buffered-file/imm32
5224
5225 e8/call flush/disp32
5226
5227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5228 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5254
5255
5256 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5257 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5258 68/push _test-output-stream/imm32
5259
5260 e8/call check-stream-equal/disp32
5261
5262 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5263
5264 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5265 5d/pop-to-EBP
5266 c3/return
5267
5268 test-convert-instruction-handles-disp16-operand:
5269
5270
5271 55/push-EBP
5272 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5273
5274
5275
5276 68/push _test-input-stream/imm32
5277
5278 e8/call clear-stream/disp32
5279
5280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5281
5282
5283 68/push _test-output-stream/imm32
5284
5285 e8/call clear-stream/disp32
5286
5287 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5288
5289
5290 b8/copy-to-EAX _test-output-buffered-file/imm32
5291 05/add-to-EAX 4/imm32
5292 50/push-EAX
5293
5294 e8/call clear-stream/disp32
5295
5296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5297
5298
5299
5300 68/push "e8/call 20/disp16"/imm32
5301 68/push _test-input-stream/imm32
5302
5303 e8/call write/disp32
5304
5305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5306
5307
5308 68/push _test-output-buffered-file/imm32
5309 68/push _test-input-stream/imm32
5310
5311 e8/call convert-instruction/disp32
5312
5313 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5314
5315
5316
5317 68/push _test-output-buffered-file/imm32
5318
5319 e8/call flush/disp32
5320
5321 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5322 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5348
5349
5350 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5351 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5352 68/push _test-output-stream/imm32
5353
5354 e8/call check-stream-equal/disp32
5355
5356 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5357
5358 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5359 5d/pop-to-EBP
5360 c3/return
5361
5362 test-convert-instruction-handles-disp8-operand:
5363
5364
5365 55/push-EBP
5366 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5367
5368
5369
5370 68/push _test-input-stream/imm32
5371
5372 e8/call clear-stream/disp32
5373
5374 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5375
5376
5377 68/push _test-output-stream/imm32
5378
5379 e8/call clear-stream/disp32
5380
5381 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5382
5383
5384 b8/copy-to-EAX _test-output-buffered-file/imm32
5385 05/add-to-EAX 4/imm32
5386 50/push-EAX
5387
5388 e8/call clear-stream/disp32
5389
5390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5391
5392
5393
5394 68/push "eb/jump 20/disp8"/imm32
5395 68/push _test-input-stream/imm32
5396
5397 e8/call write/disp32
5398
5399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5400
5401
5402 68/push _test-output-buffered-file/imm32
5403 68/push _test-input-stream/imm32
5404
5405 e8/call convert-instruction/disp32
5406
5407 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5408
5409
5410
5411 68/push _test-output-buffered-file/imm32
5412
5413 e8/call flush/disp32
5414
5415 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5416 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5442
5443
5444 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5445 68/push "eb 20 # eb/jump 20/disp8"/imm32
5446 68/push _test-output-stream/imm32
5447
5448 e8/call check-stream-equal/disp32
5449
5450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5451
5452 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5453 5d/pop-to-EBP
5454 c3/return
5455
5456 test-convert-instruction-handles-disp8-name:
5457
5458
5459 55/push-EBP
5460 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5461
5462
5463
5464 68/push _test-input-stream/imm32
5465
5466 e8/call clear-stream/disp32
5467
5468 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5469
5470
5471 68/push _test-output-stream/imm32
5472
5473 e8/call clear-stream/disp32
5474
5475 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5476
5477
5478 b8/copy-to-EAX _test-output-buffered-file/imm32
5479 05/add-to-EAX 4/imm32
5480 50/push-EAX
5481
5482 e8/call clear-stream/disp32
5483
5484 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5485
5486
5487
5488 68/push "eb/jump xyz/disp8"/imm32
5489 68/push _test-input-stream/imm32
5490
5491 e8/call write/disp32
5492
5493 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5494
5495
5496 68/push _test-output-buffered-file/imm32
5497 68/push _test-input-stream/imm32
5498
5499 e8/call convert-instruction/disp32
5500
5501 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5502
5503
5504
5505 68/push _test-output-buffered-file/imm32
5506
5507 e8/call flush/disp32
5508
5509 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5510 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5536
5537
5538 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5539 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5540 68/push _test-output-stream/imm32
5541
5542 e8/call check-stream-equal/disp32
5543
5544 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5545
5546 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5547 5d/pop-to-EBP
5548 c3/return
5549
5550 test-convert-instruction-handles-imm32-operand:
5551
5552
5553 55/push-EBP
5554 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5555
5556
5557
5558 68/push _test-input-stream/imm32
5559
5560 e8/call clear-stream/disp32
5561
5562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5563
5564
5565 68/push _test-output-stream/imm32
5566
5567 e8/call clear-stream/disp32
5568
5569 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5570
5571
5572 b8/copy-to-EAX _test-output-buffered-file/imm32
5573 05/add-to-EAX 4/imm32
5574 50/push-EAX
5575
5576 e8/call clear-stream/disp32
5577
5578 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5579
5580
5581
5582 68/push "68/push 0x20/imm32"/imm32
5583 68/push _test-input-stream/imm32
5584
5585 e8/call write/disp32
5586
5587 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5588
5589
5590 68/push _test-output-buffered-file/imm32
5591 68/push _test-input-stream/imm32
5592
5593 e8/call convert-instruction/disp32
5594
5595 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5596
5597
5598
5599 68/push _test-output-buffered-file/imm32
5600
5601 e8/call flush/disp32
5602
5603 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5604 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5630
5631
5632 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5633 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5634 68/push _test-output-stream/imm32
5635
5636 e8/call check-stream-equal/disp32
5637
5638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5639
5640 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5641 5d/pop-to-EBP
5642 c3/return
5643
5644 test-convert-instruction-handles-imm16-operand:
5645
5646
5647
5648 55/push-EBP
5649 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5650
5651
5652
5653 68/push _test-input-stream/imm32
5654
5655 e8/call clear-stream/disp32
5656
5657 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5658
5659
5660 68/push _test-output-stream/imm32
5661
5662 e8/call clear-stream/disp32
5663
5664 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5665
5666
5667 b8/copy-to-EAX _test-output-buffered-file/imm32
5668 05/add-to-EAX 4/imm32
5669 50/push-EAX
5670
5671 e8/call clear-stream/disp32
5672
5673 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5674
5675
5676
5677 68/push "68/push 0x20/imm16"/imm32
5678 68/push _test-input-stream/imm32
5679
5680 e8/call write/disp32
5681
5682 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5683
5684
5685 68/push _test-output-buffered-file/imm32
5686 68/push _test-input-stream/imm32
5687
5688 e8/call convert-instruction/disp32
5689
5690 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5691
5692
5693
5694 68/push _test-output-buffered-file/imm32
5695
5696 e8/call flush/disp32
5697
5698 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5699 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5725
5726
5727 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5728 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5729 68/push _test-output-stream/imm32
5730
5731 e8/call check-stream-equal/disp32
5732
5733 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5734
5735 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5736 5d/pop-to-EBP
5737 c3/return
5738
5739 test-convert-instruction-handles-imm8-operand:
5740
5741
5742
5743 55/push-EBP
5744 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5745
5746
5747
5748 68/push _test-input-stream/imm32
5749
5750 e8/call clear-stream/disp32
5751
5752 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5753
5754
5755 68/push _test-output-stream/imm32
5756
5757 e8/call clear-stream/disp32
5758
5759 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5760
5761
5762 b8/copy-to-EAX _test-output-buffered-file/imm32
5763 05/add-to-EAX 4/imm32
5764 50/push-EAX
5765
5766 e8/call clear-stream/disp32
5767
5768 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5769
5770
5771
5772 68/push "68/push 0x20/imm8"/imm32
5773 68/push _test-input-stream/imm32
5774
5775 e8/call write/disp32
5776
5777 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5778
5779
5780 68/push _test-output-buffered-file/imm32
5781 68/push _test-input-stream/imm32
5782
5783 e8/call convert-instruction/disp32
5784
5785 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5786
5787
5788
5789 68/push _test-output-buffered-file/imm32
5790
5791 e8/call flush/disp32
5792
5793 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5794 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5820
5821
5822 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
5823 68/push "68 20 # 68/push 0x20/imm8"/imm32
5824 68/push _test-output-stream/imm32
5825
5826 e8/call check-stream-equal/disp32
5827
5828 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5829
5830 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5831 5d/pop-to-EBP
5832 c3/return
5833
5834
5835
5836 next-word:
5837
5838 55/push-EBP
5839 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5840
5841 50/push-EAX
5842 51/push-ECX
5843 56/push-ESI
5844 57/push-EDI
5845
5846 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
5847
5848 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
5849
5850
5851 68/push 0x20/imm32/space
5852 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
5853
5854 e8/call skip-chars-matching/disp32
5855
5856 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5857 $next-word:check0:
5858
5859
5860 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
5861
5862 3b/compare 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
5863 7c/jump-if-lesser $next-word:check-for-comment/disp8
5864
5865 c7 0/subop/copy 0/mod/direct 7/rm32/EDI . . . . . 0/imm32
5866 c7 0/subop/copy 1/mod/*+disp8 7/rm32/EDI . . . . 4/disp8 0/imm32
5867 eb/jump $next-word:end/disp8
5868 $next-word:check-for-comment:
5869
5870 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
5871 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
5872 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
5873
5874
5875 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
5876 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
5877
5878 3d/compare-EAX-and 0x23/imm32/pound
5879 75/jump-if-not-equal $next-word:regular-word/disp8
5880 $next-word:comment:
5881
5882 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
5883 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
5884 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
5885
5886 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
5887
5888 eb/jump $next-word:end/disp8
5889 $next-word:regular-word:
5890
5891
5892 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
5893
5894 e8/call skip-chars-not-matching-whitespace/disp32
5895
5896 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5897
5898 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
5899 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
5900 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
5901 $next-word:end:
5902
5903 5f/pop-to-EDI
5904 5e/pop-to-ESI
5905 59/pop-to-ECX
5906 58/pop-to-EAX
5907
5908 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5909 5d/pop-to-EBP
5910 c3/return
5911
5912 test-next-word:
5913
5914 55/push-EBP
5915 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5916
5917
5918
5919 68/push _test-stream/imm32
5920
5921 e8/call clear-stream/disp32
5922
5923 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5924
5925 68/push 0/imm32/end
5926 68/push 0/imm32/start
5927 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
5928
5929
5930 68/push " ab"/imm32
5931 68/push _test-stream/imm32
5932
5933 e8/call write/disp32
5934
5935 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5936
5937
5938 51/push-ECX
5939 68/push _test-stream/imm32
5940
5941 e8/call next-word/disp32
5942
5943 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5944
5945
5946
5947 68/push "F - test-next-word: start"/imm32
5948 68/push 0xe/imm32
5949
5950 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
5951 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
5952 50/push-EAX
5953
5954 e8/call check-ints-equal/disp32
5955
5956 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5957
5958
5959
5960 68/push "F - test-next-word: end"/imm32
5961 68/push 0x10/imm32
5962
5963 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
5964 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
5965 50/push-EAX
5966
5967 e8/call check-ints-equal/disp32
5968
5969 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5970
5971 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5972 5d/pop-to-EBP
5973 c3/return
5974
5975 test-next-word-returns-whole-comment:
5976
5977 55/push-EBP
5978 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5979
5980
5981
5982 68/push _test-stream/imm32
5983
5984 e8/call clear-stream/disp32
5985
5986 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5987
5988 68/push 0/imm32/end
5989 68/push 0/imm32/start
5990 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
5991
5992
5993 68/push " # a"/imm32
5994 68/push _test-stream/imm32
5995
5996 e8/call write/disp32
5997
5998 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5999
6000
6001 51/push-ECX
6002 68/push _test-stream/imm32
6003
6004 e8/call next-word/disp32
6005
6006 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6007
6008
6009
6010 68/push "F - test-next-word-returns-whole-comment: start"/imm32
6011 68/push 0xe/imm32
6012
6013 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
6014 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
6015 50/push-EAX
6016
6017 e8/call check-ints-equal/disp32
6018
6019 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6020
6021
6022
6023 68/push "F - test-next-word-returns-whole-comment: end"/imm32
6024 68/push 0x11/imm32
6025
6026 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
6027 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
6028 50/push-EAX
6029
6030 e8/call check-ints-equal/disp32
6031
6032 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6033
6034 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6035 5d/pop-to-EBP
6036 c3/return
6037
6038 test-next-word-returns-empty-string-on-eof:
6039
6040 55/push-EBP
6041 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6042
6043
6044
6045 68/push _test-stream/imm32
6046
6047 e8/call clear-stream/disp32
6048
6049 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6050
6051 68/push 0/imm32/end
6052 68/push 0/imm32/start
6053 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6054
6055
6056
6057 51/push-ECX
6058 68/push _test-stream/imm32
6059
6060 e8/call next-word/disp32
6061
6062 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6063
6064
6065 68/push "F - test-next-word-returns-empty-string-on-eof"/imm32
6066 68/push 0/imm32
6067
6068 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
6069 2b/subtract 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
6070 50/push-EAX
6071
6072 e8/call check-ints-equal/disp32
6073
6074 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6075
6076 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6077 5d/pop-to-EBP
6078 c3/return
6079
6080 has-metadata?:
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091 55/push-EBP
6092 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6093
6094 51/push-ECX
6095 52/push-EDX
6096 56/push-ESI
6097 57/push-EDI
6098
6099 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
6100
6101 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
6102
6103 68/push 0/imm32/end
6104 68/push 0/imm32/start
6105 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
6106
6107
6108 57/push-EDI
6109 68/push 0x2f/imm32/slash
6110 52/push-EDX
6111 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
6112
6113 e8/call next-token-from-slice/disp32
6114
6115 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6116
6117 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
6118 $has-metadata?:loop:
6119
6120
6121 57/push-EDI
6122 68/push 0x2f/imm32/slash
6123 52/push-EDX
6124 51/push-ECX
6125
6126 e8/call next-token-from-slice/disp32
6127
6128 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6129
6130
6131
6132 57/push-EDI
6133
6134 e8/call slice-empty?/disp32
6135
6136 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6137
6138 3d/compare-EAX-and 0/imm32
6139 75/jump-if-not-equal $has-metadata?:false/disp8
6140
6141
6142
6143 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
6144 57/push-EDI
6145
6146 e8/call slice-equal?/disp32
6147
6148 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6149
6150 3d/compare-EAX-and 0/imm32
6151 75/jump-if-not-equal $has-metadata?:true/disp8
6152
6153 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
6154 eb/jump $has-metadata?:loop/disp8
6155 $has-metadata?:true:
6156 b8/copy-to-EAX 1/imm32/true
6157 eb/jump $has-metadata?:end/disp8
6158 $has-metadata?:false:
6159 b8/copy-to-EAX 0/imm32/false
6160 $has-metadata?:end:
6161
6162 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6163
6164 5f/pop-to-EDI
6165 5e/pop-to-ESI
6166 5a/pop-to-EDX
6167 59/pop-to-ECX
6168
6169 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6170 5d/pop-to-EBP
6171 c3/return
6172
6173 test-has-metadata-true:
6174
6175 55/push-EBP
6176 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6177
6178 b8/copy-to-EAX "ab/c"/imm32
6179 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6180 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6181 05/add-to-EAX 4/imm32
6182
6183 51/push-ECX
6184 50/push-EAX
6185 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6186
6187
6188 68/push "c"/imm32
6189 56/push-ESI
6190
6191 e8/call has-metadata?/disp32
6192
6193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6194
6195
6196 68/push "F - test-has-metadata-true"/imm32
6197 68/push 1/imm32/true
6198 50/push-EAX
6199
6200 e8/call check-ints-equal/disp32
6201
6202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6203
6204 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6205 5d/pop-to-EBP
6206 c3/return
6207
6208 test-has-metadata-false:
6209
6210 55/push-EBP
6211 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6212
6213 b8/copy-to-EAX "ab/c"/imm32
6214 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6215 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6216 05/add-to-EAX 4/imm32
6217
6218 51/push-ECX
6219 50/push-EAX
6220 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6221
6222
6223 68/push "d"/imm32
6224 56/push-ESI
6225
6226 e8/call has-metadata?/disp32
6227
6228 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6229
6230
6231 68/push "F - test-has-metadata-false"/imm32
6232 68/push 0/imm32/false
6233 50/push-EAX
6234
6235 e8/call check-ints-equal/disp32
6236
6237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6238
6239 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6240 5d/pop-to-EBP
6241 c3/return
6242
6243 test-has-metadata-ignore-name:
6244
6245 55/push-EBP
6246 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6247
6248 b8/copy-to-EAX "a/b"/imm32
6249 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6250 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6251 05/add-to-EAX 4/imm32
6252
6253 51/push-ECX
6254 50/push-EAX
6255 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6256
6257
6258 68/push "a"/imm32
6259 56/push-ESI
6260
6261 e8/call has-metadata?/disp32
6262
6263 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6264
6265
6266 68/push "F - test-has-metadata-ignore-name"/imm32
6267 68/push 0/imm32/false
6268 50/push-EAX
6269
6270 e8/call check-ints-equal/disp32
6271
6272 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6273
6274 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6275 5d/pop-to-EBP
6276 c3/return
6277
6278 test-has-metadata-multiple-true:
6279
6280 55/push-EBP
6281 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6282
6283 b8/copy-to-EAX "a/b/c"/imm32
6284 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6285 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6286 05/add-to-EAX 4/imm32
6287
6288 51/push-ECX
6289 50/push-EAX
6290 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6291
6292
6293 68/push "c"/imm32
6294 56/push-ESI
6295
6296 e8/call has-metadata?/disp32
6297
6298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6299
6300
6301 68/push "F - test-has-metadata-multiple-true"/imm32
6302 68/push 1/imm32/true
6303 50/push-EAX
6304
6305 e8/call check-ints-equal/disp32
6306
6307 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6308
6309 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6310 5d/pop-to-EBP
6311 c3/return
6312
6313 test-has-metadata-multiple-false:
6314
6315 55/push-EBP
6316 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6317
6318 b8/copy-to-EAX "a/b/c"/imm32
6319 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6320 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6321 05/add-to-EAX 4/imm32
6322
6323 51/push-ECX
6324 50/push-EAX
6325 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6326
6327
6328 68/push "d"/imm32
6329 56/push-ESI
6330
6331 e8/call has-metadata?/disp32
6332
6333 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6334
6335
6336 68/push "F - test-has-metadata-multiple-false"/imm32
6337 68/push 0/imm32/false
6338 50/push-EAX
6339
6340 e8/call check-ints-equal/disp32
6341
6342 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6343
6344 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6345 5d/pop-to-EBP
6346 c3/return
6347
6348
6349
6350
6351
6352 emit:
6353
6354 55/push-EBP
6355 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6356
6357 50/push-EAX
6358 56/push-ESI
6359 57/push-EDI
6360
6361 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
6362
6363 68/push 0/imm32/end
6364 68/push 0/imm32/start
6365 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
6366
6367
6368 57/push-EDI
6369 68/push 0x2f/imm32/slash
6370 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
6371 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
6372
6373 e8/call next-token-from-slice/disp32
6374
6375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6376
6377
6378
6379 57/push-EDI
6380
6381 e8/call is-valid-name?/disp32
6382
6383 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6384
6385 3d/compare-EAX-and 0/imm32
6386 74/jump-if-equal $emit:hex-int/disp8
6387 $emit:name:
6388
6389
6390 56/push-ESI
6391 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6392
6393 e8/call write-slice/disp32
6394
6395 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6396
6397
6398 68/push " "/imm32
6399 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6400
6401 e8/call write-buffered/disp32
6402
6403 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6404
6405 eb/jump $emit:end/disp8
6406
6407
6408
6409
6410
6411 $emit:hex-int:
6412
6413
6414 57/push-EDI
6415
6416 e8/call parse-hex-int/disp32
6417
6418 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6419
6420
6421 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
6422 50/push-EAX
6423 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6424
6425 e8/call emit-hex/disp32
6426
6427 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6428 $emit:end:
6429
6430 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6431
6432 5f/pop-to-EDI
6433 5e/pop-to-ESI
6434 58/pop-to-EAX
6435
6436 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6437 5d/pop-to-EBP
6438 c3/return
6439
6440 test-emit-number:
6441
6442 55/push-EBP
6443 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6444
6445
6446
6447 68/push _test-output-stream/imm32
6448
6449 e8/call clear-stream/disp32
6450
6451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6452
6453
6454 b8/copy-to-EAX _test-output-buffered-file/imm32
6455 05/add-to-EAX 4/imm32
6456 50/push-EAX
6457
6458 e8/call clear-stream/disp32
6459
6460 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6461
6462 68/push _test-slice-three-zero-end/imm32/end
6463 68/push _test-slice-three-zero/imm32/start
6464 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6465
6466
6467 68/push 1/imm32
6468 51/push-ECX
6469 68/push _test-output-buffered-file/imm32
6470
6471 e8/call emit/disp32
6472
6473 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6474
6475
6476 68/push _test-output-buffered-file/imm32
6477
6478 e8/call flush/disp32
6479
6480 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6481
6482
6483 68/push "F - test-emit-number/1"/imm32
6484 68/push "30 "/imm32
6485 68/push _test-output-stream/imm32
6486
6487 e8/call check-stream-equal/disp32
6488
6489 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6490
6491 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6492 5d/pop-to-EBP
6493 c3/return
6494
6495 test-emit-negative-number:
6496
6497
6498 55/push-EBP
6499 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6500
6501
6502
6503 68/push _test-output-stream/imm32
6504
6505 e8/call clear-stream/disp32
6506
6507 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6508
6509
6510 b8/copy-to-EAX _test-output-buffered-file/imm32
6511 05/add-to-EAX 4/imm32
6512 50/push-EAX
6513
6514 e8/call clear-stream/disp32
6515
6516 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6517
6518 68/push _test-slice-negative-two-end/imm32/end
6519 68/push _test-slice-negative-two/imm32/start
6520 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6521
6522
6523 68/push 2/imm32
6524 51/push-ECX
6525 68/push _test-output-buffered-file/imm32
6526
6527 e8/call emit/disp32
6528
6529 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6530
6531
6532 68/push _test-output-buffered-file/imm32
6533
6534 e8/call flush/disp32
6535
6536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6537
6538
6539 68/push "F - test-emit-number/1"/imm32
6540 68/push "fe ff "/imm32
6541 68/push _test-output-stream/imm32
6542
6543 e8/call check-stream-equal/disp32
6544
6545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6546
6547 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6548 5d/pop-to-EBP
6549 c3/return
6550
6551 test-emit-number-with-metadata:
6552
6553 55/push-EBP
6554 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6555
6556
6557
6558 68/push _test-output-stream/imm32
6559
6560 e8/call clear-stream/disp32
6561
6562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6563
6564
6565 b8/copy-to-EAX _test-output-buffered-file/imm32
6566 05/add-to-EAX 4/imm32
6567 50/push-EAX
6568
6569 e8/call clear-stream/disp32
6570
6571 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6572
6573 68/push _test-slice-negative-two-metadata-end/imm32/end
6574 68/push _test-slice-negative-two/imm32/start
6575 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6576
6577
6578 68/push 2/imm32
6579 51/push-ECX
6580 68/push _test-output-buffered-file/imm32
6581
6582 e8/call emit/disp32
6583
6584 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6585
6586
6587 68/push _test-output-buffered-file/imm32
6588
6589 e8/call flush/disp32
6590
6591 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6592
6593
6594
6595 68/push "F - test-emit-number-with-metadata"/imm32
6596 68/push "fe ff "/imm32
6597 68/push _test-output-stream/imm32
6598
6599 e8/call check-stream-equal/disp32
6600
6601 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6602
6603 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6604 5d/pop-to-EBP
6605 c3/return
6606
6607 test-emit-non-number:
6608
6609 55/push-EBP
6610 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6611
6612
6613
6614 68/push _test-output-stream/imm32
6615
6616 e8/call clear-stream/disp32
6617
6618 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6619
6620
6621 b8/copy-to-EAX _test-output-buffered-file/imm32
6622 05/add-to-EAX 4/imm32
6623 50/push-EAX
6624
6625 e8/call clear-stream/disp32
6626
6627 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6628
6629 68/push _test-slice-non-number-word-end/imm32/end
6630 68/push _test-slice-non-number-word/imm32/start
6631 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6632
6633
6634 68/push 2/imm32
6635 51/push-ECX
6636 68/push _test-output-buffered-file/imm32
6637
6638 e8/call emit/disp32
6639
6640 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6641
6642
6643 68/push _test-output-buffered-file/imm32
6644
6645 e8/call flush/disp32
6646
6647 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6648
6649
6650 68/push "F - test-emit-non-number"/imm32
6651 68/push "xyz "/imm32
6652 68/push _test-output-stream/imm32
6653
6654 e8/call check-stream-equal/disp32
6655
6656 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6657
6658 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6659 5d/pop-to-EBP
6660 c3/return
6661
6662 test-emit-non-number-with-metadata:
6663
6664 55/push-EBP
6665 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6666
6667
6668
6669 68/push _test-output-stream/imm32
6670
6671 e8/call clear-stream/disp32
6672
6673 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6674
6675
6676 b8/copy-to-EAX _test-output-buffered-file/imm32
6677 05/add-to-EAX 4/imm32
6678 50/push-EAX
6679
6680 e8/call clear-stream/disp32
6681
6682 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6683
6684 68/push _test-slice-non-number-word-metadata-end/imm32/end
6685 68/push _test-slice-non-number-word/imm32/start
6686 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6687
6688
6689 68/push 2/imm32
6690 51/push-ECX
6691 68/push _test-output-buffered-file/imm32
6692
6693 e8/call emit/disp32
6694
6695 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6696
6697
6698 68/push _test-output-buffered-file/imm32
6699
6700 e8/call flush/disp32
6701
6702 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6703
6704
6705 68/push "F - test-emit-non-number-with-metadata"/imm32
6706 68/push "xyz/ "/imm32
6707 68/push _test-output-stream/imm32
6708
6709 e8/call check-stream-equal/disp32
6710
6711 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6712
6713 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6714 5d/pop-to-EBP
6715 c3/return
6716
6717 test-emit-non-number-with-all-hex-digits-and-metadata:
6718
6719 55/push-EBP
6720 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6721
6722
6723
6724 68/push _test-output-stream/imm32
6725
6726 e8/call clear-stream/disp32
6727
6728 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6729
6730
6731 b8/copy-to-EAX _test-output-buffered-file/imm32
6732 05/add-to-EAX 4/imm32
6733 50/push-EAX
6734
6735 e8/call clear-stream/disp32
6736
6737 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6738
6739 68/push _test-slice-hexlike-non-number-word-metadata-end/imm32/end
6740 68/push _test-slice-hexlike-non-number-word/imm32/start
6741 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6742
6743
6744 68/push 2/imm32
6745 51/push-ECX
6746 68/push _test-output-buffered-file/imm32
6747
6748 e8/call emit/disp32
6749
6750 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6751
6752
6753 68/push _test-output-buffered-file/imm32
6754
6755 e8/call flush/disp32
6756
6757 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6758 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
6784
6785
6786 68/push "F - test-emit-non-number-with-all-hex-digits"/imm32
6787 68/push "abcd/xyz "/imm32
6788 68/push _test-output-stream/imm32
6789
6790 e8/call check-stream-equal/disp32
6791
6792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6793
6794 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6795 5d/pop-to-EBP
6796 c3/return
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806 is-valid-name?:
6807
6808 55/push-EBP
6809 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6810
6811 51/push-ECX
6812 56/push-ESI
6813
6814 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
6815
6816 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
6817
6818 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
6819 $is-valid-name?:check0:
6820
6821 39/compare 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
6822 7d/jump-if-greater-or-equal $is-valid-name?:false/disp8
6823 $is-valid-name?:check1:
6824
6825 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
6826
6827 3d/compare-EAX-and 2/imm32
6828 74/jump-if-equal $is-valid-name?:false/disp8
6829 $is-valid-name?:check2:
6830
6831 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
6832 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
6833
6834 3d/compare-EAX-and 2d/imm32/-
6835 74/jump-if-equal $is-valid-name?:false/disp8
6836 $is-valid-name?:check3a:
6837
6838 3d/compare-EAX-with 30/imm32/0
6839 7c/jump-if-lesser $is-valid-name?:true/disp8
6840 $is-valid-name?:check3b:
6841
6842 3d/compare-EAX-with 39/imm32/9
6843 7f/jump-if-greater $is-valid-name?:true/disp8
6844 $is-valid-name?:false:
6845
6846 b8/copy-to-EAX 0/imm32/false
6847 eb/jump $is-valid-name?:end/disp8
6848 $is-valid-name?:true:
6849
6850 b8/copy-to-EAX 1/imm32/true
6851 $is-valid-name?:end:
6852
6853 5e/pop-to-ESI
6854 59/pop-to-ECX
6855
6856 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6857 5d/pop-to-EBP
6858 c3/return
6859
6860 test-is-valid-name-digit-prefix:
6861
6862 55/push-EBP
6863 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6864
6865 68/push _test-slice-hex-int-end/imm32
6866 68/push _test-slice-hex-int/imm32
6867 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6868
6869
6870 51/push-ECX
6871
6872 e8/call is-valid-name?/disp32
6873
6874 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6875
6876
6877 68/push "F - test-is-valid-name-digit-prefix"/imm32
6878 68/push 0/imm32/false
6879 50/push-EAX
6880
6881 e8/call check-ints-equal/disp32
6882
6883 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6884
6885 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6886 5d/pop-to-EBP
6887 c3/return
6888
6889 test-is-valid-name-negative-prefix:
6890
6891 55/push-EBP
6892 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6893
6894 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
6895 68/push _test-slice-hex-int-with-0x-prefix-negative/imm32
6896 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6897
6898
6899 51/push-ECX
6900
6901 e8/call is-valid-name?/disp32
6902
6903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6904
6905
6906 68/push "F - test-is-valid-name-negative-prefix"/imm32
6907 68/push 0/imm32/false
6908 50/push-EAX
6909
6910 e8/call check-ints-equal/disp32
6911
6912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6913
6914 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6915 5d/pop-to-EBP
6916 c3/return
6917
6918 test-is-valid-name-0x-prefix:
6919
6920 55/push-EBP
6921 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6922
6923 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
6924 68/push _test-slice-hex-int-with-0x-prefix/imm32
6925 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6926
6927
6928 51/push-ECX
6929
6930 e8/call is-valid-name?/disp32
6931
6932 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6933
6934
6935 68/push "F - test-is-valid-name-0x-prefix"/imm32
6936 68/push 0/imm32/false
6937 50/push-EAX
6938
6939 e8/call check-ints-equal/disp32
6940
6941 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6942
6943 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6944 5d/pop-to-EBP
6945 c3/return
6946
6947 test-is-valid-name-starts-with-pre-digit:
6948
6949 55/push-EBP
6950 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6951
6952 68/push _test-slice-with-slash-prefix-end/imm32
6953 68/push _test-slice-with-slash-prefix/imm32
6954 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6955
6956
6957 51/push-ECX
6958
6959 e8/call is-valid-name?/disp32
6960
6961 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6962
6963
6964 68/push "F - test-is-valid-name-starts-with-pre-digit"/imm32
6965 68/push 1/imm32/true
6966 50/push-EAX
6967
6968 e8/call check-ints-equal/disp32
6969
6970 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6971
6972 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6973 5d/pop-to-EBP
6974 c3/return
6975
6976 test-is-valid-name-starts-with-post-digit:
6977
6978 55/push-EBP
6979 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6980
6981 68/push _test-slice-char-and-digits-end/imm32
6982 68/push _test-slice-char-and-digits/imm32
6983 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6984
6985
6986 51/push-ECX
6987
6988 e8/call is-valid-name?/disp32
6989
6990 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6991
6992
6993 68/push "F - test-is-valid-name-starts-with-post-digit"/imm32
6994 68/push 1/imm32/true
6995 50/push-EAX
6996
6997 e8/call check-ints-equal/disp32
6998
6999 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7000
7001 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7002 5d/pop-to-EBP
7003 c3/return
7004
7005 test-is-valid-name-starts-with-digit:
7006
7007 55/push-EBP
7008 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7009
7010 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
7011 68/push _test-slice-hex-int-with-0x-prefix/imm32
7012 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7013
7014
7015 51/push-ECX
7016
7017 e8/call is-valid-name?/disp32
7018
7019 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7020
7021
7022 68/push "F - test-is-valid-name-starts-with-digit"/imm32
7023 68/push 0/imm32/false
7024 50/push-EAX
7025
7026 e8/call check-ints-equal/disp32
7027
7028 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7029
7030 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7031 5d/pop-to-EBP
7032 c3/return
7033
7034
7035 emit-hex:
7036
7037 55/push-EBP
7038 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7039
7040 50/push-EAX
7041 51/push-ECX
7042 52/push-EDX
7043 53/push-EBX
7044 57/push-EDI
7045
7046 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
7047
7048 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
7049
7050 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0x10/disp8 .
7051
7052 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
7053 $emit-hex:loop:
7054
7055 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
7056 7d/jump-if-greater-or-equal $emit-hex:end/disp8
7057
7058
7059 53/push-EBX
7060 57/push-EDI
7061
7062 e8/call print-byte/disp32
7063
7064 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7065
7066
7067 68/push 0x20/imm32/space
7068 57/push-EDI
7069
7070 e8/call write-byte/disp32
7071
7072 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7073
7074 c1/shift 5/subop/logic-right 3/mod/direct 3/rm32/EBX . . . . . 8/imm8
7075 $emit-hex:continue:
7076
7077 41/increment-ECX
7078 eb/jump $emit-hex:loop/disp8
7079 $emit-hex:end:
7080
7081 5f/pop-to-EDI
7082 5b/pop-to-EBX
7083 5a/pop-to-EDX
7084 59/pop-to-ECX
7085 58/pop-to-EAX
7086
7087 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7088 5d/pop-to-EBP
7089 c3/return
7090
7091 test-emit-hex-single-byte:
7092
7093
7094
7095 68/push _test-output-stream/imm32
7096
7097 e8/call clear-stream/disp32
7098
7099 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7100
7101
7102 b8/copy-to-EAX _test-output-buffered-file/imm32
7103 05/add-to-EAX 4/imm32
7104 50/push-EAX
7105
7106 e8/call clear-stream/disp32
7107
7108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7109
7110
7111 68/push 1/imm32
7112 68/push 0xab/imm32
7113 68/push _test-output-buffered-file/imm32
7114
7115 e8/call emit-hex/disp32
7116
7117 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7118
7119
7120 68/push _test-output-buffered-file/imm32
7121
7122 e8/call flush/disp32
7123
7124 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7125
7126
7127 68/push "F - test-emit-hex-single-byte"/imm32
7128 68/push 0x206261/imm32
7129
7130 b8/copy-to-EAX _test-output-stream/imm32
7131 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
7132
7133 e8/call check-ints-equal/disp32
7134
7135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7136
7137 c3/return
7138
7139 test-emit-hex-multiple-byte:
7140
7141
7142
7143 68/push _test-output-stream/imm32
7144
7145 e8/call clear-stream/disp32
7146
7147 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7148
7149
7150 b8/copy-to-EAX _test-output-buffered-file/imm32
7151 05/add-to-EAX 4/imm32
7152 50/push-EAX
7153
7154 e8/call clear-stream/disp32
7155
7156 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7157
7158
7159 68/push 2/imm32
7160 68/push 0x1234/imm32
7161 68/push _test-output-buffered-file/imm32
7162
7163 e8/call emit-hex/disp32
7164
7165 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7166
7167
7168 68/push _test-output-buffered-file/imm32
7169
7170 e8/call flush/disp32
7171
7172 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7173
7174
7175 68/push "F - test-emit-hex-multiple-byte/1"/imm32
7176 68/push "34 12 "/imm32
7177 68/push _test-output-stream/imm32
7178
7179 e8/call check-stream-equal/disp32
7180
7181 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7182
7183 c3/return
7184
7185 test-emit-hex-zero-pad:
7186
7187
7188
7189 68/push _test-output-stream/imm32
7190
7191 e8/call clear-stream/disp32
7192
7193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7194
7195
7196 b8/copy-to-EAX _test-output-buffered-file/imm32
7197 05/add-to-EAX 4/imm32
7198 50/push-EAX
7199
7200 e8/call clear-stream/disp32
7201
7202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7203
7204
7205 68/push 2/imm32
7206 68/push 0xab/imm32
7207 68/push _test-output-buffered-file/imm32
7208
7209 e8/call emit-hex/disp32
7210
7211 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7212
7213
7214 68/push _test-output-buffered-file/imm32
7215
7216 e8/call flush/disp32
7217
7218 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7219
7220
7221 68/push "F - test-emit-hex-zero-pad/1"/imm32
7222 68/push "ab 00 "/imm32
7223 68/push _test-output-stream/imm32
7224
7225 e8/call check-stream-equal/disp32
7226
7227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7228
7229 c3/return
7230
7231 test-emit-hex-negative:
7232
7233
7234
7235 68/push _test-output-stream/imm32
7236
7237 e8/call clear-stream/disp32
7238
7239 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7240
7241
7242 b8/copy-to-EAX _test-output-buffered-file/imm32
7243 05/add-to-EAX 4/imm32
7244 50/push-EAX
7245
7246 e8/call clear-stream/disp32
7247
7248 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7249
7250
7251 68/push 2/imm32
7252 68/push -1/imm32
7253 68/push _test-output-buffered-file/imm32
7254
7255 e8/call emit-hex/disp32
7256
7257 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7258
7259
7260 68/push _test-output-buffered-file/imm32
7261
7262 e8/call flush/disp32
7263
7264 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7265
7266
7267 68/push "F - test-emit-hex-negative/1"/imm32
7268 68/push "ff ff "/imm32
7269 68/push _test-output-stream/imm32
7270
7271 e8/call check-stream-equal/disp32
7272
7273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7274
7275 c3/return
7276
7277
7278 parse-datum-of-word:
7279
7280 55/push-EBP
7281 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7282
7283 51/push-ECX
7284 56/push-ESI
7285
7286 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
7287
7288 68/push 0/imm32/end
7289 68/push 0/imm32/start
7290 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7291
7292
7293 51/push-ECX
7294 68/push 0x2f/imm32/slash
7295 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
7296 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
7297
7298 e8/call next-token-from-slice/disp32
7299
7300 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
7301
7302
7303 51/push-ECX
7304
7305 e8/call parse-hex-int/disp32
7306
7307 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7308 $parse-datum-of-word:end:
7309
7310 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7311
7312 5e/pop-to-ESI
7313 59/pop-to-ECX
7314
7315 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7316 5d/pop-to-EBP
7317 c3/return
7318
7319 == data
7320
7321 _test-slice-negative-two:
7322 2d/- 32/2
7323 _test-slice-negative-two-end:
7324 2f/slash 66/f 6f/o 6f/o
7325 _test-slice-negative-two-metadata-end:
7326
7327 _test-slice-three-zero:
7328 33/3 30/0
7329 _test-slice-three-zero-end:
7330
7331 _test-slice-non-number-word:
7332 78/x 79/y 7a/z
7333 _test-slice-non-number-word-end:
7334 2f/slash
7335 _test-slice-non-number-word-metadata-end:
7336
7337 _test-slice-hexlike-non-number-word:
7338 61/a 62/b 63/c 64/d
7339 _test-slice-hexlike-non-number-word-end:
7340 2f/slash
7341 78/x 79/y 7a/z
7342 _test-slice-hexlike-non-number-word-metadata-end:
7343
7344 _test-slice-with-slash-prefix:
7345 2f/slash 30/0 33/3
7346 _test-slice-with-slash-prefix-end:
7347
7348