https://github.com/akkartik/mu/blob/main/linux/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
925 55/push-ebp
926 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
927
928 50/push-eax
929 51/push-ecx
930 52/push-edx
931
932 68/push 0/imm32/end
933 68/push 0/imm32/start
934 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
935 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
961 $convert-data:loop:
962
963
964 51/push-ecx
965 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
966
967 e8/call next-word/disp32
968
969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
970 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
1010 $convert-data:check0:
1011
1012
1013
1014 51/push-ecx
1015
1016 e8/call slice-empty?/disp32
1017
1018 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1019
1020 3d/compare-eax-and 0/imm32/false
1021 0f 85/jump-if-!= $convert-data:break/disp32
1022 $convert-data:check-for-comment:
1023
1024
1025 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1026
1027 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1028 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1029
1030 3d/compare-eax-and 0x23/imm32/hash
1031 75/jump-if-!= $convert-data:check-for-label/disp8
1032 $convert-data:comment:
1033
1034
1035 51/push-ecx
1036 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1037
1038 e8/call write-slice-buffered/disp32
1039
1040 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1041
1042 0f 85/jump-if-!= $convert-data:end/disp32
1043 $convert-data:check-for-label:
1044
1045
1046 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1047
1048 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1049 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1050
1051 3d/compare-eax-and 0x3a/imm32/colon
1052 75/jump-if-!= $convert-data:check-for-imm32/disp8
1053 $convert-data:label:
1054
1055
1056 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1057 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1058
1059 e8/call write-stream-data/disp32
1060
1061 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1062
1063 0f 85/jump-if-!= $convert-data:end/disp32
1064 $convert-data:check-for-imm32:
1065
1066
1067
1068 68/push "imm32"/imm32
1069 51/push-ecx
1070
1071 e8/call has-metadata?/disp32
1072
1073 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1074
1075 3d/compare-eax-and 0/imm32/false
1076 74/jump-if-= $convert-data:check-for-imm16/disp8
1077 $convert-data:imm32:
1078
1079
1080 68/push 4/imm32
1081 51/push-ecx
1082 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1083
1084 e8/call emit/disp32
1085
1086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1087 e9/jump $convert-data:loop/disp32
1088 $convert-data:check-for-imm16:
1089
1090
1091
1092 68/push "imm16"/imm32
1093 51/push-ecx
1094
1095 e8/call has-metadata?/disp32
1096
1097 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1098
1099 3d/compare-eax-and 0/imm32/false
1100 74/jump-if-= $convert-data:single-byte/disp8
1101 $convert-data:imm16:
1102
1103
1104 68/push 2/imm32
1105 51/push-ecx
1106 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1107
1108 e8/call emit/disp32
1109
1110 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1111 e9/jump $convert-data:loop/disp32
1112 $convert-data:single-byte:
1113
1114
1115 68/push 1/imm32
1116 51/push-ecx
1117 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1118
1119 e8/call emit/disp32
1120
1121 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1122 e9/jump $convert-data:loop/disp32
1123 $convert-data:break:
1124
1125
1126 68/push Newline/imm32
1127 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1128
1129 e8/call write-buffered/disp32
1130
1131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1132 $convert-data:end:
1133
1134 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1135
1136 5a/pop-to-edx
1137 59/pop-to-ecx
1138 58/pop-to-eax
1139
1140 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1141 5d/pop-to-ebp
1142 c3/return
1143
1144 test-convert-data-passes-comments-through:
1145
1146
1147 55/push-ebp
1148 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1149
1150
1151
1152 68/push _test-input-stream/imm32
1153
1154 e8/call clear-stream/disp32
1155
1156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1157
1158
1159 68/push _test-output-stream/imm32
1160
1161 e8/call clear-stream/disp32
1162
1163 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1164
1165
1166 68/push $_test-output-buffered-file->buffer/imm32
1167
1168 e8/call clear-stream/disp32
1169
1170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1171
1172
1173
1174 68/push "# abcd"/imm32
1175 68/push _test-input-stream/imm32
1176
1177 e8/call write/disp32
1178
1179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1180
1181
1182 68/push _test-output-buffered-file/imm32
1183 68/push _test-input-stream/imm32
1184
1185 e8/call convert-data/disp32
1186
1187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1188
1189
1190
1191 68/push _test-output-buffered-file/imm32
1192
1193 e8/call flush/disp32
1194
1195 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1196 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1222
1223
1224 68/push "F - test-convert-data-passes-comments-through"/imm32
1225 68/push "# abcd"/imm32
1226 68/push _test-output-stream/imm32
1227
1228 e8/call check-stream-equal/disp32
1229
1230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1231
1232 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1233 5d/pop-to-ebp
1234 c3/return
1235
1236 test-convert-data-passes-labels-through:
1237
1238
1239 55/push-ebp
1240 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1241
1242
1243
1244 68/push _test-input-stream/imm32
1245
1246 e8/call clear-stream/disp32
1247
1248 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1249
1250
1251 68/push _test-output-stream/imm32
1252
1253 e8/call clear-stream/disp32
1254
1255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1256
1257
1258 68/push $_test-output-buffered-file->buffer/imm32
1259
1260 e8/call clear-stream/disp32
1261
1262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1263
1264
1265
1266 68/push "ab: # cd"/imm32
1267 68/push _test-input-stream/imm32
1268
1269 e8/call write/disp32
1270
1271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1272
1273
1274 68/push _test-output-buffered-file/imm32
1275 68/push _test-input-stream/imm32
1276
1277 e8/call convert-data/disp32
1278
1279 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1280
1281
1282
1283 68/push _test-output-buffered-file/imm32
1284
1285 e8/call flush/disp32
1286
1287 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1288
1289
1290 68/push "F - test-convert-data-passes-labels-through"/imm32
1291 68/push "ab: # cd"/imm32
1292 68/push _test-output-stream/imm32
1293
1294 e8/call check-stream-equal/disp32
1295
1296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1297
1298 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1299 5d/pop-to-ebp
1300 c3/return
1301
1302 test-convert-data-passes-names-through:
1303
1304
1305
1306 55/push-ebp
1307 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1308
1309
1310
1311 68/push _test-input-stream/imm32
1312
1313 e8/call clear-stream/disp32
1314
1315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1316
1317
1318 68/push _test-output-stream/imm32
1319
1320 e8/call clear-stream/disp32
1321
1322 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1323
1324
1325 68/push $_test-output-buffered-file->buffer/imm32
1326
1327 e8/call clear-stream/disp32
1328
1329 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1330
1331
1332
1333 68/push "abcd/imm32"/imm32
1334 68/push _test-input-stream/imm32
1335
1336 e8/call write/disp32
1337
1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1339
1340
1341 68/push _test-output-buffered-file/imm32
1342 68/push _test-input-stream/imm32
1343
1344 e8/call convert-data/disp32
1345
1346 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1347
1348
1349
1350 68/push _test-output-buffered-file/imm32
1351
1352 e8/call flush/disp32
1353
1354 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1355
1356
1357 68/push "F - test-convert-data-passes-names-through"/imm32
1358 68/push "abcd/imm32 \n"/imm32
1359 68/push _test-output-stream/imm32
1360
1361 e8/call check-stream-equal/disp32
1362
1363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1364
1365 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1366 5d/pop-to-ebp
1367 c3/return
1368
1369 test-convert-data-handles-imm32:
1370
1371
1372 55/push-ebp
1373 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1374
1375
1376
1377 68/push _test-input-stream/imm32
1378
1379 e8/call clear-stream/disp32
1380
1381 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1382
1383
1384 68/push _test-output-stream/imm32
1385
1386 e8/call clear-stream/disp32
1387
1388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1389
1390
1391 68/push $_test-output-buffered-file->buffer/imm32
1392
1393 e8/call clear-stream/disp32
1394
1395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1396
1397
1398
1399 68/push "30/imm32"/imm32
1400 68/push _test-input-stream/imm32
1401
1402 e8/call write/disp32
1403
1404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1405
1406
1407 68/push _test-output-buffered-file/imm32
1408 68/push _test-input-stream/imm32
1409
1410 e8/call convert-data/disp32
1411
1412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1413
1414
1415
1416 68/push _test-output-buffered-file/imm32
1417
1418 e8/call flush/disp32
1419
1420 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1421
1422
1423 68/push "F - test-convert-data-handles-imm32"/imm32
1424 68/push "30 00 00 00 \n"/imm32
1425 68/push _test-output-stream/imm32
1426
1427 e8/call check-stream-equal/disp32
1428
1429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1430
1431 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1432 5d/pop-to-ebp
1433 c3/return
1434
1435 test-convert-data-handles-imm16:
1436
1437 55/push-ebp
1438 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1439
1440
1441
1442 68/push _test-input-stream/imm32
1443
1444 e8/call clear-stream/disp32
1445
1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1447
1448
1449 68/push _test-output-stream/imm32
1450
1451 e8/call clear-stream/disp32
1452
1453 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1454
1455
1456 68/push $_test-output-buffered-file->buffer/imm32
1457
1458 e8/call clear-stream/disp32
1459
1460 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1461
1462
1463
1464 68/push "30/imm16"/imm32
1465 68/push _test-input-stream/imm32
1466
1467 e8/call write/disp32
1468
1469 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1470
1471
1472 68/push _test-output-buffered-file/imm32
1473 68/push _test-input-stream/imm32
1474
1475 e8/call convert-data/disp32
1476
1477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1478
1479
1480
1481 68/push _test-output-buffered-file/imm32
1482
1483 e8/call flush/disp32
1484
1485 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1486
1487
1488 68/push "F - test-convert-data-handles-imm16"/imm32
1489 68/push "30 00 \n"/imm32
1490 68/push _test-output-stream/imm32
1491
1492 e8/call check-stream-equal/disp32
1493
1494 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1495
1496 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1497 5d/pop-to-ebp
1498 c3/return
1499
1500 test-convert-data-handles-imm8:
1501
1502 55/push-ebp
1503 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1504
1505
1506
1507 68/push _test-input-stream/imm32
1508
1509 e8/call clear-stream/disp32
1510
1511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1512
1513
1514 68/push _test-output-stream/imm32
1515
1516 e8/call clear-stream/disp32
1517
1518 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1519
1520
1521 68/push $_test-output-buffered-file->buffer/imm32
1522
1523 e8/call clear-stream/disp32
1524
1525 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1526
1527
1528
1529 68/push "30/imm8"/imm32
1530 68/push _test-input-stream/imm32
1531
1532 e8/call write/disp32
1533
1534 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1535
1536
1537 68/push _test-output-buffered-file/imm32
1538 68/push _test-input-stream/imm32
1539
1540 e8/call convert-data/disp32
1541
1542 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1543
1544
1545
1546 68/push _test-output-buffered-file/imm32
1547
1548 e8/call flush/disp32
1549
1550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1551
1552
1553 68/push "F - test-convert-data-handles-imm8"/imm32
1554 68/push "30 \n"/imm32
1555 68/push _test-output-stream/imm32
1556
1557 e8/call check-stream-equal/disp32
1558
1559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1560
1561 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1562 5d/pop-to-ebp
1563 c3/return
1564
1565 test-convert-data-multiple-bytes:
1566
1567
1568 55/push-ebp
1569 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1570
1571
1572
1573 68/push _test-input-stream/imm32
1574
1575 e8/call clear-stream/disp32
1576
1577 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1578
1579
1580 68/push _test-output-stream/imm32
1581
1582 e8/call clear-stream/disp32
1583
1584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1585
1586
1587 68/push $_test-output-buffered-file->buffer/imm32
1588
1589 e8/call clear-stream/disp32
1590
1591 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1592
1593
1594
1595 68/push "1 2"/imm32
1596 68/push _test-input-stream/imm32
1597
1598 e8/call write/disp32
1599
1600 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1601
1602
1603 68/push _test-output-buffered-file/imm32
1604 68/push _test-input-stream/imm32
1605
1606 e8/call convert-data/disp32
1607
1608 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1609
1610
1611
1612 68/push _test-output-buffered-file/imm32
1613
1614 e8/call flush/disp32
1615
1616 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1617
1618
1619 68/push "F - test-convert-data-multiple-bytes"/imm32
1620 68/push "01 02 \n"/imm32
1621 68/push _test-output-stream/imm32
1622
1623 e8/call check-stream-equal/disp32
1624
1625 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1626
1627 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1628 5d/pop-to-ebp
1629 c3/return
1630
1631 test-convert-data-byte-then-name:
1632
1633
1634 55/push-ebp
1635 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1636
1637
1638
1639 68/push _test-input-stream/imm32
1640
1641 e8/call clear-stream/disp32
1642
1643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1644
1645
1646 68/push _test-output-stream/imm32
1647
1648 e8/call clear-stream/disp32
1649
1650 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1651
1652
1653 68/push $_test-output-buffered-file->buffer/imm32
1654
1655 e8/call clear-stream/disp32
1656
1657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1658
1659
1660
1661 68/push "30 abcd/o"/imm32
1662 68/push _test-input-stream/imm32
1663
1664 e8/call write/disp32
1665
1666 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1667
1668
1669 68/push _test-output-buffered-file/imm32
1670 68/push _test-input-stream/imm32
1671
1672 e8/call convert-data/disp32
1673
1674 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1675
1676
1677
1678 68/push _test-output-buffered-file/imm32
1679
1680 e8/call flush/disp32
1681
1682 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1683
1684
1685 68/push "F - test-convert-data-byte-then-name"/imm32
1686 68/push "30 abcd/o \n"/imm32
1687 68/push _test-output-stream/imm32
1688
1689 e8/call check-stream-equal/disp32
1690
1691 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1692
1693 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1694 5d/pop-to-ebp
1695 c3/return
1696
1697 test-convert-data-multiple-words:
1698
1699
1700 55/push-ebp
1701 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1702
1703
1704
1705 68/push _test-input-stream/imm32
1706
1707 e8/call clear-stream/disp32
1708
1709 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1710
1711
1712 68/push _test-output-stream/imm32
1713
1714 e8/call clear-stream/disp32
1715
1716 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1717
1718
1719 68/push $_test-output-buffered-file->buffer/imm32
1720
1721 e8/call clear-stream/disp32
1722
1723 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1724
1725
1726
1727 68/push "30 abcd/o 42e1/imm32"/imm32
1728 68/push _test-input-stream/imm32
1729
1730 e8/call write/disp32
1731
1732 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1733
1734
1735 68/push _test-output-buffered-file/imm32
1736 68/push _test-input-stream/imm32
1737
1738 e8/call convert-data/disp32
1739
1740 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1741
1742
1743
1744 68/push _test-output-buffered-file/imm32
1745
1746 e8/call flush/disp32
1747
1748 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1749 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1775
1776
1777 68/push "F - test-convert-data-multiple-words"/imm32
1778 68/push "30 abcd/o e1 42 00 00 \n"/imm32
1779 68/push _test-output-stream/imm32
1780
1781 e8/call check-stream-equal/disp32
1782
1783 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1784
1785 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1786 5d/pop-to-ebp
1787 c3/return
1788
1789 test-convert-data-trailing-comment:
1790
1791
1792 55/push-ebp
1793 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1794
1795
1796
1797 68/push _test-input-stream/imm32
1798
1799 e8/call clear-stream/disp32
1800
1801 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1802
1803
1804 68/push _test-output-stream/imm32
1805
1806 e8/call clear-stream/disp32
1807
1808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1809
1810
1811 68/push $_test-output-buffered-file->buffer/imm32
1812
1813 e8/call clear-stream/disp32
1814
1815 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1816
1817
1818
1819 68/push "30/imm32 # comment"/imm32
1820 68/push _test-input-stream/imm32
1821
1822 e8/call write/disp32
1823
1824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1825
1826
1827 68/push _test-output-buffered-file/imm32
1828 68/push _test-input-stream/imm32
1829
1830 e8/call convert-data/disp32
1831
1832 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1833
1834
1835
1836 68/push _test-output-buffered-file/imm32
1837
1838 e8/call flush/disp32
1839
1840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1841 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1867
1868
1869 68/push "F - test-convert-data-trailing-comment"/imm32
1870 68/push "30 00 00 00 # comment"/imm32
1871 68/push _test-output-stream/imm32
1872
1873 e8/call check-stream-equal/disp32
1874
1875 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1876
1877 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1878 5d/pop-to-ebp
1879 c3/return
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891 convert-instruction:
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913 55/push-ebp
1914 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1915
1916 50/push-eax
1917 51/push-ecx
1918 52/push-edx
1919
1920 68/push 0/imm32/end
1921 68/push 0/imm32/start
1922 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1923
1924
1925 51/push-ecx
1926 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1927
1928 e8/call next-word/disp32
1929
1930 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1931 $convert-instruction:check0:
1932
1933
1934
1935 51/push-ecx
1936
1937 e8/call slice-empty?/disp32
1938
1939 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1940
1941 3d/compare-eax-and 0/imm32/false
1942 75/jump-if-!= $convert-instruction:pass-through/disp8
1943 $convert-instruction:check1:
1944
1945
1946 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1947
1948 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1949 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1950
1951 3d/compare-eax-and 0x23/imm32/hash
1952 74/jump-if-= $convert-instruction:pass-through/disp8
1953 $convert-instruction:check2:
1954
1955
1956 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1957
1958 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1959 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1960
1961 3d/compare-eax-and 0x3a/imm32/colon
1962 75/jump-if-!= $convert-instruction:really-convert/disp8
1963 $convert-instruction:pass-through:
1964
1965
1966 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1967 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1968
1969 e8/call write-stream-data/disp32
1970
1971 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1972
1973 eb/jump $convert-instruction:end/disp8
1974 $convert-instruction:really-convert:
1975
1976
1977 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1978 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1979
1980 e8/call emit-opcodes/disp32
1981
1982 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1983
1984
1985 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1986 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1987
1988 e8/call emit-modrm/disp32
1989
1990 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1991
1992
1993 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1994 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1995
1996 e8/call emit-sib/disp32
1997
1998 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1999
2000
2001 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2002 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2003
2004 e8/call emit-disp/disp32
2005
2006 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2007
2008
2009 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2010 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2011
2012 e8/call emit-imm/disp32
2013
2014 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2015
2016
2017 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2018 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2019
2020 e8/call emit-line-in-comment/disp32
2021
2022 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2023 $convert-instruction:end:
2024
2025 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2026
2027 5a/pop-to-edx
2028 59/pop-to-ecx
2029 58/pop-to-eax
2030
2031 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2032 5d/pop-to-ebp
2033 c3/return
2034
2035 emit-opcodes:
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071 55/push-ebp
2072 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2073
2074 50/push-eax
2075 51/push-ecx
2076 52/push-edx
2077 53/push-ebx
2078
2079 68/push 0/imm32/end
2080 68/push 0/imm32/start
2081 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2082
2083 68/push 0/imm32/end
2084 68/push 0/imm32/start
2085 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
2086
2087
2088 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2089
2090 e8/call rewind-stream/disp32
2091
2092 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2093 $emit-opcodes:op1:
2094
2095
2096 51/push-ecx
2097 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2098
2099 e8/call next-word/disp32
2100
2101 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2102
2103
2104
2105 51/push-ecx
2106
2107 e8/call slice-empty?/disp32
2108
2109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2110
2111 3d/compare-eax-and 0/imm32/false
2112 0f 85/jump-if-!= $emit-opcodes:end/disp32
2113
2114
2115 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . .
2116
2117 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2118 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2119
2120 3d/compare-eax-and 0x23/imm32/hash
2121 0f 84/jump-if-= $emit-opcodes:end/disp32
2122
2123
2124 51/push-ecx
2125 68/push 0x2f/imm32/slash
2126 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 .
2127 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
2128
2129 e8/call next-token-from-slice/disp32
2130
2131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2132
2133
2134 51/push-ecx
2135 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2136
2137 e8/call write-slice-buffered/disp32
2138
2139 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2140
2141
2142 68/push Space/imm32
2143 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2144
2145 e8/call write-buffered/disp32
2146
2147 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2148
2149
2150
2151 68/push "0f"/imm32
2152 51/push-ecx
2153
2154 e8/call slice-equal?/disp32
2155
2156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2157
2158 3d/compare-eax-and 0/imm32/false
2159 75/jump-if-!= $emit-opcodes:op2/disp8
2160
2161
2162
2163 68/push "f2"/imm32
2164 51/push-ecx
2165
2166 e8/call slice-equal?/disp32
2167
2168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2169
2170 3d/compare-eax-and 0/imm32/false
2171 75/jump-if-!= $emit-opcodes:op2/disp8
2172
2173
2174
2175 68/push "f3"/imm32
2176 51/push-ecx
2177
2178 e8/call slice-equal?/disp32
2179
2180 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2181
2182 3d/compare-eax-and 0/imm32/false
2183 75/jump-if-!= $emit-opcodes:op2/disp8
2184
2185
2186
2187 68/push "66"/imm32
2188 51/push-ecx
2189
2190 e8/call slice-equal?/disp32
2191
2192 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2193
2194 3d/compare-eax-and 0/imm32/false
2195 75/jump-if-!= $emit-opcodes:op2/disp8
2196
2197
2198
2199 68/push "db"/imm32
2200 51/push-ecx
2201
2202 e8/call slice-equal?/disp32
2203
2204 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2205
2206 3d/compare-eax-and 0/imm32/false
2207 75/jump-if-!= $emit-opcodes:op2/disp8
2208
2209 e9/jump $emit-opcodes:end/disp32
2210 $emit-opcodes:op2:
2211
2212
2213 52/push-edx
2214 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2215
2216 e8/call next-word/disp32
2217
2218 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2219
2220
2221
2222 52/push-edx
2223
2224 e8/call slice-empty?/disp32
2225
2226 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2227
2228 3d/compare-eax-and 0/imm32/false
2229 0f 85/jump-if-!= $emit-opcodes:end/disp32
2230
2231
2232 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2233
2234 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2235 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2236
2237 3d/compare-eax-and 0x23/imm32/hash
2238 0f 84/jump-if-= $emit-opcodes:end/disp32
2239
2240
2241 52/push-edx
2242 68/push 0x2f/imm32/slash
2243 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2244 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2245
2246 e8/call next-token-from-slice/disp32
2247
2248 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2249
2250
2251 52/push-edx
2252 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2253
2254 e8/call write-slice-buffered/disp32
2255
2256 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2257
2258
2259 68/push Space/imm32
2260 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2261
2262 e8/call write-buffered/disp32
2263
2264 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2265
2266
2267
2268 68/push "0f"/imm32
2269 51/push-ecx
2270
2271 e8/call slice-equal?/disp32
2272
2273 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2274
2275 3d/compare-eax-and 0/imm32/false
2276 0f 85/jump-if-!= $emit-opcodes:end/disp32
2277
2278
2279
2280 68/push "0f"/imm32
2281 52/push-edx
2282
2283 e8/call slice-equal?/disp32
2284
2285 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2286
2287 3d/compare-eax-and 0/imm32/false
2288 0f 84/jump-if-= $emit-opcodes:end/disp32
2289 $emit-opcodes:op3:
2290
2291
2292 52/push-edx
2293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2294
2295 e8/call next-word/disp32
2296
2297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2298
2299
2300
2301 52/push-edx
2302
2303 e8/call slice-empty?/disp32
2304
2305 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2306
2307 3d/compare-eax-and 0/imm32/false
2308 0f 85/jump-if-!= $emit-opcodes:end/disp32
2309
2310
2311 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2312
2313 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2314 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2315
2316 3d/compare-eax-and 0x23/imm32/hash
2317 0f 84/jump-if-= $emit-opcodes:end/disp32
2318
2319
2320 52/push-edx
2321 68/push 0x2f/imm32/slash
2322 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2323 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2324
2325 e8/call next-token-from-slice/disp32
2326
2327 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2328
2329
2330 52/push-edx
2331 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2332
2333 e8/call write-slice-buffered/disp32
2334
2335 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2336
2337
2338 68/push Space/imm32
2339 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2340
2341 e8/call write-buffered/disp32
2342
2343 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2344 $emit-opcodes:end:
2345
2346 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2347
2348 5b/pop-to-ebx
2349 5a/pop-to-edx
2350 59/pop-to-ecx
2351 58/pop-to-eax
2352
2353 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2354 5d/pop-to-ebp
2355 c3/return
2356
2357 emit-modrm:
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384 55/push-ebp
2385 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2386
2387 50/push-eax
2388 51/push-ecx
2389 52/push-edx
2390 53/push-ebx
2391 56/push-esi
2392 57/push-edi
2393
2394 68/push 0/imm32/end
2395 68/push 0/imm32/start
2396 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2397
2398 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2399
2400 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2401
2402 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2403
2404 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2405
2406
2407 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2408
2409 e8/call rewind-stream/disp32
2410
2411 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2412 +-- 33 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
2445 $emit-modrm:loop:
2446
2447
2448 51/push-ecx
2449 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2450
2451 e8/call next-word/disp32
2452
2453 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2454 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
2494 $emit-modrm:check0:
2495
2496
2497
2498 51/push-ecx
2499
2500 e8/call slice-empty?/disp32
2501
2502 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2503
2504 3d/compare-eax-and 0/imm32/false
2505 0f 85/jump-if-!= $emit-modrm:break/disp32
2506 $emit-modrm:check1:
2507
2508
2509 52/push-edx
2510
2511 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2512
2513 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2514 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2515
2516 5a/pop-to-edx
2517
2518 3d/compare-eax-and 0x23/imm32/hash
2519 0f 84/jump-if-= $emit-modrm:break/disp32
2520 $emit-modrm:check-for-mod:
2521
2522
2523
2524 68/push "mod"/imm32
2525 51/push-ecx
2526
2527 e8/call has-metadata?/disp32
2528
2529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2530
2531 3d/compare-eax-and 0/imm32/false
2532 74/jump-if-= $emit-modrm:check-for-rm32/disp8
2533 $emit-modrm:mod:
2534
2535
2536
2537 51/push-ecx
2538
2539 e8/call parse-datum-of-word/disp32
2540
2541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2542
2543 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2544
2545 ba/copy-to-edx 1/imm32/true
2546
2547 e9/jump $emit-modrm:loop/disp32
2548 $emit-modrm:check-for-rm32:
2549
2550
2551
2552 68/push "rm32"/imm32
2553 51/push-ecx
2554
2555 e8/call has-metadata?/disp32
2556
2557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2558
2559 3d/compare-eax-and 0/imm32/false
2560 74/jump-if-= $emit-modrm:check-for-xm32/disp8
2561 $emit-modrm:rm32:
2562
2563
2564
2565 51/push-ecx
2566
2567 e8/call parse-datum-of-word/disp32
2568
2569 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2570
2571 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2572
2573 ba/copy-to-edx 1/imm32/true
2574
2575 e9/jump $emit-modrm:loop/disp32
2576 $emit-modrm:check-for-xm32:
2577
2578
2579
2580 68/push "xm32"/imm32
2581 51/push-ecx
2582
2583 e8/call has-metadata?/disp32
2584
2585 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2586
2587 3d/compare-eax-and 0/imm32/false
2588 74/jump-if-= $emit-modrm:check-for-r32/disp8
2589 $emit-modrm:xm32:
2590
2591
2592
2593 51/push-ecx
2594
2595 e8/call parse-datum-of-word/disp32
2596
2597 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2598
2599 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2600
2601 ba/copy-to-edx 1/imm32/true
2602
2603 e9/jump $emit-modrm:loop/disp32
2604 $emit-modrm:check-for-r32:
2605
2606
2607
2608 68/push "r32"/imm32
2609 51/push-ecx
2610
2611 e8/call has-metadata?/disp32
2612
2613 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2614
2615 3d/compare-eax-and 0/imm32/false
2616 74/jump-if-= $emit-modrm:check-for-x32/disp8
2617 $emit-modrm:r32:
2618
2619
2620
2621 51/push-ecx
2622
2623 e8/call parse-datum-of-word/disp32
2624
2625 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2626
2627 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2628
2629 ba/copy-to-edx 1/imm32/true
2630
2631 e9/jump $emit-modrm:loop/disp32
2632 $emit-modrm:check-for-x32:
2633
2634
2635
2636 68/push "x32"/imm32
2637 51/push-ecx
2638
2639 e8/call has-metadata?/disp32
2640
2641 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2642
2643 3d/compare-eax-and 0/imm32/false
2644 74/jump-if-= $emit-modrm:check-for-subop/disp8
2645 $emit-modrm:x32:
2646
2647
2648
2649 51/push-ecx
2650
2651 e8/call parse-datum-of-word/disp32
2652
2653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2654
2655 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2656
2657 ba/copy-to-edx 1/imm32/true
2658
2659 e9/jump $emit-modrm:loop/disp32
2660 $emit-modrm:check-for-subop:
2661
2662
2663
2664 68/push "subop"/imm32
2665 51/push-ecx
2666
2667 e8/call has-metadata?/disp32
2668
2669 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2670
2671 3d/compare-eax-and 0/imm32/false
2672 0f 84/jump-if-= $emit-modrm:loop/disp32
2673 $emit-modrm:subop:
2674
2675
2676
2677 51/push-ecx
2678
2679 e8/call parse-datum-of-word/disp32
2680
2681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2682
2683 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2684
2685 ba/copy-to-edx 1/imm32/true
2686
2687 e9/jump $emit-modrm:loop/disp32
2688 $emit-modrm:break:
2689
2690 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2691 74/jump-if-= $emit-modrm:end/disp8
2692 $emit-modrm:calculate:
2693
2694 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2695
2696 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2697
2698 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2699 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2700
2701 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2702
2703 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2704 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2705 $emit-modrm:emit:
2706
2707
2708 68/push 1/imm32
2709 53/push-ebx
2710 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2711
2712 e8/call emit-hex/disp32
2713
2714 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2715 $emit-modrm:end:
2716
2717 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2718
2719 5f/pop-to-edi
2720 5e/pop-to-esi
2721 5b/pop-to-ebx
2722 5a/pop-to-edx
2723 59/pop-to-ecx
2724 58/pop-to-eax
2725
2726 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2727 5d/pop-to-ebp
2728 c3/return
2729
2730 emit-sib:
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756 55/push-ebp
2757 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2758
2759 50/push-eax
2760 51/push-ecx
2761 52/push-edx
2762 53/push-ebx
2763 56/push-esi
2764 57/push-edi
2765
2766 68/push 0/imm32/end
2767 68/push 0/imm32/start
2768 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2769
2770 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2771
2772 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2773
2774 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2775
2776 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2777
2778
2779 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2780
2781 e8/call rewind-stream/disp32
2782
2783 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2784 $emit-sib:loop:
2785 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
2811
2812
2813 51/push-ecx
2814 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2815
2816 e8/call next-word/disp32
2817
2818 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2819 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
2859 $emit-sib:check0:
2860
2861
2862
2863 51/push-ecx
2864
2865 e8/call slice-empty?/disp32
2866
2867 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2868
2869 3d/compare-eax-and 0/imm32/false
2870 0f 85/jump-if-!= $emit-sib:break/disp32
2871 $emit-sib:check1:
2872
2873
2874 52/push-edx
2875
2876 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2877
2878 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2879 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2880
2881 5a/pop-to-edx
2882
2883 3d/compare-eax-and 0x23/imm32/hash
2884 0f 84/jump-if-= $emit-sib:break/disp32
2885 $emit-sib:check-for-scale:
2886
2887
2888
2889 68/push "scale"/imm32
2890 51/push-ecx
2891
2892 e8/call has-metadata?/disp32
2893
2894 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2895
2896 3d/compare-eax-and 0/imm32/false
2897 74/jump-if-= $emit-sib:check-for-base/disp8
2898 $emit-sib:scale:
2899
2900
2901
2902 51/push-ecx
2903
2904 e8/call parse-datum-of-word/disp32
2905
2906 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2907
2908 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2909
2910 ba/copy-to-edx 1/imm32/true
2911
2912 e9/jump $emit-sib:loop/disp32
2913 $emit-sib:check-for-base:
2914
2915
2916
2917 68/push "base"/imm32
2918 51/push-ecx
2919
2920 e8/call has-metadata?/disp32
2921
2922 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2923
2924 3d/compare-eax-and 0/imm32/false
2925 74/jump-if-= $emit-sib:check-for-index/disp8
2926 $emit-sib:base:
2927
2928
2929
2930 51/push-ecx
2931
2932 e8/call parse-datum-of-word/disp32
2933
2934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2935
2936 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2937
2938 ba/copy-to-edx 1/imm32/true
2939
2940 e9/jump $emit-sib:loop/disp32
2941 $emit-sib:check-for-index:
2942
2943
2944
2945 68/push "index"/imm32
2946 51/push-ecx
2947
2948 e8/call has-metadata?/disp32
2949
2950 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2951
2952 3d/compare-eax-and 0/imm32/false
2953 0f 84/jump-if-= $emit-sib:loop/disp32
2954 $emit-sib:index:
2955
2956
2957
2958 51/push-ecx
2959
2960 e8/call parse-datum-of-word/disp32
2961
2962 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2963
2964 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2965
2966 ba/copy-to-edx 1/imm32/true
2967
2968 e9/jump $emit-sib:loop/disp32
2969 $emit-sib:break:
2970
2971 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2972 74/jump-if-= $emit-sib:end/disp8
2973 $emit-sib:calculate:
2974
2975 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2976
2977 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2978
2979 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2980 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2981
2982 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2983
2984 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2985 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2986 $emit-sib:emit:
2987
2988
2989 68/push 1/imm32
2990 53/push-ebx
2991 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2992
2993 e8/call emit-hex/disp32
2994
2995 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2996 $emit-sib:end:
2997
2998 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2999
3000 5f/pop-to-edi
3001 5e/pop-to-esi
3002 5b/pop-to-ebx
3003 5a/pop-to-edx
3004 59/pop-to-ecx
3005 58/pop-to-eax
3006
3007 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3008 5d/pop-to-ebp
3009 c3/return
3010
3011 emit-disp:
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030 55/push-ebp
3031 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3032
3033 50/push-eax
3034 51/push-ecx
3035 52/push-edx
3036
3037 68/push 0/imm32/end
3038 68/push 0/imm32/start
3039 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3040
3041
3042 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3043
3044 e8/call rewind-stream/disp32
3045
3046 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3047 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
3073 $emit-disp:loop:
3074
3075
3076 51/push-ecx
3077 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3078
3079 e8/call next-word/disp32
3080
3081 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3082 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
3122 $emit-disp:check0:
3123
3124
3125
3126 51/push-ecx
3127
3128 e8/call slice-empty?/disp32
3129
3130 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3131
3132 3d/compare-eax-and 0/imm32/false
3133 0f 85/jump-if-!= $emit-disp:break/disp32
3134 $emit-disp:check1:
3135
3136
3137 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3138
3139 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3140 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3141
3142 3d/compare-eax-and 0x23/imm32/hash
3143 0f 84/jump-if-= $emit-disp:break/disp32
3144 $emit-disp:check-for-disp32:
3145
3146
3147
3148 68/push "disp32"/imm32
3149 51/push-ecx
3150
3151 e8/call has-metadata?/disp32
3152
3153 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3154
3155 3d/compare-eax-and 0/imm32/false
3156 74/jump-if-= $emit-disp:check-for-disp16/disp8
3157 $emit-disp:disp32:
3158
3159
3160 68/push 4/imm32
3161 51/push-ecx
3162 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3163
3164 e8/call emit/disp32
3165
3166 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3167
3168 e9/jump $emit-disp:break/disp32
3169 $emit-disp:check-for-disp16:
3170
3171
3172
3173 68/push "disp16"/imm32
3174 51/push-ecx
3175
3176 e8/call has-metadata?/disp32
3177
3178 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3179
3180 3d/compare-eax-and 0/imm32/false
3181 74/jump-if-= $emit-disp:check-for-disp8/disp8
3182 $emit-disp:disp16:
3183
3184
3185 68/push 2/imm32
3186 51/push-ecx
3187 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3188
3189 e8/call emit/disp32
3190
3191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3192
3193 e9/jump $emit-disp:break/disp32
3194 $emit-disp:check-for-disp8:
3195
3196
3197
3198 68/push "disp8"/imm32
3199 51/push-ecx
3200
3201 e8/call has-metadata?/disp32
3202
3203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3204
3205 3d/compare-eax-and 0/imm32/false
3206 0f 84/jump-if-= $emit-disp:loop/disp32
3207 $emit-disp:disp8:
3208
3209
3210 68/push 1/imm32
3211 51/push-ecx
3212 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3213
3214 e8/call emit/disp32
3215
3216 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3217
3218 $emit-disp:break:
3219
3220 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3221
3222 5a/pop-to-edx
3223 59/pop-to-ecx
3224 58/pop-to-eax
3225
3226 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3227 5d/pop-to-ebp
3228 c3/return
3229
3230 emit-imm:
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249 55/push-ebp
3250 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3251
3252 50/push-eax
3253 51/push-ecx
3254 52/push-edx
3255
3256 68/push 0/imm32/end
3257 68/push 0/imm32/start
3258 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3259
3260
3261 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3262
3263 e8/call rewind-stream/disp32
3264
3265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3266 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
3292 $emit-imm:loop:
3293
3294
3295 51/push-ecx
3296 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3297
3298 e8/call next-word/disp32
3299
3300 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3301 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
3341 $emit-imm:check0:
3342
3343
3344
3345 51/push-ecx
3346
3347 e8/call slice-empty?/disp32
3348
3349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3350
3351 3d/compare-eax-and 0/imm32/false
3352 0f 85/jump-if-!= $emit-imm:break/disp32
3353 $emit-imm:check1:
3354
3355
3356 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3357
3358 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3359 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3360
3361 3d/compare-eax-and 0x23/imm32/hash
3362 0f 84/jump-if-= $emit-imm:break/disp32
3363 $emit-imm:check-for-imm32:
3364
3365
3366
3367 68/push "imm32"/imm32
3368 51/push-ecx
3369
3370 e8/call has-metadata?/disp32
3371
3372 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3373
3374 3d/compare-eax-and 0/imm32/false
3375 74/jump-if-= $emit-imm:check-for-imm16/disp8
3376 $emit-imm:imm32:
3377
3378
3379 68/push 4/imm32
3380 51/push-ecx
3381 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3382
3383 e8/call emit/disp32
3384
3385 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3386
3387 e9/jump $emit-imm:break/disp32
3388 $emit-imm:check-for-imm16:
3389
3390
3391
3392 68/push "imm16"/imm32
3393 51/push-ecx
3394
3395 e8/call has-metadata?/disp32
3396
3397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3398
3399 3d/compare-eax-and 0/imm32/false
3400 74/jump-if-= $emit-imm:check-for-imm8/disp8
3401 $emit-imm:imm16:
3402
3403
3404 68/push 2/imm32
3405 51/push-ecx
3406 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3407
3408 e8/call emit/disp32
3409
3410 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3411
3412 e9/jump $emit-imm:break/disp32
3413 $emit-imm:check-for-imm8:
3414
3415
3416
3417 68/push "imm8"/imm32
3418 51/push-ecx
3419
3420 e8/call has-metadata?/disp32
3421
3422 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3423
3424 3d/compare-eax-and 0/imm32/false
3425 0f 84/jump-if-= $emit-imm:loop/disp32
3426 $emit-imm:imm8:
3427
3428
3429 68/push 1/imm32
3430 51/push-ecx
3431 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3432
3433 e8/call emit/disp32
3434
3435 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3436
3437 $emit-imm:break:
3438
3439 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3440
3441 5a/pop-to-edx
3442 59/pop-to-ecx
3443 58/pop-to-eax
3444
3445 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3446 5d/pop-to-ebp
3447 c3/return
3448
3449 emit-line-in-comment:
3450
3451 55/push-ebp
3452 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3453
3454
3455 68/push " # "/imm32
3456 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3457
3458 e8/call write-buffered/disp32
3459
3460 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3461
3462
3463 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3464 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3465
3466 e8/call write-stream-data/disp32
3467
3468 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3469 $emit-line-in-comment:end:
3470
3471 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3472 5d/pop-to-ebp
3473 c3/return
3474
3475 test-convert-instruction-passes-comments-through:
3476
3477
3478 55/push-ebp
3479 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3480
3481
3482
3483 68/push _test-input-stream/imm32
3484
3485 e8/call clear-stream/disp32
3486
3487 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3488
3489
3490 68/push _test-output-stream/imm32
3491
3492 e8/call clear-stream/disp32
3493
3494 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3495
3496
3497 68/push $_test-output-buffered-file->buffer/imm32
3498
3499 e8/call clear-stream/disp32
3500
3501 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3502
3503
3504
3505 68/push "# abcd"/imm32
3506 68/push _test-input-stream/imm32
3507
3508 e8/call write/disp32
3509
3510 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3511
3512
3513 68/push _test-output-buffered-file/imm32
3514 68/push _test-input-stream/imm32
3515
3516 e8/call convert-instruction/disp32
3517
3518 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3519
3520
3521
3522 68/push _test-output-buffered-file/imm32
3523
3524 e8/call flush/disp32
3525
3526 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3527
3528
3529 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3530 68/push "# abcd"/imm32
3531 68/push _test-output-stream/imm32
3532
3533 e8/call check-stream-equal/disp32
3534
3535 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3536
3537 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3538 5d/pop-to-ebp
3539 c3/return
3540
3541 test-convert-instruction-passes-labels-through:
3542
3543
3544 55/push-ebp
3545 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3546
3547
3548
3549 68/push _test-input-stream/imm32
3550
3551 e8/call clear-stream/disp32
3552
3553 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3554
3555
3556 68/push _test-output-stream/imm32
3557
3558 e8/call clear-stream/disp32
3559
3560 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3561
3562
3563 68/push $_test-output-buffered-file->buffer/imm32
3564
3565 e8/call clear-stream/disp32
3566
3567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3568
3569
3570
3571 68/push "ab: # cd"/imm32
3572 68/push _test-input-stream/imm32
3573
3574 e8/call write/disp32
3575
3576 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3577
3578
3579 68/push _test-output-buffered-file/imm32
3580 68/push _test-input-stream/imm32
3581
3582 e8/call convert-instruction/disp32
3583
3584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3585
3586
3587
3588 68/push _test-output-buffered-file/imm32
3589
3590 e8/call flush/disp32
3591
3592 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3593
3594
3595 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3596 68/push "ab: # cd"/imm32
3597 68/push _test-output-stream/imm32
3598
3599 e8/call check-stream-equal/disp32
3600
3601 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3602
3603 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3604 5d/pop-to-ebp
3605 c3/return
3606
3607 test-convert-instruction-handles-single-opcode:
3608
3609
3610 55/push-ebp
3611 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3612
3613
3614
3615 68/push _test-input-stream/imm32
3616
3617 e8/call clear-stream/disp32
3618
3619 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3620
3621
3622 68/push _test-output-stream/imm32
3623
3624 e8/call clear-stream/disp32
3625
3626 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3627
3628
3629 68/push $_test-output-buffered-file->buffer/imm32
3630
3631 e8/call clear-stream/disp32
3632
3633 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3634
3635
3636
3637 68/push "ab/cd # comment"/imm32
3638 68/push _test-input-stream/imm32
3639
3640 e8/call write/disp32
3641
3642 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3643
3644
3645 68/push _test-output-buffered-file/imm32
3646 68/push _test-input-stream/imm32
3647
3648 e8/call convert-instruction/disp32
3649
3650 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3651
3652
3653
3654 68/push _test-output-buffered-file/imm32
3655
3656 e8/call flush/disp32
3657
3658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3659 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
3685
3686
3687 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3688 68/push "ab # ab/cd # comment"/imm32
3689 68/push _test-output-stream/imm32
3690
3691 e8/call check-stream-equal/disp32
3692
3693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3694
3695 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3696 5d/pop-to-ebp
3697 c3/return
3698
3699 test-convert-instruction-handles-0f-opcode:
3700
3701
3702 55/push-ebp
3703 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3704
3705
3706
3707 68/push _test-input-stream/imm32
3708
3709 e8/call clear-stream/disp32
3710
3711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3712
3713
3714 68/push _test-output-stream/imm32
3715
3716 e8/call clear-stream/disp32
3717
3718 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3719
3720
3721 68/push $_test-output-buffered-file->buffer/imm32
3722
3723 e8/call clear-stream/disp32
3724
3725 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3726
3727
3728
3729 68/push "0f/m1 ab/m2 # comment"/imm32
3730 68/push _test-input-stream/imm32
3731
3732 e8/call write/disp32
3733
3734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3735
3736
3737 68/push _test-output-buffered-file/imm32
3738 68/push _test-input-stream/imm32
3739
3740 e8/call convert-instruction/disp32
3741
3742 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3743
3744
3745
3746 68/push _test-output-buffered-file/imm32
3747
3748 e8/call flush/disp32
3749
3750 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3751 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
3777
3778
3779 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3780 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3781 68/push _test-output-stream/imm32
3782
3783 e8/call check-stream-equal/disp32
3784
3785 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3786
3787 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3788 5d/pop-to-ebp
3789 c3/return
3790
3791 test-convert-instruction-handles-f2-opcode:
3792
3793
3794 55/push-ebp
3795 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3796
3797
3798
3799 68/push _test-input-stream/imm32
3800
3801 e8/call clear-stream/disp32
3802
3803 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3804
3805
3806 68/push _test-output-stream/imm32
3807
3808 e8/call clear-stream/disp32
3809
3810 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3811
3812
3813 68/push $_test-output-buffered-file->buffer/imm32
3814
3815 e8/call clear-stream/disp32
3816
3817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3818
3819
3820
3821 68/push "f2/m1 ab/m2 # comment"/imm32
3822 68/push _test-input-stream/imm32
3823
3824 e8/call write/disp32
3825
3826 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3827
3828
3829 68/push _test-output-buffered-file/imm32
3830 68/push _test-input-stream/imm32
3831
3832 e8/call convert-instruction/disp32
3833
3834 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3835
3836
3837
3838 68/push _test-output-buffered-file/imm32
3839
3840 e8/call flush/disp32
3841
3842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3843 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
3869
3870
3871 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3872 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3873 68/push _test-output-stream/imm32
3874
3875 e8/call check-stream-equal/disp32
3876
3877 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3878
3879 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3880 5d/pop-to-ebp
3881 c3/return
3882
3883 test-convert-instruction-handles-f3-opcode:
3884
3885
3886 55/push-ebp
3887 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3888
3889
3890
3891 68/push _test-input-stream/imm32
3892
3893 e8/call clear-stream/disp32
3894
3895 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3896
3897
3898 68/push _test-output-stream/imm32
3899
3900 e8/call clear-stream/disp32
3901
3902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3903
3904
3905 68/push $_test-output-buffered-file->buffer/imm32
3906
3907 e8/call clear-stream/disp32
3908
3909 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3910
3911
3912
3913 68/push "f3/m1 ab/m2 # comment"/imm32
3914 68/push _test-input-stream/imm32
3915
3916 e8/call write/disp32
3917
3918 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3919
3920
3921 68/push _test-output-buffered-file/imm32
3922 68/push _test-input-stream/imm32
3923
3924 e8/call convert-instruction/disp32
3925
3926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3927
3928
3929
3930 68/push _test-output-buffered-file/imm32
3931
3932 e8/call flush/disp32
3933
3934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3935 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
3961
3962
3963 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3964 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3965 68/push _test-output-stream/imm32
3966
3967 e8/call check-stream-equal/disp32
3968
3969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3970
3971 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3972 5d/pop-to-ebp
3973 c3/return
3974
3975 test-convert-instruction-handles-f2-0f-opcode:
3976
3977
3978 55/push-ebp
3979 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3980
3981
3982
3983 68/push _test-input-stream/imm32
3984
3985 e8/call clear-stream/disp32
3986
3987 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3988
3989
3990 68/push _test-output-stream/imm32
3991
3992 e8/call clear-stream/disp32
3993
3994 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3995
3996
3997 68/push $_test-output-buffered-file->buffer/imm32
3998
3999 e8/call clear-stream/disp32
4000
4001 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4002
4003
4004
4005 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
4006 68/push _test-input-stream/imm32
4007
4008 e8/call write/disp32
4009
4010 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4011
4012
4013 68/push _test-output-buffered-file/imm32
4014 68/push _test-input-stream/imm32
4015
4016 e8/call convert-instruction/disp32
4017
4018 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4019
4020
4021
4022 68/push _test-output-buffered-file/imm32
4023
4024 e8/call flush/disp32
4025
4026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4027 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4053
4054
4055 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
4056 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
4057 68/push _test-output-stream/imm32
4058
4059 e8/call check-stream-equal/disp32
4060
4061 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4062
4063 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4064 5d/pop-to-ebp
4065 c3/return
4066
4067 test-convert-instruction-handles-f3-0f-opcode:
4068
4069
4070 55/push-ebp
4071 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4072
4073
4074
4075 68/push _test-input-stream/imm32
4076
4077 e8/call clear-stream/disp32
4078
4079 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4080
4081
4082 68/push _test-output-stream/imm32
4083
4084 e8/call clear-stream/disp32
4085
4086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4087
4088
4089 68/push $_test-output-buffered-file->buffer/imm32
4090
4091 e8/call clear-stream/disp32
4092
4093 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4094
4095
4096
4097 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
4098 68/push _test-input-stream/imm32
4099
4100 e8/call write/disp32
4101
4102 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4103
4104
4105 68/push _test-output-buffered-file/imm32
4106 68/push _test-input-stream/imm32
4107
4108 e8/call convert-instruction/disp32
4109
4110 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4111
4112
4113
4114 68/push _test-output-buffered-file/imm32
4115
4116 e8/call flush/disp32
4117
4118 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4119 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4145
4146
4147 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
4148 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
4149 68/push _test-output-stream/imm32
4150
4151 e8/call check-stream-equal/disp32
4152
4153 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4154
4155 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4156 5d/pop-to-ebp
4157 c3/return
4158
4159 test-convert-instruction-handles-unused-opcodes:
4160
4161
4162 55/push-ebp
4163 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4164
4165
4166
4167 68/push _test-input-stream/imm32
4168
4169 e8/call clear-stream/disp32
4170
4171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4172
4173
4174 68/push _test-output-stream/imm32
4175
4176 e8/call clear-stream/disp32
4177
4178 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4179
4180
4181 68/push $_test-output-buffered-file->buffer/imm32
4182
4183 e8/call clear-stream/disp32
4184
4185 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4186
4187
4188
4189 68/push "ab/m1 cd/m2 # comment"/imm32
4190 68/push _test-input-stream/imm32
4191
4192 e8/call write/disp32
4193
4194 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4195
4196
4197 68/push _test-output-buffered-file/imm32
4198 68/push _test-input-stream/imm32
4199
4200 e8/call convert-instruction/disp32
4201
4202 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4203
4204
4205
4206 68/push _test-output-buffered-file/imm32
4207
4208 e8/call flush/disp32
4209
4210 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4211 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4237
4238
4239 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4240 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4241 68/push _test-output-stream/imm32
4242
4243 e8/call check-stream-equal/disp32
4244
4245 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4246
4247 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4248 5d/pop-to-ebp
4249 c3/return
4250
4251 test-convert-instruction-handles-unused-second-opcodes:
4252
4253
4254 55/push-ebp
4255 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4256
4257
4258
4259 68/push _test-input-stream/imm32
4260
4261 e8/call clear-stream/disp32
4262
4263 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4264
4265
4266 68/push _test-output-stream/imm32
4267
4268 e8/call clear-stream/disp32
4269
4270 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4271
4272
4273 68/push $_test-output-buffered-file->buffer/imm32
4274
4275 e8/call clear-stream/disp32
4276
4277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4278
4279
4280
4281 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4282 68/push _test-input-stream/imm32
4283
4284 e8/call write/disp32
4285
4286 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4287
4288
4289 68/push _test-output-buffered-file/imm32
4290 68/push _test-input-stream/imm32
4291
4292 e8/call convert-instruction/disp32
4293
4294 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4295
4296
4297
4298 68/push _test-output-buffered-file/imm32
4299
4300 e8/call flush/disp32
4301
4302 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4303 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4329
4330
4331 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4332 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4333 68/push _test-output-stream/imm32
4334
4335 e8/call check-stream-equal/disp32
4336
4337 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4338
4339 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4340 5d/pop-to-ebp
4341 c3/return
4342
4343 test-convert-instruction-handles-unused-second-opcodes-2:
4344
4345
4346 55/push-ebp
4347 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4348
4349
4350
4351 68/push _test-input-stream/imm32
4352
4353 e8/call clear-stream/disp32
4354
4355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4356
4357
4358 68/push _test-output-stream/imm32
4359
4360 e8/call clear-stream/disp32
4361
4362 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4363
4364
4365 68/push $_test-output-buffered-file->buffer/imm32
4366
4367 e8/call clear-stream/disp32
4368
4369 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4370
4371
4372
4373 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4374 68/push _test-input-stream/imm32
4375
4376 e8/call write/disp32
4377
4378 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4379
4380
4381 68/push _test-output-buffered-file/imm32
4382 68/push _test-input-stream/imm32
4383
4384 e8/call convert-instruction/disp32
4385
4386 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4387
4388
4389
4390 68/push _test-output-buffered-file/imm32
4391
4392 e8/call flush/disp32
4393
4394 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4395 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4421
4422
4423 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4424 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4425 68/push _test-output-stream/imm32
4426
4427 e8/call check-stream-equal/disp32
4428
4429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4430
4431 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4432 5d/pop-to-ebp
4433 c3/return
4434
4435 test-convert-instruction-emits-modrm-byte:
4436
4437
4438 55/push-ebp
4439 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4440
4441
4442
4443 68/push _test-input-stream/imm32
4444
4445 e8/call clear-stream/disp32
4446
4447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4448
4449
4450 68/push _test-output-stream/imm32
4451
4452 e8/call clear-stream/disp32
4453
4454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4455
4456
4457 68/push $_test-output-buffered-file->buffer/imm32
4458
4459 e8/call clear-stream/disp32
4460
4461 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4462
4463
4464
4465 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4466 68/push _test-input-stream/imm32
4467
4468 e8/call write/disp32
4469
4470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4471
4472
4473 68/push _test-output-buffered-file/imm32
4474 68/push _test-input-stream/imm32
4475
4476 e8/call convert-instruction/disp32
4477
4478 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4479
4480
4481
4482 68/push _test-output-buffered-file/imm32
4483
4484 e8/call flush/disp32
4485
4486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4487 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4513
4514
4515 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4516 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4517 68/push _test-output-stream/imm32
4518
4519 e8/call check-stream-equal/disp32
4520
4521 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4522
4523 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4524 5d/pop-to-ebp
4525 c3/return
4526
4527 test-convert-instruction-emits-modrm-byte-with-non-zero-mod:
4528
4529 55/push-ebp
4530 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4531
4532
4533
4534 68/push _test-input-stream/imm32
4535
4536 e8/call clear-stream/disp32
4537
4538 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4539
4540
4541 68/push _test-output-stream/imm32
4542
4543 e8/call clear-stream/disp32
4544
4545 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4546
4547
4548 68/push $_test-output-buffered-file->buffer/imm32
4549
4550 e8/call clear-stream/disp32
4551
4552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4553
4554
4555
4556 68/push "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4557 68/push _test-input-stream/imm32
4558
4559 e8/call write/disp32
4560
4561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4562
4563
4564 68/push _test-output-buffered-file/imm32
4565 68/push _test-input-stream/imm32
4566
4567 e8/call convert-instruction/disp32
4568
4569 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4570
4571
4572 68/push _test-output-buffered-file/imm32
4573
4574 e8/call flush/disp32
4575
4576 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4577 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4603
4604
4605
4606 68/push "F - test-convert-instruction-foo"/imm32
4607 68/push "01 cb # 01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4608 68/push _test-output-stream/imm32
4609
4610 e8/call check-stream-equal/disp32
4611
4612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4613
4614 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4615 5d/pop-to-ebp
4616 c3/return
4617
4618 test-convert-instruction-emits-modrm-byte-from-subop:
4619
4620
4621 55/push-ebp
4622 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4623
4624
4625
4626 68/push _test-input-stream/imm32
4627
4628 e8/call clear-stream/disp32
4629
4630 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4631
4632
4633 68/push _test-output-stream/imm32
4634
4635 e8/call clear-stream/disp32
4636
4637 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4638
4639
4640 68/push $_test-output-buffered-file->buffer/imm32
4641
4642 e8/call clear-stream/disp32
4643
4644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4645
4646
4647
4648 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4649 68/push _test-input-stream/imm32
4650
4651 e8/call write/disp32
4652
4653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4654
4655
4656 68/push _test-output-buffered-file/imm32
4657 68/push _test-input-stream/imm32
4658
4659 e8/call convert-instruction/disp32
4660
4661 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4662
4663
4664
4665 68/push _test-output-buffered-file/imm32
4666
4667 e8/call flush/disp32
4668
4669 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4670 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4696
4697
4698 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4699 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4700 68/push _test-output-stream/imm32
4701
4702 e8/call check-stream-equal/disp32
4703
4704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4705
4706 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4707 5d/pop-to-ebp
4708 c3/return
4709
4710 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4711
4712
4713 55/push-ebp
4714 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4715
4716
4717
4718 68/push _test-input-stream/imm32
4719
4720 e8/call clear-stream/disp32
4721
4722 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4723
4724
4725 68/push _test-output-stream/imm32
4726
4727 e8/call clear-stream/disp32
4728
4729 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4730
4731
4732 68/push $_test-output-buffered-file->buffer/imm32
4733
4734 e8/call clear-stream/disp32
4735
4736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4737
4738
4739
4740 68/push "8b/copy 0/rm32 1/r32"/imm32
4741 68/push _test-input-stream/imm32
4742
4743 e8/call write/disp32
4744
4745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4746
4747
4748 68/push _test-output-buffered-file/imm32
4749 68/push _test-input-stream/imm32
4750
4751 e8/call convert-instruction/disp32
4752
4753 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4754
4755
4756
4757 68/push _test-output-buffered-file/imm32
4758
4759 e8/call flush/disp32
4760
4761 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4762 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4788
4789
4790 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4791 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4792 68/push _test-output-stream/imm32
4793
4794 e8/call check-stream-equal/disp32
4795
4796 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4797
4798 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4799 5d/pop-to-ebp
4800 c3/return
4801
4802 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4803
4804
4805 55/push-ebp
4806 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4807
4808
4809
4810 68/push _test-input-stream/imm32
4811
4812 e8/call clear-stream/disp32
4813
4814 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4815
4816
4817 68/push _test-output-stream/imm32
4818
4819 e8/call clear-stream/disp32
4820
4821 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4822
4823
4824 68/push $_test-output-buffered-file->buffer/imm32
4825
4826 e8/call clear-stream/disp32
4827
4828 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4829
4830
4831
4832 68/push "8b/copy 0/mod 1/r32"/imm32
4833 68/push _test-input-stream/imm32
4834
4835 e8/call write/disp32
4836
4837 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4838
4839
4840 68/push _test-output-buffered-file/imm32
4841 68/push _test-input-stream/imm32
4842
4843 e8/call convert-instruction/disp32
4844
4845 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4846
4847
4848
4849 68/push _test-output-buffered-file/imm32
4850
4851 e8/call flush/disp32
4852
4853 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4854 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4880
4881
4882 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4883 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4884 68/push _test-output-stream/imm32
4885
4886 e8/call check-stream-equal/disp32
4887
4888 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4889
4890 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4891 5d/pop-to-ebp
4892 c3/return
4893
4894 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4895
4896
4897 55/push-ebp
4898 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4899
4900
4901
4902 68/push _test-input-stream/imm32
4903
4904 e8/call clear-stream/disp32
4905
4906 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4907
4908
4909 68/push _test-output-stream/imm32
4910
4911 e8/call clear-stream/disp32
4912
4913 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4914
4915
4916 68/push $_test-output-buffered-file->buffer/imm32
4917
4918 e8/call clear-stream/disp32
4919
4920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4921
4922
4923
4924 68/push "8b/copy 0/mod 0/rm32"/imm32
4925 68/push _test-input-stream/imm32
4926
4927 e8/call write/disp32
4928
4929 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4930
4931
4932 68/push _test-output-buffered-file/imm32
4933 68/push _test-input-stream/imm32
4934
4935 e8/call convert-instruction/disp32
4936
4937 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4938
4939
4940
4941 68/push _test-output-buffered-file/imm32
4942
4943 e8/call flush/disp32
4944
4945 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4946 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
4972
4973
4974 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4975 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4976 68/push _test-output-stream/imm32
4977
4978 e8/call check-stream-equal/disp32
4979
4980 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4981
4982 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4983 5d/pop-to-ebp
4984 c3/return
4985
4986 test-convert-instruction-emits-sib-byte:
4987
4988
4989 55/push-ebp
4990 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4991
4992
4993
4994 68/push _test-input-stream/imm32
4995
4996 e8/call clear-stream/disp32
4997
4998 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4999
5000
5001 68/push _test-output-stream/imm32
5002
5003 e8/call clear-stream/disp32
5004
5005 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5006
5007
5008 68/push $_test-output-buffered-file->buffer/imm32
5009
5010 e8/call clear-stream/disp32
5011
5012 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5013
5014
5015
5016 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
5017 68/push _test-input-stream/imm32
5018
5019 e8/call write/disp32
5020
5021 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5022
5023
5024 68/push _test-output-buffered-file/imm32
5025 68/push _test-input-stream/imm32
5026
5027 e8/call convert-instruction/disp32
5028
5029 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5030
5031
5032
5033 68/push _test-output-buffered-file/imm32
5034
5035 e8/call flush/disp32
5036
5037 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5038 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5064
5065
5066 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
5067 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
5068 68/push _test-output-stream/imm32
5069
5070 e8/call check-stream-equal/disp32
5071
5072 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5073
5074 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5075 5d/pop-to-ebp
5076 c3/return
5077
5078 test-convert-instruction-emits-scale:
5079
5080
5081 55/push-ebp
5082 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5083
5084
5085
5086 68/push _test-input-stream/imm32
5087
5088 e8/call clear-stream/disp32
5089
5090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5091
5092
5093 68/push _test-output-stream/imm32
5094
5095 e8/call clear-stream/disp32
5096
5097 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5098
5099
5100 68/push $_test-output-buffered-file->buffer/imm32
5101
5102 e8/call clear-stream/disp32
5103
5104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5105
5106
5107
5108 68/push "8b/copy 0/mod 4/rm32 1/scale"/imm32
5109 68/push _test-input-stream/imm32
5110
5111 e8/call write/disp32
5112
5113 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5114
5115
5116 68/push _test-output-buffered-file/imm32
5117 68/push _test-input-stream/imm32
5118
5119 e8/call convert-instruction/disp32
5120
5121 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5122
5123
5124
5125 68/push _test-output-buffered-file/imm32
5126
5127 e8/call flush/disp32
5128
5129 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5130 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5156
5157
5158 68/push "F - test-convert-instruction-emits-scale"/imm32
5159 68/push "8b 04 40 # 8b/copy 0/mod 4/rm32 1/scale"/imm32
5160 68/push _test-output-stream/imm32
5161
5162 e8/call check-stream-equal/disp32
5163
5164 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5165
5166 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5167 5d/pop-to-ebp
5168 c3/return
5169
5170 test-convert-instruction-emits-sib-byte-with-missing-base:
5171
5172
5173 55/push-ebp
5174 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5175
5176
5177
5178 68/push _test-input-stream/imm32
5179
5180 e8/call clear-stream/disp32
5181
5182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5183
5184
5185 68/push _test-output-stream/imm32
5186
5187 e8/call clear-stream/disp32
5188
5189 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5190
5191
5192 68/push $_test-output-buffered-file->buffer/imm32
5193
5194 e8/call clear-stream/disp32
5195
5196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5197
5198
5199
5200 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5201 68/push _test-input-stream/imm32
5202
5203 e8/call write/disp32
5204
5205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5206
5207
5208 68/push _test-output-buffered-file/imm32
5209 68/push _test-input-stream/imm32
5210
5211 e8/call convert-instruction/disp32
5212
5213 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5214
5215
5216
5217 68/push _test-output-buffered-file/imm32
5218
5219 e8/call flush/disp32
5220
5221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5222 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5248
5249
5250 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
5251 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
5252 68/push _test-output-stream/imm32
5253
5254 e8/call check-stream-equal/disp32
5255
5256 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5257
5258 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5259 5d/pop-to-ebp
5260 c3/return
5261
5262 test-convert-instruction-emits-sib-byte-with-missing-index:
5263
5264
5265 55/push-ebp
5266 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5267
5268
5269
5270 68/push _test-input-stream/imm32
5271
5272 e8/call clear-stream/disp32
5273
5274 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5275
5276
5277 68/push _test-output-stream/imm32
5278
5279 e8/call clear-stream/disp32
5280
5281 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5282
5283
5284 68/push $_test-output-buffered-file->buffer/imm32
5285
5286 e8/call clear-stream/disp32
5287
5288 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5289
5290
5291
5292 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5293 68/push _test-input-stream/imm32
5294
5295 e8/call write/disp32
5296
5297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5298
5299
5300 68/push _test-output-buffered-file/imm32
5301 68/push _test-input-stream/imm32
5302
5303 e8/call convert-instruction/disp32
5304
5305 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5306
5307
5308
5309 68/push _test-output-buffered-file/imm32
5310
5311 e8/call flush/disp32
5312
5313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5314 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5340
5341
5342 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5343 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5344 68/push _test-output-stream/imm32
5345
5346 e8/call check-stream-equal/disp32
5347
5348 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5349
5350 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5351 5d/pop-to-ebp
5352 c3/return
5353
5354 test-convert-instruction-emits-sib-byte-with-missing-scale:
5355
5356
5357 55/push-ebp
5358 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5359
5360
5361
5362 68/push _test-input-stream/imm32
5363
5364 e8/call clear-stream/disp32
5365
5366 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5367
5368
5369 68/push _test-output-stream/imm32
5370
5371 e8/call clear-stream/disp32
5372
5373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5374
5375
5376 68/push $_test-output-buffered-file->buffer/imm32
5377
5378 e8/call clear-stream/disp32
5379
5380 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5381
5382
5383
5384 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5385 68/push _test-input-stream/imm32
5386
5387 e8/call write/disp32
5388
5389 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5390
5391
5392 68/push _test-output-buffered-file/imm32
5393 68/push _test-input-stream/imm32
5394
5395 e8/call convert-instruction/disp32
5396
5397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5398
5399
5400
5401 68/push _test-output-buffered-file/imm32
5402
5403 e8/call flush/disp32
5404
5405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5406 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5432
5433
5434 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5435 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5436 68/push _test-output-stream/imm32
5437
5438 e8/call check-stream-equal/disp32
5439
5440 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5441
5442 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5443 5d/pop-to-ebp
5444 c3/return
5445
5446 test-convert-instruction-handles-disp32-operand:
5447
5448
5449 55/push-ebp
5450 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5451
5452
5453
5454 68/push _test-input-stream/imm32
5455
5456 e8/call clear-stream/disp32
5457
5458 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5459
5460
5461 68/push _test-output-stream/imm32
5462
5463 e8/call clear-stream/disp32
5464
5465 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5466
5467
5468 68/push $_test-output-buffered-file->buffer/imm32
5469
5470 e8/call clear-stream/disp32
5471
5472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5473
5474
5475
5476 68/push "e8/call 20/disp32"/imm32
5477 68/push _test-input-stream/imm32
5478
5479 e8/call write/disp32
5480
5481 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5482
5483
5484 68/push _test-output-buffered-file/imm32
5485 68/push _test-input-stream/imm32
5486
5487 e8/call convert-instruction/disp32
5488
5489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5490
5491
5492
5493 68/push _test-output-buffered-file/imm32
5494
5495 e8/call flush/disp32
5496
5497 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5498 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5524
5525
5526 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5527 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5528 68/push _test-output-stream/imm32
5529
5530 e8/call check-stream-equal/disp32
5531
5532 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5533
5534 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5535 5d/pop-to-ebp
5536 c3/return
5537
5538 test-convert-instruction-handles-disp16-operand:
5539
5540
5541 55/push-ebp
5542 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5543
5544
5545
5546 68/push _test-input-stream/imm32
5547
5548 e8/call clear-stream/disp32
5549
5550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5551
5552
5553 68/push _test-output-stream/imm32
5554
5555 e8/call clear-stream/disp32
5556
5557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5558
5559
5560 68/push $_test-output-buffered-file->buffer/imm32
5561
5562 e8/call clear-stream/disp32
5563
5564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5565
5566
5567
5568 68/push "e8/call 20/disp16"/imm32
5569 68/push _test-input-stream/imm32
5570
5571 e8/call write/disp32
5572
5573 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5574
5575
5576 68/push _test-output-buffered-file/imm32
5577 68/push _test-input-stream/imm32
5578
5579 e8/call convert-instruction/disp32
5580
5581 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5582
5583
5584
5585 68/push _test-output-buffered-file/imm32
5586
5587 e8/call flush/disp32
5588
5589 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5590 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5616
5617
5618 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5619 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5620 68/push _test-output-stream/imm32
5621
5622 e8/call check-stream-equal/disp32
5623
5624 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5625
5626 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5627 5d/pop-to-ebp
5628 c3/return
5629
5630 test-convert-instruction-handles-disp8-operand:
5631
5632
5633 55/push-ebp
5634 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5635
5636
5637
5638 68/push _test-input-stream/imm32
5639
5640 e8/call clear-stream/disp32
5641
5642 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5643
5644
5645 68/push _test-output-stream/imm32
5646
5647 e8/call clear-stream/disp32
5648
5649 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5650
5651
5652 68/push $_test-output-buffered-file->buffer/imm32
5653
5654 e8/call clear-stream/disp32
5655
5656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5657
5658
5659
5660 68/push "eb/jump 20/disp8"/imm32
5661 68/push _test-input-stream/imm32
5662
5663 e8/call write/disp32
5664
5665 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5666
5667
5668 68/push _test-output-buffered-file/imm32
5669 68/push _test-input-stream/imm32
5670
5671 e8/call convert-instruction/disp32
5672
5673 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5674
5675
5676
5677 68/push _test-output-buffered-file/imm32
5678
5679 e8/call flush/disp32
5680
5681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5682 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5708
5709
5710 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5711 68/push "eb 20 # eb/jump 20/disp8"/imm32
5712 68/push _test-output-stream/imm32
5713
5714 e8/call check-stream-equal/disp32
5715
5716 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5717
5718 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5719 5d/pop-to-ebp
5720 c3/return
5721
5722 test-convert-instruction-handles-disp8-name:
5723
5724
5725 55/push-ebp
5726 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5727
5728
5729
5730 68/push _test-input-stream/imm32
5731
5732 e8/call clear-stream/disp32
5733
5734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5735
5736
5737 68/push _test-output-stream/imm32
5738
5739 e8/call clear-stream/disp32
5740
5741 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5742
5743
5744 68/push $_test-output-buffered-file->buffer/imm32
5745
5746 e8/call clear-stream/disp32
5747
5748 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5749
5750
5751
5752 68/push "eb/jump xyz/disp8"/imm32
5753 68/push _test-input-stream/imm32
5754
5755 e8/call write/disp32
5756
5757 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5758
5759
5760 68/push _test-output-buffered-file/imm32
5761 68/push _test-input-stream/imm32
5762
5763 e8/call convert-instruction/disp32
5764
5765 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5766
5767
5768
5769 68/push _test-output-buffered-file/imm32
5770
5771 e8/call flush/disp32
5772
5773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5774 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5800
5801
5802 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5803 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5804 68/push _test-output-stream/imm32
5805
5806 e8/call check-stream-equal/disp32
5807
5808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5809
5810 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5811 5d/pop-to-ebp
5812 c3/return
5813
5814 test-convert-instruction-handles-imm32-operand:
5815
5816
5817 55/push-ebp
5818 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5819
5820
5821
5822 68/push _test-input-stream/imm32
5823
5824 e8/call clear-stream/disp32
5825
5826 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5827
5828
5829 68/push _test-output-stream/imm32
5830
5831 e8/call clear-stream/disp32
5832
5833 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5834
5835
5836 68/push $_test-output-buffered-file->buffer/imm32
5837
5838 e8/call clear-stream/disp32
5839
5840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5841
5842
5843
5844 68/push "68/push 0x20/imm32"/imm32
5845 68/push _test-input-stream/imm32
5846
5847 e8/call write/disp32
5848
5849 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5850
5851
5852 68/push _test-output-buffered-file/imm32
5853 68/push _test-input-stream/imm32
5854
5855 e8/call convert-instruction/disp32
5856
5857 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5858
5859
5860
5861 68/push _test-output-buffered-file/imm32
5862
5863 e8/call flush/disp32
5864
5865 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5866 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5892
5893
5894 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5895 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5896 68/push _test-output-stream/imm32
5897
5898 e8/call check-stream-equal/disp32
5899
5900 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5901
5902 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5903 5d/pop-to-ebp
5904 c3/return
5905
5906 test-convert-instruction-handles-imm16-operand:
5907
5908
5909
5910 55/push-ebp
5911 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5912
5913
5914
5915 68/push _test-input-stream/imm32
5916
5917 e8/call clear-stream/disp32
5918
5919 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5920
5921
5922 68/push _test-output-stream/imm32
5923
5924 e8/call clear-stream/disp32
5925
5926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5927
5928
5929 68/push $_test-output-buffered-file->buffer/imm32
5930
5931 e8/call clear-stream/disp32
5932
5933 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5934
5935
5936
5937 68/push "68/push 0x20/imm16"/imm32
5938 68/push _test-input-stream/imm32
5939
5940 e8/call write/disp32
5941
5942 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5943
5944
5945 68/push _test-output-buffered-file/imm32
5946 68/push _test-input-stream/imm32
5947
5948 e8/call convert-instruction/disp32
5949
5950 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5951
5952
5953
5954 68/push _test-output-buffered-file/imm32
5955
5956 e8/call flush/disp32
5957
5958 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5959 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
5985
5986
5987 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5988 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5989 68/push _test-output-stream/imm32
5990
5991 e8/call check-stream-equal/disp32
5992
5993 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5994
5995 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5996 5d/pop-to-ebp
5997 c3/return
5998
5999 test-convert-instruction-handles-imm8-operand:
6000
6001
6002
6003 55/push-ebp
6004 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
6005
6006
6007
6008 68/push _test-input-stream/imm32
6009
6010 e8/call clear-stream/disp32
6011
6012 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6013
6014
6015 68/push _test-output-stream/imm32
6016
6017 e8/call clear-stream/disp32
6018
6019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6020
6021
6022 68/push $_test-output-buffered-file->buffer/imm32
6023
6024 e8/call clear-stream/disp32
6025
6026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6027
6028
6029
6030 68/push "68/push 0x20/imm8"/imm32
6031 68/push _test-input-stream/imm32
6032
6033 e8/call write/disp32
6034
6035 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
6036
6037
6038 68/push _test-output-buffered-file/imm32
6039 68/push _test-input-stream/imm32
6040
6041 e8/call convert-instruction/disp32
6042
6043 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
6044
6045
6046
6047 68/push _test-output-buffered-file/imm32
6048
6049 e8/call flush/disp32
6050
6051 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6052 +-- 26 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
6078
6079
6080 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
6081 68/push "68 20 # 68/push 0x20/imm8"/imm32
6082 68/push _test-output-stream/imm32
6083
6084 e8/call check-stream-equal/disp32
6085
6086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
6087
6088 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
6089 5d/pop-to-ebp
6090 c3/return
6091
6092
6093 parse-datum-of-word:
6094
6095 55/push-ebp
6096 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
6097
6098 51/push-ecx
6099 56/push-esi
6100
6101 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
6102
6103 68/push 0/imm32/end
6104 68/push 0/imm32/start
6105 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
6106
6107
6108 51/push-ecx
6109 68/push 0x2f/imm32/slash
6110 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
6111 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
6112
6113 e8/call next-token-from-slice/disp32
6114
6115 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
6116
6117
6118 51/push-ecx
6119
6120 e8/call parse-hex-int-from-slice/disp32
6121
6122 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
6123 $parse-datum-of-word:end:
6124
6125 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
6126
6127 5e/pop-to-esi
6128 59/pop-to-ecx
6129
6130 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
6131 5d/pop-to-ebp
6132 c3/return
6133
6134