https://github.com/akkartik/mu/blob/master/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 68/push Heap/imm32
26 68/push 0x10000/imm32/64KB
27
28 e8/call new-segment/disp32
29
30 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
31
32
33 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
34
35
36 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
37 7e/jump-if-lesser-or-equal $run-main/disp8
38
39
40 68/push "test"/imm32
41 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
42
43 e8/call kernel-string-equal?/disp32
44
45 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
46
47 3d/compare-EAX-and 1/imm32
48 75/jump-if-not-equal $run-main/disp8
49
50 e8/call run-tests/disp32
51 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
52 eb/jump $main:end/disp8
53 $run-main:
54
55
56 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
57 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
58
59
60 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
61
62
63 50/push-EAX/ed
64 68/push Stderr/imm32
65 68/push Stdout/imm32
66 68/push Stdin/imm32
67
68 e8/call convert/disp32
69
70 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
71
72 bb/copy-to-EBX 0/imm32
73 $main:end:
74 b8/copy-to-EAX 1/imm32/exit
75 cd/syscall 0x80/imm8
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 convert:
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 55/push-EBP
122 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
123
124 50/push-EAX
125 51/push-ECX
126 52/push-EDX
127 53/push-EBX
128
129 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
130 68/push 0x200/imm32/length
131 68/push 0/imm32/read
132 68/push 0/imm32/write
133 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
134
135 68/push 0/imm32/end
136 68/push 0/imm32/start
137 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
138
139 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
140 $convert:loop:
141
142
143 51/push-ECX
144
145 e8/call clear-stream/disp32
146
147 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
148
149
150 51/push-ECX
151 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
152
153 e8/call read-line-buffered/disp32
154
155 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
156 $convert:check0:
157
158 81 7/subop/compare 0/mod/indirect 1/rm32/ECX . . . . . 0/imm32
159 0f 84/jump-if-equal $convert:break/disp32
160 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
186
187
188 52/push-EDX
189 51/push-ECX
190
191 e8/call next-word/disp32
192
193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
194 $convert:check1:
195
196
197
198 52/push-EDX
199
200 e8/call slice-empty?/disp32
201
202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
203
204 3d/compare-EAX-and 0/imm32
205 0f 85/jump-if-not-equal $convert:pass-through/disp32
206 $convert:check2:
207 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
249
250
251
252 68/push "=="/imm32
253 52/push-EDX
254
255 e8/call slice-equal?/disp32
256
257 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
258
259 3d/compare-EAX-and 0/imm32
260 0f 84/jump-if-equal $convert:check3/disp32
261
262
263 52/push-EDX
264 51/push-ECX
265
266 e8/call next-word/disp32
267
268 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
269 +-- 42 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------
311
312
313 68/push "code"/imm32
314 52/push-EDX
315
316 e8/call slice-equal?/disp32
317
318 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
319
320 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
321
322 eb/jump $convert:pass-through/disp8
323 $convert:check3:
324
325
326
327 51/push-ECX
328
329 e8/call rewind-stream/disp32
330
331 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
332
333 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0/imm32
334 74/jump-if-equal $convert:data/disp8
335 $convert:code:
336
337
338 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
339 51/push-ECX
340
341 e8/call convert-instruction/disp32
342
343 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
344
345 e9/jump $convert:loop/disp32
346 $convert:data:
347
348
349 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
350 51/push-ECX
351
352 e8/call convert-data/disp32
353
354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
355
356 e9/jump $convert:loop/disp32
357 $convert:pass-through:
358
359
360 51/push-ECX
361 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
362
363 e8/call write-stream-data/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
366
367 e9/jump $convert:loop/disp32
368 $convert:break:
369
370
371 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
372
373 e8/call flush/disp32
374
375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
376 $convert:end:
377
378 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
379
380 5b/pop-to-EBX
381 5a/pop-to-EDX
382 59/pop-to-ECX
383 58/pop-to-EAX
384
385 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
386 5d/pop-to-EBP
387 c3/return
388
389 test-convert-passes-empty-lines-through:
390
391
392 55/push-EBP
393 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
394
395
396
397 68/push _test-input-stream/imm32
398
399 e8/call clear-stream/disp32
400
401 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
402
403
404 b8/copy-to-EAX _test-input-buffered-file/imm32
405 05/add-to-EAX 4/imm32
406 50/push-EAX
407
408 e8/call clear-stream/disp32
409
410 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
411
412
413 68/push _test-output-stream/imm32
414
415 e8/call clear-stream/disp32
416
417 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
418
419
420 b8/copy-to-EAX _test-output-buffered-file/imm32
421 05/add-to-EAX 4/imm32
422 50/push-EAX
423
424 e8/call clear-stream/disp32
425
426 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
427
428
429
430 68/push _test-output-buffered-file/imm32
431 68/push _test-input-buffered-file/imm32
432
433 e8/call convert/disp32
434
435 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
436
437
438
439 68/push _test-output-buffered-file/imm32
440
441 e8/call flush/disp32
442
443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
444
445
446 68/push "F - test-convert-passes-empty-lines-through"/imm32
447 68/push ""/imm32
448 68/push _test-output-stream/imm32
449
450 e8/call check-stream-equal/disp32
451
452 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
453
454 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
455 5d/pop-to-EBP
456 c3/return
457
458 test-convert-passes-lines-with-just-whitespace-through:
459
460
461 55/push-EBP
462 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
463
464
465
466 68/push _test-input-stream/imm32
467
468 e8/call clear-stream/disp32
469
470 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
471
472
473 b8/copy-to-EAX _test-input-buffered-file/imm32
474 05/add-to-EAX 4/imm32
475 50/push-EAX
476
477 e8/call clear-stream/disp32
478
479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
480
481
482 68/push _test-output-stream/imm32
483
484 e8/call clear-stream/disp32
485
486 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
487
488
489 b8/copy-to-EAX _test-output-buffered-file/imm32
490 05/add-to-EAX 4/imm32
491 50/push-EAX
492
493 e8/call clear-stream/disp32
494
495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
496
497
498
499 68/push " "/imm32
500 68/push _test-input-stream/imm32
501
502 e8/call write/disp32
503
504 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
505
506
507 68/push _test-output-buffered-file/imm32
508 68/push _test-input-buffered-file/imm32
509
510 e8/call convert/disp32
511
512 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
513
514
515
516 68/push _test-output-buffered-file/imm32
517
518 e8/call flush/disp32
519
520 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
521
522
523 68/push "F - test-convert-passes-with-just-whitespace-through"/imm32
524 68/push " "/imm32
525 68/push _test-output-stream/imm32
526
527 e8/call check-next-stream-line-equal/disp32
528
529 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
530
531 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
532 5d/pop-to-EBP
533 c3/return
534
535 test-convert-passes-segment-headers-through:
536
537
538 55/push-EBP
539 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
540
541
542
543 68/push _test-input-stream/imm32
544
545 e8/call clear-stream/disp32
546
547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
548
549
550 b8/copy-to-EAX _test-input-buffered-file/imm32
551 05/add-to-EAX 4/imm32
552 50/push-EAX
553
554 e8/call clear-stream/disp32
555
556 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
557
558
559 68/push _test-output-stream/imm32
560
561 e8/call clear-stream/disp32
562
563 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
564
565
566 b8/copy-to-EAX _test-output-buffered-file/imm32
567 05/add-to-EAX 4/imm32
568 50/push-EAX
569
570 e8/call clear-stream/disp32
571
572 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
573
574
575
576 68/push "== abcd 0x1"/imm32
577 68/push _test-input-stream/imm32
578
579 e8/call write/disp32
580
581 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
582
583
584 68/push _test-output-buffered-file/imm32
585 68/push _test-input-buffered-file/imm32
586
587 e8/call convert/disp32
588
589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
590
591
592
593 68/push _test-output-buffered-file/imm32
594
595 e8/call flush/disp32
596
597 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
598
599
600 68/push "F - test-convert-passes-segment-headers-through"/imm32
601 68/push "== abcd 0x1"/imm32
602 68/push _test-output-stream/imm32
603
604 e8/call check-stream-equal/disp32
605
606 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
607
608 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
609 5d/pop-to-EBP
610 c3/return
611
612 test-convert-in-data-segment:
613
614
615 55/push-EBP
616 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
617
618
619
620 68/push _test-input-stream/imm32
621
622 e8/call clear-stream/disp32
623
624 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
625
626
627 b8/copy-to-EAX _test-input-buffered-file/imm32
628 05/add-to-EAX 4/imm32
629 50/push-EAX
630
631 e8/call clear-stream/disp32
632
633 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
634
635
636 68/push _test-output-stream/imm32
637
638 e8/call clear-stream/disp32
639
640 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
641
642
643 b8/copy-to-EAX _test-output-buffered-file/imm32
644 05/add-to-EAX 4/imm32
645 50/push-EAX
646
647 e8/call clear-stream/disp32
648
649 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
650
651
652
653
654
655
656 68/push "== code 0x1\n"/imm32
657 68/push _test-input-stream/imm32
658
659 e8/call write/disp32
660
661 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
662
663
664 68/push "== data 0x2\n"/imm32
665 68/push _test-input-stream/imm32
666
667 e8/call write/disp32
668
669 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
670
671
672 68/push "3 4/imm32\n"/imm32
673 68/push _test-input-stream/imm32
674
675 e8/call write/disp32
676
677 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
678
679
680 68/push _test-output-buffered-file/imm32
681 68/push _test-input-buffered-file/imm32
682
683 e8/call convert/disp32
684
685 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
686
687 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
713
714
715 68/push _test-output-buffered-file/imm32
716
717 e8/call flush/disp32
718
719 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
720
721
722 68/push "F - test-convert-in-data-segment/0"/imm32
723 68/push "== code 0x1"/imm32
724 68/push _test-output-stream/imm32
725
726 e8/call check-next-stream-line-equal/disp32
727
728 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
729
730
731 68/push "F - test-convert-in-data-segment/1"/imm32
732 68/push "== data 0x2"/imm32
733 68/push _test-output-stream/imm32
734
735 e8/call check-next-stream-line-equal/disp32
736
737 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
738
739
740 68/push "F - test-convert-in-data-segment/2"/imm32
741 68/push "03 04 00 00 00 "/imm32
742 68/push _test-output-stream/imm32
743
744 e8/call check-next-stream-line-equal/disp32
745
746 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
747
748 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
749 5d/pop-to-EBP
750 c3/return
751
752 test-convert-code-and-data-segments:
753
754
755 55/push-EBP
756 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
757
758
759
760 68/push _test-input-stream/imm32
761
762 e8/call clear-stream/disp32
763
764 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
765
766
767 b8/copy-to-EAX _test-input-buffered-file/imm32
768 05/add-to-EAX 4/imm32
769 50/push-EAX
770
771 e8/call clear-stream/disp32
772
773 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
774
775
776 68/push _test-output-stream/imm32
777
778 e8/call clear-stream/disp32
779
780 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
781
782
783 b8/copy-to-EAX _test-output-buffered-file/imm32
784 05/add-to-EAX 4/imm32
785 50/push-EAX
786
787 e8/call clear-stream/disp32
788
789 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
790
791
792
793
794
795
796
797
798 68/push "== code 0x1\n"/imm32
799 68/push _test-input-stream/imm32
800
801 e8/call write/disp32
802
803 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
804
805
806 68/push "e8/call 20/disp32\n"/imm32
807 68/push _test-input-stream/imm32
808
809 e8/call write/disp32
810
811 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
812
813
814 68/push "68/push 0x20/imm8\n"/imm32
815 68/push _test-input-stream/imm32
816
817 e8/call write/disp32
818
819 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
820
821
822 68/push "== data 0x2\n"/imm32
823 68/push _test-input-stream/imm32
824
825 e8/call write/disp32
826
827 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
828
829
830 68/push "3 4/imm32\n"/imm32
831 68/push _test-input-stream/imm32
832
833 e8/call write/disp32
834
835 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
836
837
838 68/push _test-output-buffered-file/imm32
839 68/push _test-input-buffered-file/imm32
840
841 e8/call convert/disp32
842
843 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
844
845
846
847
848
849
850 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
876
877
878 68/push _test-output-buffered-file/imm32
879
880 e8/call flush/disp32
881
882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
883
884
885 68/push "F - test-convert-code-and-data-segments/0"/imm32
886 68/push "== code 0x1"/imm32
887 68/push _test-output-stream/imm32
888
889 e8/call check-next-stream-line-equal/disp32
890
891 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
892
893
894 68/push "F - test-convert-code-and-data-segments/1"/imm32
895 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
896 68/push _test-output-stream/imm32
897
898 e8/call check-next-stream-line-equal/disp32
899
900 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
901
902
903 68/push "F - test-convert-code-and-data-segments/2"/imm32
904 68/push "68 20 # 68/push 0x20/imm8"/imm32
905 68/push _test-output-stream/imm32
906
907 e8/call check-next-stream-line-equal/disp32
908
909 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
910
911
912 68/push "F - test-convert-code-and-data-segments/3"/imm32
913 68/push "== data 0x2"/imm32
914 68/push _test-output-stream/imm32
915
916 e8/call check-next-stream-line-equal/disp32
917
918 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
919
920
921 68/push "F - test-convert-code-and-data-segments/4"/imm32
922 68/push "03 04 00 00 00 "/imm32
923 68/push _test-output-stream/imm32
924
925 e8/call check-next-stream-line-equal/disp32
926
927 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
928
929 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
930 5d/pop-to-EBP
931 c3/return
932
933 convert-data:
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954 55/push-EBP
955 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
956
957 50/push-EAX
958 51/push-ECX
959 52/push-EDX
960
961 68/push 0/imm32/end
962 68/push 0/imm32/start
963 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
964 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
990 $convert-data:loop:
991
992
993 51/push-ECX
994 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
995
996 e8/call next-word/disp32
997
998 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
999 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
1041 $convert-data:check0:
1042
1043
1044
1045 51/push-ECX
1046
1047 e8/call slice-empty?/disp32
1048
1049 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1050
1051 3d/compare-EAX-and 0/imm32
1052 0f 85/jump-if-not-equal $convert-data:break/disp32
1053 $convert-data:check-for-comment:
1054
1055
1056 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
1057
1058 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1059 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
1060
1061 3d/compare-EAX-and 0x23/imm32/hash
1062 75/jump-if-not-equal $convert-data:check-for-label/disp8
1063 $convert-data:comment:
1064
1065
1066 51/push-ECX
1067 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1068
1069 e8/call write-slice-buffered/disp32
1070
1071 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1072
1073 0f 85/jump-if-not-equal $convert-data:end/disp32
1074 $convert-data:check-for-label:
1075
1076
1077 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
1078
1079 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1080 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
1081
1082 3d/compare-EAX-and 0x3a/imm32/colon
1083 75/jump-if-not-equal $convert-data:check-for-imm32/disp8
1084 $convert-data:label:
1085
1086
1087 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1088 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1089
1090 e8/call write-stream-data/disp32
1091
1092 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1093
1094 75/jump-if-not-equal $convert-data:end/disp8
1095 $convert-data:check-for-imm32:
1096
1097
1098
1099 68/push "imm32"/imm32
1100 51/push-ECX
1101
1102 e8/call has-metadata?/disp32
1103
1104 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1105
1106 3d/compare-EAX-and 0/imm32
1107 74/jump-if-equal $convert-data:single-byte/disp8
1108 $convert-data:imm32:
1109
1110
1111 68/push 4/imm32
1112 51/push-ECX
1113 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1114
1115 e8/call emit/disp32
1116
1117 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1118 e9/jump $convert-data:loop/disp32
1119 $convert-data:single-byte:
1120
1121
1122 68/push 1/imm32
1123 51/push-ECX
1124 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1125
1126 e8/call emit/disp32
1127
1128 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1129 e9/jump $convert-data:loop/disp32
1130 $convert-data:break:
1131
1132
1133 68/push "\n"/imm32
1134 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1135
1136 e8/call write-buffered/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1139 $convert-data:end:
1140
1141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1142
1143 5a/pop-to-EDX
1144 59/pop-to-ECX
1145 58/pop-to-EAX
1146
1147 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1148 5d/pop-to-EBP
1149 c3/return
1150
1151 test-convert-data-passes-comments-through:
1152
1153
1154 55/push-EBP
1155 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1156
1157
1158
1159 68/push _test-input-stream/imm32
1160
1161 e8/call clear-stream/disp32
1162
1163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1164
1165
1166 68/push _test-output-stream/imm32
1167
1168 e8/call clear-stream/disp32
1169
1170 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1171
1172
1173 b8/copy-to-EAX _test-output-buffered-file/imm32
1174 05/add-to-EAX 4/imm32
1175 50/push-EAX
1176
1177 e8/call clear-stream/disp32
1178
1179 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1180
1181
1182
1183 68/push "# abcd"/imm32
1184 68/push _test-input-stream/imm32
1185
1186 e8/call write/disp32
1187
1188 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1189
1190
1191 68/push _test-output-buffered-file/imm32
1192 68/push _test-input-stream/imm32
1193
1194 e8/call convert-data/disp32
1195
1196 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1197
1198
1199
1200 68/push _test-output-buffered-file/imm32
1201
1202 e8/call flush/disp32
1203
1204 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1205 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1231
1232
1233 68/push "F - test-convert-data-passes-comments-through"/imm32
1234 68/push "# abcd"/imm32
1235 68/push _test-output-stream/imm32
1236
1237 e8/call check-stream-equal/disp32
1238
1239 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1240
1241 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1242 5d/pop-to-EBP
1243 c3/return
1244
1245 test-convert-data-passes-labels-through:
1246
1247
1248 55/push-EBP
1249 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1250
1251
1252
1253 68/push _test-input-stream/imm32
1254
1255 e8/call clear-stream/disp32
1256
1257 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1258
1259
1260 68/push _test-output-stream/imm32
1261
1262 e8/call clear-stream/disp32
1263
1264 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1265
1266
1267 b8/copy-to-EAX _test-output-buffered-file/imm32
1268 05/add-to-EAX 4/imm32
1269 50/push-EAX
1270
1271 e8/call clear-stream/disp32
1272
1273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1274
1275
1276
1277 68/push "ab: # cd"/imm32
1278 68/push _test-input-stream/imm32
1279
1280 e8/call write/disp32
1281
1282 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1283
1284
1285 68/push _test-output-buffered-file/imm32
1286 68/push _test-input-stream/imm32
1287
1288 e8/call convert-data/disp32
1289
1290 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1291
1292
1293
1294 68/push _test-output-buffered-file/imm32
1295
1296 e8/call flush/disp32
1297
1298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1299
1300
1301 68/push "F - test-convert-data-passes-labels-through"/imm32
1302 68/push "ab: # cd"/imm32
1303 68/push _test-output-stream/imm32
1304
1305 e8/call check-stream-equal/disp32
1306
1307 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1308
1309 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1310 5d/pop-to-EBP
1311 c3/return
1312
1313 test-convert-data-passes-names-through:
1314
1315
1316
1317 55/push-EBP
1318 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1319
1320
1321
1322 68/push _test-input-stream/imm32
1323
1324 e8/call clear-stream/disp32
1325
1326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1327
1328
1329 68/push _test-output-stream/imm32
1330
1331 e8/call clear-stream/disp32
1332
1333 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1334
1335
1336 b8/copy-to-EAX _test-output-buffered-file/imm32
1337 05/add-to-EAX 4/imm32
1338 50/push-EAX
1339
1340 e8/call clear-stream/disp32
1341
1342 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1343
1344
1345
1346 68/push "abcd/imm32"/imm32
1347 68/push _test-input-stream/imm32
1348
1349 e8/call write/disp32
1350
1351 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1352
1353
1354 68/push _test-output-buffered-file/imm32
1355 68/push _test-input-stream/imm32
1356
1357 e8/call convert-data/disp32
1358
1359 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1360
1361
1362
1363 68/push _test-output-buffered-file/imm32
1364
1365 e8/call flush/disp32
1366
1367 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1368
1369
1370 68/push "F - test-convert-data-passes-names-through"/imm32
1371 68/push "abcd/imm32 \n"/imm32
1372 68/push _test-output-stream/imm32
1373
1374 e8/call check-stream-equal/disp32
1375
1376 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1377
1378 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1379 5d/pop-to-EBP
1380 c3/return
1381
1382 test-convert-data-handles-imm32:
1383
1384
1385 55/push-EBP
1386 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1387
1388
1389
1390 68/push _test-input-stream/imm32
1391
1392 e8/call clear-stream/disp32
1393
1394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1395
1396
1397 68/push _test-output-stream/imm32
1398
1399 e8/call clear-stream/disp32
1400
1401 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1402
1403
1404 b8/copy-to-EAX _test-output-buffered-file/imm32
1405 05/add-to-EAX 4/imm32
1406 50/push-EAX
1407
1408 e8/call clear-stream/disp32
1409
1410 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1411
1412
1413
1414 68/push "30/imm32"/imm32
1415 68/push _test-input-stream/imm32
1416
1417 e8/call write/disp32
1418
1419 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1420
1421
1422 68/push _test-output-buffered-file/imm32
1423 68/push _test-input-stream/imm32
1424
1425 e8/call convert-data/disp32
1426
1427 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1428
1429
1430
1431 68/push _test-output-buffered-file/imm32
1432
1433 e8/call flush/disp32
1434
1435 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1436
1437
1438 68/push "F - test-convert-data-handles-imm32"/imm32
1439 68/push "30 00 00 00 \n"/imm32
1440 68/push _test-output-stream/imm32
1441
1442 e8/call check-stream-equal/disp32
1443
1444 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1445
1446 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1447 5d/pop-to-EBP
1448 c3/return
1449
1450 test-convert-data-handles-single-byte:
1451
1452
1453
1454 55/push-EBP
1455 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1456
1457
1458
1459 68/push _test-input-stream/imm32
1460
1461 e8/call clear-stream/disp32
1462
1463 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1464
1465
1466 68/push _test-output-stream/imm32
1467
1468 e8/call clear-stream/disp32
1469
1470 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1471
1472
1473 b8/copy-to-EAX _test-output-buffered-file/imm32
1474 05/add-to-EAX 4/imm32
1475 50/push-EAX
1476
1477 e8/call clear-stream/disp32
1478
1479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1480
1481
1482
1483 68/push "30/imm16"/imm32
1484 68/push _test-input-stream/imm32
1485
1486 e8/call write/disp32
1487
1488 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1489
1490
1491 68/push _test-output-buffered-file/imm32
1492 68/push _test-input-stream/imm32
1493
1494 e8/call convert-data/disp32
1495
1496 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1497
1498
1499
1500 68/push _test-output-buffered-file/imm32
1501
1502 e8/call flush/disp32
1503
1504 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1505
1506
1507 68/push "F - test-convert-data-handles-single-byte"/imm32
1508 68/push "30 \n"/imm32
1509 68/push _test-output-stream/imm32
1510
1511 e8/call check-stream-equal/disp32
1512
1513 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1514
1515 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1516 5d/pop-to-EBP
1517 c3/return
1518
1519 test-convert-data-multiple-bytes:
1520
1521
1522 55/push-EBP
1523 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1524
1525
1526
1527 68/push _test-input-stream/imm32
1528
1529 e8/call clear-stream/disp32
1530
1531 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1532
1533
1534 68/push _test-output-stream/imm32
1535
1536 e8/call clear-stream/disp32
1537
1538 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1539
1540
1541 b8/copy-to-EAX _test-output-buffered-file/imm32
1542 05/add-to-EAX 4/imm32
1543 50/push-EAX
1544
1545 e8/call clear-stream/disp32
1546
1547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1548
1549
1550
1551 68/push "1 2"/imm32
1552 68/push _test-input-stream/imm32
1553
1554 e8/call write/disp32
1555
1556 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1557
1558
1559 68/push _test-output-buffered-file/imm32
1560 68/push _test-input-stream/imm32
1561
1562 e8/call convert-data/disp32
1563
1564 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1565
1566
1567
1568 68/push _test-output-buffered-file/imm32
1569
1570 e8/call flush/disp32
1571
1572 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1573
1574
1575 68/push "F - test-convert-data-multiple-bytes"/imm32
1576 68/push "01 02 \n"/imm32
1577 68/push _test-output-stream/imm32
1578
1579 e8/call check-stream-equal/disp32
1580
1581 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1582
1583 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1584 5d/pop-to-EBP
1585 c3/return
1586
1587 test-convert-data-byte-then-name:
1588
1589
1590 55/push-EBP
1591 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1592
1593
1594
1595 68/push _test-input-stream/imm32
1596
1597 e8/call clear-stream/disp32
1598
1599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1600
1601
1602 68/push _test-output-stream/imm32
1603
1604 e8/call clear-stream/disp32
1605
1606 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1607
1608
1609 b8/copy-to-EAX _test-output-buffered-file/imm32
1610 05/add-to-EAX 4/imm32
1611 50/push-EAX
1612
1613 e8/call clear-stream/disp32
1614
1615 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1616
1617
1618
1619 68/push "30 abcd/o"/imm32
1620 68/push _test-input-stream/imm32
1621
1622 e8/call write/disp32
1623
1624 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1625
1626
1627 68/push _test-output-buffered-file/imm32
1628 68/push _test-input-stream/imm32
1629
1630 e8/call convert-data/disp32
1631
1632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1633
1634
1635
1636 68/push _test-output-buffered-file/imm32
1637
1638 e8/call flush/disp32
1639
1640 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1641
1642
1643 68/push "F - test-convert-data-byte-then-name"/imm32
1644 68/push "30 abcd/o \n"/imm32
1645 68/push _test-output-stream/imm32
1646
1647 e8/call check-stream-equal/disp32
1648
1649 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1650
1651 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1652 5d/pop-to-EBP
1653 c3/return
1654
1655 test-convert-data-multiple-words:
1656
1657
1658 55/push-EBP
1659 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1660
1661
1662
1663 68/push _test-input-stream/imm32
1664
1665 e8/call clear-stream/disp32
1666
1667 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1668
1669
1670 68/push _test-output-stream/imm32
1671
1672 e8/call clear-stream/disp32
1673
1674 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1675
1676
1677 b8/copy-to-EAX _test-output-buffered-file/imm32
1678 05/add-to-EAX 4/imm32
1679 50/push-EAX
1680
1681 e8/call clear-stream/disp32
1682
1683 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1684
1685
1686
1687 68/push "30 abcd/o 42e1/imm32"/imm32
1688 68/push _test-input-stream/imm32
1689
1690 e8/call write/disp32
1691
1692 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1693
1694
1695 68/push _test-output-buffered-file/imm32
1696 68/push _test-input-stream/imm32
1697
1698 e8/call convert-data/disp32
1699
1700 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1701
1702
1703
1704 68/push _test-output-buffered-file/imm32
1705
1706 e8/call flush/disp32
1707
1708 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1709 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1735
1736
1737 68/push "F - test-convert-data-multiple-words"/imm32
1738 68/push "30 abcd/o e1 42 00 00 \n"/imm32
1739 68/push _test-output-stream/imm32
1740
1741 e8/call check-stream-equal/disp32
1742
1743 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1744
1745 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1746 5d/pop-to-EBP
1747 c3/return
1748
1749 test-convert-data-trailing-comment:
1750
1751
1752 55/push-EBP
1753 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1754
1755
1756
1757 68/push _test-input-stream/imm32
1758
1759 e8/call clear-stream/disp32
1760
1761 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1762
1763
1764 68/push _test-output-stream/imm32
1765
1766 e8/call clear-stream/disp32
1767
1768 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1769
1770
1771 b8/copy-to-EAX _test-output-buffered-file/imm32
1772 05/add-to-EAX 4/imm32
1773 50/push-EAX
1774
1775 e8/call clear-stream/disp32
1776
1777 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1778
1779
1780
1781 68/push "30/imm32 # comment"/imm32
1782 68/push _test-input-stream/imm32
1783
1784 e8/call write/disp32
1785
1786 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1787
1788
1789 68/push _test-output-buffered-file/imm32
1790 68/push _test-input-stream/imm32
1791
1792 e8/call convert-data/disp32
1793
1794 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1795
1796
1797
1798 68/push _test-output-buffered-file/imm32
1799
1800 e8/call flush/disp32
1801
1802 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1803 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1829
1830
1831 68/push "F - test-convert-data-trailing-comment"/imm32
1832 68/push "30 00 00 00 # comment"/imm32
1833 68/push _test-output-stream/imm32
1834
1835 e8/call check-stream-equal/disp32
1836
1837 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1838
1839 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1840 5d/pop-to-EBP
1841 c3/return
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853 convert-instruction:
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875 55/push-EBP
1876 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1877
1878 50/push-EAX
1879 51/push-ECX
1880 52/push-EDX
1881
1882 68/push 0/imm32/end
1883 68/push 0/imm32/start
1884 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1885
1886
1887 51/push-ECX
1888 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1889
1890 e8/call next-word/disp32
1891
1892 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1893 $convert-instruction:check0:
1894
1895
1896
1897 51/push-ECX
1898
1899 e8/call slice-empty?/disp32
1900
1901 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1902
1903 3d/compare-EAX-and 0/imm32
1904 75/jump-if-not-equal $convert-instruction:pass-through/disp8
1905 $convert-instruction:check1:
1906
1907
1908 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
1909
1910 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1911 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
1912
1913 3d/compare-EAX-and 0x23/imm32/hash
1914 74/jump-if-equal $convert-instruction:pass-through/disp8
1915 $convert-instruction:check2:
1916
1917
1918 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
1919
1920 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1921 8a/copy-byte 1/mod/*+disp8 2/rm32/EDX . . . 0/r32/AL -1/disp8 .
1922
1923 3d/compare-EAX-and 0x3a/imm32/colon
1924 75/jump-if-not-equal $convert-instruction:really-convert/disp8
1925 $convert-instruction:pass-through:
1926
1927
1928 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1929 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1930
1931 e8/call write-stream-data/disp32
1932
1933 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1934
1935 eb/jump $convert-instruction:end/disp8
1936 $convert-instruction:really-convert:
1937
1938
1939 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1940 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1941
1942 e8/call emit-opcodes/disp32
1943
1944 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1945
1946
1947 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1948 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1949
1950 e8/call emit-modrm/disp32
1951
1952 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1953
1954
1955 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1956 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1957
1958 e8/call emit-sib/disp32
1959
1960 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1961
1962
1963 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1964 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1965
1966 e8/call emit-disp/disp32
1967
1968 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1969
1970
1971 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1972 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1973
1974 e8/call emit-imm/disp32
1975
1976 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1977
1978
1979 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1980 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1981
1982 e8/call emit-line-in-comment/disp32
1983
1984 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1985 $convert-instruction:end:
1986
1987 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1988
1989 5a/pop-to-EDX
1990 59/pop-to-ECX
1991 58/pop-to-EAX
1992
1993 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1994 5d/pop-to-EBP
1995 c3/return
1996
1997 emit-opcodes:
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031 55/push-EBP
2032 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2033
2034 50/push-EAX
2035 51/push-ECX
2036 52/push-EDX
2037 53/push-EBX
2038
2039 68/push 0/imm32/end
2040 68/push 0/imm32/start
2041 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2042
2043 68/push 0/imm32/end
2044 68/push 0/imm32/start
2045 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
2046
2047
2048 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2049
2050 e8/call rewind-stream/disp32
2051
2052 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2053 $emit-opcodes:op1:
2054
2055
2056 51/push-ECX
2057 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2058
2059 e8/call next-word/disp32
2060
2061 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2062
2063
2064
2065 51/push-ECX
2066
2067 e8/call slice-empty?/disp32
2068
2069 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2070
2071 3d/compare-EAX-and 0/imm32
2072 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2073
2074
2075 8b/copy 0/mod/indirect 1/rm32/ECX . . . 3/r32/EBX . .
2076
2077 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2078 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2079
2080 3d/compare-EAX-and 0x23/imm32/hash
2081 0f 84/jump-if-equal $emit-opcodes:end/disp32
2082
2083
2084 51/push-ECX
2085 68/push 0x2f/imm32/slash
2086 ff 6/subop/push 1/mod/*+disp8 1/rm32/ECX . . . . 4/disp8 .
2087 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . .
2088
2089 e8/call next-token-from-slice/disp32
2090
2091 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2092
2093
2094 51/push-ECX
2095 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2096
2097 e8/call write-slice-buffered/disp32
2098
2099 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2100
2101
2102 68/push " "/imm32
2103 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2104
2105 e8/call write-buffered/disp32
2106
2107 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2108
2109
2110
2111 68/push "0f"/imm32
2112 51/push-ECX
2113
2114 e8/call slice-equal?/disp32
2115
2116 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2117
2118 3d/compare-EAX-and 0/imm32
2119 75/jump-if-not-equal $emit-opcodes:op2/disp8
2120
2121
2122
2123 68/push "f2"/imm32
2124 51/push-ECX
2125
2126 e8/call slice-equal?/disp32
2127
2128 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2129
2130 3d/compare-EAX-and 0/imm32
2131 75/jump-if-not-equal $emit-opcodes:op2/disp8
2132
2133
2134
2135 68/push "f3"/imm32
2136 51/push-ECX
2137
2138 e8/call slice-equal?/disp32
2139
2140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2141
2142 3d/compare-EAX-and 0/imm32
2143 75/jump-if-not-equal $emit-opcodes:op2/disp8
2144
2145 e9/jump $emit-opcodes:end/disp32
2146 $emit-opcodes:op2:
2147
2148
2149 52/push-EDX
2150 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2151
2152 e8/call next-word/disp32
2153
2154 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2155
2156
2157
2158 52/push-EDX
2159
2160 e8/call slice-empty?/disp32
2161
2162 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2163
2164 3d/compare-EAX-and 0/imm32
2165 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2166
2167
2168 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2169
2170 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2171 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2172
2173 3d/compare-EAX-and 0x23/imm32/hash
2174 0f 84/jump-if-equal $emit-opcodes:end/disp32
2175
2176
2177 52/push-EDX
2178 68/push 0x2f/imm32/slash
2179 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2180 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2181
2182 e8/call next-token-from-slice/disp32
2183
2184 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2185
2186
2187 52/push-EDX
2188 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2189
2190 e8/call write-slice-buffered/disp32
2191
2192 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2193
2194
2195 68/push " "/imm32
2196 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2197
2198 e8/call write-buffered/disp32
2199
2200 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2201
2202
2203
2204 68/push "0f"/imm32
2205 51/push-ECX
2206
2207 e8/call slice-equal?/disp32
2208
2209 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2210
2211 3d/compare-EAX-and 0/imm32
2212 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2213
2214
2215
2216 68/push "0f"/imm32
2217 52/push-EDX
2218
2219 e8/call slice-equal?/disp32
2220
2221 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2222
2223 3d/compare-EAX-and 0/imm32
2224 0f 84/jump-if-equal $emit-opcodes:end/disp32
2225 $emit-opcodes:op3:
2226
2227
2228 52/push-EDX
2229 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2230
2231 e8/call next-word/disp32
2232
2233 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2234
2235
2236
2237 52/push-EDX
2238
2239 e8/call slice-empty?/disp32
2240
2241 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2242
2243 3d/compare-EAX-and 0/imm32
2244 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2245
2246
2247 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
2248
2249 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2250 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
2251
2252 3d/compare-EAX-and 0x23/imm32/hash
2253 0f 84/jump-if-equal $emit-opcodes:end/disp32
2254
2255
2256 52/push-EDX
2257 68/push 0x2f/imm32/slash
2258 ff 6/subop/push 1/mod/*+disp8 2/rm32/EDX . . . . 4/disp8 .
2259 ff 6/subop/push 0/mod/indirect 2/rm32/EDX . . . . . .
2260
2261 e8/call next-token-from-slice/disp32
2262
2263 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2264
2265
2266 52/push-EDX
2267 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2268
2269 e8/call write-slice-buffered/disp32
2270
2271 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2272
2273
2274 68/push " "/imm32
2275 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2276
2277 e8/call write-buffered/disp32
2278
2279 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2280 $emit-opcodes:end:
2281
2282 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2283
2284 5b/pop-to-EBX
2285 5a/pop-to-EDX
2286 59/pop-to-ECX
2287 58/pop-to-EAX
2288
2289 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2290 5d/pop-to-EBP
2291 c3/return
2292
2293 emit-modrm:
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320 55/push-EBP
2321 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2322
2323 50/push-EAX
2324 51/push-ECX
2325 52/push-EDX
2326 53/push-EBX
2327 56/push-ESI
2328 57/push-EDI
2329
2330 68/push 0/imm32/end
2331 68/push 0/imm32/start
2332 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2333
2334 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2335
2336 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2337
2338 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2339
2340 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2341
2342
2343 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2344
2345 e8/call rewind-stream/disp32
2346
2347 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2348 +-- 33 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2381 $emit-modrm:loop:
2382
2383
2384 51/push-ECX
2385 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2386
2387 e8/call next-word/disp32
2388
2389 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2390 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2432 $emit-modrm:check0:
2433
2434
2435
2436 51/push-ECX
2437
2438 e8/call slice-empty?/disp32
2439
2440 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2441
2442 3d/compare-EAX-and 0/imm32
2443 0f 85/jump-if-not-equal $emit-modrm:break/disp32
2444 $emit-modrm:check1:
2445
2446
2447 52/push-EDX
2448
2449 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2450
2451 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2452 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2453
2454 5a/pop-to-EDX
2455
2456 3d/compare-EAX-and 0x23/imm32/hash
2457 0f 84/jump-if-equal $emit-modrm:break/disp32
2458 $emit-modrm:check-for-mod:
2459
2460
2461
2462 68/push "mod"/imm32
2463 51/push-ECX
2464
2465 e8/call has-metadata?/disp32
2466
2467 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2468
2469 3d/compare-EAX-and 0/imm32
2470 74/jump-if-equal $emit-modrm:check-for-rm32/disp8
2471 $emit-modrm:mod:
2472
2473
2474
2475 51/push-ECX
2476
2477 e8/call parse-datum-of-word/disp32
2478
2479 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2480
2481 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2482
2483 ba/copy-to-EDX 1/imm32/true
2484
2485 e9/jump $emit-modrm:loop/disp32
2486 $emit-modrm:check-for-rm32:
2487
2488
2489
2490 68/push "rm32"/imm32
2491 51/push-ECX
2492
2493 e8/call has-metadata?/disp32
2494
2495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2496
2497 3d/compare-EAX-and 0/imm32
2498 74/jump-if-equal $emit-modrm:check-for-r32/disp8
2499 $emit-modrm:rm32:
2500
2501
2502
2503 51/push-ECX
2504
2505 e8/call parse-datum-of-word/disp32
2506
2507 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2508
2509 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2510
2511 ba/copy-to-EDX 1/imm32/true
2512
2513 e9/jump $emit-modrm:loop/disp32
2514 $emit-modrm:check-for-r32:
2515
2516
2517
2518 68/push "r32"/imm32
2519 51/push-ECX
2520
2521 e8/call has-metadata?/disp32
2522
2523 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2524
2525 3d/compare-EAX-and 0/imm32
2526 74/jump-if-equal $emit-modrm:check-for-subop/disp8
2527 $emit-modrm:r32:
2528
2529
2530
2531 51/push-ECX
2532
2533 e8/call parse-datum-of-word/disp32
2534
2535 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2536
2537 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2538
2539 ba/copy-to-EDX 1/imm32/true
2540
2541 e9/jump $emit-modrm:loop/disp32
2542 $emit-modrm:check-for-subop:
2543
2544
2545
2546 68/push "subop"/imm32
2547 51/push-ECX
2548
2549 e8/call has-metadata?/disp32
2550
2551 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2552
2553 3d/compare-EAX-and 0/imm32
2554 0f 84/jump-if-equal $emit-modrm:loop/disp32
2555 $emit-modrm:subop:
2556
2557
2558
2559 51/push-ECX
2560
2561 e8/call parse-datum-of-word/disp32
2562
2563 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2564
2565 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2566
2567 ba/copy-to-EDX 1/imm32/true
2568
2569 e9/jump $emit-modrm:loop/disp32
2570 $emit-modrm:break:
2571
2572 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
2573 74/jump-if-equal $emit-modrm:end/disp8
2574 $emit-modrm:calculate:
2575
2576 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
2577
2578 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2579
2580 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
2581 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
2582
2583 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2584
2585 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
2586 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
2587 $emit-modrm:emit:
2588
2589
2590 68/push 1/imm32
2591 53/push-EBX
2592 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2593
2594 e8/call emit-hex/disp32
2595
2596 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2597 $emit-modrm:end:
2598
2599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2600
2601 5f/pop-to-EDI
2602 5e/pop-to-ESI
2603 5b/pop-to-EBX
2604 5a/pop-to-EDX
2605 59/pop-to-ECX
2606 58/pop-to-EAX
2607
2608 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2609 5d/pop-to-EBP
2610 c3/return
2611
2612 emit-sib:
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638 55/push-EBP
2639 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2640
2641 50/push-EAX
2642 51/push-ECX
2643 52/push-EDX
2644 53/push-EBX
2645 56/push-ESI
2646 57/push-EDI
2647
2648 68/push 0/imm32/end
2649 68/push 0/imm32/start
2650 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2651
2652 31/xor 3/mod/direct 2/rm32/EDX . . . 2/r32/EDX . .
2653
2654 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2655
2656 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
2657
2658 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
2659
2660
2661 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2662
2663 e8/call rewind-stream/disp32
2664
2665 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2666 $emit-sib:loop:
2667 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2693
2694
2695 51/push-ECX
2696 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2697
2698 e8/call next-word/disp32
2699
2700 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2701 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2743 $emit-sib:check0:
2744
2745
2746
2747 51/push-ECX
2748
2749 e8/call slice-empty?/disp32
2750
2751 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2752
2753 3d/compare-EAX-and 0/imm32
2754 0f 85/jump-if-not-equal $emit-sib:break/disp32
2755 $emit-sib:check1:
2756
2757
2758 52/push-EDX
2759
2760 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
2761
2762 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2763 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
2764
2765 5a/pop-to-EDX
2766
2767 3d/compare-EAX-and 0x23/imm32/hash
2768 0f 84/jump-if-equal $emit-sib:break/disp32
2769 $emit-sib:check-for-scale:
2770
2771
2772
2773 68/push "scale"/imm32
2774 51/push-ECX
2775
2776 e8/call has-metadata?/disp32
2777
2778 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2779
2780 3d/compare-EAX-and 0/imm32
2781 74/jump-if-equal $emit-sib:check-for-base/disp8
2782 $emit-sib:scale:
2783
2784
2785
2786 51/push-ECX
2787
2788 e8/call parse-datum-of-word/disp32
2789
2790 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2791
2792 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2793
2794 ba/copy-to-EDX 1/imm32/true
2795
2796 e9/jump $emit-sib:loop/disp32
2797 $emit-sib:check-for-base:
2798
2799
2800
2801 68/push "base"/imm32
2802 51/push-ECX
2803
2804 e8/call has-metadata?/disp32
2805
2806 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2807
2808 3d/compare-EAX-and 0/imm32
2809 74/jump-if-equal $emit-sib:check-for-index/disp8
2810 $emit-sib:base:
2811
2812
2813
2814 51/push-ECX
2815
2816 e8/call parse-datum-of-word/disp32
2817
2818 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2819
2820 89/copy 3/mod/direct 6/rm32/ESI . . . 0/r32/EAX . .
2821
2822 ba/copy-to-EDX 1/imm32/true
2823
2824 e9/jump $emit-sib:loop/disp32
2825 $emit-sib:check-for-index:
2826
2827
2828
2829 68/push "index"/imm32
2830 51/push-ECX
2831
2832 e8/call has-metadata?/disp32
2833
2834 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2835
2836 3d/compare-EAX-and 0/imm32
2837 0f 84/jump-if-equal $emit-sib:loop/disp32
2838 $emit-sib:index:
2839
2840
2841
2842 51/push-ECX
2843
2844 e8/call parse-datum-of-word/disp32
2845
2846 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2847
2848 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
2849
2850 ba/copy-to-EDX 1/imm32/true
2851
2852 e9/jump $emit-sib:loop/disp32
2853 $emit-sib:break:
2854
2855 81 7/subop/compare 3/mod/direct 2/rm32/EDX . . . . . 0/imm32
2856 74/jump-if-equal $emit-sib:end/disp8
2857 $emit-sib:calculate:
2858
2859 81 4/subop/and 3/mod/direct 3/rm32/EBX . . . . . 3/imm32/0b11
2860
2861 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 2/imm8
2862
2863 81 4/subop/and 3/mod/direct 7/rm32/EDI . . . . . 7/imm32/0b111
2864 09/or 3/mod/direct 3/rm32/EBX . . . 7/r32/EDI . .
2865
2866 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 3/imm8
2867
2868 81 4/subop/and 3/mod/direct 6/rm32/ESI . . . . . 7/imm32/0b111
2869 09/or 3/mod/direct 3/rm32/EBX . . . 6/r32/ESI . .
2870 $emit-sib:emit:
2871
2872
2873 68/push 1/imm32
2874 53/push-EBX
2875 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2876
2877 e8/call emit-hex/disp32
2878
2879 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2880 $emit-sib:end:
2881
2882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2883
2884 5f/pop-to-EDI
2885 5e/pop-to-ESI
2886 5b/pop-to-EBX
2887 5a/pop-to-EDX
2888 59/pop-to-ECX
2889 58/pop-to-EAX
2890
2891 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2892 5d/pop-to-EBP
2893 c3/return
2894
2895 emit-disp:
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914 55/push-EBP
2915 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2916
2917 50/push-EAX
2918 51/push-ECX
2919 52/push-EDX
2920
2921 68/push 0/imm32/end
2922 68/push 0/imm32/start
2923 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2924
2925
2926 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2927
2928 e8/call rewind-stream/disp32
2929
2930 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2931 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2957 $emit-disp:loop:
2958
2959
2960 51/push-ECX
2961 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2962
2963 e8/call next-word/disp32
2964
2965 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2966 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3008 $emit-disp:check0:
3009
3010
3011
3012 51/push-ECX
3013
3014 e8/call slice-empty?/disp32
3015
3016 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3017
3018 3d/compare-EAX-and 0/imm32
3019 0f 85/jump-if-not-equal $emit-disp:break/disp32
3020 $emit-disp:check1:
3021
3022
3023 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3024
3025 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3026 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3027
3028 3d/compare-EAX-and 0x23/imm32/hash
3029 0f 84/jump-if-equal $emit-disp:break/disp32
3030 $emit-disp:check-for-disp32:
3031
3032
3033
3034 68/push "disp32"/imm32
3035 51/push-ECX
3036
3037 e8/call has-metadata?/disp32
3038
3039 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3040
3041 3d/compare-EAX-and 0/imm32
3042 74/jump-if-equal $emit-disp:check-for-disp16/disp8
3043 $emit-disp:disp32:
3044
3045
3046 68/push 4/imm32
3047 51/push-ECX
3048 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3049
3050 e8/call emit/disp32
3051
3052 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3053
3054 e9/jump $emit-disp:break/disp32
3055 $emit-disp:check-for-disp16:
3056
3057
3058
3059 68/push "disp16"/imm32
3060 51/push-ECX
3061
3062 e8/call has-metadata?/disp32
3063
3064 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3065
3066 3d/compare-EAX-and 0/imm32
3067 74/jump-if-equal $emit-disp:check-for-disp8/disp8
3068 $emit-disp:disp16:
3069
3070
3071 68/push 2/imm32
3072 51/push-ECX
3073 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3074
3075 e8/call emit/disp32
3076
3077 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3078
3079 e9/jump $emit-disp:break/disp32
3080 $emit-disp:check-for-disp8:
3081
3082
3083
3084 68/push "disp8"/imm32
3085 51/push-ECX
3086
3087 e8/call has-metadata?/disp32
3088
3089 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3090
3091 3d/compare-EAX-and 0/imm32
3092 0f 84/jump-if-equal $emit-disp:loop/disp32
3093 $emit-disp:disp8:
3094
3095
3096 68/push 1/imm32
3097 51/push-ECX
3098 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3099
3100 e8/call emit/disp32
3101
3102 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3103
3104 $emit-disp:break:
3105
3106 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3107
3108 5a/pop-to-EDX
3109 59/pop-to-ECX
3110 58/pop-to-EAX
3111
3112 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3113 5d/pop-to-EBP
3114 c3/return
3115
3116 emit-imm:
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135 55/push-EBP
3136 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3137
3138 50/push-EAX
3139 51/push-ECX
3140 52/push-EDX
3141
3142 68/push 0/imm32/end
3143 68/push 0/imm32/start
3144 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3145
3146
3147 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3148
3149 e8/call rewind-stream/disp32
3150
3151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3152 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
3178 $emit-imm:loop:
3179
3180
3181 51/push-ECX
3182 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3183
3184 e8/call next-word/disp32
3185
3186 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3187 +-- 42 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3229 $emit-imm:check0:
3230
3231
3232
3233 51/push-ECX
3234
3235 e8/call slice-empty?/disp32
3236
3237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3238
3239 3d/compare-EAX-and 0/imm32
3240 0f 85/jump-if-not-equal $emit-imm:break/disp32
3241 $emit-imm:check1:
3242
3243
3244 8b/copy 0/mod/indirect 1/rm32/ECX . . . 2/r32/EDX . .
3245
3246 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3247 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 0/r32/AL . .
3248
3249 3d/compare-EAX-and 0x23/imm32/hash
3250 0f 84/jump-if-equal $emit-imm:break/disp32
3251 $emit-imm:check-for-imm32:
3252
3253
3254
3255 68/push "imm32"/imm32
3256 51/push-ECX
3257
3258 e8/call has-metadata?/disp32
3259
3260 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3261
3262 3d/compare-EAX-and 0/imm32
3263 74/jump-if-equal $emit-imm:check-for-imm16/disp8
3264 $emit-imm:imm32:
3265
3266
3267 68/push 4/imm32
3268 51/push-ECX
3269 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3270
3271 e8/call emit/disp32
3272
3273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3274
3275 e9/jump $emit-imm:break/disp32
3276 $emit-imm:check-for-imm16:
3277
3278
3279
3280 68/push "imm16"/imm32
3281 51/push-ECX
3282
3283 e8/call has-metadata?/disp32
3284
3285 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3286
3287 3d/compare-EAX-and 0/imm32
3288 74/jump-if-equal $emit-imm:check-for-imm8/disp8
3289 $emit-imm:imm16:
3290
3291
3292 68/push 2/imm32
3293 51/push-ECX
3294 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3295
3296 e8/call emit/disp32
3297
3298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3299
3300 e9/jump $emit-imm:break/disp32
3301 $emit-imm:check-for-imm8:
3302
3303
3304
3305 68/push "imm8"/imm32
3306 51/push-ECX
3307
3308 e8/call has-metadata?/disp32
3309
3310 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3311
3312 3d/compare-EAX-and 0/imm32
3313 0f 84/jump-if-equal $emit-imm:loop/disp32
3314 $emit-imm:imm8:
3315
3316
3317 68/push 1/imm32
3318 51/push-ECX
3319 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3320
3321 e8/call emit/disp32
3322
3323 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3324
3325 $emit-imm:break:
3326
3327 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3328
3329 5a/pop-to-EDX
3330 59/pop-to-ECX
3331 58/pop-to-EAX
3332
3333 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3334 5d/pop-to-EBP
3335 c3/return
3336
3337 emit-line-in-comment:
3338
3339 55/push-EBP
3340 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3341
3342
3343 68/push " # "/imm32
3344 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3345
3346 e8/call write-buffered/disp32
3347
3348 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3349
3350
3351 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3352 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3353
3354 e8/call write-stream-data/disp32
3355
3356 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3357 $emit-line-in-comment:end:
3358
3359 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3360 5d/pop-to-EBP
3361 c3/return
3362
3363 test-convert-instruction-passes-comments-through:
3364
3365
3366 55/push-EBP
3367 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3368
3369
3370
3371 68/push _test-input-stream/imm32
3372
3373 e8/call clear-stream/disp32
3374
3375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3376
3377
3378 68/push _test-output-stream/imm32
3379
3380 e8/call clear-stream/disp32
3381
3382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3383
3384
3385 b8/copy-to-EAX _test-output-buffered-file/imm32
3386 05/add-to-EAX 4/imm32
3387 50/push-EAX
3388
3389 e8/call clear-stream/disp32
3390
3391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3392
3393
3394
3395 68/push "# abcd"/imm32
3396 68/push _test-input-stream/imm32
3397
3398 e8/call write/disp32
3399
3400 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3401
3402
3403 68/push _test-output-buffered-file/imm32
3404 68/push _test-input-stream/imm32
3405
3406 e8/call convert-instruction/disp32
3407
3408 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3409
3410
3411
3412 68/push _test-output-buffered-file/imm32
3413
3414 e8/call flush/disp32
3415
3416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3417
3418
3419 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3420 68/push "# abcd"/imm32
3421 68/push _test-output-stream/imm32
3422
3423 e8/call check-stream-equal/disp32
3424
3425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3426
3427 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3428 5d/pop-to-EBP
3429 c3/return
3430
3431 test-convert-instruction-passes-labels-through:
3432
3433
3434 55/push-EBP
3435 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3436
3437
3438
3439 68/push _test-input-stream/imm32
3440
3441 e8/call clear-stream/disp32
3442
3443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3444
3445
3446 68/push _test-output-stream/imm32
3447
3448 e8/call clear-stream/disp32
3449
3450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3451
3452
3453 b8/copy-to-EAX _test-output-buffered-file/imm32
3454 05/add-to-EAX 4/imm32
3455 50/push-EAX
3456
3457 e8/call clear-stream/disp32
3458
3459 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3460
3461
3462
3463 68/push "ab: # cd"/imm32
3464 68/push _test-input-stream/imm32
3465
3466 e8/call write/disp32
3467
3468 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3469
3470
3471 68/push _test-output-buffered-file/imm32
3472 68/push _test-input-stream/imm32
3473
3474 e8/call convert-instruction/disp32
3475
3476 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3477
3478
3479
3480 68/push _test-output-buffered-file/imm32
3481
3482 e8/call flush/disp32
3483
3484 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3485
3486
3487 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3488 68/push "ab: # cd"/imm32
3489 68/push _test-output-stream/imm32
3490
3491 e8/call check-stream-equal/disp32
3492
3493 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3494
3495 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3496 5d/pop-to-EBP
3497 c3/return
3498
3499 test-convert-instruction-handles-single-opcode:
3500
3501
3502 55/push-EBP
3503 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3504
3505
3506
3507 68/push _test-input-stream/imm32
3508
3509 e8/call clear-stream/disp32
3510
3511 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3512
3513
3514 68/push _test-output-stream/imm32
3515
3516 e8/call clear-stream/disp32
3517
3518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3519
3520
3521 b8/copy-to-EAX _test-output-buffered-file/imm32
3522 05/add-to-EAX 4/imm32
3523 50/push-EAX
3524
3525 e8/call clear-stream/disp32
3526
3527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3528
3529
3530
3531 68/push "ab/cd # comment"/imm32
3532 68/push _test-input-stream/imm32
3533
3534 e8/call write/disp32
3535
3536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3537
3538
3539 68/push _test-output-buffered-file/imm32
3540 68/push _test-input-stream/imm32
3541
3542 e8/call convert-instruction/disp32
3543
3544 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3545
3546
3547
3548 68/push _test-output-buffered-file/imm32
3549
3550 e8/call flush/disp32
3551
3552 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3553 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3579
3580
3581 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3582 68/push "ab # ab/cd # comment"/imm32
3583 68/push _test-output-stream/imm32
3584
3585 e8/call check-stream-equal/disp32
3586
3587 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3588
3589 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3590 5d/pop-to-EBP
3591 c3/return
3592
3593 test-convert-instruction-handles-0f-opcode:
3594
3595
3596 55/push-EBP
3597 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3598
3599
3600
3601 68/push _test-input-stream/imm32
3602
3603 e8/call clear-stream/disp32
3604
3605 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3606
3607
3608 68/push _test-output-stream/imm32
3609
3610 e8/call clear-stream/disp32
3611
3612 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3613
3614
3615 b8/copy-to-EAX _test-output-buffered-file/imm32
3616 05/add-to-EAX 4/imm32
3617 50/push-EAX
3618
3619 e8/call clear-stream/disp32
3620
3621 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3622
3623
3624
3625 68/push "0f/m1 ab/m2 # comment"/imm32
3626 68/push _test-input-stream/imm32
3627
3628 e8/call write/disp32
3629
3630 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3631
3632
3633 68/push _test-output-buffered-file/imm32
3634 68/push _test-input-stream/imm32
3635
3636 e8/call convert-instruction/disp32
3637
3638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3639
3640
3641
3642 68/push _test-output-buffered-file/imm32
3643
3644 e8/call flush/disp32
3645
3646 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3647 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3673
3674
3675 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3676 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3677 68/push _test-output-stream/imm32
3678
3679 e8/call check-stream-equal/disp32
3680
3681 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3682
3683 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3684 5d/pop-to-EBP
3685 c3/return
3686
3687 test-convert-instruction-handles-f2-opcode:
3688
3689
3690 55/push-EBP
3691 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3692
3693
3694
3695 68/push _test-input-stream/imm32
3696
3697 e8/call clear-stream/disp32
3698
3699 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3700
3701
3702 68/push _test-output-stream/imm32
3703
3704 e8/call clear-stream/disp32
3705
3706 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3707
3708
3709 b8/copy-to-EAX _test-output-buffered-file/imm32
3710 05/add-to-EAX 4/imm32
3711 50/push-EAX
3712
3713 e8/call clear-stream/disp32
3714
3715 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3716
3717
3718
3719 68/push "f2/m1 ab/m2 # comment"/imm32
3720 68/push _test-input-stream/imm32
3721
3722 e8/call write/disp32
3723
3724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3725
3726
3727 68/push _test-output-buffered-file/imm32
3728 68/push _test-input-stream/imm32
3729
3730 e8/call convert-instruction/disp32
3731
3732 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3733
3734
3735
3736 68/push _test-output-buffered-file/imm32
3737
3738 e8/call flush/disp32
3739
3740 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3741 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3767
3768
3769 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3770 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3771 68/push _test-output-stream/imm32
3772
3773 e8/call check-stream-equal/disp32
3774
3775 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3776
3777 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3778 5d/pop-to-EBP
3779 c3/return
3780
3781 test-convert-instruction-handles-f3-opcode:
3782
3783
3784 55/push-EBP
3785 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3786
3787
3788
3789 68/push _test-input-stream/imm32
3790
3791 e8/call clear-stream/disp32
3792
3793 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3794
3795
3796 68/push _test-output-stream/imm32
3797
3798 e8/call clear-stream/disp32
3799
3800 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3801
3802
3803 b8/copy-to-EAX _test-output-buffered-file/imm32
3804 05/add-to-EAX 4/imm32
3805 50/push-EAX
3806
3807 e8/call clear-stream/disp32
3808
3809 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3810
3811
3812
3813 68/push "f3/m1 ab/m2 # comment"/imm32
3814 68/push _test-input-stream/imm32
3815
3816 e8/call write/disp32
3817
3818 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3819
3820
3821 68/push _test-output-buffered-file/imm32
3822 68/push _test-input-stream/imm32
3823
3824 e8/call convert-instruction/disp32
3825
3826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3827
3828
3829
3830 68/push _test-output-buffered-file/imm32
3831
3832 e8/call flush/disp32
3833
3834 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3835 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3861
3862
3863 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3864 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3865 68/push _test-output-stream/imm32
3866
3867 e8/call check-stream-equal/disp32
3868
3869 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3870
3871 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3872 5d/pop-to-EBP
3873 c3/return
3874
3875 test-convert-instruction-handles-f2-0f-opcode:
3876
3877
3878 55/push-EBP
3879 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3880
3881
3882
3883 68/push _test-input-stream/imm32
3884
3885 e8/call clear-stream/disp32
3886
3887 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3888
3889
3890 68/push _test-output-stream/imm32
3891
3892 e8/call clear-stream/disp32
3893
3894 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3895
3896
3897 b8/copy-to-EAX _test-output-buffered-file/imm32
3898 05/add-to-EAX 4/imm32
3899 50/push-EAX
3900
3901 e8/call clear-stream/disp32
3902
3903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3904
3905
3906
3907 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
3908 68/push _test-input-stream/imm32
3909
3910 e8/call write/disp32
3911
3912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3913
3914
3915 68/push _test-output-buffered-file/imm32
3916 68/push _test-input-stream/imm32
3917
3918 e8/call convert-instruction/disp32
3919
3920 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3921
3922
3923
3924 68/push _test-output-buffered-file/imm32
3925
3926 e8/call flush/disp32
3927
3928 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3929 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3955
3956
3957 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
3958 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
3959 68/push _test-output-stream/imm32
3960
3961 e8/call check-stream-equal/disp32
3962
3963 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3964
3965 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3966 5d/pop-to-EBP
3967 c3/return
3968
3969 test-convert-instruction-handles-f3-0f-opcode:
3970
3971
3972 55/push-EBP
3973 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3974
3975
3976
3977 68/push _test-input-stream/imm32
3978
3979 e8/call clear-stream/disp32
3980
3981 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3982
3983
3984 68/push _test-output-stream/imm32
3985
3986 e8/call clear-stream/disp32
3987
3988 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3989
3990
3991 b8/copy-to-EAX _test-output-buffered-file/imm32
3992 05/add-to-EAX 4/imm32
3993 50/push-EAX
3994
3995 e8/call clear-stream/disp32
3996
3997 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3998
3999
4000
4001 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
4002 68/push _test-input-stream/imm32
4003
4004 e8/call write/disp32
4005
4006 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4007
4008
4009 68/push _test-output-buffered-file/imm32
4010 68/push _test-input-stream/imm32
4011
4012 e8/call convert-instruction/disp32
4013
4014 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4015
4016
4017
4018 68/push _test-output-buffered-file/imm32
4019
4020 e8/call flush/disp32
4021
4022 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4023 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4049
4050
4051 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
4052 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
4053 68/push _test-output-stream/imm32
4054
4055 e8/call check-stream-equal/disp32
4056
4057 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4058
4059 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4060 5d/pop-to-EBP
4061 c3/return
4062
4063 test-convert-instruction-handles-unused-opcodes:
4064
4065
4066 55/push-EBP
4067 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4068
4069
4070
4071 68/push _test-input-stream/imm32
4072
4073 e8/call clear-stream/disp32
4074
4075 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4076
4077
4078 68/push _test-output-stream/imm32
4079
4080 e8/call clear-stream/disp32
4081
4082 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4083
4084
4085 b8/copy-to-EAX _test-output-buffered-file/imm32
4086 05/add-to-EAX 4/imm32
4087 50/push-EAX
4088
4089 e8/call clear-stream/disp32
4090
4091 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4092
4093
4094
4095 68/push "ab/m1 cd/m2 # comment"/imm32
4096 68/push _test-input-stream/imm32
4097
4098 e8/call write/disp32
4099
4100 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4101
4102
4103 68/push _test-output-buffered-file/imm32
4104 68/push _test-input-stream/imm32
4105
4106 e8/call convert-instruction/disp32
4107
4108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4109
4110
4111
4112 68/push _test-output-buffered-file/imm32
4113
4114 e8/call flush/disp32
4115
4116 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4117 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4143
4144
4145 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4146 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4147 68/push _test-output-stream/imm32
4148
4149 e8/call check-stream-equal/disp32
4150
4151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4152
4153 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4154 5d/pop-to-EBP
4155 c3/return
4156
4157 test-convert-instruction-handles-unused-second-opcodes:
4158
4159
4160 55/push-EBP
4161 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4162
4163
4164
4165 68/push _test-input-stream/imm32
4166
4167 e8/call clear-stream/disp32
4168
4169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4170
4171
4172 68/push _test-output-stream/imm32
4173
4174 e8/call clear-stream/disp32
4175
4176 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4177
4178
4179 b8/copy-to-EAX _test-output-buffered-file/imm32
4180 05/add-to-EAX 4/imm32
4181 50/push-EAX
4182
4183 e8/call clear-stream/disp32
4184
4185 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4186
4187
4188
4189 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4190 68/push _test-input-stream/imm32
4191
4192 e8/call write/disp32
4193
4194 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4195
4196
4197 68/push _test-output-buffered-file/imm32
4198 68/push _test-input-stream/imm32
4199
4200 e8/call convert-instruction/disp32
4201
4202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4203
4204
4205
4206 68/push _test-output-buffered-file/imm32
4207
4208 e8/call flush/disp32
4209
4210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4211 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4237
4238
4239 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4240 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4241 68/push _test-output-stream/imm32
4242
4243 e8/call check-stream-equal/disp32
4244
4245 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4246
4247 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4248 5d/pop-to-EBP
4249 c3/return
4250
4251 test-convert-instruction-handles-unused-second-opcodes-2:
4252
4253
4254 55/push-EBP
4255 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4256
4257
4258
4259 68/push _test-input-stream/imm32
4260
4261 e8/call clear-stream/disp32
4262
4263 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4264
4265
4266 68/push _test-output-stream/imm32
4267
4268 e8/call clear-stream/disp32
4269
4270 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4271
4272
4273 b8/copy-to-EAX _test-output-buffered-file/imm32
4274 05/add-to-EAX 4/imm32
4275 50/push-EAX
4276
4277 e8/call clear-stream/disp32
4278
4279 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4280
4281
4282
4283 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4284 68/push _test-input-stream/imm32
4285
4286 e8/call write/disp32
4287
4288 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4289
4290
4291 68/push _test-output-buffered-file/imm32
4292 68/push _test-input-stream/imm32
4293
4294 e8/call convert-instruction/disp32
4295
4296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4297
4298
4299
4300 68/push _test-output-buffered-file/imm32
4301
4302 e8/call flush/disp32
4303
4304 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4305 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4331
4332
4333 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4334 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4335 68/push _test-output-stream/imm32
4336
4337 e8/call check-stream-equal/disp32
4338
4339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4340
4341 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4342 5d/pop-to-EBP
4343 c3/return
4344
4345 test-convert-instruction-emits-modrm-byte:
4346
4347
4348 55/push-EBP
4349 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4350
4351
4352
4353 68/push _test-input-stream/imm32
4354
4355 e8/call clear-stream/disp32
4356
4357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4358
4359
4360 68/push _test-output-stream/imm32
4361
4362 e8/call clear-stream/disp32
4363
4364 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4365
4366
4367 b8/copy-to-EAX _test-output-buffered-file/imm32
4368 05/add-to-EAX 4/imm32
4369 50/push-EAX
4370
4371 e8/call clear-stream/disp32
4372
4373 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4374
4375
4376
4377 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4378 68/push _test-input-stream/imm32
4379
4380 e8/call write/disp32
4381
4382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4383
4384
4385 68/push _test-output-buffered-file/imm32
4386 68/push _test-input-stream/imm32
4387
4388 e8/call convert-instruction/disp32
4389
4390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4391
4392
4393
4394 68/push _test-output-buffered-file/imm32
4395
4396 e8/call flush/disp32
4397
4398 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4399 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4425
4426
4427 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4428 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4429 68/push _test-output-stream/imm32
4430
4431 e8/call check-stream-equal/disp32
4432
4433 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4434
4435 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4436 5d/pop-to-EBP
4437 c3/return
4438
4439 test-convert-instruction-emits-modrm-byte-with-non-zero-mod:
4440
4441 55/push-EBP
4442 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4443
4444
4445
4446 68/push _test-input-stream/imm32
4447
4448 e8/call clear-stream/disp32
4449
4450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4451
4452
4453 68/push _test-output-stream/imm32
4454
4455 e8/call clear-stream/disp32
4456
4457 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4458
4459
4460 b8/copy-to-EAX _test-output-buffered-file/imm32
4461 05/add-to-EAX 4/imm32
4462 50/push-EAX
4463
4464 e8/call clear-stream/disp32
4465
4466 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4467
4468
4469
4470 68/push "01/add 3/mod/direct 3/rm32/EBX 1/r32/ECX"/imm32
4471 68/push _test-input-stream/imm32
4472
4473 e8/call write/disp32
4474
4475 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4476
4477
4478 68/push _test-output-buffered-file/imm32
4479 68/push _test-input-stream/imm32
4480
4481 e8/call convert-instruction/disp32
4482
4483 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4484
4485
4486 68/push _test-output-buffered-file/imm32
4487
4488 e8/call flush/disp32
4489
4490 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4491 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4517
4518
4519
4520 68/push "F - test-convert-instruction-foo"/imm32
4521 68/push "01 cb # 01/add 3/mod/direct 3/rm32/EBX 1/r32/ECX"/imm32
4522 68/push _test-output-stream/imm32
4523
4524 e8/call check-stream-equal/disp32
4525
4526 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4527
4528 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4529 5d/pop-to-EBP
4530 c3/return
4531
4532 test-convert-instruction-emits-modrm-byte-from-subop:
4533
4534
4535 55/push-EBP
4536 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4537
4538
4539
4540 68/push _test-input-stream/imm32
4541
4542 e8/call clear-stream/disp32
4543
4544 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4545
4546
4547 68/push _test-output-stream/imm32
4548
4549 e8/call clear-stream/disp32
4550
4551 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4552
4553
4554 b8/copy-to-EAX _test-output-buffered-file/imm32
4555 05/add-to-EAX 4/imm32
4556 50/push-EAX
4557
4558 e8/call clear-stream/disp32
4559
4560 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4561
4562
4563
4564 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4565 68/push _test-input-stream/imm32
4566
4567 e8/call write/disp32
4568
4569 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4570
4571
4572 68/push _test-output-buffered-file/imm32
4573 68/push _test-input-stream/imm32
4574
4575 e8/call convert-instruction/disp32
4576
4577 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4578
4579
4580
4581 68/push _test-output-buffered-file/imm32
4582
4583 e8/call flush/disp32
4584
4585 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4586 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4612
4613
4614 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4615 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4616 68/push _test-output-stream/imm32
4617
4618 e8/call check-stream-equal/disp32
4619
4620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4621
4622 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4623 5d/pop-to-EBP
4624 c3/return
4625
4626 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4627
4628
4629 55/push-EBP
4630 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4631
4632
4633
4634 68/push _test-input-stream/imm32
4635
4636 e8/call clear-stream/disp32
4637
4638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4639
4640
4641 68/push _test-output-stream/imm32
4642
4643 e8/call clear-stream/disp32
4644
4645 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4646
4647
4648 b8/copy-to-EAX _test-output-buffered-file/imm32
4649 05/add-to-EAX 4/imm32
4650 50/push-EAX
4651
4652 e8/call clear-stream/disp32
4653
4654 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4655
4656
4657
4658 68/push "8b/copy 0/rm32 1/r32"/imm32
4659 68/push _test-input-stream/imm32
4660
4661 e8/call write/disp32
4662
4663 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4664
4665
4666 68/push _test-output-buffered-file/imm32
4667 68/push _test-input-stream/imm32
4668
4669 e8/call convert-instruction/disp32
4670
4671 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4672
4673
4674
4675 68/push _test-output-buffered-file/imm32
4676
4677 e8/call flush/disp32
4678
4679 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4680 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4706
4707
4708 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4709 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4710 68/push _test-output-stream/imm32
4711
4712 e8/call check-stream-equal/disp32
4713
4714 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4715
4716 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4717 5d/pop-to-EBP
4718 c3/return
4719
4720 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4721
4722
4723 55/push-EBP
4724 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4725
4726
4727
4728 68/push _test-input-stream/imm32
4729
4730 e8/call clear-stream/disp32
4731
4732 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4733
4734
4735 68/push _test-output-stream/imm32
4736
4737 e8/call clear-stream/disp32
4738
4739 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4740
4741
4742 b8/copy-to-EAX _test-output-buffered-file/imm32
4743 05/add-to-EAX 4/imm32
4744 50/push-EAX
4745
4746 e8/call clear-stream/disp32
4747
4748 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4749
4750
4751
4752 68/push "8b/copy 0/mod 1/r32"/imm32
4753 68/push _test-input-stream/imm32
4754
4755 e8/call write/disp32
4756
4757 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4758
4759
4760 68/push _test-output-buffered-file/imm32
4761 68/push _test-input-stream/imm32
4762
4763 e8/call convert-instruction/disp32
4764
4765 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4766
4767
4768
4769 68/push _test-output-buffered-file/imm32
4770
4771 e8/call flush/disp32
4772
4773 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4774 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4800
4801
4802 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4803 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4804 68/push _test-output-stream/imm32
4805
4806 e8/call check-stream-equal/disp32
4807
4808 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4809
4810 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4811 5d/pop-to-EBP
4812 c3/return
4813
4814 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4815
4816
4817 55/push-EBP
4818 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4819
4820
4821
4822 68/push _test-input-stream/imm32
4823
4824 e8/call clear-stream/disp32
4825
4826 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4827
4828
4829 68/push _test-output-stream/imm32
4830
4831 e8/call clear-stream/disp32
4832
4833 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4834
4835
4836 b8/copy-to-EAX _test-output-buffered-file/imm32
4837 05/add-to-EAX 4/imm32
4838 50/push-EAX
4839
4840 e8/call clear-stream/disp32
4841
4842 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4843
4844
4845
4846 68/push "8b/copy 0/mod 0/rm32"/imm32
4847 68/push _test-input-stream/imm32
4848
4849 e8/call write/disp32
4850
4851 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4852
4853
4854 68/push _test-output-buffered-file/imm32
4855 68/push _test-input-stream/imm32
4856
4857 e8/call convert-instruction/disp32
4858
4859 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4860
4861
4862
4863 68/push _test-output-buffered-file/imm32
4864
4865 e8/call flush/disp32
4866
4867 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4868 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4894
4895
4896 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4897 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4898 68/push _test-output-stream/imm32
4899
4900 e8/call check-stream-equal/disp32
4901
4902 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4903
4904 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4905 5d/pop-to-EBP
4906 c3/return
4907
4908 test-convert-instruction-emits-sib-byte:
4909
4910
4911 55/push-EBP
4912 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4913
4914
4915
4916 68/push _test-input-stream/imm32
4917
4918 e8/call clear-stream/disp32
4919
4920 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4921
4922
4923 68/push _test-output-stream/imm32
4924
4925 e8/call clear-stream/disp32
4926
4927 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4928
4929
4930 b8/copy-to-EAX _test-output-buffered-file/imm32
4931 05/add-to-EAX 4/imm32
4932 50/push-EAX
4933
4934 e8/call clear-stream/disp32
4935
4936 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4937
4938
4939
4940 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4941 68/push _test-input-stream/imm32
4942
4943 e8/call write/disp32
4944
4945 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4946
4947
4948 68/push _test-output-buffered-file/imm32
4949 68/push _test-input-stream/imm32
4950
4951 e8/call convert-instruction/disp32
4952
4953 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
4954
4955
4956
4957 68/push _test-output-buffered-file/imm32
4958
4959 e8/call flush/disp32
4960
4961 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4962 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4988
4989
4990 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
4991 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4992 68/push _test-output-stream/imm32
4993
4994 e8/call check-stream-equal/disp32
4995
4996 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4997
4998 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4999 5d/pop-to-EBP
5000 c3/return
5001
5002 test-convert-instruction-emits-sib-byte-with-missing-base:
5003
5004
5005 55/push-EBP
5006 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5007
5008
5009
5010 68/push _test-input-stream/imm32
5011
5012 e8/call clear-stream/disp32
5013
5014 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5015
5016
5017 68/push _test-output-stream/imm32
5018
5019 e8/call clear-stream/disp32
5020
5021 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5022
5023
5024 b8/copy-to-EAX _test-output-buffered-file/imm32
5025 05/add-to-EAX 4/imm32
5026 50/push-EAX
5027
5028 e8/call clear-stream/disp32
5029
5030 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5031
5032
5033
5034 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5035 68/push _test-input-stream/imm32
5036
5037 e8/call write/disp32
5038
5039 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5040
5041
5042 68/push _test-output-buffered-file/imm32
5043 68/push _test-input-stream/imm32
5044
5045 e8/call convert-instruction/disp32
5046
5047 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5048
5049
5050
5051 68/push _test-output-buffered-file/imm32
5052
5053 e8/call flush/disp32
5054
5055 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5056 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5082
5083
5084 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
5085 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5086 68/push _test-output-stream/imm32
5087
5088 e8/call check-stream-equal/disp32
5089
5090 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5091
5092 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5093 5d/pop-to-EBP
5094 c3/return
5095
5096 test-convert-instruction-emits-sib-byte-with-missing-index:
5097
5098
5099 55/push-EBP
5100 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5101
5102
5103
5104 68/push _test-input-stream/imm32
5105
5106 e8/call clear-stream/disp32
5107
5108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5109
5110
5111 68/push _test-output-stream/imm32
5112
5113 e8/call clear-stream/disp32
5114
5115 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5116
5117
5118 b8/copy-to-EAX _test-output-buffered-file/imm32
5119 05/add-to-EAX 4/imm32
5120 50/push-EAX
5121
5122 e8/call clear-stream/disp32
5123
5124 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5125
5126
5127
5128 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5129 68/push _test-input-stream/imm32
5130
5131 e8/call write/disp32
5132
5133 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5134
5135
5136 68/push _test-output-buffered-file/imm32
5137 68/push _test-input-stream/imm32
5138
5139 e8/call convert-instruction/disp32
5140
5141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5142
5143
5144
5145 68/push _test-output-buffered-file/imm32
5146
5147 e8/call flush/disp32
5148
5149 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5150 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5176
5177
5178 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5179 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5180 68/push _test-output-stream/imm32
5181
5182 e8/call check-stream-equal/disp32
5183
5184 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5185
5186 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5187 5d/pop-to-EBP
5188 c3/return
5189
5190 test-convert-instruction-emits-sib-byte-with-missing-scale:
5191
5192
5193 55/push-EBP
5194 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5195
5196
5197
5198 68/push _test-input-stream/imm32
5199
5200 e8/call clear-stream/disp32
5201
5202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5203
5204
5205 68/push _test-output-stream/imm32
5206
5207 e8/call clear-stream/disp32
5208
5209 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5210
5211
5212 b8/copy-to-EAX _test-output-buffered-file/imm32
5213 05/add-to-EAX 4/imm32
5214 50/push-EAX
5215
5216 e8/call clear-stream/disp32
5217
5218 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5219
5220
5221
5222 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5223 68/push _test-input-stream/imm32
5224
5225 e8/call write/disp32
5226
5227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5228
5229
5230 68/push _test-output-buffered-file/imm32
5231 68/push _test-input-stream/imm32
5232
5233 e8/call convert-instruction/disp32
5234
5235 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5236
5237
5238
5239 68/push _test-output-buffered-file/imm32
5240
5241 e8/call flush/disp32
5242
5243 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5244 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5270
5271
5272 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5273 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5274 68/push _test-output-stream/imm32
5275
5276 e8/call check-stream-equal/disp32
5277
5278 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5279
5280 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5281 5d/pop-to-EBP
5282 c3/return
5283
5284 test-convert-instruction-handles-disp32-operand:
5285
5286
5287 55/push-EBP
5288 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5289
5290
5291
5292 68/push _test-input-stream/imm32
5293
5294 e8/call clear-stream/disp32
5295
5296 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5297
5298
5299 68/push _test-output-stream/imm32
5300
5301 e8/call clear-stream/disp32
5302
5303 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5304
5305
5306 b8/copy-to-EAX _test-output-buffered-file/imm32
5307 05/add-to-EAX 4/imm32
5308 50/push-EAX
5309
5310 e8/call clear-stream/disp32
5311
5312 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5313
5314
5315
5316 68/push "e8/call 20/disp32"/imm32
5317 68/push _test-input-stream/imm32
5318
5319 e8/call write/disp32
5320
5321 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5322
5323
5324 68/push _test-output-buffered-file/imm32
5325 68/push _test-input-stream/imm32
5326
5327 e8/call convert-instruction/disp32
5328
5329 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5330
5331
5332
5333 68/push _test-output-buffered-file/imm32
5334
5335 e8/call flush/disp32
5336
5337 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5338 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5364
5365
5366 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5367 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5368 68/push _test-output-stream/imm32
5369
5370 e8/call check-stream-equal/disp32
5371
5372 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5373
5374 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5375 5d/pop-to-EBP
5376 c3/return
5377
5378 test-convert-instruction-handles-disp16-operand:
5379
5380
5381 55/push-EBP
5382 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5383
5384
5385
5386 68/push _test-input-stream/imm32
5387
5388 e8/call clear-stream/disp32
5389
5390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5391
5392
5393 68/push _test-output-stream/imm32
5394
5395 e8/call clear-stream/disp32
5396
5397 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5398
5399
5400 b8/copy-to-EAX _test-output-buffered-file/imm32
5401 05/add-to-EAX 4/imm32
5402 50/push-EAX
5403
5404 e8/call clear-stream/disp32
5405
5406 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5407
5408
5409
5410 68/push "e8/call 20/disp16"/imm32
5411 68/push _test-input-stream/imm32
5412
5413 e8/call write/disp32
5414
5415 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5416
5417
5418 68/push _test-output-buffered-file/imm32
5419 68/push _test-input-stream/imm32
5420
5421 e8/call convert-instruction/disp32
5422
5423 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5424
5425
5426
5427 68/push _test-output-buffered-file/imm32
5428
5429 e8/call flush/disp32
5430
5431 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5432 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5458
5459
5460 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5461 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5462 68/push _test-output-stream/imm32
5463
5464 e8/call check-stream-equal/disp32
5465
5466 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5467
5468 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5469 5d/pop-to-EBP
5470 c3/return
5471
5472 test-convert-instruction-handles-disp8-operand:
5473
5474
5475 55/push-EBP
5476 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5477
5478
5479
5480 68/push _test-input-stream/imm32
5481
5482 e8/call clear-stream/disp32
5483
5484 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5485
5486
5487 68/push _test-output-stream/imm32
5488
5489 e8/call clear-stream/disp32
5490
5491 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5492
5493
5494 b8/copy-to-EAX _test-output-buffered-file/imm32
5495 05/add-to-EAX 4/imm32
5496 50/push-EAX
5497
5498 e8/call clear-stream/disp32
5499
5500 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5501
5502
5503
5504 68/push "eb/jump 20/disp8"/imm32
5505 68/push _test-input-stream/imm32
5506
5507 e8/call write/disp32
5508
5509 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5510
5511
5512 68/push _test-output-buffered-file/imm32
5513 68/push _test-input-stream/imm32
5514
5515 e8/call convert-instruction/disp32
5516
5517 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5518
5519
5520
5521 68/push _test-output-buffered-file/imm32
5522
5523 e8/call flush/disp32
5524
5525 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5526 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5552
5553
5554 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5555 68/push "eb 20 # eb/jump 20/disp8"/imm32
5556 68/push _test-output-stream/imm32
5557
5558 e8/call check-stream-equal/disp32
5559
5560 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5561
5562 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5563 5d/pop-to-EBP
5564 c3/return
5565
5566 test-convert-instruction-handles-disp8-name:
5567
5568
5569 55/push-EBP
5570 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5571
5572
5573
5574 68/push _test-input-stream/imm32
5575
5576 e8/call clear-stream/disp32
5577
5578 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5579
5580
5581 68/push _test-output-stream/imm32
5582
5583 e8/call clear-stream/disp32
5584
5585 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5586
5587
5588 b8/copy-to-EAX _test-output-buffered-file/imm32
5589 05/add-to-EAX 4/imm32
5590 50/push-EAX
5591
5592 e8/call clear-stream/disp32
5593
5594 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5595
5596
5597
5598 68/push "eb/jump xyz/disp8"/imm32
5599 68/push _test-input-stream/imm32
5600
5601 e8/call write/disp32
5602
5603 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5604
5605
5606 68/push _test-output-buffered-file/imm32
5607 68/push _test-input-stream/imm32
5608
5609 e8/call convert-instruction/disp32
5610
5611 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5612
5613
5614
5615 68/push _test-output-buffered-file/imm32
5616
5617 e8/call flush/disp32
5618
5619 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5620 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5646
5647
5648 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5649 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5650 68/push _test-output-stream/imm32
5651
5652 e8/call check-stream-equal/disp32
5653
5654 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5655
5656 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5657 5d/pop-to-EBP
5658 c3/return
5659
5660 test-convert-instruction-handles-imm32-operand:
5661
5662
5663 55/push-EBP
5664 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5665
5666
5667
5668 68/push _test-input-stream/imm32
5669
5670 e8/call clear-stream/disp32
5671
5672 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5673
5674
5675 68/push _test-output-stream/imm32
5676
5677 e8/call clear-stream/disp32
5678
5679 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5680
5681
5682 b8/copy-to-EAX _test-output-buffered-file/imm32
5683 05/add-to-EAX 4/imm32
5684 50/push-EAX
5685
5686 e8/call clear-stream/disp32
5687
5688 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5689
5690
5691
5692 68/push "68/push 0x20/imm32"/imm32
5693 68/push _test-input-stream/imm32
5694
5695 e8/call write/disp32
5696
5697 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5698
5699
5700 68/push _test-output-buffered-file/imm32
5701 68/push _test-input-stream/imm32
5702
5703 e8/call convert-instruction/disp32
5704
5705 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5706
5707
5708
5709 68/push _test-output-buffered-file/imm32
5710
5711 e8/call flush/disp32
5712
5713 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5714 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5740
5741
5742 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5743 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5744 68/push _test-output-stream/imm32
5745
5746 e8/call check-stream-equal/disp32
5747
5748 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5749
5750 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5751 5d/pop-to-EBP
5752 c3/return
5753
5754 test-convert-instruction-handles-imm16-operand:
5755
5756
5757
5758 55/push-EBP
5759 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5760
5761
5762
5763 68/push _test-input-stream/imm32
5764
5765 e8/call clear-stream/disp32
5766
5767 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5768
5769
5770 68/push _test-output-stream/imm32
5771
5772 e8/call clear-stream/disp32
5773
5774 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5775
5776
5777 b8/copy-to-EAX _test-output-buffered-file/imm32
5778 05/add-to-EAX 4/imm32
5779 50/push-EAX
5780
5781 e8/call clear-stream/disp32
5782
5783 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5784
5785
5786
5787 68/push "68/push 0x20/imm16"/imm32
5788 68/push _test-input-stream/imm32
5789
5790 e8/call write/disp32
5791
5792 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5793
5794
5795 68/push _test-output-buffered-file/imm32
5796 68/push _test-input-stream/imm32
5797
5798 e8/call convert-instruction/disp32
5799
5800 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5801
5802
5803
5804 68/push _test-output-buffered-file/imm32
5805
5806 e8/call flush/disp32
5807
5808 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5809 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5835
5836
5837 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5838 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5839 68/push _test-output-stream/imm32
5840
5841 e8/call check-stream-equal/disp32
5842
5843 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5844
5845 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5846 5d/pop-to-EBP
5847 c3/return
5848
5849 test-convert-instruction-handles-imm8-operand:
5850
5851
5852
5853 55/push-EBP
5854 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5855
5856
5857
5858 68/push _test-input-stream/imm32
5859
5860 e8/call clear-stream/disp32
5861
5862 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5863
5864
5865 68/push _test-output-stream/imm32
5866
5867 e8/call clear-stream/disp32
5868
5869 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5870
5871
5872 b8/copy-to-EAX _test-output-buffered-file/imm32
5873 05/add-to-EAX 4/imm32
5874 50/push-EAX
5875
5876 e8/call clear-stream/disp32
5877
5878 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5879
5880
5881
5882 68/push "68/push 0x20/imm8"/imm32
5883 68/push _test-input-stream/imm32
5884
5885 e8/call write/disp32
5886
5887 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5888
5889
5890 68/push _test-output-buffered-file/imm32
5891 68/push _test-input-stream/imm32
5892
5893 e8/call convert-instruction/disp32
5894
5895 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5896
5897
5898
5899 68/push _test-output-buffered-file/imm32
5900
5901 e8/call flush/disp32
5902
5903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5904 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5930
5931
5932 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
5933 68/push "68 20 # 68/push 0x20/imm8"/imm32
5934 68/push _test-output-stream/imm32
5935
5936 e8/call check-stream-equal/disp32
5937
5938 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
5939
5940 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5941 5d/pop-to-EBP
5942 c3/return
5943
5944
5945 parse-datum-of-word:
5946
5947 55/push-EBP
5948 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
5949
5950 51/push-ECX
5951 56/push-ESI
5952
5953 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
5954
5955 68/push 0/imm32/end
5956 68/push 0/imm32/start
5957 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
5958
5959
5960 51/push-ECX
5961 68/push 0x2f/imm32/slash
5962 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
5963 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
5964
5965 e8/call next-token-from-slice/disp32
5966
5967 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
5968
5969
5970 51/push-ECX
5971
5972 e8/call parse-hex-int/disp32
5973
5974 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
5975 $parse-datum-of-word:end:
5976
5977 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
5978
5979 5e/pop-to-ESI
5980 59/pop-to-ECX
5981
5982 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
5983 5d/pop-to-EBP
5984 c3/return
5985
5986