https://github.com/akkartik/mu/blob/main/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 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
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-<= $subx-pack-main:interactive/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/false
50 74/jump-if-= $subx-pack-main:interactive/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 $subx-pack-main:end/disp8
56 $subx-pack-main:interactive:
57
58
59
60 68/push Stdout/imm32
61 68/push Stdin/imm32
62
63 e8/call subx-pack/disp32
64
65 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x8/imm32
66
67 bb/copy-to-ebx 0/imm32
68 $subx-pack-main:end:
69 e8/call syscall_exit/disp32
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 subx-pack:
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 55/push-ebp
116 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
117
118 50/push-eax
119 51/push-ecx
120 52/push-edx
121 53/push-ebx
122
123 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
124 68/push 0x200/imm32/length
125 68/push 0/imm32/read
126 68/push 0/imm32/write
127 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
128
129 68/push 0/imm32/end
130 68/push 0/imm32/start
131 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
132
133 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
134 $subx-pack:loop:
135
136
137 51/push-ecx
138
139 e8/call clear-stream/disp32
140
141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
142
143
144 51/push-ecx
145 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
146
147 e8/call read-line-buffered/disp32
148
149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
150 $subx-pack:check0:
151
152 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
153 0f 84/jump-if-= $subx-pack:break/disp32
154 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
180
181
182 52/push-edx
183 51/push-ecx
184
185 e8/call next-word/disp32
186
187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
188 $subx-pack:check1:
189
190
191
192 52/push-edx
193
194 e8/call slice-empty?/disp32
195
196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
197
198 3d/compare-eax-and 0/imm32/false
199 0f 85/jump-if-!= $subx-pack:pass-through/disp32
200 $subx-pack:check2:
201 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
241
242
243
244 68/push "=="/imm32
245 52/push-edx
246
247 e8/call slice-equal?/disp32
248
249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
250
251 3d/compare-eax-and 0/imm32/false
252 0f 84/jump-if-= $subx-pack:check3/disp32
253
254
255 52/push-edx
256 51/push-ecx
257
258 e8/call next-word/disp32
259
260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
261 +-- 40 lines: #? # dump segment name ------------------------------------------------------------------------------------------------------------------------------------------------
301
302
303 68/push "code"/imm32
304 52/push-edx
305
306 e8/call slice-equal?/disp32
307
308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
309
310 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
311
312 eb/jump $subx-pack:pass-through/disp8
313 $subx-pack:check3:
314
315
316
317 51/push-ecx
318
319 e8/call rewind-stream/disp32
320
321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
322
323 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false
324 74/jump-if-= $subx-pack:data/disp8
325 $subx-pack:code:
326
327
328 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
329 51/push-ecx
330
331 e8/call convert-instruction/disp32
332
333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
334
335 e9/jump $subx-pack:loop/disp32
336 $subx-pack:data:
337
338
339 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
340 51/push-ecx
341
342 e8/call convert-data/disp32
343
344 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
345
346 e9/jump $subx-pack:loop/disp32
347 $subx-pack:pass-through:
348
349
350 51/push-ecx
351 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
352
353 e8/call write-stream-data/disp32
354
355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
356
357 e9/jump $subx-pack:loop/disp32
358 $subx-pack:break:
359
360
361 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
362
363 e8/call flush/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
366 $subx-pack:end:
367
368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
369
370 5b/pop-to-ebx
371 5a/pop-to-edx
372 59/pop-to-ecx
373 58/pop-to-eax
374
375 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
376 5d/pop-to-ebp
377 c3/return
378
379 test-subx-pack-passes-empty-lines-through:
380
381
382 55/push-ebp
383 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
384
385
386
387 68/push _test-input-stream/imm32
388
389 e8/call clear-stream/disp32
390
391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
392
393
394 68/push $_test-input-buffered-file->buffer/imm32
395
396 e8/call clear-stream/disp32
397
398 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
399
400
401 68/push _test-output-stream/imm32
402
403 e8/call clear-stream/disp32
404
405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
406
407
408 68/push $_test-output-buffered-file->buffer/imm32
409
410 e8/call clear-stream/disp32
411
412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
413
414
415
416 68/push _test-output-buffered-file/imm32
417 68/push _test-input-buffered-file/imm32
418
419 e8/call subx-pack/disp32
420
421 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
422
423
424
425 68/push _test-output-buffered-file/imm32
426
427 e8/call flush/disp32
428
429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
430
431
432 68/push "F - test-subx-pack-passes-empty-lines-through"/imm32
433 68/push ""/imm32
434 68/push _test-output-stream/imm32
435
436 e8/call check-stream-equal/disp32
437
438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
439
440 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
441 5d/pop-to-ebp
442 c3/return
443
444 test-subx-pack-passes-lines-with-just-whitespace-through:
445
446
447 55/push-ebp
448 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
449
450
451
452 68/push _test-input-stream/imm32
453
454 e8/call clear-stream/disp32
455
456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
457
458
459 68/push $_test-input-buffered-file->buffer/imm32
460
461 e8/call clear-stream/disp32
462
463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
464
465
466 68/push _test-output-stream/imm32
467
468 e8/call clear-stream/disp32
469
470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
471
472
473 68/push $_test-output-buffered-file->buffer/imm32
474
475 e8/call clear-stream/disp32
476
477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
478
479
480
481 68/push " "/imm32
482 68/push _test-input-stream/imm32
483
484 e8/call write/disp32
485
486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
487
488
489 68/push _test-output-buffered-file/imm32
490 68/push _test-input-buffered-file/imm32
491
492 e8/call subx-pack/disp32
493
494 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
495
496
497
498 68/push _test-output-buffered-file/imm32
499
500 e8/call flush/disp32
501
502 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
503
504
505 68/push "F - test-subx-pack-passes-with-just-whitespace-through"/imm32
506 68/push " "/imm32
507 68/push _test-output-stream/imm32
508
509 e8/call check-next-stream-line-equal/disp32
510
511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
512
513 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
514 5d/pop-to-ebp
515 c3/return
516
517 test-subx-pack-passes-segment-headers-through:
518
519
520 55/push-ebp
521 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
522
523
524
525 68/push _test-input-stream/imm32
526
527 e8/call clear-stream/disp32
528
529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
530
531
532 68/push $_test-input-buffered-file->buffer/imm32
533
534 e8/call clear-stream/disp32
535
536 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
537
538
539 68/push _test-output-stream/imm32
540
541 e8/call clear-stream/disp32
542
543 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
544
545
546 68/push $_test-output-buffered-file->buffer/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
554 68/push "== abcd 0x1"/imm32
555 68/push _test-input-stream/imm32
556
557 e8/call write/disp32
558
559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
560
561
562 68/push _test-output-buffered-file/imm32
563 68/push _test-input-buffered-file/imm32
564
565 e8/call subx-pack/disp32
566
567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
568
569
570
571 68/push _test-output-buffered-file/imm32
572
573 e8/call flush/disp32
574
575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
576
577
578 68/push "F - test-subx-pack-passes-segment-headers-through"/imm32
579 68/push "== abcd 0x1"/imm32
580 68/push _test-output-stream/imm32
581
582 e8/call check-stream-equal/disp32
583
584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
585
586 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
587 5d/pop-to-ebp
588 c3/return
589
590 test-subx-pack-in-data-segment:
591
592
593 55/push-ebp
594 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
595
596
597
598 68/push _test-input-stream/imm32
599
600 e8/call clear-stream/disp32
601
602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
603
604
605 68/push $_test-input-buffered-file->buffer/imm32
606
607 e8/call clear-stream/disp32
608
609 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
610
611
612 68/push _test-output-stream/imm32
613
614 e8/call clear-stream/disp32
615
616 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
617
618
619 68/push $_test-output-buffered-file->buffer/imm32
620
621 e8/call clear-stream/disp32
622
623 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
624
625
626
627
628
629
630 68/push "== code 0x1\n"/imm32
631 68/push _test-input-stream/imm32
632
633 e8/call write/disp32
634
635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
636
637
638 68/push "== data 0x2\n"/imm32
639 68/push _test-input-stream/imm32
640
641 e8/call write/disp32
642
643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
644
645
646 68/push "3 4/imm32\n"/imm32
647 68/push _test-input-stream/imm32
648
649 e8/call write/disp32
650
651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
652
653
654 68/push _test-output-buffered-file/imm32
655 68/push _test-input-buffered-file/imm32
656
657 e8/call subx-pack/disp32
658
659 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
660
661 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------
687
688
689 68/push _test-output-buffered-file/imm32
690
691 e8/call flush/disp32
692
693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
694
695
696 68/push "F - test-subx-pack-in-data-segment/0"/imm32
697 68/push "== code 0x1"/imm32
698 68/push _test-output-stream/imm32
699
700 e8/call check-next-stream-line-equal/disp32
701
702 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
703
704
705 68/push "F - test-subx-pack-in-data-segment/1"/imm32
706 68/push "== data 0x2"/imm32
707 68/push _test-output-stream/imm32
708
709 e8/call check-next-stream-line-equal/disp32
710
711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
712
713
714 68/push "F - test-subx-pack-in-data-segment/2"/imm32
715 68/push "03 04 00 00 00 "/imm32
716 68/push _test-output-stream/imm32
717
718 e8/call check-next-stream-line-equal/disp32
719
720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
721
722 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
723 5d/pop-to-ebp
724 c3/return
725
726 test-subx-pack-code-and-data-segments:
727
728
729 55/push-ebp
730 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
731
732
733
734 68/push _test-input-stream/imm32
735
736 e8/call clear-stream/disp32
737
738 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
739
740
741 68/push $_test-input-buffered-file->buffer/imm32
742
743 e8/call clear-stream/disp32
744
745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
746
747
748 68/push _test-output-stream/imm32
749
750 e8/call clear-stream/disp32
751
752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
753
754
755 68/push $_test-output-buffered-file->buffer/imm32
756
757 e8/call clear-stream/disp32
758
759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
760
761
762
763
764
765
766
767
768 68/push "== code 0x1\n"/imm32
769 68/push _test-input-stream/imm32
770
771 e8/call write/disp32
772
773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
774
775
776 68/push "e8/call 20/disp32\n"/imm32
777 68/push _test-input-stream/imm32
778
779 e8/call write/disp32
780
781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
782
783
784 68/push "68/push 0x20/imm8\n"/imm32
785 68/push _test-input-stream/imm32
786
787 e8/call write/disp32
788
789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
790
791
792 68/push "== data 0x2\n"/imm32
793 68/push _test-input-stream/imm32
794
795 e8/call write/disp32
796
797 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
798
799
800 68/push "3 4/imm32\n"/imm32
801 68/push _test-input-stream/imm32
802
803 e8/call write/disp32
804
805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
806
807
808 68/push _test-output-buffered-file/imm32
809 68/push _test-input-buffered-file/imm32
810
811 e8/call subx-pack/disp32
812
813 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
814
815
816
817
818
819
820 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------
846
847
848 68/push _test-output-buffered-file/imm32
849
850 e8/call flush/disp32
851
852 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
853
854
855 68/push "F - test-subx-pack-code-and-data-segments/0"/imm32
856 68/push "== code 0x1"/imm32
857 68/push _test-output-stream/imm32
858
859 e8/call check-next-stream-line-equal/disp32
860
861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
862
863
864 68/push "F - test-subx-pack-code-and-data-segments/1"/imm32
865 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
866 68/push _test-output-stream/imm32
867
868 e8/call check-next-stream-line-equal/disp32
869
870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
871
872
873 68/push "F - test-subx-pack-code-and-data-segments/2"/imm32
874 68/push "68 20 # 68/push 0x20/imm8"/imm32
875 68/push _test-output-stream/imm32
876
877 e8/call check-next-stream-line-equal/disp32
878
879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
880
881
882 68/push "F - test-subx-pack-code-and-data-segments/3"/imm32
883 68/push "== data 0x2"/imm32
884 68/push _test-output-stream/imm32
885
886 e8/call check-next-stream-line-equal/disp32
887
888 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
889
890
891 68/push "F - test-subx-pack-code-and-data-segments/4"/imm32
892 68/push "03 04 00 00 00 "/imm32
893 68/push _test-output-stream/imm32
894
895 e8/call check-next-stream-line-equal/disp32
896
897 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
898
899 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
900 5d/pop-to-ebp
901 c3/return
902
903 convert-data:
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924 55/push-ebp
925 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
926
927 50/push-eax
928 51/push-ecx
929 52/push-edx
930
931 68/push 0/imm32/end
932 68/push 0/imm32/start
933 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
934 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
960 $convert-data:loop:
961
962
963 51/push-ecx
964 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
965
966 e8/call next-word/disp32
967
968 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
969 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
1009 $convert-data:check0:
1010
1011
1012
1013 51/push-ecx
1014
1015 e8/call slice-empty?/disp32
1016
1017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1018
1019 3d/compare-eax-and 0/imm32/false
1020 0f 85/jump-if-!= $convert-data:break/disp32
1021 $convert-data:check-for-comment:
1022
1023
1024 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1025
1026 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1027 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1028
1029 3d/compare-eax-and 0x23/imm32/hash
1030 75/jump-if-!= $convert-data:check-for-label/disp8
1031 $convert-data:comment:
1032
1033
1034 51/push-ecx
1035 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1036
1037 e8/call write-slice-buffered/disp32
1038
1039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1040
1041 0f 85/jump-if-!= $convert-data:end/disp32
1042 $convert-data:check-for-label:
1043
1044
1045 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1046
1047 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1048 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1049
1050 3d/compare-eax-and 0x3a/imm32/colon
1051 75/jump-if-!= $convert-data:check-for-imm32/disp8
1052 $convert-data:label:
1053
1054
1055 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1056 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1057
1058 e8/call write-stream-data/disp32
1059
1060 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1061
1062 75/jump-if-!= $convert-data:end/disp8
1063 $convert-data:check-for-imm32:
1064
1065
1066
1067 68/push "imm32"/imm32
1068 51/push-ecx
1069
1070 e8/call has-metadata?/disp32
1071
1072 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1073
1074 3d/compare-eax-and 0/imm32/false
1075 74/jump-if-= $convert-data:single-byte/disp8
1076 $convert-data:imm32:
1077
1078
1079 68/push 4/imm32
1080 51/push-ecx
1081 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1082
1083 e8/call emit/disp32
1084
1085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1086 e9/jump $convert-data:loop/disp32
1087 $convert-data:single-byte:
1088
1089
1090 68/push 1/imm32
1091 51/push-ecx
1092 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1093
1094 e8/call emit/disp32
1095
1096 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1097 e9/jump $convert-data:loop/disp32
1098 $convert-data:break:
1099
1100
1101 68/push Newline/imm32
1102 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1103
1104 e8/call write-buffered/disp32
1105
1106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1107 $convert-data:end:
1108
1109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1110
1111 5a/pop-to-edx
1112 59/pop-to-ecx
1113 58/pop-to-eax
1114
1115 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1116 5d/pop-to-ebp
1117 c3/return
1118
1119 test-convert-data-passes-comments-through:
1120
1121
1122 55/push-ebp
1123 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1124
1125
1126
1127 68/push _test-input-stream/imm32
1128
1129 e8/call clear-stream/disp32
1130
1131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1132
1133
1134 68/push _test-output-stream/imm32
1135
1136 e8/call clear-stream/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1139
1140
1141 68/push $_test-output-buffered-file->buffer/imm32
1142
1143 e8/call clear-stream/disp32
1144
1145 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1146
1147
1148
1149 68/push "# abcd"/imm32
1150 68/push _test-input-stream/imm32
1151
1152 e8/call write/disp32
1153
1154 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1155
1156
1157 68/push _test-output-buffered-file/imm32
1158 68/push _test-input-stream/imm32
1159
1160 e8/call convert-data/disp32
1161
1162 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1163
1164
1165
1166 68/push _test-output-buffered-file/imm32
1167
1168 e8/call flush/disp32
1169
1170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1171 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1197
1198
1199 68/push "F - test-convert-data-passes-comments-through"/imm32
1200 68/push "# abcd"/imm32
1201 68/push _test-output-stream/imm32
1202
1203 e8/call check-stream-equal/disp32
1204
1205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1206
1207 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1208 5d/pop-to-ebp
1209 c3/return
1210
1211 test-convert-data-passes-labels-through:
1212
1213
1214 55/push-ebp
1215 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1216
1217
1218
1219 68/push _test-input-stream/imm32
1220
1221 e8/call clear-stream/disp32
1222
1223 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1224
1225
1226 68/push _test-output-stream/imm32
1227
1228 e8/call clear-stream/disp32
1229
1230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1231
1232
1233 68/push $_test-output-buffered-file->buffer/imm32
1234
1235 e8/call clear-stream/disp32
1236
1237 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1238
1239
1240
1241 68/push "ab: # cd"/imm32
1242 68/push _test-input-stream/imm32
1243
1244 e8/call write/disp32
1245
1246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1247
1248
1249 68/push _test-output-buffered-file/imm32
1250 68/push _test-input-stream/imm32
1251
1252 e8/call convert-data/disp32
1253
1254 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1255
1256
1257
1258 68/push _test-output-buffered-file/imm32
1259
1260 e8/call flush/disp32
1261
1262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1263
1264
1265 68/push "F - test-convert-data-passes-labels-through"/imm32
1266 68/push "ab: # cd"/imm32
1267 68/push _test-output-stream/imm32
1268
1269 e8/call check-stream-equal/disp32
1270
1271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1272
1273 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1274 5d/pop-to-ebp
1275 c3/return
1276
1277 test-convert-data-passes-names-through:
1278
1279
1280
1281 55/push-ebp
1282 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1283
1284
1285
1286 68/push _test-input-stream/imm32
1287
1288 e8/call clear-stream/disp32
1289
1290 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1291
1292
1293 68/push _test-output-stream/imm32
1294
1295 e8/call clear-stream/disp32
1296
1297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1298
1299
1300 68/push $_test-output-buffered-file->buffer/imm32
1301
1302 e8/call clear-stream/disp32
1303
1304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1305
1306
1307
1308 68/push "abcd/imm32"/imm32
1309 68/push _test-input-stream/imm32
1310
1311 e8/call write/disp32
1312
1313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1314
1315
1316 68/push _test-output-buffered-file/imm32
1317 68/push _test-input-stream/imm32
1318
1319 e8/call convert-data/disp32
1320
1321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1322
1323
1324
1325 68/push _test-output-buffered-file/imm32
1326
1327 e8/call flush/disp32
1328
1329 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1330
1331
1332 68/push "F - test-convert-data-passes-names-through"/imm32
1333 68/push "abcd/imm32 \n"/imm32
1334 68/push _test-output-stream/imm32
1335
1336 e8/call check-stream-equal/disp32
1337
1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1339
1340 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1341 5d/pop-to-ebp
1342 c3/return
1343
1344 test-convert-data-handles-imm32:
1345
1346
1347 55/push-ebp
1348 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1349
1350
1351
1352 68/push _test-input-stream/imm32
1353
1354 e8/call clear-stream/disp32
1355
1356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1357
1358
1359 68/push _test-output-stream/imm32
1360
1361 e8/call clear-stream/disp32
1362
1363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1364
1365
1366 68/push $_test-output-buffered-file->buffer/imm32
1367
1368 e8/call clear-stream/disp32
1369
1370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1371
1372
1373
1374 68/push "30/imm32"/imm32
1375 68/push _test-input-stream/imm32
1376
1377 e8/call write/disp32
1378
1379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1380
1381
1382 68/push _test-output-buffered-file/imm32
1383 68/push _test-input-stream/imm32
1384
1385 e8/call convert-data/disp32
1386
1387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1388
1389
1390
1391 68/push _test-output-buffered-file/imm32
1392
1393 e8/call flush/disp32
1394
1395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1396
1397
1398 68/push "F - test-convert-data-handles-imm32"/imm32
1399 68/push "30 00 00 00 \n"/imm32
1400 68/push _test-output-stream/imm32
1401
1402 e8/call check-stream-equal/disp32
1403
1404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1405
1406 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1407 5d/pop-to-ebp
1408 c3/return
1409
1410 test-convert-data-handles-single-byte:
1411
1412
1413
1414 55/push-ebp
1415 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1416
1417
1418
1419 68/push _test-input-stream/imm32
1420
1421 e8/call clear-stream/disp32
1422
1423 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1424
1425
1426 68/push _test-output-stream/imm32
1427
1428 e8/call clear-stream/disp32
1429
1430 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1431
1432
1433 68/push $_test-output-buffered-file->buffer/imm32
1434
1435 e8/call clear-stream/disp32
1436
1437 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1438
1439
1440
1441 68/push "30/imm16"/imm32
1442 68/push _test-input-stream/imm32
1443
1444 e8/call write/disp32
1445
1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1447
1448
1449 68/push _test-output-buffered-file/imm32
1450 68/push _test-input-stream/imm32
1451
1452 e8/call convert-data/disp32
1453
1454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1455
1456
1457
1458 68/push _test-output-buffered-file/imm32
1459
1460 e8/call flush/disp32
1461
1462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1463
1464
1465 68/push "F - test-convert-data-handles-single-byte"/imm32
1466 68/push "30 \n"/imm32
1467 68/push _test-output-stream/imm32
1468
1469 e8/call check-stream-equal/disp32
1470
1471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1472
1473 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1474 5d/pop-to-ebp
1475 c3/return
1476
1477 test-convert-data-multiple-bytes:
1478
1479
1480 55/push-ebp
1481 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1482
1483
1484
1485 68/push _test-input-stream/imm32
1486
1487 e8/call clear-stream/disp32
1488
1489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1490
1491
1492 68/push _test-output-stream/imm32
1493
1494 e8/call clear-stream/disp32
1495
1496 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1497
1498
1499 68/push $_test-output-buffered-file->buffer/imm32
1500
1501 e8/call clear-stream/disp32
1502
1503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1504
1505
1506
1507 68/push "1 2"/imm32
1508 68/push _test-input-stream/imm32
1509
1510 e8/call write/disp32
1511
1512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1513
1514
1515 68/push _test-output-buffered-file/imm32
1516 68/push _test-input-stream/imm32
1517
1518 e8/call convert-data/disp32
1519
1520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1521
1522
1523
1524 68/push _test-output-buffered-file/imm32
1525
1526 e8/call flush/disp32
1527
1528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1529
1530
1531 68/push "F - test-convert-data-multiple-bytes"/imm32
1532 68/push "01 02 \n"/imm32
1533 68/push _test-output-stream/imm32
1534
1535 e8/call check-stream-equal/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1538
1539 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1540 5d/pop-to-ebp
1541 c3/return
1542
1543 test-convert-data-byte-then-name:
1544
1545
1546 55/push-ebp
1547 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1548
1549
1550
1551 68/push _test-input-stream/imm32
1552
1553 e8/call clear-stream/disp32
1554
1555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1556
1557
1558 68/push _test-output-stream/imm32
1559
1560 e8/call clear-stream/disp32
1561
1562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1563
1564
1565 68/push $_test-output-buffered-file->buffer/imm32
1566
1567 e8/call clear-stream/disp32
1568
1569 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1570
1571
1572
1573 68/push "30 abcd/o"/imm32
1574 68/push _test-input-stream/imm32
1575
1576 e8/call write/disp32
1577
1578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1579
1580
1581 68/push _test-output-buffered-file/imm32
1582 68/push _test-input-stream/imm32
1583
1584 e8/call convert-data/disp32
1585
1586 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1587
1588
1589
1590 68/push _test-output-buffered-file/imm32
1591
1592 e8/call flush/disp32
1593
1594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1595
1596
1597 68/push "F - test-convert-data-byte-then-name"/imm32
1598 68/push "30 abcd/o \n"/imm32
1599 68/push _test-output-stream/imm32
1600
1601 e8/call check-stream-equal/disp32
1602
1603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1604
1605 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1606 5d/pop-to-ebp
1607 c3/return
1608
1609 test-convert-data-multiple-words:
1610
1611
1612 55/push-ebp
1613 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1614
1615
1616
1617 68/push _test-input-stream/imm32
1618
1619 e8/call clear-stream/disp32
1620
1621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1622
1623
1624 68/push _test-output-stream/imm32
1625
1626 e8/call clear-stream/disp32
1627
1628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1629
1630
1631 68/push $_test-output-buffered-file->buffer/imm32
1632
1633 e8/call clear-stream/disp32
1634
1635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1636
1637
1638
1639 68/push "30 abcd/o 42e1/imm32"/imm32
1640 68/push _test-input-stream/imm32
1641
1642 e8/call write/disp32
1643
1644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1645
1646
1647 68/push _test-output-buffered-file/imm32
1648 68/push _test-input-stream/imm32
1649
1650 e8/call convert-data/disp32
1651
1652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1653
1654
1655
1656 68/push _test-output-buffered-file/imm32
1657
1658 e8/call flush/disp32
1659
1660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1661 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1687
1688
1689 68/push "F - test-convert-data-multiple-words"/imm32
1690 68/push "30 abcd/o e1 42 00 00 \n"/imm32
1691 68/push _test-output-stream/imm32
1692
1693 e8/call check-stream-equal/disp32
1694
1695 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1696
1697 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1698 5d/pop-to-ebp
1699 c3/return
1700
1701 test-convert-data-trailing-comment:
1702
1703
1704 55/push-ebp
1705 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1706
1707
1708
1709 68/push _test-input-stream/imm32
1710
1711 e8/call clear-stream/disp32
1712
1713 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1714
1715
1716 68/push _test-output-stream/imm32
1717
1718 e8/call clear-stream/disp32
1719
1720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1721
1722
1723 68/push $_test-output-buffered-file->buffer/imm32
1724
1725 e8/call clear-stream/disp32
1726
1727 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1728
1729
1730
1731 68/push "30/imm32 # comment"/imm32
1732 68/push _test-input-stream/imm32
1733
1734 e8/call write/disp32
1735
1736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1737
1738
1739 68/push _test-output-buffered-file/imm32
1740 68/push _test-input-stream/imm32
1741
1742 e8/call convert-data/disp32
1743
1744 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1745
1746
1747
1748 68/push _test-output-buffered-file/imm32
1749
1750 e8/call flush/disp32
1751
1752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1753 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1779
1780
1781 68/push "F - test-convert-data-trailing-comment"/imm32
1782 68/push "30 00 00 00 # comment"/imm32
1783 68/push _test-output-stream/imm32
1784
1785 e8/call check-stream-equal/disp32
1786
1787 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1788
1789 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1790 5d/pop-to-ebp
1791 c3/return
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803 convert-instruction:
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825 55/push-ebp
1826 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1827
1828 50/push-eax
1829 51/push-ecx
1830 52/push-edx
1831
1832 68/push 0/imm32/end
1833 68/push 0/imm32/start
1834 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1835
1836
1837 51/push-ecx
1838 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1839
1840 e8/call next-word/disp32
1841
1842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1843 $convert-instruction:check0:
1844
1845
1846
1847 51/push-ecx
1848
1849 e8/call slice-empty?/disp32
1850
1851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1852
1853 3d/compare-eax-and 0/imm32/false
1854 75/jump-if-!= $convert-instruction:pass-through/disp8
1855 $convert-instruction:check1:
1856
1857
1858 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1859
1860 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1861 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1862
1863 3d/compare-eax-and 0x23/imm32/hash
1864 74/jump-if-= $convert-instruction:pass-through/disp8
1865 $convert-instruction:check2:
1866
1867
1868 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1869
1870 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1871 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1872
1873 3d/compare-eax-and 0x3a/imm32/colon
1874 75/jump-if-!= $convert-instruction:really-convert/disp8
1875 $convert-instruction:pass-through:
1876
1877
1878 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1879 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1880
1881 e8/call write-stream-data/disp32
1882
1883 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1884
1885 eb/jump $convert-instruction:end/disp8
1886 $convert-instruction:really-convert:
1887
1888
1889 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1890 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1891
1892 e8/call emit-opcodes/disp32
1893
1894 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1895
1896
1897 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1898 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1899
1900 e8/call emit-modrm/disp32
1901
1902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1903
1904
1905 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1906 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1907
1908 e8/call emit-sib/disp32
1909
1910 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1911
1912
1913 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1914 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1915
1916 e8/call emit-disp/disp32
1917
1918 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1919
1920
1921 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1922 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1923
1924 e8/call emit-imm/disp32
1925
1926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1927
1928
1929 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1930 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1931
1932 e8/call emit-line-in-comment/disp32
1933
1934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1935 $convert-instruction:end:
1936
1937 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1938
1939 5a/pop-to-edx
1940 59/pop-to-ecx
1941 58/pop-to-eax
1942
1943 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1944 5d/pop-to-ebp
1945 c3/return
1946
1947 emit-opcodes:
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981 55/push-ebp
1982 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1983
1984 50/push-eax
1985 51/push-ecx
1986 52/push-edx
1987 53/push-ebx
1988
1989 68/push 0/imm32/end
1990 68/push 0/imm32/start
1991 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1992
1993 68/push 0/imm32/end
1994 68/push 0/imm32/start
1995 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1996
1997
1998 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1999
2000 e8/call rewind-stream/disp32
2001
2002 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2003 $emit-opcodes:op1:
2004
2005
2006 51/push-ecx
2007 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2008
2009 e8/call next-word/disp32
2010
2011 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2012
2013
2014
2015 51/push-ecx
2016
2017 e8/call slice-empty?/disp32
2018
2019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2020
2021 3d/compare-eax-and 0/imm32/false
2022 0f 85/jump-if-!= $emit-opcodes:end/disp32
2023
2024
2025 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . .
2026
2027 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2028 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2029
2030 3d/compare-eax-and 0x23/imm32/hash
2031 0f 84/jump-if-= $emit-opcodes:end/disp32
2032
2033
2034 51/push-ecx
2035 68/push 0x2f/imm32/slash
2036 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 .
2037 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
2038
2039 e8/call next-token-from-slice/disp32
2040
2041 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2042
2043
2044 51/push-ecx
2045 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2046
2047 e8/call write-slice-buffered/disp32
2048
2049 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2050
2051
2052 68/push Space/imm32
2053 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2054
2055 e8/call write-buffered/disp32
2056
2057 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2058
2059
2060
2061 68/push "0f"/imm32
2062 51/push-ecx
2063
2064 e8/call slice-equal?/disp32
2065
2066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2067
2068 3d/compare-eax-and 0/imm32/false
2069 75/jump-if-!= $emit-opcodes:op2/disp8
2070
2071
2072
2073 68/push "f2"/imm32
2074 51/push-ecx
2075
2076 e8/call slice-equal?/disp32
2077
2078 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2079
2080 3d/compare-eax-and 0/imm32/false
2081 75/jump-if-!= $emit-opcodes:op2/disp8
2082
2083
2084
2085 68/push "f3"/imm32
2086 51/push-ecx
2087
2088 e8/call slice-equal?/disp32
2089
2090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2091
2092 3d/compare-eax-and 0/imm32/false
2093 75/jump-if-!= $emit-opcodes:op2/disp8
2094
2095 e9/jump $emit-opcodes:end/disp32
2096 $emit-opcodes:op2:
2097
2098
2099 52/push-edx
2100 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2101
2102 e8/call next-word/disp32
2103
2104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2105
2106
2107
2108 52/push-edx
2109
2110 e8/call slice-empty?/disp32
2111
2112 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2113
2114 3d/compare-eax-and 0/imm32/false
2115 0f 85/jump-if-!= $emit-opcodes:end/disp32
2116
2117
2118 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2119
2120 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2121 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2122
2123 3d/compare-eax-and 0x23/imm32/hash
2124 0f 84/jump-if-= $emit-opcodes:end/disp32
2125
2126
2127 52/push-edx
2128 68/push 0x2f/imm32/slash
2129 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2130 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2131
2132 e8/call next-token-from-slice/disp32
2133
2134 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2135
2136
2137 52/push-edx
2138 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2139
2140 e8/call write-slice-buffered/disp32
2141
2142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2143
2144
2145 68/push Space/imm32
2146 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2147
2148 e8/call write-buffered/disp32
2149
2150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2151
2152
2153
2154 68/push "0f"/imm32
2155 51/push-ecx
2156
2157 e8/call slice-equal?/disp32
2158
2159 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2160
2161 3d/compare-eax-and 0/imm32/false
2162 0f 85/jump-if-!= $emit-opcodes:end/disp32
2163
2164
2165
2166 68/push "0f"/imm32
2167 52/push-edx
2168
2169 e8/call slice-equal?/disp32
2170
2171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2172
2173 3d/compare-eax-and 0/imm32/false
2174 0f 84/jump-if-= $emit-opcodes:end/disp32
2175 $emit-opcodes:op3:
2176
2177
2178 52/push-edx
2179 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2180
2181 e8/call next-word/disp32
2182
2183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2184
2185
2186
2187 52/push-edx
2188
2189 e8/call slice-empty?/disp32
2190
2191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2192
2193 3d/compare-eax-and 0/imm32/false
2194 0f 85/jump-if-!= $emit-opcodes:end/disp32
2195
2196
2197 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2198
2199 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2200 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2201
2202 3d/compare-eax-and 0x23/imm32/hash
2203 0f 84/jump-if-= $emit-opcodes:end/disp32
2204
2205
2206 52/push-edx
2207 68/push 0x2f/imm32/slash
2208 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2209 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2210
2211 e8/call next-token-from-slice/disp32
2212
2213 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2214
2215
2216 52/push-edx
2217 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2218
2219 e8/call write-slice-buffered/disp32
2220
2221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2222
2223
2224 68/push Space/imm32
2225 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2226
2227 e8/call write-buffered/disp32
2228
2229 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2230 $emit-opcodes:end:
2231
2232 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2233
2234 5b/pop-to-ebx
2235 5a/pop-to-edx
2236 59/pop-to-ecx
2237 58/pop-to-eax
2238
2239 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2240 5d/pop-to-ebp
2241 c3/return
2242
2243 emit-modrm:
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270 55/push-ebp
2271 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2272
2273 50/push-eax
2274 51/push-ecx
2275 52/push-edx
2276 53/push-ebx
2277 56/push-esi
2278 57/push-edi
2279
2280 68/push 0/imm32/end
2281 68/push 0/imm32/start
2282 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2283
2284 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2285
2286 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2287
2288 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2289
2290 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2291
2292
2293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2294
2295 e8/call rewind-stream/disp32
2296
2297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2298 +-- 33 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2331 $emit-modrm:loop:
2332
2333
2334 51/push-ecx
2335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2336
2337 e8/call next-word/disp32
2338
2339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2340 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
2380 $emit-modrm:check0:
2381
2382
2383
2384 51/push-ecx
2385
2386 e8/call slice-empty?/disp32
2387
2388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2389
2390 3d/compare-eax-and 0/imm32/false
2391 0f 85/jump-if-!= $emit-modrm:break/disp32
2392 $emit-modrm:check1:
2393
2394
2395 52/push-edx
2396
2397 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2398
2399 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2400 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2401
2402 5a/pop-to-edx
2403
2404 3d/compare-eax-and 0x23/imm32/hash
2405 0f 84/jump-if-= $emit-modrm:break/disp32
2406 $emit-modrm:check-for-mod:
2407
2408
2409
2410 68/push "mod"/imm32
2411 51/push-ecx
2412
2413 e8/call has-metadata?/disp32
2414
2415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2416
2417 3d/compare-eax-and 0/imm32/false
2418 74/jump-if-= $emit-modrm:check-for-rm32/disp8
2419 $emit-modrm:mod:
2420
2421
2422
2423 51/push-ecx
2424
2425 e8/call parse-datum-of-word/disp32
2426
2427 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2428
2429 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2430
2431 ba/copy-to-edx 1/imm32/true
2432
2433 e9/jump $emit-modrm:loop/disp32
2434 $emit-modrm:check-for-rm32:
2435
2436
2437
2438 68/push "rm32"/imm32
2439 51/push-ecx
2440
2441 e8/call has-metadata?/disp32
2442
2443 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2444
2445 3d/compare-eax-and 0/imm32/false
2446 74/jump-if-= $emit-modrm:check-for-xm32/disp8
2447 $emit-modrm:rm32:
2448
2449
2450
2451 51/push-ecx
2452
2453 e8/call parse-datum-of-word/disp32
2454
2455 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2456
2457 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2458
2459 ba/copy-to-edx 1/imm32/true
2460
2461 e9/jump $emit-modrm:loop/disp32
2462 $emit-modrm:check-for-xm32:
2463
2464
2465
2466 68/push "xm32"/imm32
2467 51/push-ecx
2468
2469 e8/call has-metadata?/disp32
2470
2471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2472
2473 3d/compare-eax-and 0/imm32/false
2474 74/jump-if-= $emit-modrm:check-for-r32/disp8
2475 $emit-modrm:xm32:
2476
2477
2478
2479 51/push-ecx
2480
2481 e8/call parse-datum-of-word/disp32
2482
2483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2484
2485 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2486
2487 ba/copy-to-edx 1/imm32/true
2488
2489 e9/jump $emit-modrm:loop/disp32
2490 $emit-modrm:check-for-r32:
2491
2492
2493
2494 68/push "r32"/imm32
2495 51/push-ecx
2496
2497 e8/call has-metadata?/disp32
2498
2499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2500
2501 3d/compare-eax-and 0/imm32/false
2502 74/jump-if-= $emit-modrm:check-for-x32/disp8
2503 $emit-modrm:r32:
2504
2505
2506
2507 51/push-ecx
2508
2509 e8/call parse-datum-of-word/disp32
2510
2511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2512
2513 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2514
2515 ba/copy-to-edx 1/imm32/true
2516
2517 e9/jump $emit-modrm:loop/disp32
2518 $emit-modrm:check-for-x32:
2519
2520
2521
2522 68/push "x32"/imm32
2523 51/push-ecx
2524
2525 e8/call has-metadata?/disp32
2526
2527 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2528
2529 3d/compare-eax-and 0/imm32/false
2530 74/jump-if-= $emit-modrm:check-for-subop/disp8
2531 $emit-modrm:x32:
2532
2533
2534
2535 51/push-ecx
2536
2537 e8/call parse-datum-of-word/disp32
2538
2539 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2540
2541 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2542
2543 ba/copy-to-edx 1/imm32/true
2544
2545 e9/jump $emit-modrm:loop/disp32
2546 $emit-modrm:check-for-subop:
2547
2548
2549
2550 68/push "subop"/imm32
2551 51/push-ecx
2552
2553 e8/call has-metadata?/disp32
2554
2555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2556
2557 3d/compare-eax-and 0/imm32/false
2558 0f 84/jump-if-= $emit-modrm:loop/disp32
2559 $emit-modrm:subop:
2560
2561
2562
2563 51/push-ecx
2564
2565 e8/call parse-datum-of-word/disp32
2566
2567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2568
2569 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2570
2571 ba/copy-to-edx 1/imm32/true
2572
2573 e9/jump $emit-modrm:loop/disp32
2574 $emit-modrm:break:
2575
2576 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2577 74/jump-if-= $emit-modrm:end/disp8
2578 $emit-modrm:calculate:
2579
2580 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2581
2582 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2583
2584 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2585 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2586
2587 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2588
2589 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2590 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2591 $emit-modrm:emit:
2592
2593
2594 68/push 1/imm32
2595 53/push-ebx
2596 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2597
2598 e8/call emit-hex/disp32
2599
2600 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2601 $emit-modrm:end:
2602
2603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2604
2605 5f/pop-to-edi
2606 5e/pop-to-esi
2607 5b/pop-to-ebx
2608 5a/pop-to-edx
2609 59/pop-to-ecx
2610 58/pop-to-eax
2611
2612 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2613 5d/pop-to-ebp
2614 c3/return
2615
2616 emit-sib:
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
2642 55/push-ebp
2643 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2644
2645 50/push-eax
2646 51/push-ecx
2647 52/push-edx
2648 53/push-ebx
2649 56/push-esi
2650 57/push-edi
2651
2652 68/push 0/imm32/end
2653 68/push 0/imm32/start
2654 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2655
2656 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2657
2658 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2659
2660 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2661
2662 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2663
2664
2665 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2666
2667 e8/call rewind-stream/disp32
2668
2669 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2670 $emit-sib:loop:
2671 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2697
2698
2699 51/push-ecx
2700 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2701
2702 e8/call next-word/disp32
2703
2704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2705 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
2745 $emit-sib:check0:
2746
2747
2748
2749 51/push-ecx
2750
2751 e8/call slice-empty?/disp32
2752
2753 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2754
2755 3d/compare-eax-and 0/imm32/false
2756 0f 85/jump-if-!= $emit-sib:break/disp32
2757 $emit-sib:check1:
2758
2759
2760 52/push-edx
2761
2762 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2763
2764 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2765 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2766
2767 5a/pop-to-edx
2768
2769 3d/compare-eax-and 0x23/imm32/hash
2770 0f 84/jump-if-= $emit-sib:break/disp32
2771 $emit-sib:check-for-scale:
2772
2773
2774
2775 68/push "scale"/imm32
2776 51/push-ecx
2777
2778 e8/call has-metadata?/disp32
2779
2780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2781
2782 3d/compare-eax-and 0/imm32/false
2783 74/jump-if-= $emit-sib:check-for-base/disp8
2784 $emit-sib:scale:
2785
2786
2787
2788 51/push-ecx
2789
2790 e8/call parse-datum-of-word/disp32
2791
2792 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2793
2794 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2795
2796 ba/copy-to-edx 1/imm32/true
2797
2798 e9/jump $emit-sib:loop/disp32
2799 $emit-sib:check-for-base:
2800
2801
2802
2803 68/push "base"/imm32
2804 51/push-ecx
2805
2806 e8/call has-metadata?/disp32
2807
2808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2809
2810 3d/compare-eax-and 0/imm32/false
2811 74/jump-if-= $emit-sib:check-for-index/disp8
2812 $emit-sib:base:
2813
2814
2815
2816 51/push-ecx
2817
2818 e8/call parse-datum-of-word/disp32
2819
2820 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2821
2822 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2823
2824 ba/copy-to-edx 1/imm32/true
2825
2826 e9/jump $emit-sib:loop/disp32
2827 $emit-sib:check-for-index:
2828
2829
2830
2831 68/push "index"/imm32
2832 51/push-ecx
2833
2834 e8/call has-metadata?/disp32
2835
2836 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2837
2838 3d/compare-eax-and 0/imm32/false
2839 0f 84/jump-if-= $emit-sib:loop/disp32
2840 $emit-sib:index:
2841
2842
2843
2844 51/push-ecx
2845
2846 e8/call parse-datum-of-word/disp32
2847
2848 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2849
2850 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2851
2852 ba/copy-to-edx 1/imm32/true
2853
2854 e9/jump $emit-sib:loop/disp32
2855 $emit-sib:break:
2856
2857 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2858 74/jump-if-= $emit-sib:end/disp8
2859 $emit-sib:calculate:
2860
2861 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2862
2863 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2864
2865 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2866 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2867
2868 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2869
2870 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2871 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2872 $emit-sib:emit:
2873
2874
2875 68/push 1/imm32
2876 53/push-ebx
2877 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2878
2879 e8/call emit-hex/disp32
2880
2881 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2882 $emit-sib:end:
2883
2884 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2885
2886 5f/pop-to-edi
2887 5e/pop-to-esi
2888 5b/pop-to-ebx
2889 5a/pop-to-edx
2890 59/pop-to-ecx
2891 58/pop-to-eax
2892
2893 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2894 5d/pop-to-ebp
2895 c3/return
2896
2897 emit-disp:
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916 55/push-ebp
2917 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2918
2919 50/push-eax
2920 51/push-ecx
2921 52/push-edx
2922
2923 68/push 0/imm32/end
2924 68/push 0/imm32/start
2925 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2926
2927
2928 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2929
2930 e8/call rewind-stream/disp32
2931
2932 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2933 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2959 $emit-disp:loop:
2960
2961
2962 51/push-ecx
2963 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2964
2965 e8/call next-word/disp32
2966
2967 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2968 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
3008 $emit-disp:check0:
3009
3010
3011
3012 51/push-ecx
3013
3014 e8/call slice-empty?/disp32
3015
3016 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3017
3018 3d/compare-eax-and 0/imm32/false
3019 0f 85/jump-if-!= $emit-disp:break/disp32
3020 $emit-disp:check1:
3021
3022
3023 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3024
3025 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3026 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3027
3028 3d/compare-eax-and 0x23/imm32/hash
3029 0f 84/jump-if-= $emit-disp:break/disp32
3030 $emit-disp:check-for-disp32:
3031
3032
3033
3034 68/push "disp32"/imm32
3035 51/push-ecx
3036
3037 e8/call has-metadata?/disp32
3038
3039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3040
3041 3d/compare-eax-and 0/imm32/false
3042 74/jump-if-= $emit-disp:check-for-disp16/disp8
3043 $emit-disp:disp32:
3044
3045
3046 68/push 4/imm32
3047 51/push-ecx
3048 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3049
3050 e8/call emit/disp32
3051
3052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3053
3054 e9/jump $emit-disp:break/disp32
3055 $emit-disp:check-for-disp16:
3056
3057
3058
3059 68/push "disp16"/imm32
3060 51/push-ecx
3061
3062 e8/call has-metadata?/disp32
3063
3064 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3065
3066 3d/compare-eax-and 0/imm32/false
3067 74/jump-if-= $emit-disp:check-for-disp8/disp8
3068 $emit-disp:disp16:
3069
3070
3071 68/push 2/imm32
3072 51/push-ecx
3073 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3074
3075 e8/call emit/disp32
3076
3077 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3078
3079 e9/jump $emit-disp:break/disp32
3080 $emit-disp:check-for-disp8:
3081
3082
3083
3084 68/push "disp8"/imm32
3085 51/push-ecx
3086
3087 e8/call has-metadata?/disp32
3088
3089 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3090
3091 3d/compare-eax-and 0/imm32/false
3092 0f 84/jump-if-= $emit-disp:loop/disp32
3093 $emit-disp:disp8:
3094
3095
3096 68/push 1/imm32
3097 51/push-ecx
3098 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3099
3100 e8/call emit/disp32
3101
3102 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3103
3104 $emit-disp:break:
3105
3106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3107
3108 5a/pop-to-edx
3109 59/pop-to-ecx
3110 58/pop-to-eax
3111
3112 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3113 5d/pop-to-ebp
3114 c3/return
3115
3116 emit-imm:
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135 55/push-ebp
3136 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3137
3138 50/push-eax
3139 51/push-ecx
3140 52/push-edx
3141
3142 68/push 0/imm32/end
3143 68/push 0/imm32/start
3144 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3145
3146
3147 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3148
3149 e8/call rewind-stream/disp32
3150
3151 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3152 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
3178 $emit-imm:loop:
3179
3180
3181 51/push-ecx
3182 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3183
3184 e8/call next-word/disp32
3185
3186 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3187 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
3227 $emit-imm:check0:
3228
3229
3230
3231 51/push-ecx
3232
3233 e8/call slice-empty?/disp32
3234
3235 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3236
3237 3d/compare-eax-and 0/imm32/false
3238 0f 85/jump-if-!= $emit-imm:break/disp32
3239 $emit-imm:check1:
3240
3241
3242 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3243
3244 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3245 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3246
3247 3d/compare-eax-and 0x23/imm32/hash
3248 0f 84/jump-if-= $emit-imm:break/disp32
3249 $emit-imm:check-for-imm32:
3250
3251
3252
3253 68/push "imm32"/imm32
3254 51/push-ecx
3255
3256 e8/call has-metadata?/disp32
3257
3258 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3259
3260 3d/compare-eax-and 0/imm32/false
3261 74/jump-if-= $emit-imm:check-for-imm16/disp8
3262 $emit-imm:imm32:
3263
3264
3265 68/push 4/imm32
3266 51/push-ecx
3267 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3268
3269 e8/call emit/disp32
3270
3271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3272
3273 e9/jump $emit-imm:break/disp32
3274 $emit-imm:check-for-imm16:
3275
3276
3277
3278 68/push "imm16"/imm32
3279 51/push-ecx
3280
3281 e8/call has-metadata?/disp32
3282
3283 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3284
3285 3d/compare-eax-and 0/imm32/false
3286 74/jump-if-= $emit-imm:check-for-imm8/disp8
3287 $emit-imm:imm16:
3288
3289
3290 68/push 2/imm32
3291 51/push-ecx
3292 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3293
3294 e8/call emit/disp32
3295
3296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3297
3298 e9/jump $emit-imm:break/disp32
3299 $emit-imm:check-for-imm8:
3300
3301
3302
3303 68/push "imm8"/imm32
3304 51/push-ecx
3305
3306 e8/call has-metadata?/disp32
3307
3308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3309
3310 3d/compare-eax-and 0/imm32/false
3311 0f 84/jump-if-= $emit-imm:loop/disp32
3312 $emit-imm:imm8:
3313
3314
3315 68/push 1/imm32
3316 51/push-ecx
3317 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3318
3319 e8/call emit/disp32
3320
3321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3322
3323 $emit-imm:break:
3324
3325 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3326
3327 5a/pop-to-edx
3328 59/pop-to-ecx
3329 58/pop-to-eax
3330
3331 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3332 5d/pop-to-ebp
3333 c3/return
3334
3335 emit-line-in-comment:
3336
3337 55/push-ebp
3338 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3339
3340
3341 68/push " # "/imm32
3342 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3343
3344 e8/call write-buffered/disp32
3345
3346 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3347
3348
3349 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3350 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3351
3352 e8/call write-stream-data/disp32
3353
3354 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3355 $emit-line-in-comment:end:
3356
3357 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3358 5d/pop-to-ebp
3359 c3/return
3360
3361 test-convert-instruction-passes-comments-through:
3362
3363
3364 55/push-ebp
3365 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3366
3367
3368
3369 68/push _test-input-stream/imm32
3370
3371 e8/call clear-stream/disp32
3372
3373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3374
3375
3376 68/push _test-output-stream/imm32
3377
3378 e8/call clear-stream/disp32
3379
3380 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3381
3382
3383 68/push $_test-output-buffered-file->buffer/imm32
3384
3385 e8/call clear-stream/disp32
3386
3387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3388
3389
3390
3391 68/push "# abcd"/imm32
3392 68/push _test-input-stream/imm32
3393
3394 e8/call write/disp32
3395
3396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3397
3398
3399 68/push _test-output-buffered-file/imm32
3400 68/push _test-input-stream/imm32
3401
3402 e8/call convert-instruction/disp32
3403
3404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3405
3406
3407
3408 68/push _test-output-buffered-file/imm32
3409
3410 e8/call flush/disp32
3411
3412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3413
3414
3415 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3416 68/push "# abcd"/imm32
3417 68/push _test-output-stream/imm32
3418
3419 e8/call check-stream-equal/disp32
3420
3421 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3422
3423 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3424 5d/pop-to-ebp
3425 c3/return
3426
3427 test-convert-instruction-passes-labels-through:
3428
3429
3430 55/push-ebp
3431 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3432
3433
3434
3435 68/push _test-input-stream/imm32
3436
3437 e8/call clear-stream/disp32
3438
3439 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3440
3441
3442 68/push _test-output-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-buffered-file->buffer/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
3457 68/push "ab: # cd"/imm32
3458 68/push _test-input-stream/imm32
3459
3460 e8/call write/disp32
3461
3462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3463
3464
3465 68/push _test-output-buffered-file/imm32
3466 68/push _test-input-stream/imm32
3467
3468 e8/call convert-instruction/disp32
3469
3470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3471
3472
3473
3474 68/push _test-output-buffered-file/imm32
3475
3476 e8/call flush/disp32
3477
3478 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3479
3480
3481 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3482 68/push "ab: # cd"/imm32
3483 68/push _test-output-stream/imm32
3484
3485 e8/call check-stream-equal/disp32
3486
3487 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3488
3489 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3490 5d/pop-to-ebp
3491 c3/return
3492
3493 test-convert-instruction-handles-single-opcode:
3494
3495
3496 55/push-ebp
3497 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3498
3499
3500
3501 68/push _test-input-stream/imm32
3502
3503 e8/call clear-stream/disp32
3504
3505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3506
3507
3508 68/push _test-output-stream/imm32
3509
3510 e8/call clear-stream/disp32
3511
3512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3513
3514
3515 68/push $_test-output-buffered-file->buffer/imm32
3516
3517 e8/call clear-stream/disp32
3518
3519 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3520
3521
3522
3523 68/push "ab/cd # comment"/imm32
3524 68/push _test-input-stream/imm32
3525
3526 e8/call write/disp32
3527
3528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3529
3530
3531 68/push _test-output-buffered-file/imm32
3532 68/push _test-input-stream/imm32
3533
3534 e8/call convert-instruction/disp32
3535
3536 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3537
3538
3539
3540 68/push _test-output-buffered-file/imm32
3541
3542 e8/call flush/disp32
3543
3544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3545 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3571
3572
3573 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3574 68/push "ab # ab/cd # comment"/imm32
3575 68/push _test-output-stream/imm32
3576
3577 e8/call check-stream-equal/disp32
3578
3579 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3580
3581 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3582 5d/pop-to-ebp
3583 c3/return
3584
3585 test-convert-instruction-handles-0f-opcode:
3586
3587
3588 55/push-ebp
3589 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3590
3591
3592
3593 68/push _test-input-stream/imm32
3594
3595 e8/call clear-stream/disp32
3596
3597 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3598
3599
3600 68/push _test-output-stream/imm32
3601
3602 e8/call clear-stream/disp32
3603
3604 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3605
3606
3607 68/push $_test-output-buffered-file->buffer/imm32
3608
3609 e8/call clear-stream/disp32
3610
3611 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3612
3613
3614
3615 68/push "0f/m1 ab/m2 # comment"/imm32
3616 68/push _test-input-stream/imm32
3617
3618 e8/call write/disp32
3619
3620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3621
3622
3623 68/push _test-output-buffered-file/imm32
3624 68/push _test-input-stream/imm32
3625
3626 e8/call convert-instruction/disp32
3627
3628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3629
3630
3631
3632 68/push _test-output-buffered-file/imm32
3633
3634 e8/call flush/disp32
3635
3636 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3637 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3663
3664
3665 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3666 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3667 68/push _test-output-stream/imm32
3668
3669 e8/call check-stream-equal/disp32
3670
3671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3672
3673 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3674 5d/pop-to-ebp
3675 c3/return
3676
3677 test-convert-instruction-handles-f2-opcode:
3678
3679
3680 55/push-ebp
3681 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3682
3683
3684
3685 68/push _test-input-stream/imm32
3686
3687 e8/call clear-stream/disp32
3688
3689 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3690
3691
3692 68/push _test-output-stream/imm32
3693
3694 e8/call clear-stream/disp32
3695
3696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3697
3698
3699 68/push $_test-output-buffered-file->buffer/imm32
3700
3701 e8/call clear-stream/disp32
3702
3703 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3704
3705
3706
3707 68/push "f2/m1 ab/m2 # comment"/imm32
3708 68/push _test-input-stream/imm32
3709
3710 e8/call write/disp32
3711
3712 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3713
3714
3715 68/push _test-output-buffered-file/imm32
3716 68/push _test-input-stream/imm32
3717
3718 e8/call convert-instruction/disp32
3719
3720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3721
3722
3723
3724 68/push _test-output-buffered-file/imm32
3725
3726 e8/call flush/disp32
3727
3728 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3729 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3755
3756
3757 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3758 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3759 68/push _test-output-stream/imm32
3760
3761 e8/call check-stream-equal/disp32
3762
3763 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3764
3765 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3766 5d/pop-to-ebp
3767 c3/return
3768
3769 test-convert-instruction-handles-f3-opcode:
3770
3771
3772 55/push-ebp
3773 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3774
3775
3776
3777 68/push _test-input-stream/imm32
3778
3779 e8/call clear-stream/disp32
3780
3781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3782
3783
3784 68/push _test-output-stream/imm32
3785
3786 e8/call clear-stream/disp32
3787
3788 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3789
3790
3791 68/push $_test-output-buffered-file->buffer/imm32
3792
3793 e8/call clear-stream/disp32
3794
3795 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3796
3797
3798
3799 68/push "f3/m1 ab/m2 # comment"/imm32
3800 68/push _test-input-stream/imm32
3801
3802 e8/call write/disp32
3803
3804 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3805
3806
3807 68/push _test-output-buffered-file/imm32
3808 68/push _test-input-stream/imm32
3809
3810 e8/call convert-instruction/disp32
3811
3812 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3813
3814
3815
3816 68/push _test-output-buffered-file/imm32
3817
3818 e8/call flush/disp32
3819
3820 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3821 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3847
3848
3849 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3850 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3851 68/push _test-output-stream/imm32
3852
3853 e8/call check-stream-equal/disp32
3854
3855 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3856
3857 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3858 5d/pop-to-ebp
3859 c3/return
3860
3861 test-convert-instruction-handles-f2-0f-opcode:
3862
3863
3864 55/push-ebp
3865 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3866
3867
3868
3869 68/push _test-input-stream/imm32
3870
3871 e8/call clear-stream/disp32
3872
3873 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3874
3875
3876 68/push _test-output-stream/imm32
3877
3878 e8/call clear-stream/disp32
3879
3880 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3881
3882
3883 68/push $_test-output-buffered-file->buffer/imm32
3884
3885 e8/call clear-stream/disp32
3886
3887 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3888
3889
3890
3891 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
3892 68/push _test-input-stream/imm32
3893
3894 e8/call write/disp32
3895
3896 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3897
3898
3899 68/push _test-output-buffered-file/imm32
3900 68/push _test-input-stream/imm32
3901
3902 e8/call convert-instruction/disp32
3903
3904 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3905
3906
3907
3908 68/push _test-output-buffered-file/imm32
3909
3910 e8/call flush/disp32
3911
3912 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3913 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3939
3940
3941 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
3942 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
3943 68/push _test-output-stream/imm32
3944
3945 e8/call check-stream-equal/disp32
3946
3947 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3948
3949 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3950 5d/pop-to-ebp
3951 c3/return
3952
3953 test-convert-instruction-handles-f3-0f-opcode:
3954
3955
3956 55/push-ebp
3957 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3958
3959
3960
3961 68/push _test-input-stream/imm32
3962
3963 e8/call clear-stream/disp32
3964
3965 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3966
3967
3968 68/push _test-output-stream/imm32
3969
3970 e8/call clear-stream/disp32
3971
3972 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3973
3974
3975 68/push $_test-output-buffered-file->buffer/imm32
3976
3977 e8/call clear-stream/disp32
3978
3979 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3980
3981
3982
3983 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
3984 68/push _test-input-stream/imm32
3985
3986 e8/call write/disp32
3987
3988 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3989
3990
3991 68/push _test-output-buffered-file/imm32
3992 68/push _test-input-stream/imm32
3993
3994 e8/call convert-instruction/disp32
3995
3996 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3997
3998
3999
4000 68/push _test-output-buffered-file/imm32
4001
4002 e8/call flush/disp32
4003
4004 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4005 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4031
4032
4033 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
4034 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
4035 68/push _test-output-stream/imm32
4036
4037 e8/call check-stream-equal/disp32
4038
4039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4040
4041 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4042 5d/pop-to-ebp
4043 c3/return
4044
4045 test-convert-instruction-handles-unused-opcodes:
4046
4047
4048 55/push-ebp
4049 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4050
4051
4052
4053 68/push _test-input-stream/imm32
4054
4055 e8/call clear-stream/disp32
4056
4057 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4058
4059
4060 68/push _test-output-stream/imm32
4061
4062 e8/call clear-stream/disp32
4063
4064 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4065
4066
4067 68/push $_test-output-buffered-file->buffer/imm32
4068
4069 e8/call clear-stream/disp32
4070
4071 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4072
4073
4074
4075 68/push "ab/m1 cd/m2 # comment"/imm32
4076 68/push _test-input-stream/imm32
4077
4078 e8/call write/disp32
4079
4080 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4081
4082
4083 68/push _test-output-buffered-file/imm32
4084 68/push _test-input-stream/imm32
4085
4086 e8/call convert-instruction/disp32
4087
4088 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4089
4090
4091
4092 68/push _test-output-buffered-file/imm32
4093
4094 e8/call flush/disp32
4095
4096 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4097 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4123
4124
4125 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4126 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4127 68/push _test-output-stream/imm32
4128
4129 e8/call check-stream-equal/disp32
4130
4131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4132
4133 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4134 5d/pop-to-ebp
4135 c3/return
4136
4137 test-convert-instruction-handles-unused-second-opcodes:
4138
4139
4140 55/push-ebp
4141 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4142
4143
4144
4145 68/push _test-input-stream/imm32
4146
4147 e8/call clear-stream/disp32
4148
4149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4150
4151
4152 68/push _test-output-stream/imm32
4153
4154 e8/call clear-stream/disp32
4155
4156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4157
4158
4159 68/push $_test-output-buffered-file->buffer/imm32
4160
4161 e8/call clear-stream/disp32
4162
4163 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4164
4165
4166
4167 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4168 68/push _test-input-stream/imm32
4169
4170 e8/call write/disp32
4171
4172 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4173
4174
4175 68/push _test-output-buffered-file/imm32
4176 68/push _test-input-stream/imm32
4177
4178 e8/call convert-instruction/disp32
4179
4180 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4181
4182
4183
4184 68/push _test-output-buffered-file/imm32
4185
4186 e8/call flush/disp32
4187
4188 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4189 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4215
4216
4217 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4218 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4219 68/push _test-output-stream/imm32
4220
4221 e8/call check-stream-equal/disp32
4222
4223 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4224
4225 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4226 5d/pop-to-ebp
4227 c3/return
4228
4229 test-convert-instruction-handles-unused-second-opcodes-2:
4230
4231
4232 55/push-ebp
4233 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4234
4235
4236
4237 68/push _test-input-stream/imm32
4238
4239 e8/call clear-stream/disp32
4240
4241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4242
4243
4244 68/push _test-output-stream/imm32
4245
4246 e8/call clear-stream/disp32
4247
4248 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4249
4250
4251 68/push $_test-output-buffered-file->buffer/imm32
4252
4253 e8/call clear-stream/disp32
4254
4255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4256
4257
4258
4259 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4260 68/push _test-input-stream/imm32
4261
4262 e8/call write/disp32
4263
4264 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4265
4266
4267 68/push _test-output-buffered-file/imm32
4268 68/push _test-input-stream/imm32
4269
4270 e8/call convert-instruction/disp32
4271
4272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4273
4274
4275
4276 68/push _test-output-buffered-file/imm32
4277
4278 e8/call flush/disp32
4279
4280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4281 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4307
4308
4309 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4310 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4311 68/push _test-output-stream/imm32
4312
4313 e8/call check-stream-equal/disp32
4314
4315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4316
4317 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4318 5d/pop-to-ebp
4319 c3/return
4320
4321 test-convert-instruction-emits-modrm-byte:
4322
4323
4324 55/push-ebp
4325 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4326
4327
4328
4329 68/push _test-input-stream/imm32
4330
4331 e8/call clear-stream/disp32
4332
4333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4334
4335
4336 68/push _test-output-stream/imm32
4337
4338 e8/call clear-stream/disp32
4339
4340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4341
4342
4343 68/push $_test-output-buffered-file->buffer/imm32
4344
4345 e8/call clear-stream/disp32
4346
4347 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4348
4349
4350
4351 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4352 68/push _test-input-stream/imm32
4353
4354 e8/call write/disp32
4355
4356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4357
4358
4359 68/push _test-output-buffered-file/imm32
4360 68/push _test-input-stream/imm32
4361
4362 e8/call convert-instruction/disp32
4363
4364 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4365
4366
4367
4368 68/push _test-output-buffered-file/imm32
4369
4370 e8/call flush/disp32
4371
4372 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4373 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4399
4400
4401 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4402 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4403 68/push _test-output-stream/imm32
4404
4405 e8/call check-stream-equal/disp32
4406
4407 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4408
4409 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4410 5d/pop-to-ebp
4411 c3/return
4412
4413 test-convert-instruction-emits-modrm-byte-with-non-zero-mod:
4414
4415 55/push-ebp
4416 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4417
4418
4419
4420 68/push _test-input-stream/imm32
4421
4422 e8/call clear-stream/disp32
4423
4424 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4425
4426
4427 68/push _test-output-stream/imm32
4428
4429 e8/call clear-stream/disp32
4430
4431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4432
4433
4434 68/push $_test-output-buffered-file->buffer/imm32
4435
4436 e8/call clear-stream/disp32
4437
4438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4439
4440
4441
4442 68/push "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4443 68/push _test-input-stream/imm32
4444
4445 e8/call write/disp32
4446
4447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4448
4449
4450 68/push _test-output-buffered-file/imm32
4451 68/push _test-input-stream/imm32
4452
4453 e8/call convert-instruction/disp32
4454
4455 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4456
4457
4458 68/push _test-output-buffered-file/imm32
4459
4460 e8/call flush/disp32
4461
4462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4463 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4489
4490
4491
4492 68/push "F - test-convert-instruction-foo"/imm32
4493 68/push "01 cb # 01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4494 68/push _test-output-stream/imm32
4495
4496 e8/call check-stream-equal/disp32
4497
4498 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4499
4500 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4501 5d/pop-to-ebp
4502 c3/return
4503
4504 test-convert-instruction-emits-modrm-byte-from-subop:
4505
4506
4507 55/push-ebp
4508 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4509
4510
4511
4512 68/push _test-input-stream/imm32
4513
4514 e8/call clear-stream/disp32
4515
4516 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4517
4518
4519 68/push _test-output-stream/imm32
4520
4521 e8/call clear-stream/disp32
4522
4523 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4524
4525
4526 68/push $_test-output-buffered-file->buffer/imm32
4527
4528 e8/call clear-stream/disp32
4529
4530 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4531
4532
4533
4534 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4535 68/push _test-input-stream/imm32
4536
4537 e8/call write/disp32
4538
4539 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4540
4541
4542 68/push _test-output-buffered-file/imm32
4543 68/push _test-input-stream/imm32
4544
4545 e8/call convert-instruction/disp32
4546
4547 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4548
4549
4550
4551 68/push _test-output-buffered-file/imm32
4552
4553 e8/call flush/disp32
4554
4555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4556 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4582
4583
4584 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4585 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4586 68/push _test-output-stream/imm32
4587
4588 e8/call check-stream-equal/disp32
4589
4590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4591
4592 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4593 5d/pop-to-ebp
4594 c3/return
4595
4596 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4597
4598
4599 55/push-ebp
4600 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4601
4602
4603
4604 68/push _test-input-stream/imm32
4605
4606 e8/call clear-stream/disp32
4607
4608 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4609
4610
4611 68/push _test-output-stream/imm32
4612
4613 e8/call clear-stream/disp32
4614
4615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4616
4617
4618 68/push $_test-output-buffered-file->buffer/imm32
4619
4620 e8/call clear-stream/disp32
4621
4622 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4623
4624
4625
4626 68/push "8b/copy 0/rm32 1/r32"/imm32
4627 68/push _test-input-stream/imm32
4628
4629 e8/call write/disp32
4630
4631 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4632
4633
4634 68/push _test-output-buffered-file/imm32
4635 68/push _test-input-stream/imm32
4636
4637 e8/call convert-instruction/disp32
4638
4639 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4640
4641
4642
4643 68/push _test-output-buffered-file/imm32
4644
4645 e8/call flush/disp32
4646
4647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4648 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4674
4675
4676 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4677 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4678 68/push _test-output-stream/imm32
4679
4680 e8/call check-stream-equal/disp32
4681
4682 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4683
4684 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4685 5d/pop-to-ebp
4686 c3/return
4687
4688 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4689
4690
4691 55/push-ebp
4692 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4693
4694
4695
4696 68/push _test-input-stream/imm32
4697
4698 e8/call clear-stream/disp32
4699
4700 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4701
4702
4703 68/push _test-output-stream/imm32
4704
4705 e8/call clear-stream/disp32
4706
4707 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4708
4709
4710 68/push $_test-output-buffered-file->buffer/imm32
4711
4712 e8/call clear-stream/disp32
4713
4714 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4715
4716
4717
4718 68/push "8b/copy 0/mod 1/r32"/imm32
4719 68/push _test-input-stream/imm32
4720
4721 e8/call write/disp32
4722
4723 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4724
4725
4726 68/push _test-output-buffered-file/imm32
4727 68/push _test-input-stream/imm32
4728
4729 e8/call convert-instruction/disp32
4730
4731 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4732
4733
4734
4735 68/push _test-output-buffered-file/imm32
4736
4737 e8/call flush/disp32
4738
4739 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4740 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4766
4767
4768 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4769 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4770 68/push _test-output-stream/imm32
4771
4772 e8/call check-stream-equal/disp32
4773
4774 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4775
4776 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4777 5d/pop-to-ebp
4778 c3/return
4779
4780 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4781
4782
4783 55/push-ebp
4784 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4785
4786
4787
4788 68/push _test-input-stream/imm32
4789
4790 e8/call clear-stream/disp32
4791
4792 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4793
4794
4795 68/push _test-output-stream/imm32
4796
4797 e8/call clear-stream/disp32
4798
4799 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4800
4801
4802 68/push $_test-output-buffered-file->buffer/imm32
4803
4804 e8/call clear-stream/disp32
4805
4806 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4807
4808
4809
4810 68/push "8b/copy 0/mod 0/rm32"/imm32
4811 68/push _test-input-stream/imm32
4812
4813 e8/call write/disp32
4814
4815 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4816
4817
4818 68/push _test-output-buffered-file/imm32
4819 68/push _test-input-stream/imm32
4820
4821 e8/call convert-instruction/disp32
4822
4823 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4824
4825
4826
4827 68/push _test-output-buffered-file/imm32
4828
4829 e8/call flush/disp32
4830
4831 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4832 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4858
4859
4860 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4861 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4862 68/push _test-output-stream/imm32
4863
4864 e8/call check-stream-equal/disp32
4865
4866 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4867
4868 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4869 5d/pop-to-ebp
4870 c3/return
4871
4872 test-convert-instruction-emits-sib-byte:
4873
4874
4875 55/push-ebp
4876 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4877
4878
4879
4880 68/push _test-input-stream/imm32
4881
4882 e8/call clear-stream/disp32
4883
4884 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4885
4886
4887 68/push _test-output-stream/imm32
4888
4889 e8/call clear-stream/disp32
4890
4891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4892
4893
4894 68/push $_test-output-buffered-file->buffer/imm32
4895
4896 e8/call clear-stream/disp32
4897
4898 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4899
4900
4901
4902 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4903 68/push _test-input-stream/imm32
4904
4905 e8/call write/disp32
4906
4907 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4908
4909
4910 68/push _test-output-buffered-file/imm32
4911 68/push _test-input-stream/imm32
4912
4913 e8/call convert-instruction/disp32
4914
4915 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4916
4917
4918
4919 68/push _test-output-buffered-file/imm32
4920
4921 e8/call flush/disp32
4922
4923 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4924 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4950
4951
4952 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
4953 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4954 68/push _test-output-stream/imm32
4955
4956 e8/call check-stream-equal/disp32
4957
4958 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4959
4960 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4961 5d/pop-to-ebp
4962 c3/return
4963
4964 test-convert-instruction-emits-scale:
4965
4966
4967 55/push-ebp
4968 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4969
4970
4971
4972 68/push _test-input-stream/imm32
4973
4974 e8/call clear-stream/disp32
4975
4976 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4977
4978
4979 68/push _test-output-stream/imm32
4980
4981 e8/call clear-stream/disp32
4982
4983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4984
4985
4986 68/push $_test-output-buffered-file->buffer/imm32
4987
4988 e8/call clear-stream/disp32
4989
4990 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4991
4992
4993
4994 68/push "8b/copy 0/mod 4/rm32 1/scale"/imm32
4995 68/push _test-input-stream/imm32
4996
4997 e8/call write/disp32
4998
4999 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5000
5001
5002 68/push _test-output-buffered-file/imm32
5003 68/push _test-input-stream/imm32
5004
5005 e8/call convert-instruction/disp32
5006
5007 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5008
5009
5010
5011 68/push _test-output-buffered-file/imm32
5012
5013 e8/call flush/disp32
5014
5015 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5016 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5042
5043
5044 68/push "F - test-convert-instruction-emits-scale"/imm32
5045 68/push "8b 04 40 # 8b/copy 0/mod 4/rm32 1/scale"/imm32
5046 68/push _test-output-stream/imm32
5047
5048 e8/call check-stream-equal/disp32
5049
5050 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5051
5052 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5053 5d/pop-to-ebp
5054 c3/return
5055
5056 test-convert-instruction-emits-sib-byte-with-missing-base:
5057
5058
5059 55/push-ebp
5060 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5061
5062
5063
5064 68/push _test-input-stream/imm32
5065
5066 e8/call clear-stream/disp32
5067
5068 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5069
5070
5071 68/push _test-output-stream/imm32
5072
5073 e8/call clear-stream/disp32
5074
5075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5076
5077
5078 68/push $_test-output-buffered-file->buffer/imm32
5079
5080 e8/call clear-stream/disp32
5081
5082 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5083
5084
5085
5086 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5087 68/push _test-input-stream/imm32
5088
5089 e8/call write/disp32
5090
5091 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5092
5093
5094 68/push _test-output-buffered-file/imm32
5095 68/push _test-input-stream/imm32
5096
5097 e8/call convert-instruction/disp32
5098
5099 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5100
5101
5102
5103 68/push _test-output-buffered-file/imm32
5104
5105 e8/call flush/disp32
5106
5107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5108 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5134
5135
5136 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
5137 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5138 68/push _test-output-stream/imm32
5139
5140 e8/call check-stream-equal/disp32
5141
5142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5143
5144 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5145 5d/pop-to-ebp
5146 c3/return
5147
5148 test-convert-instruction-emits-sib-byte-with-missing-index:
5149
5150
5151 55/push-ebp
5152 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5153
5154
5155
5156 68/push _test-input-stream/imm32
5157
5158 e8/call clear-stream/disp32
5159
5160 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5161
5162
5163 68/push _test-output-stream/imm32
5164
5165 e8/call clear-stream/disp32
5166
5167 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5168
5169
5170 68/push $_test-output-buffered-file->buffer/imm32
5171
5172 e8/call clear-stream/disp32
5173
5174 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5175
5176
5177
5178 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5179 68/push _test-input-stream/imm32
5180
5181 e8/call write/disp32
5182
5183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5184
5185
5186 68/push _test-output-buffered-file/imm32
5187 68/push _test-input-stream/imm32
5188
5189 e8/call convert-instruction/disp32
5190
5191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5192
5193
5194
5195 68/push _test-output-buffered-file/imm32
5196
5197 e8/call flush/disp32
5198
5199 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5200 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5226
5227
5228 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5229 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5230 68/push _test-output-stream/imm32
5231
5232 e8/call check-stream-equal/disp32
5233
5234 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5235
5236 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5237 5d/pop-to-ebp
5238 c3/return
5239
5240 test-convert-instruction-emits-sib-byte-with-missing-scale:
5241
5242
5243 55/push-ebp
5244 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5245
5246
5247
5248 68/push _test-input-stream/imm32
5249
5250 e8/call clear-stream/disp32
5251
5252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5253
5254
5255 68/push _test-output-stream/imm32
5256
5257 e8/call clear-stream/disp32
5258
5259 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5260
5261
5262 68/push $_test-output-buffered-file->buffer/imm32
5263
5264 e8/call clear-stream/disp32
5265
5266 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5267
5268
5269
5270 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5271 68/push _test-input-stream/imm32
5272
5273 e8/call write/disp32
5274
5275 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5276
5277
5278 68/push _test-output-buffered-file/imm32
5279 68/push _test-input-stream/imm32
5280
5281 e8/call convert-instruction/disp32
5282
5283 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5284
5285
5286
5287 68/push _test-output-buffered-file/imm32
5288
5289 e8/call flush/disp32
5290
5291 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5292 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5318
5319
5320 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5321 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5322 68/push _test-output-stream/imm32
5323
5324 e8/call check-stream-equal/disp32
5325
5326 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5327
5328 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5329 5d/pop-to-ebp
5330 c3/return
5331
5332 test-convert-instruction-handles-disp32-operand:
5333
5334
5335 55/push-ebp
5336 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5337
5338
5339
5340 68/push _test-input-stream/imm32
5341
5342 e8/call clear-stream/disp32
5343
5344 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5345
5346
5347 68/push _test-output-stream/imm32
5348
5349 e8/call clear-stream/disp32
5350
5351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5352
5353
5354 68/push $_test-output-buffered-file->buffer/imm32
5355
5356 e8/call clear-stream/disp32
5357
5358 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5359
5360
5361
5362 68/push "e8/call 20/disp32"/imm32
5363 68/push _test-input-stream/imm32
5364
5365 e8/call write/disp32
5366
5367 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5368
5369
5370 68/push _test-output-buffered-file/imm32
5371 68/push _test-input-stream/imm32
5372
5373 e8/call convert-instruction/disp32
5374
5375 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5376
5377
5378
5379 68/push _test-output-buffered-file/imm32
5380
5381 e8/call flush/disp32
5382
5383 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5384 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5410
5411
5412 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5413 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5414 68/push _test-output-stream/imm32
5415
5416 e8/call check-stream-equal/disp32
5417
5418 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5419
5420 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5421 5d/pop-to-ebp
5422 c3/return
5423
5424 test-convert-instruction-handles-disp16-operand:
5425
5426
5427 55/push-ebp
5428 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5429
5430
5431
5432 68/push _test-input-stream/imm32
5433
5434 e8/call clear-stream/disp32
5435
5436 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5437
5438
5439 68/push _test-output-stream/imm32
5440
5441 e8/call clear-stream/disp32
5442
5443 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5444
5445
5446 68/push $_test-output-buffered-file->buffer/imm32
5447
5448 e8/call clear-stream/disp32
5449
5450 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5451
5452
5453
5454 68/push "e8/call 20/disp16"/imm32
5455 68/push _test-input-stream/imm32
5456
5457 e8/call write/disp32
5458
5459 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5460
5461
5462 68/push _test-output-buffered-file/imm32
5463 68/push _test-input-stream/imm32
5464
5465 e8/call convert-instruction/disp32
5466
5467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5468
5469
5470
5471 68/push _test-output-buffered-file/imm32
5472
5473 e8/call flush/disp32
5474
5475 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5476 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5502
5503
5504 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5505 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5506 68/push _test-output-stream/imm32
5507
5508 e8/call check-stream-equal/disp32
5509
5510 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5511
5512 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5513 5d/pop-to-ebp
5514 c3/return
5515
5516 test-convert-instruction-handles-disp8-operand:
5517
5518
5519 55/push-ebp
5520 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5521
5522
5523
5524 68/push _test-input-stream/imm32
5525
5526 e8/call clear-stream/disp32
5527
5528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5529
5530
5531 68/push _test-output-stream/imm32
5532
5533 e8/call clear-stream/disp32
5534
5535 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5536
5537
5538 68/push $_test-output-buffered-file->buffer/imm32
5539
5540 e8/call clear-stream/disp32
5541
5542 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5543
5544
5545
5546 68/push "eb/jump 20/disp8"/imm32
5547 68/push _test-input-stream/imm32
5548
5549 e8/call write/disp32
5550
5551 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5552
5553
5554 68/push _test-output-buffered-file/imm32
5555 68/push _test-input-stream/imm32
5556
5557 e8/call convert-instruction/disp32
5558
5559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5560
5561
5562
5563 68/push _test-output-buffered-file/imm32
5564
5565 e8/call flush/disp32
5566
5567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5568 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5594
5595
5596 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5597 68/push "eb 20 # eb/jump 20/disp8"/imm32
5598 68/push _test-output-stream/imm32
5599
5600 e8/call check-stream-equal/disp32
5601
5602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5603
5604 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5605 5d/pop-to-ebp
5606 c3/return
5607
5608 test-convert-instruction-handles-disp8-name:
5609
5610
5611 55/push-ebp
5612 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5613
5614
5615
5616 68/push _test-input-stream/imm32
5617
5618 e8/call clear-stream/disp32
5619
5620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5621
5622
5623 68/push _test-output-stream/imm32
5624
5625 e8/call clear-stream/disp32
5626
5627 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5628
5629
5630 68/push $_test-output-buffered-file->buffer/imm32
5631
5632 e8/call clear-stream/disp32
5633
5634 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5635
5636
5637
5638 68/push "eb/jump xyz/disp8"/imm32
5639 68/push _test-input-stream/imm32
5640
5641 e8/call write/disp32
5642
5643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5644
5645
5646 68/push _test-output-buffered-file/imm32
5647 68/push _test-input-stream/imm32
5648
5649 e8/call convert-instruction/disp32
5650
5651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5652
5653
5654
5655 68/push _test-output-buffered-file/imm32
5656
5657 e8/call flush/disp32
5658
5659 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5660 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5686
5687
5688 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5689 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5690 68/push _test-output-stream/imm32
5691
5692 e8/call check-stream-equal/disp32
5693
5694 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5695
5696 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5697 5d/pop-to-ebp
5698 c3/return
5699
5700 test-convert-instruction-handles-imm32-operand:
5701
5702
5703 55/push-ebp
5704 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5705
5706
5707
5708 68/push _test-input-stream/imm32
5709
5710 e8/call clear-stream/disp32
5711
5712 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5713
5714
5715 68/push _test-output-stream/imm32
5716
5717 e8/call clear-stream/disp32
5718
5719 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5720
5721
5722 68/push $_test-output-buffered-file->buffer/imm32
5723
5724 e8/call clear-stream/disp32
5725
5726 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5727
5728
5729
5730 68/push "68/push 0x20/imm32"/imm32
5731 68/push _test-input-stream/imm32
5732
5733 e8/call write/disp32
5734
5735 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5736
5737
5738 68/push _test-output-buffered-file/imm32
5739 68/push _test-input-stream/imm32
5740
5741 e8/call convert-instruction/disp32
5742
5743 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5744
5745
5746
5747 68/push _test-output-buffered-file/imm32
5748
5749 e8/call flush/disp32
5750
5751 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5752 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5778
5779
5780 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5781 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5782 68/push _test-output-stream/imm32
5783
5784 e8/call check-stream-equal/disp32
5785
5786 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5787
5788 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5789 5d/pop-to-ebp
5790 c3/return
5791
5792 test-convert-instruction-handles-imm16-operand:
5793
5794
5795
5796 55/push-ebp
5797 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5798
5799
5800
5801 68/push _test-input-stream/imm32
5802
5803 e8/call clear-stream/disp32
5804
5805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5806
5807
5808 68/push _test-output-stream/imm32
5809
5810 e8/call clear-stream/disp32
5811
5812 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5813
5814
5815 68/push $_test-output-buffered-file->buffer/imm32
5816
5817 e8/call clear-stream/disp32
5818
5819 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5820
5821
5822
5823 68/push "68/push 0x20/imm16"/imm32
5824 68/push _test-input-stream/imm32
5825
5826 e8/call write/disp32
5827
5828 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5829
5830
5831 68/push _test-output-buffered-file/imm32
5832 68/push _test-input-stream/imm32
5833
5834 e8/call convert-instruction/disp32
5835
5836 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5837
5838
5839
5840 68/push _test-output-buffered-file/imm32
5841
5842 e8/call flush/disp32
5843
5844 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5845 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5871
5872
5873 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5874 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5875 68/push _test-output-stream/imm32
5876
5877 e8/call check-stream-equal/disp32
5878
5879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5880
5881 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5882 5d/pop-to-ebp
5883 c3/return
5884
5885 test-convert-instruction-handles-imm8-operand:
5886
5887
5888
5889 55/push-ebp
5890 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5891
5892
5893
5894 68/push _test-input-stream/imm32
5895
5896 e8/call clear-stream/disp32
5897
5898 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5899
5900
5901 68/push _test-output-stream/imm32
5902
5903 e8/call clear-stream/disp32
5904
5905 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5906
5907
5908 68/push $_test-output-buffered-file->buffer/imm32
5909
5910 e8/call clear-stream/disp32
5911
5912 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5913
5914
5915
5916 68/push "68/push 0x20/imm8"/imm32
5917 68/push _test-input-stream/imm32
5918
5919 e8/call write/disp32
5920
5921 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5922
5923
5924 68/push _test-output-buffered-file/imm32
5925 68/push _test-input-stream/imm32
5926
5927 e8/call convert-instruction/disp32
5928
5929 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5930
5931
5932
5933 68/push _test-output-buffered-file/imm32
5934
5935 e8/call flush/disp32
5936
5937 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5938 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5964
5965
5966 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
5967 68/push "68 20 # 68/push 0x20/imm8"/imm32
5968 68/push _test-output-stream/imm32
5969
5970 e8/call check-stream-equal/disp32
5971
5972 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5973
5974 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5975 5d/pop-to-ebp
5976 c3/return
5977
5978
5979 parse-datum-of-word:
5980
5981 55/push-ebp
5982 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5983
5984 51/push-ecx
5985 56/push-esi
5986
5987 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
5988
5989 68/push 0/imm32/end
5990 68/push 0/imm32/start
5991 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
5992
5993
5994 51/push-ecx
5995 68/push 0x2f/imm32/slash
5996 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
5997 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
5998
5999 e8/call next-token-from-slice/disp32
6000
6001 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
6002
6003
6004 51/push-ecx
6005
6006 e8/call parse-hex-int-from-slice/disp32
6007
6008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6009 $parse-datum-of-word:end:
6010
6011 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
6012
6013 5e/pop-to-esi
6014 59/pop-to-ecx
6015
6016 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
6017 5d/pop-to-ebp
6018 c3/return
6019
6020