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