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 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
190
191
192 52/push-EDX
193 51/push-ECX
194
195 e8/call next-word/disp32
196
197 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
198 $convert:check1:
199
200
201
202 52/push-EDX
203
204 e8/call slice-empty?/disp32
205
206 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
207
208 3d/compare-EAX-and 0/imm32
209 0f 85/jump-if-not-equal $convert:pass-through/disp32
210 $convert:check2:
211 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
261
262
263
264
265
266
267 68/push "=="/imm32
268 52/push-EDX
269
270 e8/call slice-equal?/disp32
271
272 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
273
274 3d/compare-EAX-and 0/imm32
275 0f 84/jump-if-equal $convert:check3/disp32
276
277
278 52/push-EDX
279 51/push-ECX
280
281 e8/call next-word/disp32
282
283 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
284 +-- 50 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------
334
335
336 68/push "code"/imm32
337 52/push-EDX
338
339 e8/call slice-equal?/disp32
340
341 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
342
343 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
344
345 eb/jump $convert:pass-through/disp8
346 $convert:check3:
347
348
349
350 51/push-ECX
351
352 e8/call rewind-stream/disp32
353
354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
355
356 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0/imm32
357 74/jump-if-equal $convert:data/disp8
358 $convert:code:
359
360
361 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
362 51/push-ECX
363
364 e8/call convert-instruction/disp32
365
366 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
367
368 e9/jump $convert:loop/disp32
369 $convert:data:
370
371
372 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
373 51/push-ECX
374
375 e8/call convert-data/disp32
376
377 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
378
379 e9/jump $convert:loop/disp32
380 $convert:pass-through:
381
382
383 51/push-ECX
384 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
385
386 e8/call write-stream-data/disp32
387
388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
389
390 e9/jump $convert:loop/disp32
391 $convert:break:
392
393
394 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
395
396 e8/call flush/disp32
397
398 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
399 $convert:end:
400
401 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
402
403 5b/pop-to-EBX
404 5a/pop-to-EDX
405 59/pop-to-ECX
406 58/pop-to-EAX
407
408 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
409 5d/pop-to-EBP
410 c3/return
411
412 test-convert-passes-empty-lines-through:
413
414
415 55/push-EBP
416 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
417
418
419
420 68/push _test-input-stream/imm32
421
422 e8/call clear-stream/disp32
423
424 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
425
426
427 b8/copy-to-EAX _test-input-buffered-file/imm32
428 05/add-to-EAX 4/imm32
429 50/push-EAX
430
431 e8/call clear-stream/disp32
432
433 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
434
435
436 68/push _test-output-stream/imm32
437
438 e8/call clear-stream/disp32
439
440 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
441
442
443 b8/copy-to-EAX _test-output-buffered-file/imm32
444 05/add-to-EAX 4/imm32
445 50/push-EAX
446
447 e8/call clear-stream/disp32
448
449 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
450
451
452
453 68/push _test-output-buffered-file/imm32
454 68/push _test-input-buffered-file/imm32
455
456 e8/call convert/disp32
457
458 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
459
460
461
462 68/push _test-output-buffered-file/imm32
463
464 e8/call flush/disp32
465
466 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
467
468
469 68/push "F - test-convert-passes-empty-lines-through"/imm32
470 68/push ""/imm32
471 68/push _test-output-stream/imm32
472
473 e8/call check-stream-equal/disp32
474
475 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
476
477 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
478 5d/pop-to-EBP
479 c3/return
480
481 test-convert-passes-lines-with-just-whitespace-through:
482
483
484 55/push-EBP
485 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
486
487
488
489 68/push _test-input-stream/imm32
490
491 e8/call clear-stream/disp32
492
493 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
494
495
496 b8/copy-to-EAX _test-input-buffered-file/imm32
497 05/add-to-EAX 4/imm32
498 50/push-EAX
499
500 e8/call clear-stream/disp32
501
502 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
503
504
505 68/push _test-output-stream/imm32
506
507 e8/call clear-stream/disp32
508
509 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
510
511
512 b8/copy-to-EAX _test-output-buffered-file/imm32
513 05/add-to-EAX 4/imm32
514 50/push-EAX
515
516 e8/call clear-stream/disp32
517
518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
519
520
521
522 68/push " "/imm32
523 68/push _test-input-stream/imm32
524
525 e8/call write/disp32
526
527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
528
529
530 68/push _test-output-buffered-file/imm32
531 68/push _test-input-buffered-file/imm32
532
533 e8/call convert/disp32
534
535 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
536
537
538
539 68/push _test-output-buffered-file/imm32
540
541 e8/call flush/disp32
542
543 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
544
545
546 68/push "F - test-convert-passes-with-just-whitespace-through"/imm32
547 68/push " "/imm32
548 68/push _test-output-stream/imm32
549
550 e8/call check-next-stream-line-equal/disp32
551
552 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
553
554 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
555 5d/pop-to-EBP
556 c3/return
557
558 test-convert-passes-segment-headers-through:
559
560
561 55/push-EBP
562 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
563
564
565
566 68/push _test-input-stream/imm32
567
568 e8/call clear-stream/disp32
569
570 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
571
572
573 b8/copy-to-EAX _test-input-buffered-file/imm32
574 05/add-to-EAX 4/imm32
575 50/push-EAX
576
577 e8/call clear-stream/disp32
578
579 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
580
581
582 68/push _test-output-stream/imm32
583
584 e8/call clear-stream/disp32
585
586 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
587
588
589 b8/copy-to-EAX _test-output-buffered-file/imm32
590 05/add-to-EAX 4/imm32
591 50/push-EAX
592
593 e8/call clear-stream/disp32
594
595 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
596
597
598
599 68/push "== abcd"/imm32
600 68/push _test-input-stream/imm32
601
602 e8/call write/disp32
603
604 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
605
606
607 68/push _test-output-buffered-file/imm32
608 68/push _test-input-buffered-file/imm32
609
610 e8/call convert/disp32
611
612 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
613
614
615
616 68/push _test-output-buffered-file/imm32
617
618 e8/call flush/disp32
619
620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
621
622
623 68/push "F - test-convert-passes-segment-headers-through"/imm32
624 68/push "== abcd"/imm32
625 68/push _test-output-stream/imm32
626
627 e8/call check-stream-equal/disp32
628
629 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
630
631 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
632 5d/pop-to-EBP
633 c3/return
634
635 test-convert-in-data-segment:
636
637
638 55/push-EBP
639 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
640
641
642
643 68/push _test-input-stream/imm32
644
645 e8/call clear-stream/disp32
646
647 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
648
649
650 b8/copy-to-EAX _test-input-buffered-file/imm32
651 05/add-to-EAX 4/imm32
652 50/push-EAX
653
654 e8/call clear-stream/disp32
655
656 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
657
658
659 68/push _test-output-stream/imm32
660
661 e8/call clear-stream/disp32
662
663 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
664
665
666 b8/copy-to-EAX _test-output-buffered-file/imm32
667 05/add-to-EAX 4/imm32
668 50/push-EAX
669
670 e8/call clear-stream/disp32
671
672 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
673
674
675
676
677
678
679 68/push "== code"/imm32
680 68/push _test-input-stream/imm32
681
682 e8/call write/disp32
683
684 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
685
686
687 68/push Newline/imm32
688 68/push _test-input-stream/imm32
689
690 e8/call write/disp32
691
692 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
693
694
695 68/push "== data"/imm32
696 68/push _test-input-stream/imm32
697
698 e8/call write/disp32
699
700 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
701
702
703 68/push Newline/imm32
704 68/push _test-input-stream/imm32
705
706 e8/call write/disp32
707
708 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
709
710
711 68/push "3 4/imm32"/imm32
712 68/push _test-input-stream/imm32
713
714 e8/call write/disp32
715
716 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
717
718
719 68/push Newline/imm32
720 68/push _test-input-stream/imm32
721
722 e8/call write/disp32
723
724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
725
726
727 68/push _test-output-buffered-file/imm32
728 68/push _test-input-buffered-file/imm32
729
730 e8/call convert/disp32
731
732 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
733
734 +-- 34 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
768
769
770 68/push _test-output-buffered-file/imm32
771
772 e8/call flush/disp32
773
774 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
775
776
777 68/push "F - test-convert-in-data-segment/0"/imm32
778 68/push "== code"/imm32
779 68/push _test-output-stream/imm32
780
781 e8/call check-next-stream-line-equal/disp32
782
783 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
784
785
786 68/push "F - test-convert-in-data-segment/1"/imm32
787 68/push "== data"/imm32
788 68/push _test-output-stream/imm32
789
790 e8/call check-next-stream-line-equal/disp32
791
792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
793
794
795 68/push "F - test-convert-in-data-segment/2"/imm32
796 68/push "03 04 00 00 00 "/imm32
797 68/push _test-output-stream/imm32
798
799 e8/call check-next-stream-line-equal/disp32
800
801 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
802
803 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
804 5d/pop-to-EBP
805 c3/return
806
807 test-convert-code-and-data-segments:
808
809
810 55/push-EBP
811 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
812
813
814
815 68/push _test-input-stream/imm32
816
817 e8/call clear-stream/disp32
818
819 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
820
821
822 b8/copy-to-EAX _test-input-buffered-file/imm32
823 05/add-to-EAX 4/imm32
824 50/push-EAX
825
826 e8/call clear-stream/disp32
827
828 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
829
830
831 68/push _test-output-stream/imm32
832
833 e8/call clear-stream/disp32
834
835 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
836
837
838 b8/copy-to-EAX _test-output-buffered-file/imm32
839 05/add-to-EAX 4/imm32
840 50/push-EAX
841
842 e8/call clear-stream/disp32
843
844 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
845
846
847
848
849
850
851
852
853 68/push "== code"/imm32
854 68/push _test-input-stream/imm32
855
856 e8/call write/disp32
857
858 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
859
860
861 68/push Newline/imm32
862 68/push _test-input-stream/imm32
863
864 e8/call write/disp32
865
866 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
867
868
869 68/push "e8/call 20/disp32"/imm32
870 68/push _test-input-stream/imm32
871
872 e8/call write/disp32
873
874 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
875
876
877 68/push Newline/imm32
878 68/push _test-input-stream/imm32
879
880 e8/call write/disp32
881
882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
883
884
885 68/push "68/push 0x20/imm8"/imm32
886 68/push _test-input-stream/imm32
887
888 e8/call write/disp32
889
890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
891
892
893 68/push Newline/imm32
894 68/push _test-input-stream/imm32
895
896 e8/call write/disp32
897
898 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
899
900
901 68/push "== data"/imm32
902 68/push _test-input-stream/imm32
903
904 e8/call write/disp32
905
906 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
907
908
909 68/push Newline/imm32
910 68/push _test-input-stream/imm32
911
912 e8/call write/disp32
913
914 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
915
916
917 68/push "3 4/imm32"/imm32
918 68/push _test-input-stream/imm32
919
920 e8/call write/disp32
921
922 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
923
924
925 68/push Newline/imm32
926 68/push _test-input-stream/imm32
927
928 e8/call write/disp32
929
930 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
931
932
933 68/push _test-output-buffered-file/imm32
934 68/push _test-input-buffered-file/imm32
935
936 e8/call convert/disp32
937
938 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
939
940
941
942
943
944
945 +-- 34 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
979
980
981 68/push _test-output-buffered-file/imm32
982
983 e8/call flush/disp32
984
985 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
986
987
988 68/push "F - test-convert-code-and-data-segments/0"/imm32
989 68/push "== code"/imm32
990 68/push _test-output-stream/imm32
991
992 e8/call check-next-stream-line-equal/disp32
993
994 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
995
996
997 68/push "F - test-convert-code-and-data-segments/1"/imm32
998 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
999 68/push _test-output-stream/imm32
1000
1001 e8/call check-next-stream-line-equal/disp32
1002
1003 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1004
1005
1006 68/push "F - test-convert-code-and-data-segments/2"/imm32
1007 68/push "68 20 # 68/push 0x20/imm8"/imm32
1008 68/push _test-output-stream/imm32
1009
1010 e8/call check-next-stream-line-equal/disp32
1011
1012 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1013
1014
1015 68/push "F - test-convert-code-and-data-segments/3"/imm32
1016 68/push "== data"/imm32
1017 68/push _test-output-stream/imm32
1018
1019 e8/call check-next-stream-line-equal/disp32
1020
1021 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1022
1023
1024 68/push "F - test-convert-code-and-data-segments/4"/imm32
1025 68/push "03 04 00 00 00 "/imm32
1026 68/push _test-output-stream/imm32
1027
1028 e8/call check-next-stream-line-equal/disp32
1029
1030 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1031
1032 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1033 5d/pop-to-EBP
1034 c3/return
1035
1036 convert-data:
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056 55/push-EBP
1057 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1058
1059 50/push-EAX
1060 51/push-ECX
1061 52/push-EDX
1062
1063 68/push 0/imm32/end
1064 68/push 0/imm32/start
1065 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1066 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
1100 $convert-data:loop:
1101
1102
1103 51/push-ECX
1104 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1105
1106 e8/call next-word/disp32
1107
1108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1109 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
1159 $convert-data:check0:
1160
1161
1162
1163 51/push-ECX
1164
1165 e8/call slice-empty?/disp32
1166
1167 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1168
1169 3d/compare-EAX-and 0/imm32
1170 0f 85/jump-if-not-equal $convert-data:break/disp32
1171 $convert-data:check-for-comment:
1172
1173
1174 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
1175
1176 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1177 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
1178
1179 3d/compare-EAX-and 0x23/imm32/hash
1180 75/jump-if-not-equal $convert-data:check-for-label/disp8
1181 $convert-data:comment:
1182
1183
1184 51/push-ECX
1185 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1186
1187 e8/call write-slice/disp32
1188
1189 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1190
1191 75/jump-if-not-equal $convert-data:break/disp8
1192 $convert-data:check-for-label:
1193
1194
1195 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
1196
1197 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1198 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
1199
1200 3d/compare-EAX-and 0x3a/imm32/colon
1201 75/jump-if-not-equal $convert-data:check-for-imm32/disp8
1202 $convert-data:label:
1203
1204
1205 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1206 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1207
1208 e8/call write-stream-data/disp32
1209
1210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1211
1212 75/jump-if-not-equal $convert-data:break/disp8
1213 $convert-data:check-for-imm32:
1214
1215
1216
1217 68/push "imm32"/imm32
1218 51/push-ECX
1219
1220 e8/call has-metadata?/disp32
1221
1222 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1223
1224 3d/compare-EAX-and 0/imm32
1225 74/jump-if-equal $convert-data:single-byte/disp8
1226 $convert-data:imm32:
1227
1228
1229 68/push 4/imm32
1230 51/push-ECX
1231 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1232
1233 e8/call emit/disp32
1234
1235 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1236 e9/jump $convert-data:loop/disp32
1237 $convert-data:single-byte:
1238
1239
1240 68/push 1/imm32
1241 51/push-ECX
1242 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1243
1244 e8/call emit/disp32
1245
1246 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1247 e9/jump $convert-data:loop/disp32
1248 $convert-data:break:
1249 $convert-data:end:
1250
1251 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1252
1253 5a/pop-to-EDX
1254 59/pop-to-ECX
1255 58/pop-to-EAX
1256
1257 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1258 5d/pop-to-EBP
1259 c3/return
1260
1261 test-convert-data-passes-comments-through:
1262
1263
1264 55/push-EBP
1265 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1266
1267
1268
1269 68/push _test-input-stream/imm32
1270
1271 e8/call clear-stream/disp32
1272
1273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1274
1275
1276 68/push _test-output-stream/imm32
1277
1278 e8/call clear-stream/disp32
1279
1280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1281
1282
1283 b8/copy-to-EAX _test-output-buffered-file/imm32
1284 05/add-to-EAX 4/imm32
1285 50/push-EAX
1286
1287 e8/call clear-stream/disp32
1288
1289 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1290
1291
1292
1293 68/push "# abcd"/imm32
1294 68/push _test-input-stream/imm32
1295
1296 e8/call write/disp32
1297
1298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1299
1300
1301 68/push _test-output-buffered-file/imm32
1302 68/push _test-input-stream/imm32
1303
1304 e8/call convert-data/disp32
1305
1306 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1307
1308
1309
1310 68/push _test-output-buffered-file/imm32
1311
1312 e8/call flush/disp32
1313
1314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1315 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1349
1350
1351 68/push "F - test-convert-data-passes-comments-through"/imm32
1352 68/push "# abcd"/imm32
1353 68/push _test-output-stream/imm32
1354
1355 e8/call check-stream-equal/disp32
1356
1357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1358
1359 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1360 5d/pop-to-EBP
1361 c3/return
1362
1363 test-convert-data-passes-labels-through:
1364
1365
1366 55/push-EBP
1367 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1368
1369
1370
1371 68/push _test-input-stream/imm32
1372
1373 e8/call clear-stream/disp32
1374
1375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1376
1377
1378 68/push _test-output-stream/imm32
1379
1380 e8/call clear-stream/disp32
1381
1382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1383
1384
1385 b8/copy-to-EAX _test-output-buffered-file/imm32
1386 05/add-to-EAX 4/imm32
1387 50/push-EAX
1388
1389 e8/call clear-stream/disp32
1390
1391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1392
1393
1394
1395 68/push "ab: # cd"/imm32
1396 68/push _test-input-stream/imm32
1397
1398 e8/call write/disp32
1399
1400 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1401
1402
1403 68/push _test-output-buffered-file/imm32
1404 68/push _test-input-stream/imm32
1405
1406 e8/call convert-data/disp32
1407
1408 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1409
1410
1411
1412 68/push _test-output-buffered-file/imm32
1413
1414 e8/call flush/disp32
1415
1416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1417
1418
1419 68/push "F - test-convert-data-passes-labels-through"/imm32
1420 68/push "ab: # cd"/imm32
1421 68/push _test-output-stream/imm32
1422
1423 e8/call check-stream-equal/disp32
1424
1425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1426
1427 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1428 5d/pop-to-EBP
1429 c3/return
1430
1431 test-convert-data-passes-names-through:
1432
1433
1434
1435 55/push-EBP
1436 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1437
1438
1439
1440 68/push _test-input-stream/imm32
1441
1442 e8/call clear-stream/disp32
1443
1444 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1445
1446
1447 68/push _test-output-stream/imm32
1448
1449 e8/call clear-stream/disp32
1450
1451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1452
1453
1454 b8/copy-to-EAX _test-output-buffered-file/imm32
1455 05/add-to-EAX 4/imm32
1456 50/push-EAX
1457
1458 e8/call clear-stream/disp32
1459
1460 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1461
1462
1463
1464 68/push "abcd/imm32"/imm32
1465 68/push _test-input-stream/imm32
1466
1467 e8/call write/disp32
1468
1469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1470
1471
1472 68/push _test-output-buffered-file/imm32
1473 68/push _test-input-stream/imm32
1474
1475 e8/call convert-data/disp32
1476
1477 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1478
1479
1480
1481 68/push _test-output-buffered-file/imm32
1482
1483 e8/call flush/disp32
1484
1485 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1486
1487
1488 68/push "F - test-convert-data-passes-names-through"/imm32
1489 68/push "abcd/imm32 "/imm32
1490 68/push _test-output-stream/imm32
1491
1492 e8/call check-stream-equal/disp32
1493
1494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1495
1496 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1497 5d/pop-to-EBP
1498 c3/return
1499
1500 test-convert-data-handles-imm32:
1501
1502
1503 55/push-EBP
1504 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1505
1506
1507
1508 68/push _test-input-stream/imm32
1509
1510 e8/call clear-stream/disp32
1511
1512 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1513
1514
1515 68/push _test-output-stream/imm32
1516
1517 e8/call clear-stream/disp32
1518
1519 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1520
1521
1522 b8/copy-to-EAX _test-output-buffered-file/imm32
1523 05/add-to-EAX 4/imm32
1524 50/push-EAX
1525
1526 e8/call clear-stream/disp32
1527
1528 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1529
1530
1531
1532 68/push "30/imm32"/imm32
1533 68/push _test-input-stream/imm32
1534
1535 e8/call write/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1538
1539
1540 68/push _test-output-buffered-file/imm32
1541 68/push _test-input-stream/imm32
1542
1543 e8/call convert-data/disp32
1544
1545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1546
1547
1548
1549 68/push _test-output-buffered-file/imm32
1550
1551 e8/call flush/disp32
1552
1553 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1554
1555
1556 68/push "F - test-convert-data-handles-imm32"/imm32
1557 68/push "30 00 00 00 "/imm32
1558 68/push _test-output-stream/imm32
1559
1560 e8/call check-stream-equal/disp32
1561
1562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1563
1564 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1565 5d/pop-to-EBP
1566 c3/return
1567
1568 test-convert-data-handles-single-byte:
1569
1570
1571
1572 55/push-EBP
1573 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1574
1575
1576
1577 68/push _test-input-stream/imm32
1578
1579 e8/call clear-stream/disp32
1580
1581 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1582
1583
1584 68/push _test-output-stream/imm32
1585
1586 e8/call clear-stream/disp32
1587
1588 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1589
1590
1591 b8/copy-to-EAX _test-output-buffered-file/imm32
1592 05/add-to-EAX 4/imm32
1593 50/push-EAX
1594
1595 e8/call clear-stream/disp32
1596
1597 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1598
1599
1600
1601 68/push "30/imm16"/imm32
1602 68/push _test-input-stream/imm32
1603
1604 e8/call write/disp32
1605
1606 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1607
1608
1609 68/push _test-output-buffered-file/imm32
1610 68/push _test-input-stream/imm32
1611
1612 e8/call convert-data/disp32
1613
1614 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1615
1616
1617
1618 68/push _test-output-buffered-file/imm32
1619
1620 e8/call flush/disp32
1621
1622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1623
1624
1625 68/push "F - test-convert-data-handles-single-byte"/imm32
1626 68/push "30 "/imm32
1627 68/push _test-output-stream/imm32
1628
1629 e8/call check-stream-equal/disp32
1630
1631 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1632
1633 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1634 5d/pop-to-EBP
1635 c3/return
1636
1637 test-convert-data-multiple-bytes:
1638
1639
1640 55/push-EBP
1641 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1642
1643
1644
1645 68/push _test-input-stream/imm32
1646
1647 e8/call clear-stream/disp32
1648
1649 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1650
1651
1652 68/push _test-output-stream/imm32
1653
1654 e8/call clear-stream/disp32
1655
1656 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1657
1658
1659 b8/copy-to-EAX _test-output-buffered-file/imm32
1660 05/add-to-EAX 4/imm32
1661 50/push-EAX
1662
1663 e8/call clear-stream/disp32
1664
1665 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1666
1667
1668
1669 68/push "1 2"/imm32
1670 68/push _test-input-stream/imm32
1671
1672 e8/call write/disp32
1673
1674 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1675
1676
1677 68/push _test-output-buffered-file/imm32
1678 68/push _test-input-stream/imm32
1679
1680 e8/call convert-data/disp32
1681
1682 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1683
1684
1685
1686 68/push _test-output-buffered-file/imm32
1687
1688 e8/call flush/disp32
1689
1690 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1691
1692
1693 68/push "F - test-convert-data-multiple-bytes"/imm32
1694 68/push "01 02 "/imm32
1695 68/push _test-output-stream/imm32
1696
1697 e8/call check-stream-equal/disp32
1698
1699 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1700
1701 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1702 5d/pop-to-EBP
1703 c3/return
1704
1705 test-convert-data-byte-then-name:
1706
1707
1708 55/push-EBP
1709 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1710
1711
1712
1713 68/push _test-input-stream/imm32
1714
1715 e8/call clear-stream/disp32
1716
1717 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1718
1719
1720 68/push _test-output-stream/imm32
1721
1722 e8/call clear-stream/disp32
1723
1724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1725
1726
1727 b8/copy-to-EAX _test-output-buffered-file/imm32
1728 05/add-to-EAX 4/imm32
1729 50/push-EAX
1730
1731 e8/call clear-stream/disp32
1732
1733 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1734
1735
1736
1737 68/push "30 abcd/o"/imm32
1738 68/push _test-input-stream/imm32
1739
1740 e8/call write/disp32
1741
1742 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1743
1744
1745 68/push _test-output-buffered-file/imm32
1746 68/push _test-input-stream/imm32
1747
1748 e8/call convert-data/disp32
1749
1750 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1751
1752
1753
1754 68/push _test-output-buffered-file/imm32
1755
1756 e8/call flush/disp32
1757
1758 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1759
1760
1761 68/push "F - test-convert-data-byte-then-name"/imm32
1762 68/push "30 abcd/o "/imm32
1763 68/push _test-output-stream/imm32
1764
1765 e8/call check-stream-equal/disp32
1766
1767 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1768
1769 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1770 5d/pop-to-EBP
1771 c3/return
1772
1773 test-convert-data-multiple-words:
1774
1775
1776 55/push-EBP
1777 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1778
1779
1780
1781 68/push _test-input-stream/imm32
1782
1783 e8/call clear-stream/disp32
1784
1785 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1786
1787
1788 68/push _test-output-stream/imm32
1789
1790 e8/call clear-stream/disp32
1791
1792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1793
1794
1795 b8/copy-to-EAX _test-output-buffered-file/imm32
1796 05/add-to-EAX 4/imm32
1797 50/push-EAX
1798
1799 e8/call clear-stream/disp32
1800
1801 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1802
1803
1804
1805 68/push "30 abcd/o 42e1/imm32"/imm32
1806 68/push _test-input-stream/imm32
1807
1808 e8/call write/disp32
1809
1810 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1811
1812
1813 68/push _test-output-buffered-file/imm32
1814 68/push _test-input-stream/imm32
1815
1816 e8/call convert-data/disp32
1817
1818 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1819
1820
1821
1822 68/push _test-output-buffered-file/imm32
1823
1824 e8/call flush/disp32
1825
1826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1827 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1861
1862
1863 68/push "F - test-convert-data-multiple-words"/imm32
1864 68/push "30 abcd/o e1 42 00 00 "/imm32
1865 68/push _test-output-stream/imm32
1866
1867 e8/call check-stream-equal/disp32
1868
1869 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1870
1871 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1872 5d/pop-to-EBP
1873 c3/return
1874
1875 test-convert-data-trailing-comment:
1876
1877
1878 55/push-EBP
1879 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1880
1881
1882
1883 68/push _test-input-stream/imm32
1884
1885 e8/call clear-stream/disp32
1886
1887 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1888
1889
1890 68/push _test-output-stream/imm32
1891
1892 e8/call clear-stream/disp32
1893
1894 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1895
1896
1897 b8/copy-to-EAX _test-output-buffered-file/imm32
1898 05/add-to-EAX 4/imm32
1899 50/push-EAX
1900
1901 e8/call clear-stream/disp32
1902
1903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1904
1905
1906
1907 68/push "30/imm32 # comment"/imm32
1908 68/push _test-input-stream/imm32
1909
1910 e8/call write/disp32
1911
1912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1913
1914
1915 68/push _test-output-buffered-file/imm32
1916 68/push _test-input-stream/imm32
1917
1918 e8/call convert-data/disp32
1919
1920 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1921
1922
1923
1924 68/push _test-output-buffered-file/imm32
1925
1926 e8/call flush/disp32
1927
1928 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1929 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1963
1964
1965 68/push "F - test-convert-data-trailing-comment"/imm32
1966 68/push "30 00 00 00 # comment"/imm32
1967 68/push _test-output-stream/imm32
1968
1969 e8/call check-stream-equal/disp32
1970
1971 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1972
1973 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1974 5d/pop-to-EBP
1975 c3/return
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987 convert-instruction:
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009 55/push-EBP
2010 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2011
2012 50/push-EAX
2013 51/push-ECX
2014 52/push-EDX
2015
2016 68/push 0/imm32/end
2017 68/push 0/imm32/start
2018 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2019
2020
2021 51/push-ECX
2022 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2023
2024 e8/call next-word/disp32
2025
2026 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2027 $convert-instruction:check0:
2028
2029
2030
2031 51/push-ECX
2032
2033 e8/call slice-empty?/disp32
2034
2035 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2036
2037 3d/compare-EAX-and 0/imm32
2038 75/jump-if-not-equal $convert-instruction:pass-through/disp8
2039 $convert-instruction:check1:
2040
2041
2042 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2043
2044 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2045 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2046
2047 3d/compare-EAX-and 0x23/imm32/hash
2048 74/jump-if-equal $convert-instruction:pass-through/disp8
2049 $convert-instruction:check2:
2050
2051
2052 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
2053
2054 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2055 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
2056
2057 3d/compare-EAX-and 0x3a/imm32/colon
2058 75/jump-if-not-equal $convert-instruction:really-convert/disp8
2059 $convert-instruction:pass-through:
2060
2061
2062 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2063 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2064
2065 e8/call write-stream-data/disp32
2066
2067 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2068
2069 eb/jump $convert-instruction:end/disp8
2070 $convert-instruction:really-convert:
2071
2072
2073 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2074 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2075
2076 e8/call emit-opcodes/disp32
2077
2078 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2079
2080
2081 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2082 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2083
2084 e8/call emit-modrm/disp32
2085
2086 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2087
2088
2089 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2090 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2091
2092 e8/call emit-sib/disp32
2093
2094 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2095
2096
2097 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2098 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2099
2100 e8/call emit-disp/disp32
2101
2102 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2103
2104
2105 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2106 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2107
2108 e8/call emit-imm/disp32
2109
2110 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2111
2112
2113 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2114 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2115
2116 e8/call emit-line-in-comment/disp32
2117
2118 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2119 $convert-instruction:end:
2120
2121 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2122
2123 5a/pop-to-EDX
2124 59/pop-to-ECX
2125 58/pop-to-EAX
2126
2127 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2128 5d/pop-to-EBP
2129 c3/return
2130
2131 emit-opcodes:
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165 55/push-EBP
2166 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2167
2168 50/push-EAX
2169 51/push-ECX
2170 52/push-EDX
2171 53/push-EBX
2172
2173 68/push 0/imm32/end
2174 68/push 0/imm32/start
2175 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2176
2177 68/push 0/imm32/end
2178 68/push 0/imm32/start
2179 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
2180
2181
2182 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2183
2184 e8/call rewind-stream/disp32
2185
2186 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2187 $emit-opcodes:op1:
2188
2189
2190 51/push-ECX
2191 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2192
2193 e8/call next-word/disp32
2194
2195 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2196
2197
2198
2199 51/push-ECX
2200
2201 e8/call slice-empty?/disp32
2202
2203 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2204
2205 3d/compare-EAX-and 0/imm32
2206 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2207
2208
2209 8b/copy 0/mod/indirect 1/rm32/ECX . . . 3/r32/EBX . .
2210
2211 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2212 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2213
2214 3d/compare-EAX-and 0x23/imm32/hash
2215 0f 84/jump-if-equal $emit-opcodes:end/disp32
2216
2217
2218 51/push-ECX
2219 68/push 0x2f/imm32/slash
2220 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 .
2221 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
2222
2223 e8/call next-token-from-slice/disp32
2224
2225 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2226
2227
2228 51/push-ECX
2229 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2230
2231 e8/call write-slice/disp32
2232
2233 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2234
2235
2236 68/push " "/imm32
2237 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2238
2239 e8/call write-buffered/disp32
2240
2241 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2242
2243
2244
2245 68/push "0f"/imm32
2246 51/push-ECX
2247
2248 e8/call slice-equal?/disp32
2249
2250 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2251
2252 3d/compare-EAX-and 0/imm32
2253 75/jump-if-not-equal $emit-opcodes:op2/disp8
2254
2255
2256
2257 68/push "f2"/imm32
2258 51/push-ECX
2259
2260 e8/call slice-equal?/disp32
2261
2262 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2263
2264 3d/compare-EAX-and 0/imm32
2265 75/jump-if-not-equal $emit-opcodes:op2/disp8
2266
2267
2268
2269 68/push "f3"/imm32
2270 51/push-ECX
2271
2272 e8/call slice-equal?/disp32
2273
2274 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2275
2276 3d/compare-EAX-and 0/imm32
2277 75/jump-if-not-equal $emit-opcodes:op2/disp8
2278
2279 e9/jump $emit-opcodes:end/disp32
2280 $emit-opcodes:op2:
2281
2282
2283 52/push-EDX
2284 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2285
2286 e8/call next-word/disp32
2287
2288 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2289
2290
2291
2292 52/push-EDX
2293
2294 e8/call slice-empty?/disp32
2295
2296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2297
2298 3d/compare-EAX-and 0/imm32
2299 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2300
2301
2302 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2303
2304 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2305 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2306
2307 3d/compare-EAX-and 0x23/imm32/hash
2308 0f 84/jump-if-equal $emit-opcodes:end/disp32
2309
2310
2311 52/push-EDX
2312 68/push 0x2f/imm32/slash
2313 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2314 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2315
2316 e8/call next-token-from-slice/disp32
2317
2318 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2319
2320
2321 52/push-EDX
2322 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2323
2324 e8/call write-slice/disp32
2325
2326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2327
2328
2329 68/push " "/imm32
2330 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2331
2332 e8/call write-buffered/disp32
2333
2334 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2335
2336
2337
2338 68/push "0f"/imm32
2339 51/push-ECX
2340
2341 e8/call slice-equal?/disp32
2342
2343 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2344
2345 3d/compare-EAX-and 0/imm32
2346 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2347
2348
2349
2350 68/push "0f"/imm32
2351 52/push-EDX
2352
2353 e8/call slice-equal?/disp32
2354
2355 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2356
2357 3d/compare-EAX-and 0/imm32
2358 0f 84/jump-if-equal $emit-opcodes:end/disp32
2359 $emit-opcodes:op3:
2360
2361
2362 52/push-EDX
2363 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2364
2365 e8/call next-word/disp32
2366
2367 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2368
2369
2370
2371 52/push-EDX
2372
2373 e8/call slice-empty?/disp32
2374
2375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2376
2377 3d/compare-EAX-and 0/imm32
2378 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2379
2380
2381 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2382
2383 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2384 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2385
2386 3d/compare-EAX-and 0x23/imm32/hash
2387 0f 84/jump-if-equal $emit-opcodes:end/disp32
2388
2389
2390 52/push-EDX
2391 68/push 0x2f/imm32/slash
2392 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2393 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2394
2395 e8/call next-token-from-slice/disp32
2396
2397 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2398
2399
2400 52/push-EDX
2401 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2402
2403 e8/call write-slice/disp32
2404
2405 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2406
2407
2408 68/push " "/imm32
2409 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2410
2411 e8/call write-buffered/disp32
2412
2413 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2414 $emit-opcodes:end:
2415
2416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2417
2418 5b/pop-to-EBX
2419 5a/pop-to-EDX
2420 59/pop-to-ECX
2421 58/pop-to-EAX
2422
2423 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2424 5d/pop-to-EBP
2425 c3/return
2426
2427 emit-modrm:
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454 55/push-EBP
2455 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2456
2457 50/push-EAX
2458 51/push-ECX
2459 52/push-EDX
2460 53/push-EBX
2461 56/push-ESI
2462 57/push-EDI
2463
2464 68/push 0/imm32/end
2465 68/push 0/imm32/start
2466 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2467
2468 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2469
2470 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2471
2472 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2473
2474 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2475
2476
2477 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2478
2479 e8/call rewind-stream/disp32
2480
2481 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2482 $emit-modrm:loop:
2483 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2517
2518
2519 51/push-ECX
2520 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2521
2522 e8/call next-word/disp32
2523
2524 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2525 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2575 $emit-modrm:check0:
2576
2577
2578
2579 51/push-ECX
2580
2581 e8/call slice-empty?/disp32
2582
2583 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2584
2585 3d/compare-EAX-and 0/imm32
2586 0f 85/jump-if-not-equal $emit-modrm:break/disp32
2587 $emit-modrm:check1:
2588
2589
2590 52/push-EDX
2591
2592 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2593
2594 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2595 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2596
2597 5a/pop-to-EDX
2598
2599 3d/compare-EAX-and 0x23/imm32/hash
2600 0f 84/jump-if-equal $emit-modrm:break/disp32
2601 $emit-modrm:check-for-mod:
2602
2603
2604
2605 68/push "mod"/imm32
2606 51/push-ECX
2607
2608 e8/call has-metadata?/disp32
2609
2610 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2611
2612 3d/compare-EAX-and 0/imm32
2613 74/jump-if-equal $emit-modrm:check-for-rm32/disp8
2614 $emit-modrm:mod:
2615
2616
2617
2618 51/push-ECX
2619
2620 e8/call parse-datum-of-word/disp32
2621
2622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2623
2624 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2625
2626 ba/copy-to-EDX 1/imm32/true
2627
2628 e9/jump $emit-modrm:loop/disp32
2629 $emit-modrm:check-for-rm32:
2630
2631
2632
2633 68/push "rm32"/imm32
2634 51/push-ECX
2635
2636 e8/call has-metadata?/disp32
2637
2638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2639
2640 3d/compare-EAX-and 0/imm32
2641 74/jump-if-equal $emit-modrm:check-for-r32/disp8
2642 $emit-modrm:rm32:
2643
2644
2645
2646 51/push-ECX
2647
2648 e8/call parse-datum-of-word/disp32
2649
2650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2651
2652 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2653
2654 ba/copy-to-EDX 1/imm32/true
2655
2656 e9/jump $emit-modrm:loop/disp32
2657 $emit-modrm:check-for-r32:
2658
2659
2660
2661 68/push "r32"/imm32
2662 51/push-ECX
2663
2664 e8/call has-metadata?/disp32
2665
2666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2667
2668 3d/compare-EAX-and 0/imm32
2669 74/jump-if-equal $emit-modrm:check-for-subop/disp8
2670 $emit-modrm:r32:
2671
2672
2673
2674 51/push-ECX
2675
2676 e8/call parse-datum-of-word/disp32
2677
2678 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2679
2680 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2681
2682 ba/copy-to-EDX 1/imm32/true
2683
2684 e9/jump $emit-modrm:loop/disp32
2685 $emit-modrm:check-for-subop:
2686
2687
2688
2689 68/push "subop"/imm32
2690 51/push-ECX
2691
2692 e8/call has-metadata?/disp32
2693
2694 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2695
2696 3d/compare-EAX-and 0/imm32
2697 0f 84/jump-if-equal $emit-modrm:loop/disp32
2698 $emit-modrm:subop:
2699
2700
2701
2702 51/push-ECX
2703
2704 e8/call parse-datum-of-word/disp32
2705
2706 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2707
2708 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2709
2710 ba/copy-to-EDX 1/imm32/true
2711
2712 e9/jump $emit-modrm:loop/disp32
2713 $emit-modrm:break:
2714
2715 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
2716 74/jump-if-equal $emit-modrm:end/disp8
2717 $emit-modrm:calculate:
2718
2719 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
2720
2721 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 2/imm8
2722
2723 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
2724 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
2725
2726 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2727
2728 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
2729 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
2730 $emit-modrm:emit:
2731
2732
2733 68/push 1/imm32
2734 53/push-EBX
2735 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2736
2737 e8/call emit-hex/disp32
2738
2739 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2740 $emit-modrm:end:
2741
2742 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2743
2744 5f/pop-to-EDI
2745 5e/pop-to-ESI
2746 5b/pop-to-EBX
2747 5a/pop-to-EDX
2748 59/pop-to-ECX
2749 58/pop-to-EAX
2750
2751 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2752 5d/pop-to-EBP
2753 c3/return
2754
2755 emit-sib:
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781 55/push-EBP
2782 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2783
2784 50/push-EAX
2785 51/push-ECX
2786 52/push-EDX
2787 53/push-EBX
2788 56/push-ESI
2789 57/push-EDI
2790
2791 68/push 0/imm32/end
2792 68/push 0/imm32/start
2793 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2794
2795 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2796
2797 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2798
2799 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2800
2801 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2802
2803
2804 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2805
2806 e8/call rewind-stream/disp32
2807
2808 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2809 $emit-sib:loop:
2810 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2844
2845
2846 51/push-ECX
2847 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2848
2849 e8/call next-word/disp32
2850
2851 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2852 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2902 $emit-sib:check0:
2903
2904
2905
2906 51/push-ECX
2907
2908 e8/call slice-empty?/disp32
2909
2910 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2911
2912 3d/compare-EAX-and 0/imm32
2913 0f 85/jump-if-not-equal $emit-sib:break/disp32
2914 $emit-sib:check1:
2915
2916
2917 52/push-EDX
2918
2919 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2920
2921 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2922 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2923
2924 5a/pop-to-EDX
2925
2926 3d/compare-EAX-and 0x23/imm32/hash
2927 0f 84/jump-if-equal $emit-sib:break/disp32
2928 $emit-sib:check-for-scale:
2929
2930
2931
2932 68/push "scale"/imm32
2933 51/push-ECX
2934
2935 e8/call has-metadata?/disp32
2936
2937 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2938
2939 3d/compare-EAX-and 0/imm32
2940 74/jump-if-equal $emit-sib:check-for-base/disp8
2941 $emit-sib:scale:
2942
2943
2944
2945 51/push-ECX
2946
2947 e8/call parse-datum-of-word/disp32
2948
2949 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2950
2951 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2952
2953 ba/copy-to-EDX 1/imm32/true
2954
2955 e9/jump $emit-sib:loop/disp32
2956 $emit-sib:check-for-base:
2957
2958
2959
2960 68/push "base"/imm32
2961 51/push-ECX
2962
2963 e8/call has-metadata?/disp32
2964
2965 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2966
2967 3d/compare-EAX-and 0/imm32
2968 74/jump-if-equal $emit-sib:check-for-index/disp8
2969 $emit-sib:base:
2970
2971
2972
2973 51/push-ECX
2974
2975 e8/call parse-datum-of-word/disp32
2976
2977 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2978
2979 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2980
2981 ba/copy-to-EDX 1/imm32/true
2982
2983 e9/jump $emit-sib:loop/disp32
2984 $emit-sib:check-for-index:
2985
2986
2987
2988 68/push "index"/imm32
2989 51/push-ECX
2990
2991 e8/call has-metadata?/disp32
2992
2993 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2994
2995 3d/compare-EAX-and 0/imm32
2996 0f 84/jump-if-equal $emit-sib:loop/disp32
2997 $emit-sib:index:
2998
2999
3000
3001 51/push-ECX
3002
3003 e8/call parse-datum-of-word/disp32
3004
3005 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3006
3007 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
3008
3009 ba/copy-to-EDX 1/imm32/true
3010
3011 e9/jump $emit-sib:loop/disp32
3012 $emit-sib:break:
3013
3014 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
3015 74/jump-if-equal $emit-sib:end/disp8
3016 $emit-sib:calculate:
3017
3018 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
3019
3020 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 2/imm8
3021
3022 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
3023 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
3024
3025 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
3026
3027 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
3028 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
3029 $emit-sib:emit:
3030
3031
3032 68/push 1/imm32
3033 53/push-EBX
3034 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3035
3036 e8/call emit-hex/disp32
3037
3038 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3039 $emit-sib:end:
3040
3041 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3042
3043 5f/pop-to-EDI
3044 5e/pop-to-ESI
3045 5b/pop-to-EBX
3046 5a/pop-to-EDX
3047 59/pop-to-ECX
3048 58/pop-to-EAX
3049
3050 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3051 5d/pop-to-EBP
3052 c3/return
3053
3054 emit-disp:
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073 55/push-EBP
3074 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3075
3076 50/push-EAX
3077 51/push-ECX
3078 52/push-EDX
3079
3080 68/push 0/imm32/end
3081 68/push 0/imm32/start
3082 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3083
3084
3085 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3086
3087 e8/call rewind-stream/disp32
3088
3089 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3090 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
3124 $emit-disp:loop:
3125
3126
3127 51/push-ECX
3128 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3129
3130 e8/call next-word/disp32
3131
3132 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3133 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3183 $emit-disp:check0:
3184
3185
3186
3187 51/push-ECX
3188
3189 e8/call slice-empty?/disp32
3190
3191 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3192
3193 3d/compare-EAX-and 0/imm32
3194 0f 85/jump-if-not-equal $emit-disp:break/disp32
3195 $emit-disp:check1:
3196
3197
3198 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3199
3200 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3201 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3202
3203 3d/compare-EAX-and 0x23/imm32/hash
3204 0f 84/jump-if-equal $emit-disp:break/disp32
3205 $emit-disp:check-for-disp32:
3206
3207
3208
3209 68/push "disp32"/imm32
3210 51/push-ECX
3211
3212 e8/call has-metadata?/disp32
3213
3214 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3215
3216 3d/compare-EAX-and 0/imm32
3217 74/jump-if-equal $emit-disp:check-for-disp16/disp8
3218 $emit-disp:disp32:
3219
3220
3221 68/push 4/imm32
3222 51/push-ECX
3223 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3224
3225 e8/call emit/disp32
3226
3227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3228
3229 e9/jump $emit-disp:break/disp32
3230 $emit-disp:check-for-disp16:
3231
3232
3233
3234 68/push "disp16"/imm32
3235 51/push-ECX
3236
3237 e8/call has-metadata?/disp32
3238
3239 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3240
3241 3d/compare-EAX-and 0/imm32
3242 74/jump-if-equal $emit-disp:check-for-disp8/disp8
3243 $emit-disp:disp16:
3244
3245
3246 68/push 2/imm32
3247 51/push-ECX
3248 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3249
3250 e8/call emit/disp32
3251
3252 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3253
3254 e9/jump $emit-disp:break/disp32
3255 $emit-disp:check-for-disp8:
3256
3257
3258
3259 68/push "disp8"/imm32
3260 51/push-ECX
3261
3262 e8/call has-metadata?/disp32
3263
3264 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3265
3266 3d/compare-EAX-and 0/imm32
3267 0f 84/jump-if-equal $emit-disp:loop/disp32
3268 $emit-disp:disp8:
3269
3270
3271 68/push 1/imm32
3272 51/push-ECX
3273 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3274
3275 e8/call emit/disp32
3276
3277 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3278
3279 $emit-disp:break:
3280
3281 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3282
3283 5a/pop-to-EDX
3284 59/pop-to-ECX
3285 58/pop-to-EAX
3286
3287 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3288 5d/pop-to-EBP
3289 c3/return
3290
3291 emit-imm:
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310 55/push-EBP
3311 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3312
3313 50/push-EAX
3314 51/push-ECX
3315 52/push-EDX
3316
3317 68/push 0/imm32/end
3318 68/push 0/imm32/start
3319 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3320
3321
3322 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3323
3324 e8/call rewind-stream/disp32
3325
3326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3327 +-- 34 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
3361 $emit-imm:loop:
3362
3363
3364 51/push-ECX
3365 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3366
3367 e8/call next-word/disp32
3368
3369 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3370 +-- 50 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3420 $emit-imm:check0:
3421
3422
3423
3424 51/push-ECX
3425
3426 e8/call slice-empty?/disp32
3427
3428 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3429
3430 3d/compare-EAX-and 0/imm32
3431 0f 85/jump-if-not-equal $emit-imm:break/disp32
3432 $emit-imm:check1:
3433
3434
3435 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3436
3437 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3438 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3439
3440 3d/compare-EAX-and 0x23/imm32/hash
3441 0f 84/jump-if-equal $emit-imm:break/disp32
3442 $emit-imm:check-for-imm32:
3443
3444
3445
3446 68/push "imm32"/imm32
3447 51/push-ECX
3448
3449 e8/call has-metadata?/disp32
3450
3451 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3452
3453 3d/compare-EAX-and 0/imm32
3454 74/jump-if-equal $emit-imm:check-for-imm16/disp8
3455 $emit-imm:imm32:
3456
3457
3458 68/push 4/imm32
3459 51/push-ECX
3460 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3461
3462 e8/call emit/disp32
3463
3464 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3465
3466 e9/jump $emit-imm:break/disp32
3467 $emit-imm:check-for-imm16:
3468
3469
3470
3471 68/push "imm16"/imm32
3472 51/push-ECX
3473
3474 e8/call has-metadata?/disp32
3475
3476 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3477
3478 3d/compare-EAX-and 0/imm32
3479 74/jump-if-equal $emit-imm:check-for-imm8/disp8
3480 $emit-imm:imm16:
3481
3482
3483 68/push 2/imm32
3484 51/push-ECX
3485 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3486
3487 e8/call emit/disp32
3488
3489 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3490
3491 e9/jump $emit-imm:break/disp32
3492 $emit-imm:check-for-imm8:
3493
3494
3495
3496 68/push "imm8"/imm32
3497 51/push-ECX
3498
3499 e8/call has-metadata?/disp32
3500
3501 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3502
3503 3d/compare-EAX-and 0/imm32
3504 0f 84/jump-if-equal $emit-imm:loop/disp32
3505 $emit-imm:imm8:
3506
3507
3508 68/push 1/imm32
3509 51/push-ECX
3510 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3511
3512 e8/call emit/disp32
3513
3514 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3515
3516 $emit-imm:break:
3517
3518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3519
3520 5a/pop-to-EDX
3521 59/pop-to-ECX
3522 58/pop-to-EAX
3523
3524 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3525 5d/pop-to-EBP
3526 c3/return
3527
3528 emit-line-in-comment:
3529
3530 55/push-EBP
3531 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3532
3533
3534 68/push " # "/imm32
3535 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3536
3537 e8/call write-buffered/disp32
3538
3539 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3540
3541
3542 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3543 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3544
3545 e8/call write-stream-data/disp32
3546
3547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3548 $emit-line-in-comment:end:
3549
3550 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3551 5d/pop-to-EBP
3552 c3/return
3553
3554 test-convert-instruction-passes-comments-through:
3555
3556
3557 55/push-EBP
3558 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3559
3560
3561
3562 68/push _test-input-stream/imm32
3563
3564 e8/call clear-stream/disp32
3565
3566 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3567
3568
3569 68/push _test-output-stream/imm32
3570
3571 e8/call clear-stream/disp32
3572
3573 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3574
3575
3576 b8/copy-to-EAX _test-output-buffered-file/imm32
3577 05/add-to-EAX 4/imm32
3578 50/push-EAX
3579
3580 e8/call clear-stream/disp32
3581
3582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3583
3584
3585
3586 68/push "# abcd"/imm32
3587 68/push _test-input-stream/imm32
3588
3589 e8/call write/disp32
3590
3591 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3592
3593
3594 68/push _test-output-buffered-file/imm32
3595 68/push _test-input-stream/imm32
3596
3597 e8/call convert-instruction/disp32
3598
3599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3600
3601
3602
3603 68/push _test-output-buffered-file/imm32
3604
3605 e8/call flush/disp32
3606
3607 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3608
3609
3610 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3611 68/push "# abcd"/imm32
3612 68/push _test-output-stream/imm32
3613
3614 e8/call check-stream-equal/disp32
3615
3616 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3617
3618 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3619 5d/pop-to-EBP
3620 c3/return
3621
3622 test-convert-instruction-passes-labels-through:
3623
3624
3625 55/push-EBP
3626 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3627
3628
3629
3630 68/push _test-input-stream/imm32
3631
3632 e8/call clear-stream/disp32
3633
3634 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3635
3636
3637 68/push _test-output-stream/imm32
3638
3639 e8/call clear-stream/disp32
3640
3641 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3642
3643
3644 b8/copy-to-EAX _test-output-buffered-file/imm32
3645 05/add-to-EAX 4/imm32
3646 50/push-EAX
3647
3648 e8/call clear-stream/disp32
3649
3650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3651
3652
3653
3654 68/push "ab: # cd"/imm32
3655 68/push _test-input-stream/imm32
3656
3657 e8/call write/disp32
3658
3659 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3660
3661
3662 68/push _test-output-buffered-file/imm32
3663 68/push _test-input-stream/imm32
3664
3665 e8/call convert-instruction/disp32
3666
3667 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3668
3669
3670
3671 68/push _test-output-buffered-file/imm32
3672
3673 e8/call flush/disp32
3674
3675 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3676
3677
3678 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3679 68/push "ab: # cd"/imm32
3680 68/push _test-output-stream/imm32
3681
3682 e8/call check-stream-equal/disp32
3683
3684 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3685
3686 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3687 5d/pop-to-EBP
3688 c3/return
3689
3690 test-convert-instruction-handles-single-opcode:
3691
3692
3693 55/push-EBP
3694 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3695
3696
3697
3698 68/push _test-input-stream/imm32
3699
3700 e8/call clear-stream/disp32
3701
3702 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3703
3704
3705 68/push _test-output-stream/imm32
3706
3707 e8/call clear-stream/disp32
3708
3709 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3710
3711
3712 b8/copy-to-EAX _test-output-buffered-file/imm32
3713 05/add-to-EAX 4/imm32
3714 50/push-EAX
3715
3716 e8/call clear-stream/disp32
3717
3718 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3719
3720
3721
3722 68/push "ab/cd # comment"/imm32
3723 68/push _test-input-stream/imm32
3724
3725 e8/call write/disp32
3726
3727 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3728
3729
3730 68/push _test-output-buffered-file/imm32
3731 68/push _test-input-stream/imm32
3732
3733 e8/call convert-instruction/disp32
3734
3735 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3736
3737
3738
3739 68/push _test-output-buffered-file/imm32
3740
3741 e8/call flush/disp32
3742
3743 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3744 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3778
3779
3780 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3781 68/push "ab # ab/cd # comment"/imm32
3782 68/push _test-output-stream/imm32
3783
3784 e8/call check-stream-equal/disp32
3785
3786 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3787
3788 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3789 5d/pop-to-EBP
3790 c3/return
3791
3792 test-convert-instruction-handles-0f-opcode:
3793
3794
3795 55/push-EBP
3796 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3797
3798
3799
3800 68/push _test-input-stream/imm32
3801
3802 e8/call clear-stream/disp32
3803
3804 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3805
3806
3807 68/push _test-output-stream/imm32
3808
3809 e8/call clear-stream/disp32
3810
3811 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3812
3813
3814 b8/copy-to-EAX _test-output-buffered-file/imm32
3815 05/add-to-EAX 4/imm32
3816 50/push-EAX
3817
3818 e8/call clear-stream/disp32
3819
3820 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3821
3822
3823
3824 68/push "0f/m1 ab/m2 # comment"/imm32
3825 68/push _test-input-stream/imm32
3826
3827 e8/call write/disp32
3828
3829 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3830
3831
3832 68/push _test-output-buffered-file/imm32
3833 68/push _test-input-stream/imm32
3834
3835 e8/call convert-instruction/disp32
3836
3837 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3838
3839
3840
3841 68/push _test-output-buffered-file/imm32
3842
3843 e8/call flush/disp32
3844
3845 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3846 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3880
3881
3882 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3883 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3884 68/push _test-output-stream/imm32
3885
3886 e8/call check-stream-equal/disp32
3887
3888 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3889
3890 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3891 5d/pop-to-EBP
3892 c3/return
3893
3894 test-convert-instruction-handles-f2-opcode:
3895
3896
3897 55/push-EBP
3898 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3899
3900
3901
3902 68/push _test-input-stream/imm32
3903
3904 e8/call clear-stream/disp32
3905
3906 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3907
3908
3909 68/push _test-output-stream/imm32
3910
3911 e8/call clear-stream/disp32
3912
3913 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3914
3915
3916 b8/copy-to-EAX _test-output-buffered-file/imm32
3917 05/add-to-EAX 4/imm32
3918 50/push-EAX
3919
3920 e8/call clear-stream/disp32
3921
3922 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3923
3924
3925
3926 68/push "f2/m1 ab/m2 # comment"/imm32
3927 68/push _test-input-stream/imm32
3928
3929 e8/call write/disp32
3930
3931 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3932
3933
3934 68/push _test-output-buffered-file/imm32
3935 68/push _test-input-stream/imm32
3936
3937 e8/call convert-instruction/disp32
3938
3939 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3940
3941
3942
3943 68/push _test-output-buffered-file/imm32
3944
3945 e8/call flush/disp32
3946
3947 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3948 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3982
3983
3984 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3985 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3986 68/push _test-output-stream/imm32
3987
3988 e8/call check-stream-equal/disp32
3989
3990 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3991
3992 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3993 5d/pop-to-EBP
3994 c3/return
3995
3996 test-convert-instruction-handles-f3-opcode:
3997
3998
3999 55/push-EBP
4000 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4001
4002
4003
4004 68/push _test-input-stream/imm32
4005
4006 e8/call clear-stream/disp32
4007
4008 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4009
4010
4011 68/push _test-output-stream/imm32
4012
4013 e8/call clear-stream/disp32
4014
4015 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4016
4017
4018 b8/copy-to-EAX _test-output-buffered-file/imm32
4019 05/add-to-EAX 4/imm32
4020 50/push-EAX
4021
4022 e8/call clear-stream/disp32
4023
4024 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4025
4026
4027
4028 68/push "f3/m1 ab/m2 # comment"/imm32
4029 68/push _test-input-stream/imm32
4030
4031 e8/call write/disp32
4032
4033 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4034
4035
4036 68/push _test-output-buffered-file/imm32
4037 68/push _test-input-stream/imm32
4038
4039 e8/call convert-instruction/disp32
4040
4041 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4042
4043
4044
4045 68/push _test-output-buffered-file/imm32
4046
4047 e8/call flush/disp32
4048
4049 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4050 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4084
4085
4086 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
4087 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
4088 68/push _test-output-stream/imm32
4089
4090 e8/call check-stream-equal/disp32
4091
4092 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4093
4094 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4095 5d/pop-to-EBP
4096 c3/return
4097
4098 test-convert-instruction-handles-f2-0f-opcode:
4099
4100
4101 55/push-EBP
4102 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4103
4104
4105
4106 68/push _test-input-stream/imm32
4107
4108 e8/call clear-stream/disp32
4109
4110 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4111
4112
4113 68/push _test-output-stream/imm32
4114
4115 e8/call clear-stream/disp32
4116
4117 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4118
4119
4120 b8/copy-to-EAX _test-output-buffered-file/imm32
4121 05/add-to-EAX 4/imm32
4122 50/push-EAX
4123
4124 e8/call clear-stream/disp32
4125
4126 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4127
4128
4129
4130 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
4131 68/push _test-input-stream/imm32
4132
4133 e8/call write/disp32
4134
4135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4136
4137
4138 68/push _test-output-buffered-file/imm32
4139 68/push _test-input-stream/imm32
4140
4141 e8/call convert-instruction/disp32
4142
4143 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4144
4145
4146
4147 68/push _test-output-buffered-file/imm32
4148
4149 e8/call flush/disp32
4150
4151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4152 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4186
4187
4188 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
4189 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
4190 68/push _test-output-stream/imm32
4191
4192 e8/call check-stream-equal/disp32
4193
4194 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4195
4196 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4197 5d/pop-to-EBP
4198 c3/return
4199
4200 test-convert-instruction-handles-f3-0f-opcode:
4201
4202
4203 55/push-EBP
4204 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4205
4206
4207
4208 68/push _test-input-stream/imm32
4209
4210 e8/call clear-stream/disp32
4211
4212 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4213
4214
4215 68/push _test-output-stream/imm32
4216
4217 e8/call clear-stream/disp32
4218
4219 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4220
4221
4222 b8/copy-to-EAX _test-output-buffered-file/imm32
4223 05/add-to-EAX 4/imm32
4224 50/push-EAX
4225
4226 e8/call clear-stream/disp32
4227
4228 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4229
4230
4231
4232 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
4233 68/push _test-input-stream/imm32
4234
4235 e8/call write/disp32
4236
4237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4238
4239
4240 68/push _test-output-buffered-file/imm32
4241 68/push _test-input-stream/imm32
4242
4243 e8/call convert-instruction/disp32
4244
4245 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4246
4247
4248
4249 68/push _test-output-buffered-file/imm32
4250
4251 e8/call flush/disp32
4252
4253 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4254 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4288
4289
4290 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
4291 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
4292 68/push _test-output-stream/imm32
4293
4294 e8/call check-stream-equal/disp32
4295
4296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4297
4298 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4299 5d/pop-to-EBP
4300 c3/return
4301
4302 test-convert-instruction-handles-unused-opcodes:
4303
4304
4305 55/push-EBP
4306 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4307
4308
4309
4310 68/push _test-input-stream/imm32
4311
4312 e8/call clear-stream/disp32
4313
4314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4315
4316
4317 68/push _test-output-stream/imm32
4318
4319 e8/call clear-stream/disp32
4320
4321 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4322
4323
4324 b8/copy-to-EAX _test-output-buffered-file/imm32
4325 05/add-to-EAX 4/imm32
4326 50/push-EAX
4327
4328 e8/call clear-stream/disp32
4329
4330 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4331
4332
4333
4334 68/push "ab/m1 cd/m2 # comment"/imm32
4335 68/push _test-input-stream/imm32
4336
4337 e8/call write/disp32
4338
4339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4340
4341
4342 68/push _test-output-buffered-file/imm32
4343 68/push _test-input-stream/imm32
4344
4345 e8/call convert-instruction/disp32
4346
4347 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4348
4349
4350
4351 68/push _test-output-buffered-file/imm32
4352
4353 e8/call flush/disp32
4354
4355 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4356 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4390
4391
4392 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4393 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4394 68/push _test-output-stream/imm32
4395
4396 e8/call check-stream-equal/disp32
4397
4398 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4399
4400 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4401 5d/pop-to-EBP
4402 c3/return
4403
4404 test-convert-instruction-handles-unused-second-opcodes:
4405
4406
4407 55/push-EBP
4408 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4409
4410
4411
4412 68/push _test-input-stream/imm32
4413
4414 e8/call clear-stream/disp32
4415
4416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4417
4418
4419 68/push _test-output-stream/imm32
4420
4421 e8/call clear-stream/disp32
4422
4423 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4424
4425
4426 b8/copy-to-EAX _test-output-buffered-file/imm32
4427 05/add-to-EAX 4/imm32
4428 50/push-EAX
4429
4430 e8/call clear-stream/disp32
4431
4432 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4433
4434
4435
4436 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4437 68/push _test-input-stream/imm32
4438
4439 e8/call write/disp32
4440
4441 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4442
4443
4444 68/push _test-output-buffered-file/imm32
4445 68/push _test-input-stream/imm32
4446
4447 e8/call convert-instruction/disp32
4448
4449 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4450
4451
4452
4453 68/push _test-output-buffered-file/imm32
4454
4455 e8/call flush/disp32
4456
4457 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4458 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4492
4493
4494 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4495 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4496 68/push _test-output-stream/imm32
4497
4498 e8/call check-stream-equal/disp32
4499
4500 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4501
4502 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4503 5d/pop-to-EBP
4504 c3/return
4505
4506 test-convert-instruction-handles-unused-second-opcodes-2:
4507
4508
4509 55/push-EBP
4510 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4511
4512
4513
4514 68/push _test-input-stream/imm32
4515
4516 e8/call clear-stream/disp32
4517
4518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4519
4520
4521 68/push _test-output-stream/imm32
4522
4523 e8/call clear-stream/disp32
4524
4525 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4526
4527
4528 b8/copy-to-EAX _test-output-buffered-file/imm32
4529 05/add-to-EAX 4/imm32
4530 50/push-EAX
4531
4532 e8/call clear-stream/disp32
4533
4534 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4535
4536
4537
4538 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4539 68/push _test-input-stream/imm32
4540
4541 e8/call write/disp32
4542
4543 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4544
4545
4546 68/push _test-output-buffered-file/imm32
4547 68/push _test-input-stream/imm32
4548
4549 e8/call convert-instruction/disp32
4550
4551 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4552
4553
4554
4555 68/push _test-output-buffered-file/imm32
4556
4557 e8/call flush/disp32
4558
4559 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4560 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4594
4595
4596 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4597 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4598 68/push _test-output-stream/imm32
4599
4600 e8/call check-stream-equal/disp32
4601
4602 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4603
4604 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4605 5d/pop-to-EBP
4606 c3/return
4607
4608 test-convert-instruction-emits-modrm-byte:
4609
4610
4611 55/push-EBP
4612 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4613
4614
4615
4616 68/push _test-input-stream/imm32
4617
4618 e8/call clear-stream/disp32
4619
4620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4621
4622
4623 68/push _test-output-stream/imm32
4624
4625 e8/call clear-stream/disp32
4626
4627 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4628
4629
4630 b8/copy-to-EAX _test-output-buffered-file/imm32
4631 05/add-to-EAX 4/imm32
4632 50/push-EAX
4633
4634 e8/call clear-stream/disp32
4635
4636 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4637
4638
4639
4640 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4641 68/push _test-input-stream/imm32
4642
4643 e8/call write/disp32
4644
4645 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4646
4647
4648 68/push _test-output-buffered-file/imm32
4649 68/push _test-input-stream/imm32
4650
4651 e8/call convert-instruction/disp32
4652
4653 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4654
4655
4656
4657 68/push _test-output-buffered-file/imm32
4658
4659 e8/call flush/disp32
4660
4661 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4662 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4696
4697
4698 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4699 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4700 68/push _test-output-stream/imm32
4701
4702 e8/call check-stream-equal/disp32
4703
4704 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4705
4706 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4707 5d/pop-to-EBP
4708 c3/return
4709
4710 test-convert-instruction-emits-modrm-byte-from-subop:
4711
4712
4713 55/push-EBP
4714 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4715
4716
4717
4718 68/push _test-input-stream/imm32
4719
4720 e8/call clear-stream/disp32
4721
4722 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4723
4724
4725 68/push _test-output-stream/imm32
4726
4727 e8/call clear-stream/disp32
4728
4729 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4730
4731
4732 b8/copy-to-EAX _test-output-buffered-file/imm32
4733 05/add-to-EAX 4/imm32
4734 50/push-EAX
4735
4736 e8/call clear-stream/disp32
4737
4738 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4739
4740
4741
4742 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4743 68/push _test-input-stream/imm32
4744
4745 e8/call write/disp32
4746
4747 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4748
4749
4750 68/push _test-output-buffered-file/imm32
4751 68/push _test-input-stream/imm32
4752
4753 e8/call convert-instruction/disp32
4754
4755 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4756
4757
4758
4759 68/push _test-output-buffered-file/imm32
4760
4761 e8/call flush/disp32
4762
4763 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4764 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4798
4799
4800 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4801 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4802 68/push _test-output-stream/imm32
4803
4804 e8/call check-stream-equal/disp32
4805
4806 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4807
4808 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4809 5d/pop-to-EBP
4810 c3/return
4811
4812 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4813
4814
4815 55/push-EBP
4816 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4817
4818
4819
4820 68/push _test-input-stream/imm32
4821
4822 e8/call clear-stream/disp32
4823
4824 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4825
4826
4827 68/push _test-output-stream/imm32
4828
4829 e8/call clear-stream/disp32
4830
4831 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4832
4833
4834 b8/copy-to-EAX _test-output-buffered-file/imm32
4835 05/add-to-EAX 4/imm32
4836 50/push-EAX
4837
4838 e8/call clear-stream/disp32
4839
4840 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4841
4842
4843
4844 68/push "8b/copy 0/rm32 1/r32"/imm32
4845 68/push _test-input-stream/imm32
4846
4847 e8/call write/disp32
4848
4849 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4850
4851
4852 68/push _test-output-buffered-file/imm32
4853 68/push _test-input-stream/imm32
4854
4855 e8/call convert-instruction/disp32
4856
4857 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4858
4859
4860
4861 68/push _test-output-buffered-file/imm32
4862
4863 e8/call flush/disp32
4864
4865 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4866 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4900
4901
4902 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4903 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4904 68/push _test-output-stream/imm32
4905
4906 e8/call check-stream-equal/disp32
4907
4908 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4909
4910 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4911 5d/pop-to-EBP
4912 c3/return
4913
4914 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4915
4916
4917 55/push-EBP
4918 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4919
4920
4921
4922 68/push _test-input-stream/imm32
4923
4924 e8/call clear-stream/disp32
4925
4926 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4927
4928
4929 68/push _test-output-stream/imm32
4930
4931 e8/call clear-stream/disp32
4932
4933 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4934
4935
4936 b8/copy-to-EAX _test-output-buffered-file/imm32
4937 05/add-to-EAX 4/imm32
4938 50/push-EAX
4939
4940 e8/call clear-stream/disp32
4941
4942 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4943
4944
4945
4946 68/push "8b/copy 0/mod 1/r32"/imm32
4947 68/push _test-input-stream/imm32
4948
4949 e8/call write/disp32
4950
4951 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4952
4953
4954 68/push _test-output-buffered-file/imm32
4955 68/push _test-input-stream/imm32
4956
4957 e8/call convert-instruction/disp32
4958
4959 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4960
4961
4962
4963 68/push _test-output-buffered-file/imm32
4964
4965 e8/call flush/disp32
4966
4967 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4968 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5002
5003
5004 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
5005 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
5006 68/push _test-output-stream/imm32
5007
5008 e8/call check-stream-equal/disp32
5009
5010 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5011
5012 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5013 5d/pop-to-EBP
5014 c3/return
5015
5016 test-convert-instruction-emits-modrm-byte-with-missing-r32:
5017
5018
5019 55/push-EBP
5020 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5021
5022
5023
5024 68/push _test-input-stream/imm32
5025
5026 e8/call clear-stream/disp32
5027
5028 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5029
5030
5031 68/push _test-output-stream/imm32
5032
5033 e8/call clear-stream/disp32
5034
5035 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5036
5037
5038 b8/copy-to-EAX _test-output-buffered-file/imm32
5039 05/add-to-EAX 4/imm32
5040 50/push-EAX
5041
5042 e8/call clear-stream/disp32
5043
5044 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5045
5046
5047
5048 68/push "8b/copy 0/mod 0/rm32"/imm32
5049 68/push _test-input-stream/imm32
5050
5051 e8/call write/disp32
5052
5053 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5054
5055
5056 68/push _test-output-buffered-file/imm32
5057 68/push _test-input-stream/imm32
5058
5059 e8/call convert-instruction/disp32
5060
5061 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5062
5063
5064
5065 68/push _test-output-buffered-file/imm32
5066
5067 e8/call flush/disp32
5068
5069 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5070 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5104
5105
5106 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
5107 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
5108 68/push _test-output-stream/imm32
5109
5110 e8/call check-stream-equal/disp32
5111
5112 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5113
5114 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5115 5d/pop-to-EBP
5116 c3/return
5117
5118 test-convert-instruction-emits-sib-byte:
5119
5120
5121 55/push-EBP
5122 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5123
5124
5125
5126 68/push _test-input-stream/imm32
5127
5128 e8/call clear-stream/disp32
5129
5130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5131
5132
5133 68/push _test-output-stream/imm32
5134
5135 e8/call clear-stream/disp32
5136
5137 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5138
5139
5140 b8/copy-to-EAX _test-output-buffered-file/imm32
5141 05/add-to-EAX 4/imm32
5142 50/push-EAX
5143
5144 e8/call clear-stream/disp32
5145
5146 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5147
5148
5149
5150 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
5151 68/push _test-input-stream/imm32
5152
5153 e8/call write/disp32
5154
5155 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5156
5157
5158 68/push _test-output-buffered-file/imm32
5159 68/push _test-input-stream/imm32
5160
5161 e8/call convert-instruction/disp32
5162
5163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5164
5165
5166
5167 68/push _test-output-buffered-file/imm32
5168
5169 e8/call flush/disp32
5170
5171 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5172 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5206
5207
5208 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
5209 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
5210 68/push _test-output-stream/imm32
5211
5212 e8/call check-stream-equal/disp32
5213
5214 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5215
5216 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5217 5d/pop-to-EBP
5218 c3/return
5219
5220 test-convert-instruction-emits-sib-byte-with-missing-base:
5221
5222
5223 55/push-EBP
5224 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5225
5226
5227
5228 68/push _test-input-stream/imm32
5229
5230 e8/call clear-stream/disp32
5231
5232 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5233
5234
5235 68/push _test-output-stream/imm32
5236
5237 e8/call clear-stream/disp32
5238
5239 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5240
5241
5242 b8/copy-to-EAX _test-output-buffered-file/imm32
5243 05/add-to-EAX 4/imm32
5244 50/push-EAX
5245
5246 e8/call clear-stream/disp32
5247
5248 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5249
5250
5251
5252 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5253 68/push _test-input-stream/imm32
5254
5255 e8/call write/disp32
5256
5257 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5258
5259
5260 68/push _test-output-buffered-file/imm32
5261 68/push _test-input-stream/imm32
5262
5263 e8/call convert-instruction/disp32
5264
5265 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5266
5267
5268
5269 68/push _test-output-buffered-file/imm32
5270
5271 e8/call flush/disp32
5272
5273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5274 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5308
5309
5310 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
5311 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5312 68/push _test-output-stream/imm32
5313
5314 e8/call check-stream-equal/disp32
5315
5316 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5317
5318 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5319 5d/pop-to-EBP
5320 c3/return
5321
5322 test-convert-instruction-emits-sib-byte-with-missing-index:
5323
5324
5325 55/push-EBP
5326 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5327
5328
5329
5330 68/push _test-input-stream/imm32
5331
5332 e8/call clear-stream/disp32
5333
5334 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5335
5336
5337 68/push _test-output-stream/imm32
5338
5339 e8/call clear-stream/disp32
5340
5341 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5342
5343
5344 b8/copy-to-EAX _test-output-buffered-file/imm32
5345 05/add-to-EAX 4/imm32
5346 50/push-EAX
5347
5348 e8/call clear-stream/disp32
5349
5350 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5351
5352
5353
5354 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5355 68/push _test-input-stream/imm32
5356
5357 e8/call write/disp32
5358
5359 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5360
5361
5362 68/push _test-output-buffered-file/imm32
5363 68/push _test-input-stream/imm32
5364
5365 e8/call convert-instruction/disp32
5366
5367 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5368
5369
5370
5371 68/push _test-output-buffered-file/imm32
5372
5373 e8/call flush/disp32
5374
5375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5376 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5410
5411
5412 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5413 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5414 68/push _test-output-stream/imm32
5415
5416 e8/call check-stream-equal/disp32
5417
5418 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5419
5420 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5421 5d/pop-to-EBP
5422 c3/return
5423
5424 test-convert-instruction-emits-sib-byte-with-missing-scale:
5425
5426
5427 55/push-EBP
5428 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5429
5430
5431
5432 68/push _test-input-stream/imm32
5433
5434 e8/call clear-stream/disp32
5435
5436 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5437
5438
5439 68/push _test-output-stream/imm32
5440
5441 e8/call clear-stream/disp32
5442
5443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5444
5445
5446 b8/copy-to-EAX _test-output-buffered-file/imm32
5447 05/add-to-EAX 4/imm32
5448 50/push-EAX
5449
5450 e8/call clear-stream/disp32
5451
5452 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5453
5454
5455
5456 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5457 68/push _test-input-stream/imm32
5458
5459 e8/call write/disp32
5460
5461 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5462
5463
5464 68/push _test-output-buffered-file/imm32
5465 68/push _test-input-stream/imm32
5466
5467 e8/call convert-instruction/disp32
5468
5469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5470
5471
5472
5473 68/push _test-output-buffered-file/imm32
5474
5475 e8/call flush/disp32
5476
5477 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5478 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5512
5513
5514 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5515 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5516 68/push _test-output-stream/imm32
5517
5518 e8/call check-stream-equal/disp32
5519
5520 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5521
5522 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5523 5d/pop-to-EBP
5524 c3/return
5525
5526 test-convert-instruction-handles-disp32-operand:
5527
5528
5529 55/push-EBP
5530 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5531
5532
5533
5534 68/push _test-input-stream/imm32
5535
5536 e8/call clear-stream/disp32
5537
5538 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5539
5540
5541 68/push _test-output-stream/imm32
5542
5543 e8/call clear-stream/disp32
5544
5545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5546
5547
5548 b8/copy-to-EAX _test-output-buffered-file/imm32
5549 05/add-to-EAX 4/imm32
5550 50/push-EAX
5551
5552 e8/call clear-stream/disp32
5553
5554 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5555
5556
5557
5558 68/push "e8/call 20/disp32"/imm32
5559 68/push _test-input-stream/imm32
5560
5561 e8/call write/disp32
5562
5563 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5564
5565
5566 68/push _test-output-buffered-file/imm32
5567 68/push _test-input-stream/imm32
5568
5569 e8/call convert-instruction/disp32
5570
5571 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5572
5573
5574
5575 68/push _test-output-buffered-file/imm32
5576
5577 e8/call flush/disp32
5578
5579 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5580 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5614
5615
5616 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5617 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5618 68/push _test-output-stream/imm32
5619
5620 e8/call check-stream-equal/disp32
5621
5622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5623
5624 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5625 5d/pop-to-EBP
5626 c3/return
5627
5628 test-convert-instruction-handles-disp16-operand:
5629
5630
5631 55/push-EBP
5632 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5633
5634
5635
5636 68/push _test-input-stream/imm32
5637
5638 e8/call clear-stream/disp32
5639
5640 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5641
5642
5643 68/push _test-output-stream/imm32
5644
5645 e8/call clear-stream/disp32
5646
5647 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5648
5649
5650 b8/copy-to-EAX _test-output-buffered-file/imm32
5651 05/add-to-EAX 4/imm32
5652 50/push-EAX
5653
5654 e8/call clear-stream/disp32
5655
5656 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5657
5658
5659
5660 68/push "e8/call 20/disp16"/imm32
5661 68/push _test-input-stream/imm32
5662
5663 e8/call write/disp32
5664
5665 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5666
5667
5668 68/push _test-output-buffered-file/imm32
5669 68/push _test-input-stream/imm32
5670
5671 e8/call convert-instruction/disp32
5672
5673 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5674
5675
5676
5677 68/push _test-output-buffered-file/imm32
5678
5679 e8/call flush/disp32
5680
5681 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5682 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5716
5717
5718 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5719 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5720 68/push _test-output-stream/imm32
5721
5722 e8/call check-stream-equal/disp32
5723
5724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5725
5726 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5727 5d/pop-to-EBP
5728 c3/return
5729
5730 test-convert-instruction-handles-disp8-operand:
5731
5732
5733 55/push-EBP
5734 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5735
5736
5737
5738 68/push _test-input-stream/imm32
5739
5740 e8/call clear-stream/disp32
5741
5742 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5743
5744
5745 68/push _test-output-stream/imm32
5746
5747 e8/call clear-stream/disp32
5748
5749 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5750
5751
5752 b8/copy-to-EAX _test-output-buffered-file/imm32
5753 05/add-to-EAX 4/imm32
5754 50/push-EAX
5755
5756 e8/call clear-stream/disp32
5757
5758 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5759
5760
5761
5762 68/push "eb/jump 20/disp8"/imm32
5763 68/push _test-input-stream/imm32
5764
5765 e8/call write/disp32
5766
5767 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5768
5769
5770 68/push _test-output-buffered-file/imm32
5771 68/push _test-input-stream/imm32
5772
5773 e8/call convert-instruction/disp32
5774
5775 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5776
5777
5778
5779 68/push _test-output-buffered-file/imm32
5780
5781 e8/call flush/disp32
5782
5783 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5784 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5818
5819
5820 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5821 68/push "eb 20 # eb/jump 20/disp8"/imm32
5822 68/push _test-output-stream/imm32
5823
5824 e8/call check-stream-equal/disp32
5825
5826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5827
5828 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5829 5d/pop-to-EBP
5830 c3/return
5831
5832 test-convert-instruction-handles-disp8-name:
5833
5834
5835 55/push-EBP
5836 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5837
5838
5839
5840 68/push _test-input-stream/imm32
5841
5842 e8/call clear-stream/disp32
5843
5844 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5845
5846
5847 68/push _test-output-stream/imm32
5848
5849 e8/call clear-stream/disp32
5850
5851 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5852
5853
5854 b8/copy-to-EAX _test-output-buffered-file/imm32
5855 05/add-to-EAX 4/imm32
5856 50/push-EAX
5857
5858 e8/call clear-stream/disp32
5859
5860 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5861
5862
5863
5864 68/push "eb/jump xyz/disp8"/imm32
5865 68/push _test-input-stream/imm32
5866
5867 e8/call write/disp32
5868
5869 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5870
5871
5872 68/push _test-output-buffered-file/imm32
5873 68/push _test-input-stream/imm32
5874
5875 e8/call convert-instruction/disp32
5876
5877 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5878
5879
5880
5881 68/push _test-output-buffered-file/imm32
5882
5883 e8/call flush/disp32
5884
5885 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5886 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5920
5921
5922 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5923 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5924 68/push _test-output-stream/imm32
5925
5926 e8/call check-stream-equal/disp32
5927
5928 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5929
5930 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5931 5d/pop-to-EBP
5932 c3/return
5933
5934 test-convert-instruction-handles-imm32-operand:
5935
5936
5937 55/push-EBP
5938 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5939
5940
5941
5942 68/push _test-input-stream/imm32
5943
5944 e8/call clear-stream/disp32
5945
5946 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5947
5948
5949 68/push _test-output-stream/imm32
5950
5951 e8/call clear-stream/disp32
5952
5953 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5954
5955
5956 b8/copy-to-EAX _test-output-buffered-file/imm32
5957 05/add-to-EAX 4/imm32
5958 50/push-EAX
5959
5960 e8/call clear-stream/disp32
5961
5962 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5963
5964
5965
5966 68/push "68/push 0x20/imm32"/imm32
5967 68/push _test-input-stream/imm32
5968
5969 e8/call write/disp32
5970
5971 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5972
5973
5974 68/push _test-output-buffered-file/imm32
5975 68/push _test-input-stream/imm32
5976
5977 e8/call convert-instruction/disp32
5978
5979 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5980
5981
5982
5983 68/push _test-output-buffered-file/imm32
5984
5985 e8/call flush/disp32
5986
5987 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5988 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
6022
6023
6024 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
6025 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
6026 68/push _test-output-stream/imm32
6027
6028 e8/call check-stream-equal/disp32
6029
6030 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6031
6032 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6033 5d/pop-to-EBP
6034 c3/return
6035
6036 test-convert-instruction-handles-imm16-operand:
6037
6038
6039
6040 55/push-EBP
6041 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6042
6043
6044
6045 68/push _test-input-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
6052 68/push _test-output-stream/imm32
6053
6054 e8/call clear-stream/disp32
6055
6056 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6057
6058
6059 b8/copy-to-EAX _test-output-buffered-file/imm32
6060 05/add-to-EAX 4/imm32
6061 50/push-EAX
6062
6063 e8/call clear-stream/disp32
6064
6065 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6066
6067
6068
6069 68/push "68/push 0x20/imm16"/imm32
6070 68/push _test-input-stream/imm32
6071
6072 e8/call write/disp32
6073
6074 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6075
6076
6077 68/push _test-output-buffered-file/imm32
6078 68/push _test-input-stream/imm32
6079
6080 e8/call convert-instruction/disp32
6081
6082 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6083
6084
6085
6086 68/push _test-output-buffered-file/imm32
6087
6088 e8/call flush/disp32
6089
6090 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6091 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
6125
6126
6127 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
6128 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
6129 68/push _test-output-stream/imm32
6130
6131 e8/call check-stream-equal/disp32
6132
6133 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6134
6135 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6136 5d/pop-to-EBP
6137 c3/return
6138
6139 test-convert-instruction-handles-imm8-operand:
6140
6141
6142
6143 55/push-EBP
6144 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6145
6146
6147
6148 68/push _test-input-stream/imm32
6149
6150 e8/call clear-stream/disp32
6151
6152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6153
6154
6155 68/push _test-output-stream/imm32
6156
6157 e8/call clear-stream/disp32
6158
6159 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6160
6161
6162 b8/copy-to-EAX _test-output-buffered-file/imm32
6163 05/add-to-EAX 4/imm32
6164 50/push-EAX
6165
6166 e8/call clear-stream/disp32
6167
6168 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6169
6170
6171
6172 68/push "68/push 0x20/imm8"/imm32
6173 68/push _test-input-stream/imm32
6174
6175 e8/call write/disp32
6176
6177 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6178
6179
6180 68/push _test-output-buffered-file/imm32
6181 68/push _test-input-stream/imm32
6182
6183 e8/call convert-instruction/disp32
6184
6185 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6186
6187
6188
6189 68/push _test-output-buffered-file/imm32
6190
6191 e8/call flush/disp32
6192
6193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6194 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
6228
6229
6230 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
6231 68/push "68 20 # 68/push 0x20/imm8"/imm32
6232 68/push _test-output-stream/imm32
6233
6234 e8/call check-stream-equal/disp32
6235
6236 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6237
6238 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6239 5d/pop-to-EBP
6240 c3/return
6241
6242 has-metadata?:
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253 55/push-EBP
6254 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6255
6256 51/push-ECX
6257 52/push-EDX
6258 56/push-ESI
6259 57/push-EDI
6260
6261 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
6262
6263 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
6264
6265 68/push 0/imm32/end
6266 68/push 0/imm32/start
6267 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
6268
6269
6270 57/push-EDI
6271 68/push 0x2f/imm32/slash
6272 52/push-EDX
6273 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
6274
6275 e8/call next-token-from-slice/disp32
6276
6277 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6278
6279 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
6280 $has-metadata?:loop:
6281
6282
6283 57/push-EDI
6284 68/push 0x2f/imm32/slash
6285 52/push-EDX
6286 51/push-ECX
6287
6288 e8/call next-token-from-slice/disp32
6289
6290 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6291
6292
6293
6294 57/push-EDI
6295
6296 e8/call slice-empty?/disp32
6297
6298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6299
6300 3d/compare-EAX-and 0/imm32
6301 75/jump-if-not-equal $has-metadata?:false/disp8
6302
6303
6304
6305 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
6306 57/push-EDI
6307
6308 e8/call slice-equal?/disp32
6309
6310 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6311
6312 3d/compare-EAX-and 0/imm32
6313 75/jump-if-not-equal $has-metadata?:true/disp8
6314
6315 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
6316 eb/jump $has-metadata?:loop/disp8
6317 $has-metadata?:true:
6318 b8/copy-to-EAX 1/imm32/true
6319 eb/jump $has-metadata?:end/disp8
6320 $has-metadata?:false:
6321 b8/copy-to-EAX 0/imm32/false
6322 $has-metadata?:end:
6323
6324 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6325
6326 5f/pop-to-EDI
6327 5e/pop-to-ESI
6328 5a/pop-to-EDX
6329 59/pop-to-ECX
6330
6331 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6332 5d/pop-to-EBP
6333 c3/return
6334
6335 test-has-metadata-true:
6336
6337 55/push-EBP
6338 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6339
6340 b8/copy-to-EAX "ab/c"/imm32
6341 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6342 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6343 05/add-to-EAX 4/imm32
6344
6345 51/push-ECX
6346 50/push-EAX
6347 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6348
6349
6350 68/push "c"/imm32
6351 56/push-ESI
6352
6353 e8/call has-metadata?/disp32
6354
6355 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6356
6357
6358 68/push "F - test-has-metadata-true"/imm32
6359 68/push 1/imm32/true
6360 50/push-EAX
6361
6362 e8/call check-ints-equal/disp32
6363
6364 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6365
6366 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6367 5d/pop-to-EBP
6368 c3/return
6369
6370 test-has-metadata-false:
6371
6372 55/push-EBP
6373 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6374
6375 b8/copy-to-EAX "ab/c"/imm32
6376 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6377 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6378 05/add-to-EAX 4/imm32
6379
6380 51/push-ECX
6381 50/push-EAX
6382 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6383
6384
6385 68/push "d"/imm32
6386 56/push-ESI
6387
6388 e8/call has-metadata?/disp32
6389
6390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6391
6392
6393 68/push "F - test-has-metadata-false"/imm32
6394 68/push 0/imm32/false
6395 50/push-EAX
6396
6397 e8/call check-ints-equal/disp32
6398
6399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6400
6401 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6402 5d/pop-to-EBP
6403 c3/return
6404
6405 test-has-metadata-ignore-name:
6406
6407 55/push-EBP
6408 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6409
6410 b8/copy-to-EAX "a/b"/imm32
6411 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6412 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6413 05/add-to-EAX 4/imm32
6414
6415 51/push-ECX
6416 50/push-EAX
6417 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6418
6419
6420 68/push "a"/imm32
6421 56/push-ESI
6422
6423 e8/call has-metadata?/disp32
6424
6425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6426
6427
6428 68/push "F - test-has-metadata-ignore-name"/imm32
6429 68/push 0/imm32/false
6430 50/push-EAX
6431
6432 e8/call check-ints-equal/disp32
6433
6434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6435
6436 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6437 5d/pop-to-EBP
6438 c3/return
6439
6440 test-has-metadata-multiple-true:
6441
6442 55/push-EBP
6443 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6444
6445 b8/copy-to-EAX "a/b/c"/imm32
6446 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6447 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6448 05/add-to-EAX 4/imm32
6449
6450 51/push-ECX
6451 50/push-EAX
6452 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6453
6454
6455 68/push "c"/imm32
6456 56/push-ESI
6457
6458 e8/call has-metadata?/disp32
6459
6460 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6461
6462
6463 68/push "F - test-has-metadata-multiple-true"/imm32
6464 68/push 1/imm32/true
6465 50/push-EAX
6466
6467 e8/call check-ints-equal/disp32
6468
6469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6470
6471 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6472 5d/pop-to-EBP
6473 c3/return
6474
6475 test-has-metadata-multiple-false:
6476
6477 55/push-EBP
6478 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6479
6480 b8/copy-to-EAX "a/b/c"/imm32
6481 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
6482 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
6483 05/add-to-EAX 4/imm32
6484
6485 51/push-ECX
6486 50/push-EAX
6487 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
6488
6489
6490 68/push "d"/imm32
6491 56/push-ESI
6492
6493 e8/call has-metadata?/disp32
6494
6495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6496
6497
6498 68/push "F - test-has-metadata-multiple-false"/imm32
6499 68/push 0/imm32/false
6500 50/push-EAX
6501
6502 e8/call check-ints-equal/disp32
6503
6504 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6505
6506 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6507 5d/pop-to-EBP
6508 c3/return
6509
6510
6511
6512
6513
6514 emit:
6515
6516 55/push-EBP
6517 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6518
6519 50/push-EAX
6520 56/push-ESI
6521 57/push-EDI
6522
6523 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
6524
6525 68/push 0/imm32/end
6526 68/push 0/imm32/start
6527 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
6528
6529
6530 57/push-EDI
6531 68/push 0x2f/imm32/slash
6532 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
6533 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
6534
6535 e8/call next-token-from-slice/disp32
6536
6537 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
6538
6539
6540
6541 57/push-EDI
6542
6543 e8/call is-valid-name?/disp32
6544
6545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6546
6547 3d/compare-EAX-and 0/imm32
6548 74/jump-if-equal $emit:hex-int/disp8
6549 $emit:name:
6550
6551
6552 56/push-ESI
6553 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6554
6555 e8/call write-slice/disp32
6556
6557 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6558
6559
6560 68/push " "/imm32
6561 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6562
6563 e8/call write-buffered/disp32
6564
6565 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6566
6567 eb/jump $emit:end/disp8
6568
6569
6570
6571
6572
6573 $emit:hex-int:
6574
6575
6576 57/push-EDI
6577
6578 e8/call parse-hex-int/disp32
6579
6580 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6581
6582
6583 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
6584 50/push-EAX
6585 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
6586
6587 e8/call emit-hex/disp32
6588
6589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6590 $emit:end:
6591
6592 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
6593
6594 5f/pop-to-EDI
6595 5e/pop-to-ESI
6596 58/pop-to-EAX
6597
6598 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6599 5d/pop-to-EBP
6600 c3/return
6601
6602 test-emit-number:
6603
6604 55/push-EBP
6605 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6606
6607
6608
6609 68/push _test-output-stream/imm32
6610
6611 e8/call clear-stream/disp32
6612
6613 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6614
6615
6616 b8/copy-to-EAX _test-output-buffered-file/imm32
6617 05/add-to-EAX 4/imm32
6618 50/push-EAX
6619
6620 e8/call clear-stream/disp32
6621
6622 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6623
6624 68/push _test-slice-three-zero-end/imm32/end
6625 68/push _test-slice-three-zero/imm32/start
6626 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6627
6628
6629 68/push 1/imm32
6630 51/push-ECX
6631 68/push _test-output-buffered-file/imm32
6632
6633 e8/call emit/disp32
6634
6635 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6636
6637
6638 68/push _test-output-buffered-file/imm32
6639
6640 e8/call flush/disp32
6641
6642 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6643
6644
6645 68/push "F - test-emit-number/1"/imm32
6646 68/push "30 "/imm32
6647 68/push _test-output-stream/imm32
6648
6649 e8/call check-stream-equal/disp32
6650
6651 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6652
6653 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6654 5d/pop-to-EBP
6655 c3/return
6656
6657 test-emit-negative-number:
6658
6659
6660 55/push-EBP
6661 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6662
6663
6664
6665 68/push _test-output-stream/imm32
6666
6667 e8/call clear-stream/disp32
6668
6669 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6670
6671
6672 b8/copy-to-EAX _test-output-buffered-file/imm32
6673 05/add-to-EAX 4/imm32
6674 50/push-EAX
6675
6676 e8/call clear-stream/disp32
6677
6678 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6679
6680 68/push _test-slice-negative-two-end/imm32/end
6681 68/push _test-slice-negative-two/imm32/start
6682 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6683
6684
6685 68/push 2/imm32
6686 51/push-ECX
6687 68/push _test-output-buffered-file/imm32
6688
6689 e8/call emit/disp32
6690
6691 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6692
6693
6694 68/push _test-output-buffered-file/imm32
6695
6696 e8/call flush/disp32
6697
6698 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6699
6700
6701 68/push "F - test-emit-number/1"/imm32
6702 68/push "fe ff "/imm32
6703 68/push _test-output-stream/imm32
6704
6705 e8/call check-stream-equal/disp32
6706
6707 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6708
6709 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6710 5d/pop-to-EBP
6711 c3/return
6712
6713 test-emit-number-with-metadata:
6714
6715 55/push-EBP
6716 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6717
6718
6719
6720 68/push _test-output-stream/imm32
6721
6722 e8/call clear-stream/disp32
6723
6724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6725
6726
6727 b8/copy-to-EAX _test-output-buffered-file/imm32
6728 05/add-to-EAX 4/imm32
6729 50/push-EAX
6730
6731 e8/call clear-stream/disp32
6732
6733 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6734
6735 68/push _test-slice-negative-two-metadata-end/imm32/end
6736 68/push _test-slice-negative-two/imm32/start
6737 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6738
6739
6740 68/push 2/imm32
6741 51/push-ECX
6742 68/push _test-output-buffered-file/imm32
6743
6744 e8/call emit/disp32
6745
6746 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6747
6748
6749 68/push _test-output-buffered-file/imm32
6750
6751 e8/call flush/disp32
6752
6753 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6754
6755
6756
6757 68/push "F - test-emit-number-with-metadata"/imm32
6758 68/push "fe ff "/imm32
6759 68/push _test-output-stream/imm32
6760
6761 e8/call check-stream-equal/disp32
6762
6763 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6764
6765 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6766 5d/pop-to-EBP
6767 c3/return
6768
6769 test-emit-non-number:
6770
6771 55/push-EBP
6772 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6773
6774
6775
6776 68/push _test-output-stream/imm32
6777
6778 e8/call clear-stream/disp32
6779
6780 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6781
6782
6783 b8/copy-to-EAX _test-output-buffered-file/imm32
6784 05/add-to-EAX 4/imm32
6785 50/push-EAX
6786
6787 e8/call clear-stream/disp32
6788
6789 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6790
6791 68/push _test-slice-non-number-word-end/imm32/end
6792 68/push _test-slice-non-number-word/imm32/start
6793 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6794
6795
6796 68/push 2/imm32
6797 51/push-ECX
6798 68/push _test-output-buffered-file/imm32
6799
6800 e8/call emit/disp32
6801
6802 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6803
6804
6805 68/push _test-output-buffered-file/imm32
6806
6807 e8/call flush/disp32
6808
6809 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6810
6811
6812 68/push "F - test-emit-non-number"/imm32
6813 68/push "xyz "/imm32
6814 68/push _test-output-stream/imm32
6815
6816 e8/call check-stream-equal/disp32
6817
6818 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6819
6820 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6821 5d/pop-to-EBP
6822 c3/return
6823
6824 test-emit-non-number-with-metadata:
6825
6826 55/push-EBP
6827 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6828
6829
6830
6831 68/push _test-output-stream/imm32
6832
6833 e8/call clear-stream/disp32
6834
6835 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6836
6837
6838 b8/copy-to-EAX _test-output-buffered-file/imm32
6839 05/add-to-EAX 4/imm32
6840 50/push-EAX
6841
6842 e8/call clear-stream/disp32
6843
6844 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6845
6846 68/push _test-slice-non-number-word-metadata-end/imm32/end
6847 68/push _test-slice-non-number-word/imm32/start
6848 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6849
6850
6851 68/push 2/imm32
6852 51/push-ECX
6853 68/push _test-output-buffered-file/imm32
6854
6855 e8/call emit/disp32
6856
6857 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6858
6859
6860 68/push _test-output-buffered-file/imm32
6861
6862 e8/call flush/disp32
6863
6864 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6865
6866
6867 68/push "F - test-emit-non-number-with-metadata"/imm32
6868 68/push "xyz/ "/imm32
6869 68/push _test-output-stream/imm32
6870
6871 e8/call check-stream-equal/disp32
6872
6873 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6874
6875 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6876 5d/pop-to-EBP
6877 c3/return
6878
6879 test-emit-non-number-with-all-hex-digits-and-metadata:
6880
6881 55/push-EBP
6882 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6883
6884
6885
6886 68/push _test-output-stream/imm32
6887
6888 e8/call clear-stream/disp32
6889
6890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6891
6892
6893 b8/copy-to-EAX _test-output-buffered-file/imm32
6894 05/add-to-EAX 4/imm32
6895 50/push-EAX
6896
6897 e8/call clear-stream/disp32
6898
6899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6900
6901 68/push _test-slice-hexlike-non-number-word-metadata-end/imm32/end
6902 68/push _test-slice-hexlike-non-number-word/imm32/start
6903 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
6904
6905
6906 68/push 2/imm32
6907 51/push-ECX
6908 68/push _test-output-buffered-file/imm32
6909
6910 e8/call emit/disp32
6911
6912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6913
6914
6915 68/push _test-output-buffered-file/imm32
6916
6917 e8/call flush/disp32
6918
6919 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
6920 +-- 34 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
6954
6955
6956 68/push "F - test-emit-non-number-with-all-hex-digits"/imm32
6957 68/push "abcd/xyz "/imm32
6958 68/push _test-output-stream/imm32
6959
6960 e8/call check-stream-equal/disp32
6961
6962 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
6963
6964 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
6965 5d/pop-to-EBP
6966 c3/return
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976 is-valid-name?:
6977
6978 55/push-EBP
6979 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
6980
6981 51/push-ECX
6982 56/push-ESI
6983
6984 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
6985
6986 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
6987
6988 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
6989 $is-valid-name?:check0:
6990
6991 39/compare 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
6992 7d/jump-if-greater-or-equal $is-valid-name?:false/disp8
6993 $is-valid-name?:check1:
6994
6995 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
6996
6997 3d/compare-EAX-and 2/imm32
6998 74/jump-if-equal $is-valid-name?:false/disp8
6999 $is-valid-name?:check2:
7000
7001 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
7002 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
7003
7004 3d/compare-EAX-and 2d/imm32/-
7005 74/jump-if-equal $is-valid-name?:false/disp8
7006 $is-valid-name?:check3a:
7007
7008 3d/compare-EAX-with 30/imm32/0
7009 7c/jump-if-lesser $is-valid-name?:true/disp8
7010 $is-valid-name?:check3b:
7011
7012 3d/compare-EAX-with 39/imm32/9
7013 7f/jump-if-greater $is-valid-name?:true/disp8
7014 $is-valid-name?:false:
7015
7016 b8/copy-to-EAX 0/imm32/false
7017 eb/jump $is-valid-name?:end/disp8
7018 $is-valid-name?:true:
7019
7020 b8/copy-to-EAX 1/imm32/true
7021 $is-valid-name?:end:
7022
7023 5e/pop-to-ESI
7024 59/pop-to-ECX
7025
7026 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7027 5d/pop-to-EBP
7028 c3/return
7029
7030 test-is-valid-name-digit-prefix:
7031
7032 55/push-EBP
7033 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7034
7035 68/push _test-slice-hex-int-end/imm32
7036 68/push _test-slice-hex-int/imm32
7037 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7038
7039
7040 51/push-ECX
7041
7042 e8/call is-valid-name?/disp32
7043
7044 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7045
7046
7047 68/push "F - test-is-valid-name-digit-prefix"/imm32
7048 68/push 0/imm32/false
7049 50/push-EAX
7050
7051 e8/call check-ints-equal/disp32
7052
7053 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7054
7055 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7056 5d/pop-to-EBP
7057 c3/return
7058
7059 test-is-valid-name-negative-prefix:
7060
7061 55/push-EBP
7062 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7063
7064 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
7065 68/push _test-slice-hex-int-with-0x-prefix-negative/imm32
7066 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7067
7068
7069 51/push-ECX
7070
7071 e8/call is-valid-name?/disp32
7072
7073 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7074
7075
7076 68/push "F - test-is-valid-name-negative-prefix"/imm32
7077 68/push 0/imm32/false
7078 50/push-EAX
7079
7080 e8/call check-ints-equal/disp32
7081
7082 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7083
7084 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7085 5d/pop-to-EBP
7086 c3/return
7087
7088 test-is-valid-name-0x-prefix:
7089
7090 55/push-EBP
7091 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7092
7093 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
7094 68/push _test-slice-hex-int-with-0x-prefix/imm32
7095 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7096
7097
7098 51/push-ECX
7099
7100 e8/call is-valid-name?/disp32
7101
7102 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7103
7104
7105 68/push "F - test-is-valid-name-0x-prefix"/imm32
7106 68/push 0/imm32/false
7107 50/push-EAX
7108
7109 e8/call check-ints-equal/disp32
7110
7111 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7112
7113 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7114 5d/pop-to-EBP
7115 c3/return
7116
7117 test-is-valid-name-starts-with-pre-digit:
7118
7119 55/push-EBP
7120 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7121
7122 68/push _test-slice-with-slash-prefix-end/imm32
7123 68/push _test-slice-with-slash-prefix/imm32
7124 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7125
7126
7127 51/push-ECX
7128
7129 e8/call is-valid-name?/disp32
7130
7131 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7132
7133
7134 68/push "F - test-is-valid-name-starts-with-pre-digit"/imm32
7135 68/push 1/imm32/true
7136 50/push-EAX
7137
7138 e8/call check-ints-equal/disp32
7139
7140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7141
7142 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7143 5d/pop-to-EBP
7144 c3/return
7145
7146 test-is-valid-name-starts-with-post-digit:
7147
7148 55/push-EBP
7149 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7150
7151 68/push _test-slice-char-and-digits-end/imm32
7152 68/push _test-slice-char-and-digits/imm32
7153 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7154
7155
7156 51/push-ECX
7157
7158 e8/call is-valid-name?/disp32
7159
7160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7161
7162
7163 68/push "F - test-is-valid-name-starts-with-post-digit"/imm32
7164 68/push 1/imm32/true
7165 50/push-EAX
7166
7167 e8/call check-ints-equal/disp32
7168
7169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7170
7171 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7172 5d/pop-to-EBP
7173 c3/return
7174
7175 test-is-valid-name-starts-with-digit:
7176
7177 55/push-EBP
7178 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7179
7180 68/push _test-slice-hex-int-with-0x-prefix-end/imm32
7181 68/push _test-slice-hex-int-with-0x-prefix/imm32
7182 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7183
7184
7185 51/push-ECX
7186
7187 e8/call is-valid-name?/disp32
7188
7189 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7190
7191
7192 68/push "F - test-is-valid-name-starts-with-digit"/imm32
7193 68/push 0/imm32/false
7194 50/push-EAX
7195
7196 e8/call check-ints-equal/disp32
7197
7198 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7199
7200 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7201 5d/pop-to-EBP
7202 c3/return
7203
7204
7205 emit-hex:
7206
7207 55/push-EBP
7208 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7209
7210 50/push-EAX
7211 51/push-ECX
7212 52/push-EDX
7213 53/push-EBX
7214 57/push-EDI
7215
7216 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
7217
7218 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
7219
7220 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0x10/disp8 .
7221
7222 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
7223 $emit-hex:loop:
7224
7225 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
7226 7d/jump-if-greater-or-equal $emit-hex:end/disp8
7227
7228
7229 53/push-EBX
7230 57/push-EDI
7231
7232 e8/call print-byte/disp32
7233
7234 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7235
7236
7237 68/push 0x20/imm32/space
7238 57/push-EDI
7239
7240 e8/call write-byte/disp32
7241
7242 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7243
7244 c1/shift 5/subop/logic-right 3/mod/direct 3/rm32/EBX . . . . . 8/imm8
7245 $emit-hex:continue:
7246
7247 41/increment-ECX
7248 eb/jump $emit-hex:loop/disp8
7249 $emit-hex:end:
7250
7251 5f/pop-to-EDI
7252 5b/pop-to-EBX
7253 5a/pop-to-EDX
7254 59/pop-to-ECX
7255 58/pop-to-EAX
7256
7257 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7258 5d/pop-to-EBP
7259 c3/return
7260
7261 test-emit-hex-single-byte:
7262
7263
7264
7265 68/push _test-output-stream/imm32
7266
7267 e8/call clear-stream/disp32
7268
7269 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7270
7271
7272 b8/copy-to-EAX _test-output-buffered-file/imm32
7273 05/add-to-EAX 4/imm32
7274 50/push-EAX
7275
7276 e8/call clear-stream/disp32
7277
7278 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7279
7280
7281 68/push 1/imm32
7282 68/push 0xab/imm32
7283 68/push _test-output-buffered-file/imm32
7284
7285 e8/call emit-hex/disp32
7286
7287 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7288
7289
7290 68/push _test-output-buffered-file/imm32
7291
7292 e8/call flush/disp32
7293
7294 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7295
7296
7297 68/push "F - test-emit-hex-single-byte"/imm32
7298 68/push 0x206261/imm32
7299
7300 b8/copy-to-EAX _test-output-stream/imm32
7301 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
7302
7303 e8/call check-ints-equal/disp32
7304
7305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7306
7307 c3/return
7308
7309 test-emit-hex-multiple-byte:
7310
7311
7312
7313 68/push _test-output-stream/imm32
7314
7315 e8/call clear-stream/disp32
7316
7317 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7318
7319
7320 b8/copy-to-EAX _test-output-buffered-file/imm32
7321 05/add-to-EAX 4/imm32
7322 50/push-EAX
7323
7324 e8/call clear-stream/disp32
7325
7326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7327
7328
7329 68/push 2/imm32
7330 68/push 0x1234/imm32
7331 68/push _test-output-buffered-file/imm32
7332
7333 e8/call emit-hex/disp32
7334
7335 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7336
7337
7338 68/push _test-output-buffered-file/imm32
7339
7340 e8/call flush/disp32
7341
7342 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7343
7344
7345 68/push "F - test-emit-hex-multiple-byte/1"/imm32
7346 68/push "34 12 "/imm32
7347 68/push _test-output-stream/imm32
7348
7349 e8/call check-stream-equal/disp32
7350
7351 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7352
7353 c3/return
7354
7355 test-emit-hex-zero-pad:
7356
7357
7358
7359 68/push _test-output-stream/imm32
7360
7361 e8/call clear-stream/disp32
7362
7363 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7364
7365
7366 b8/copy-to-EAX _test-output-buffered-file/imm32
7367 05/add-to-EAX 4/imm32
7368 50/push-EAX
7369
7370 e8/call clear-stream/disp32
7371
7372 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7373
7374
7375 68/push 2/imm32
7376 68/push 0xab/imm32
7377 68/push _test-output-buffered-file/imm32
7378
7379 e8/call emit-hex/disp32
7380
7381 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7382
7383
7384 68/push _test-output-buffered-file/imm32
7385
7386 e8/call flush/disp32
7387
7388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7389
7390
7391 68/push "F - test-emit-hex-zero-pad/1"/imm32
7392 68/push "ab 00 "/imm32
7393 68/push _test-output-stream/imm32
7394
7395 e8/call check-stream-equal/disp32
7396
7397 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7398
7399 c3/return
7400
7401 test-emit-hex-negative:
7402
7403
7404
7405 68/push _test-output-stream/imm32
7406
7407 e8/call clear-stream/disp32
7408
7409 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7410
7411
7412 b8/copy-to-EAX _test-output-buffered-file/imm32
7413 05/add-to-EAX 4/imm32
7414 50/push-EAX
7415
7416 e8/call clear-stream/disp32
7417
7418 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7419
7420
7421 68/push 2/imm32
7422 68/push -1/imm32
7423 68/push _test-output-buffered-file/imm32
7424
7425 e8/call emit-hex/disp32
7426
7427 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7428
7429
7430 68/push _test-output-buffered-file/imm32
7431
7432 e8/call flush/disp32
7433
7434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7435
7436
7437 68/push "F - test-emit-hex-negative/1"/imm32
7438 68/push "ff ff "/imm32
7439 68/push _test-output-stream/imm32
7440
7441 e8/call check-stream-equal/disp32
7442
7443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7444
7445 c3/return
7446
7447
7448
7449
7450
7451
7452 write-stream-data:
7453
7454 55/push-EBP
7455 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7456
7457 50/push-EAX
7458 51/push-ECX
7459 56/push-ESI
7460
7461 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
7462
7463
7464 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
7465 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
7466 50/push-EAX
7467
7468 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 0xc/disp8 .
7469 50/push-EAX
7470
7471 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7472
7473
7474 51/push-ECX
7475 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
7476
7477 e8/call write-slice/disp32
7478
7479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7480 $write-stream-data:end:
7481
7482 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7483
7484 5e/pop-to-ESI
7485 59/pop-to-ECX
7486 58/pop-to-EAX
7487
7488 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7489 5d/pop-to-EBP
7490 c3/return
7491
7492 test-write-stream-data:
7493
7494 55/push-EBP
7495 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7496
7497
7498
7499 68/push _test-output-stream/imm32
7500
7501 e8/call clear-stream/disp32
7502
7503 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7504
7505
7506 b8/copy-to-EAX _test-output-buffered-file/imm32
7507 05/add-to-EAX 4/imm32
7508 50/push-EAX
7509
7510 e8/call clear-stream/disp32
7511
7512 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7513
7514
7515 68/push _test-tmp-stream/imm32
7516
7517 e8/call clear-stream/disp32
7518
7519 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7520
7521
7522
7523 68/push "abcd"/imm32
7524 68/push _test-tmp-stream/imm32
7525
7526 e8/call write/disp32
7527
7528 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7529
7530
7531 68/push _test-tmp-stream/imm32
7532 68/push _test-output-buffered-file/imm32
7533
7534 e8/call write-stream-data/disp32
7535
7536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7537
7538
7539
7540 68/push _test-output-buffered-file/imm32
7541
7542 e8/call flush/disp32
7543
7544 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7545
7546
7547 68/push "F - test-write-stream-data"/imm32
7548 68/push "abcd"/imm32
7549 68/push _test-output-stream/imm32
7550
7551 e8/call check-stream-equal/disp32
7552
7553 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
7554
7555 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7556 5d/pop-to-EBP
7557 c3/return
7558
7559
7560 parse-datum-of-word:
7561
7562 55/push-EBP
7563 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
7564
7565 51/push-ECX
7566 56/push-ESI
7567
7568 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
7569
7570 68/push 0/imm32/end
7571 68/push 0/imm32/start
7572 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
7573
7574
7575 51/push-ECX
7576 68/push 0x2f/imm32/slash
7577 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
7578 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
7579
7580 e8/call next-token-from-slice/disp32
7581
7582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
7583
7584
7585 51/push-ECX
7586
7587 e8/call parse-hex-int/disp32
7588
7589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
7590 $parse-datum-of-word:end:
7591
7592 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
7593
7594 5e/pop-to-ESI
7595 59/pop-to-ECX
7596
7597 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
7598 5d/pop-to-EBP
7599 c3/return
7600
7601 == data
7602
7603 _test-slice-negative-two:
7604 2d/- 32/2
7605 _test-slice-negative-two-end:
7606 2f/slash 66/f 6f/o 6f/o
7607 _test-slice-negative-two-metadata-end:
7608
7609 _test-slice-three-zero:
7610 33/3 30/0
7611 _test-slice-three-zero-end:
7612
7613 _test-slice-non-number-word:
7614 78/x 79/y 7a/z
7615 _test-slice-non-number-word-end:
7616 2f/slash
7617 _test-slice-non-number-word-metadata-end:
7618
7619 _test-input-stream:
7620
7621 0/imm32
7622
7623 0/imm32
7624
7625 0x80/imm32
7626
7627 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7628 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7629 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7631 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7632 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7633 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7634 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7635
7636
7637 _test-input-buffered-file:
7638
7639 _test-input-stream/imm32
7640
7641 0/imm32
7642
7643 0/imm32
7644
7645 6/imm32
7646
7647 00 00 00 00 00 00
7648
7649 _test-output-stream:
7650
7651 0/imm32
7652
7653 0/imm32
7654
7655 0x80/imm32
7656
7657 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7658 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7659 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7661 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7662 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7663 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7664 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7665
7666
7667 _test-output-buffered-file:
7668
7669 _test-output-stream/imm32
7670
7671 0/imm32
7672
7673 0/imm32
7674
7675 6/imm32
7676
7677 00 00 00 00 00 00
7678
7679 _test-slice-hexlike-non-number-word:
7680 61/a 62/b 63/c 64/d
7681 _test-slice-hexlike-non-number-word-end:
7682 2f/slash
7683 78/x 79/y 7a/z
7684 _test-slice-hexlike-non-number-word-metadata-end:
7685
7686 _test-slice-with-slash-prefix:
7687 2f/slash 30/0 33/3
7688 _test-slice-with-slash-prefix-end:
7689
7690