https://github.com/akkartik/mu/blob/master/apps/pack.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 == code
17
18
19
20
21 Entry:
22
23 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
24
25
26
27
28 68/push Heap/imm32
29 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
30
31 e8/call new-segment/disp32
32
33 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
34
35
36
37 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
38 7e/jump-if-<= $subx-pack-main:interactive/disp8
39
40
41
42 68/push "test"/imm32
43 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
44
45 e8/call kernel-string-equal?/disp32
46
47 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
48
49 3d/compare-eax-and 0/imm32/false
50 74/jump-if-= $subx-pack-main:interactive/disp8
51
52 e8/call run-tests/disp32
53
54 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
55 eb/jump $subx-pack-main:end/disp8
56 $subx-pack-main:interactive:
57
58
59
60 68/push Stdout/imm32
61 68/push Stdin/imm32
62
63 e8/call subx-pack/disp32
64
65 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x8/imm32
66
67 bb/copy-to-ebx 0/imm32
68 $subx-pack-main:end:
69 e8/call syscall_exit/disp32
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 subx-pack:
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 55/push-ebp
116 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
117
118 50/push-eax
119 51/push-ecx
120 52/push-edx
121 53/push-ebx
122
123 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
124 68/push 0x200/imm32/length
125 68/push 0/imm32/read
126 68/push 0/imm32/write
127 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
128
129 68/push 0/imm32/end
130 68/push 0/imm32/start
131 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
132
133 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
134 $subx-pack:loop:
135
136
137 51/push-ecx
138
139 e8/call clear-stream/disp32
140
141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
142
143
144 51/push-ecx
145 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
146
147 e8/call read-line-buffered/disp32
148
149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
150 $subx-pack:check0:
151
152 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
153 0f 84/jump-if-= $subx-pack:break/disp32
154 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
180
181
182 52/push-edx
183 51/push-ecx
184
185 e8/call next-word/disp32
186
187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
188 $subx-pack:check1:
189
190
191
192 52/push-edx
193
194 e8/call slice-empty?/disp32
195
196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
197
198 3d/compare-eax-and 0/imm32/false
199 0f 85/jump-if-!= $subx-pack:pass-through/disp32
200 $subx-pack:check2:
201 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
241
242
243
244 68/push "=="/imm32
245 52/push-edx
246
247 e8/call slice-equal?/disp32
248
249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
250
251 3d/compare-eax-and 0/imm32/false
252 0f 84/jump-if-= $subx-pack:check3/disp32
253
254
255 52/push-edx
256 51/push-ecx
257
258 e8/call next-word/disp32
259
260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
261 +-- 40 lines: #? # dump segment name ------------------------------------------------------------------------------------------------------------------------------------------------
301
302
303 68/push "code"/imm32
304 52/push-edx
305
306 e8/call slice-equal?/disp32
307
308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
309
310 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
311
312 eb/jump $subx-pack:pass-through/disp8
313 $subx-pack:check3:
314
315
316
317 51/push-ecx
318
319 e8/call rewind-stream/disp32
320
321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
322
323 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false
324 74/jump-if-= $subx-pack:data/disp8
325 $subx-pack:code:
326
327
328 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
329 51/push-ecx
330
331 e8/call convert-instruction/disp32
332
333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
334
335 e9/jump $subx-pack:loop/disp32
336 $subx-pack:data:
337
338
339 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
340 51/push-ecx
341
342 e8/call convert-data/disp32
343
344 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
345
346 e9/jump $subx-pack:loop/disp32
347 $subx-pack:pass-through:
348
349
350 51/push-ecx
351 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
352
353 e8/call write-stream-data/disp32
354
355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
356
357 e9/jump $subx-pack:loop/disp32
358 $subx-pack:break:
359
360
361 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
362
363 e8/call flush/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
366 $subx-pack:end:
367
368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
369
370 5b/pop-to-ebx
371 5a/pop-to-edx
372 59/pop-to-ecx
373 58/pop-to-eax
374
375 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
376 5d/pop-to-ebp
377 c3/return
378
379 test-subx-pack-passes-empty-lines-through:
380
381
382 55/push-ebp
383 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
384
385
386
387 68/push _test-input-stream/imm32
388
389 e8/call clear-stream/disp32
390
391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
392
393
394 68/push $_test-input-buffered-file->buffer/imm32
395
396 e8/call clear-stream/disp32
397
398 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
399
400
401 68/push _test-output-stream/imm32
402
403 e8/call clear-stream/disp32
404
405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
406
407
408 68/push $_test-output-buffered-file->buffer/imm32
409
410 e8/call clear-stream/disp32
411
412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
413
414
415
416 68/push _test-output-buffered-file/imm32
417 68/push _test-input-buffered-file/imm32
418
419 e8/call subx-pack/disp32
420
421 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
422
423
424
425 68/push _test-output-buffered-file/imm32
426
427 e8/call flush/disp32
428
429 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
430
431
432 68/push "F - test-subx-pack-passes-empty-lines-through"/imm32
433 68/push ""/imm32
434 68/push _test-output-stream/imm32
435
436 e8/call check-stream-equal/disp32
437
438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
439
440 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
441 5d/pop-to-ebp
442 c3/return
443
444 test-subx-pack-passes-lines-with-just-whitespace-through:
445
446
447 55/push-ebp
448 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
449
450
451
452 68/push _test-input-stream/imm32
453
454 e8/call clear-stream/disp32
455
456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
457
458
459 68/push $_test-input-buffered-file->buffer/imm32
460
461 e8/call clear-stream/disp32
462
463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
464
465
466 68/push _test-output-stream/imm32
467
468 e8/call clear-stream/disp32
469
470 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
471
472
473 68/push $_test-output-buffered-file->buffer/imm32
474
475 e8/call clear-stream/disp32
476
477 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
478
479
480
481 68/push " "/imm32
482 68/push _test-input-stream/imm32
483
484 e8/call write/disp32
485
486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
487
488
489 68/push _test-output-buffered-file/imm32
490 68/push _test-input-buffered-file/imm32
491
492 e8/call subx-pack/disp32
493
494 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
495
496
497
498 68/push _test-output-buffered-file/imm32
499
500 e8/call flush/disp32
501
502 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
503
504
505 68/push "F - test-subx-pack-passes-with-just-whitespace-through"/imm32
506 68/push " "/imm32
507 68/push _test-output-stream/imm32
508
509 e8/call check-next-stream-line-equal/disp32
510
511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
512
513 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
514 5d/pop-to-ebp
515 c3/return
516
517 test-subx-pack-passes-segment-headers-through:
518
519
520 55/push-ebp
521 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
522
523
524
525 68/push _test-input-stream/imm32
526
527 e8/call clear-stream/disp32
528
529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
530
531
532 68/push $_test-input-buffered-file->buffer/imm32
533
534 e8/call clear-stream/disp32
535
536 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
537
538
539 68/push _test-output-stream/imm32
540
541 e8/call clear-stream/disp32
542
543 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
544
545
546 68/push $_test-output-buffered-file->buffer/imm32
547
548 e8/call clear-stream/disp32
549
550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
551
552
553
554 68/push "== abcd 0x1"/imm32
555 68/push _test-input-stream/imm32
556
557 e8/call write/disp32
558
559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
560
561
562 68/push _test-output-buffered-file/imm32
563 68/push _test-input-buffered-file/imm32
564
565 e8/call subx-pack/disp32
566
567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
568
569
570
571 68/push _test-output-buffered-file/imm32
572
573 e8/call flush/disp32
574
575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
576
577
578 68/push "F - test-subx-pack-passes-segment-headers-through"/imm32
579 68/push "== abcd 0x1"/imm32
580 68/push _test-output-stream/imm32
581
582 e8/call check-stream-equal/disp32
583
584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
585
586 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
587 5d/pop-to-ebp
588 c3/return
589
590 test-subx-pack-in-data-segment:
591
592
593 55/push-ebp
594 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
595
596
597
598 68/push _test-input-stream/imm32
599
600 e8/call clear-stream/disp32
601
602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
603
604
605 68/push $_test-input-buffered-file->buffer/imm32
606
607 e8/call clear-stream/disp32
608
609 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
610
611
612 68/push _test-output-stream/imm32
613
614 e8/call clear-stream/disp32
615
616 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
617
618
619 68/push $_test-output-buffered-file->buffer/imm32
620
621 e8/call clear-stream/disp32
622
623 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
624
625
626
627
628
629
630 68/push "== code 0x1\n"/imm32
631 68/push _test-input-stream/imm32
632
633 e8/call write/disp32
634
635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
636
637
638 68/push "== data 0x2\n"/imm32
639 68/push _test-input-stream/imm32
640
641 e8/call write/disp32
642
643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
644
645
646 68/push "3 4/imm32\n"/imm32
647 68/push _test-input-stream/imm32
648
649 e8/call write/disp32
650
651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
652
653
654 68/push _test-output-buffered-file/imm32
655 68/push _test-input-buffered-file/imm32
656
657 e8/call subx-pack/disp32
658
659 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
660
661 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------
687
688
689 68/push _test-output-buffered-file/imm32
690
691 e8/call flush/disp32
692
693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
694
695
696 68/push "F - test-subx-pack-in-data-segment/0"/imm32
697 68/push "== code 0x1"/imm32
698 68/push _test-output-stream/imm32
699
700 e8/call check-next-stream-line-equal/disp32
701
702 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
703
704
705 68/push "F - test-subx-pack-in-data-segment/1"/imm32
706 68/push "== data 0x2"/imm32
707 68/push _test-output-stream/imm32
708
709 e8/call check-next-stream-line-equal/disp32
710
711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
712
713
714 68/push "F - test-subx-pack-in-data-segment/2"/imm32
715 68/push "03 04 00 00 00 "/imm32
716 68/push _test-output-stream/imm32
717
718 e8/call check-next-stream-line-equal/disp32
719
720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
721
722 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
723 5d/pop-to-ebp
724 c3/return
725
726 test-subx-pack-code-and-data-segments:
727
728
729 55/push-ebp
730 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
731
732
733
734 68/push _test-input-stream/imm32
735
736 e8/call clear-stream/disp32
737
738 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
739
740
741 68/push $_test-input-buffered-file->buffer/imm32
742
743 e8/call clear-stream/disp32
744
745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
746
747
748 68/push _test-output-stream/imm32
749
750 e8/call clear-stream/disp32
751
752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
753
754
755 68/push $_test-output-buffered-file->buffer/imm32
756
757 e8/call clear-stream/disp32
758
759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
760
761
762
763
764
765
766
767
768 68/push "== code 0x1\n"/imm32
769 68/push _test-input-stream/imm32
770
771 e8/call write/disp32
772
773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
774
775
776 68/push "e8/call 20/disp32\n"/imm32
777 68/push _test-input-stream/imm32
778
779 e8/call write/disp32
780
781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
782
783
784 68/push "68/push 0x20/imm8\n"/imm32
785 68/push _test-input-stream/imm32
786
787 e8/call write/disp32
788
789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
790
791
792 68/push "== data 0x2\n"/imm32
793 68/push _test-input-stream/imm32
794
795 e8/call write/disp32
796
797 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
798
799
800 68/push "3 4/imm32\n"/imm32
801 68/push _test-input-stream/imm32
802
803 e8/call write/disp32
804
805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
806
807
808 68/push _test-output-buffered-file/imm32
809 68/push _test-input-buffered-file/imm32
810
811 e8/call subx-pack/disp32
812
813 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
814
815
816
817
818
819
820 +-- 26 lines: #? # debug print ------------------------------------------------------------------------------------------------------------------------------------------------------
846
847
848 68/push _test-output-buffered-file/imm32
849
850 e8/call flush/disp32
851
852 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
853
854
855 68/push "F - test-subx-pack-code-and-data-segments/0"/imm32
856 68/push "== code 0x1"/imm32
857 68/push _test-output-stream/imm32
858
859 e8/call check-next-stream-line-equal/disp32
860
861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
862
863
864 68/push "F - test-subx-pack-code-and-data-segments/1"/imm32
865 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
866 68/push _test-output-stream/imm32
867
868 e8/call check-next-stream-line-equal/disp32
869
870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
871
872
873 68/push "F - test-subx-pack-code-and-data-segments/2"/imm32
874 68/push "68 20 # 68/push 0x20/imm8"/imm32
875 68/push _test-output-stream/imm32
876
877 e8/call check-next-stream-line-equal/disp32
878
879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
880
881
882 68/push "F - test-subx-pack-code-and-data-segments/3"/imm32
883 68/push "== data 0x2"/imm32
884 68/push _test-output-stream/imm32
885
886 e8/call check-next-stream-line-equal/disp32
887
888 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
889
890
891 68/push "F - test-subx-pack-code-and-data-segments/4"/imm32
892 68/push "03 04 00 00 00 "/imm32
893 68/push _test-output-stream/imm32
894
895 e8/call check-next-stream-line-equal/disp32
896
897 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
898
899 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
900 5d/pop-to-ebp
901 c3/return
902
903 convert-data:
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924 55/push-ebp
925 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
926
927 50/push-eax
928 51/push-ecx
929 52/push-edx
930
931 68/push 0/imm32/end
932 68/push 0/imm32/start
933 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
934 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
960 $convert-data:loop:
961
962
963 51/push-ecx
964 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
965
966 e8/call next-word/disp32
967
968 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
969 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
1009 $convert-data:check0:
1010
1011
1012
1013 51/push-ecx
1014
1015 e8/call slice-empty?/disp32
1016
1017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1018
1019 3d/compare-eax-and 0/imm32/false
1020 0f 85/jump-if-!= $convert-data:break/disp32
1021 $convert-data:check-for-comment:
1022
1023
1024 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1025
1026 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1027 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1028
1029 3d/compare-eax-and 0x23/imm32/hash
1030 75/jump-if-!= $convert-data:check-for-label/disp8
1031 $convert-data:comment:
1032
1033
1034 51/push-ecx
1035 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1036
1037 e8/call write-slice-buffered/disp32
1038
1039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1040
1041 0f 85/jump-if-!= $convert-data:end/disp32
1042 $convert-data:check-for-label:
1043
1044
1045 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1046
1047 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1048 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1049
1050 3d/compare-eax-and 0x3a/imm32/colon
1051 75/jump-if-!= $convert-data:check-for-imm32/disp8
1052 $convert-data:label:
1053
1054
1055 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1056 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1057
1058 e8/call write-stream-data/disp32
1059
1060 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1061
1062 75/jump-if-!= $convert-data:end/disp8
1063 $convert-data:check-for-imm32:
1064
1065
1066
1067 68/push "imm32"/imm32
1068 51/push-ecx
1069
1070 e8/call has-metadata?/disp32
1071
1072 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1073
1074 3d/compare-eax-and 0/imm32/false
1075 74/jump-if-= $convert-data:single-byte/disp8
1076 $convert-data:imm32:
1077
1078
1079 68/push 4/imm32
1080 51/push-ecx
1081 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1082
1083 e8/call emit/disp32
1084
1085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1086 e9/jump $convert-data:loop/disp32
1087 $convert-data:single-byte:
1088
1089
1090 68/push 1/imm32
1091 51/push-ecx
1092 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1093
1094 e8/call emit/disp32
1095
1096 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1097 e9/jump $convert-data:loop/disp32
1098 $convert-data:break:
1099
1100
1101 68/push Newline/imm32
1102 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1103
1104 e8/call write-buffered/disp32
1105
1106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1107 $convert-data:end:
1108
1109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1110
1111 5a/pop-to-edx
1112 59/pop-to-ecx
1113 58/pop-to-eax
1114
1115 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1116 5d/pop-to-ebp
1117 c3/return
1118
1119 test-convert-data-passes-comments-through:
1120
1121
1122 55/push-ebp
1123 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1124
1125
1126
1127 68/push _test-input-stream/imm32
1128
1129 e8/call clear-stream/disp32
1130
1131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1132
1133
1134 68/push _test-output-stream/imm32
1135
1136 e8/call clear-stream/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1139
1140
1141 68/push $_test-output-buffered-file->buffer/imm32
1142
1143 e8/call clear-stream/disp32
1144
1145 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1146
1147
1148
1149 68/push "# abcd"/imm32
1150 68/push _test-input-stream/imm32
1151
1152 e8/call write/disp32
1153
1154 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1155
1156
1157 68/push _test-output-buffered-file/imm32
1158 68/push _test-input-stream/imm32
1159
1160 e8/call convert-data/disp32
1161
1162 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1163
1164
1165
1166 68/push _test-output-buffered-file/imm32
1167
1168 e8/call flush/disp32
1169
1170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1171 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1197
1198
1199 68/push "F - test-convert-data-passes-comments-through"/imm32
1200 68/push "# abcd"/imm32
1201 68/push _test-output-stream/imm32
1202
1203 e8/call check-stream-equal/disp32
1204
1205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1206
1207 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1208 5d/pop-to-ebp
1209 c3/return
1210
1211 test-convert-data-passes-labels-through:
1212
1213
1214 55/push-ebp
1215 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1216
1217
1218
1219 68/push _test-input-stream/imm32
1220
1221 e8/call clear-stream/disp32
1222
1223 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1224
1225
1226 68/push _test-output-stream/imm32
1227
1228 e8/call clear-stream/disp32
1229
1230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1231
1232
1233 68/push $_test-output-buffered-file->buffer/imm32
1234
1235 e8/call clear-stream/disp32
1236
1237 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1238
1239
1240
1241 68/push "ab: # cd"/imm32
1242 68/push _test-input-stream/imm32
1243
1244 e8/call write/disp32
1245
1246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1247
1248
1249 68/push _test-output-buffered-file/imm32
1250 68/push _test-input-stream/imm32
1251
1252 e8/call convert-data/disp32
1253
1254 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1255
1256
1257
1258 68/push _test-output-buffered-file/imm32
1259
1260 e8/call flush/disp32
1261
1262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1263
1264
1265 68/push "F - test-convert-data-passes-labels-through"/imm32
1266 68/push "ab: # cd"/imm32
1267 68/push _test-output-stream/imm32
1268
1269 e8/call check-stream-equal/disp32
1270
1271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1272
1273 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1274 5d/pop-to-ebp
1275 c3/return
1276
1277 test-convert-data-passes-names-through:
1278
1279
1280
1281 55/push-ebp
1282 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1283
1284
1285
1286 68/push _test-input-stream/imm32
1287
1288 e8/call clear-stream/disp32
1289
1290 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1291
1292
1293 68/push _test-output-stream/imm32
1294
1295 e8/call clear-stream/disp32
1296
1297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1298
1299
1300 68/push $_test-output-buffered-file->buffer/imm32
1301
1302 e8/call clear-stream/disp32
1303
1304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1305
1306
1307
1308 68/push "abcd/imm32"/imm32
1309 68/push _test-input-stream/imm32
1310
1311 e8/call write/disp32
1312
1313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1314
1315
1316 68/push _test-output-buffered-file/imm32
1317 68/push _test-input-stream/imm32
1318
1319 e8/call convert-data/disp32
1320
1321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1322
1323
1324
1325 68/push _test-output-buffered-file/imm32
1326
1327 e8/call flush/disp32
1328
1329 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1330
1331
1332 68/push "F - test-convert-data-passes-names-through"/imm32
1333 68/push "abcd/imm32 \n"/imm32
1334 68/push _test-output-stream/imm32
1335
1336 e8/call check-stream-equal/disp32
1337
1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1339
1340 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1341 5d/pop-to-ebp
1342 c3/return
1343
1344 test-convert-data-handles-imm32:
1345
1346
1347 55/push-ebp
1348 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1349
1350
1351
1352 68/push _test-input-stream/imm32
1353
1354 e8/call clear-stream/disp32
1355
1356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1357
1358
1359 68/push _test-output-stream/imm32
1360
1361 e8/call clear-stream/disp32
1362
1363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1364
1365
1366 68/push $_test-output-buffered-file->buffer/imm32
1367
1368 e8/call clear-stream/disp32
1369
1370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1371
1372
1373
1374 68/push "30/imm32"/imm32
1375 68/push _test-input-stream/imm32
1376
1377 e8/call write/disp32
1378
1379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1380
1381
1382 68/push _test-output-buffered-file/imm32
1383 68/push _test-input-stream/imm32
1384
1385 e8/call convert-data/disp32
1386
1387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1388
1389
1390
1391 68/push _test-output-buffered-file/imm32
1392
1393 e8/call flush/disp32
1394
1395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1396
1397
1398 68/push "F - test-convert-data-handles-imm32"/imm32
1399 68/push "30 00 00 00 \n"/imm32
1400 68/push _test-output-stream/imm32
1401
1402 e8/call check-stream-equal/disp32
1403
1404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1405
1406 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1407 5d/pop-to-ebp
1408 c3/return
1409
1410 test-convert-data-handles-single-byte:
1411
1412
1413
1414 55/push-ebp
1415 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1416
1417
1418
1419 68/push _test-input-stream/imm32
1420
1421 e8/call clear-stream/disp32
1422
1423 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1424
1425
1426 68/push _test-output-stream/imm32
1427
1428 e8/call clear-stream/disp32
1429
1430 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1431
1432
1433 68/push $_test-output-buffered-file->buffer/imm32
1434
1435 e8/call clear-stream/disp32
1436
1437 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1438
1439
1440
1441 68/push "30/imm16"/imm32
1442 68/push _test-input-stream/imm32
1443
1444 e8/call write/disp32
1445
1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1447
1448
1449 68/push _test-output-buffered-file/imm32
1450 68/push _test-input-stream/imm32
1451
1452 e8/call convert-data/disp32
1453
1454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1455
1456
1457
1458 68/push _test-output-buffered-file/imm32
1459
1460 e8/call flush/disp32
1461
1462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1463
1464
1465 68/push "F - test-convert-data-handles-single-byte"/imm32
1466 68/push "30 \n"/imm32
1467 68/push _test-output-stream/imm32
1468
1469 e8/call check-stream-equal/disp32
1470
1471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1472
1473 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1474 5d/pop-to-ebp
1475 c3/return
1476
1477 test-convert-data-multiple-bytes:
1478
1479
1480 55/push-ebp
1481 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1482
1483
1484
1485 68/push _test-input-stream/imm32
1486
1487 e8/call clear-stream/disp32
1488
1489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1490
1491
1492 68/push _test-output-stream/imm32
1493
1494 e8/call clear-stream/disp32
1495
1496 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1497
1498
1499 68/push $_test-output-buffered-file->buffer/imm32
1500
1501 e8/call clear-stream/disp32
1502
1503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1504
1505
1506
1507 68/push "1 2"/imm32
1508 68/push _test-input-stream/imm32
1509
1510 e8/call write/disp32
1511
1512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1513
1514
1515 68/push _test-output-buffered-file/imm32
1516 68/push _test-input-stream/imm32
1517
1518 e8/call convert-data/disp32
1519
1520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1521
1522
1523
1524 68/push _test-output-buffered-file/imm32
1525
1526 e8/call flush/disp32
1527
1528 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1529
1530
1531 68/push "F - test-convert-data-multiple-bytes"/imm32
1532 68/push "01 02 \n"/imm32
1533 68/push _test-output-stream/imm32
1534
1535 e8/call check-stream-equal/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1538
1539 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1540 5d/pop-to-ebp
1541 c3/return
1542
1543 test-convert-data-byte-then-name:
1544
1545
1546 55/push-ebp
1547 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1548
1549
1550
1551 68/push _test-input-stream/imm32
1552
1553 e8/call clear-stream/disp32
1554
1555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1556
1557
1558 68/push _test-output-stream/imm32
1559
1560 e8/call clear-stream/disp32
1561
1562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1563
1564
1565 68/push $_test-output-buffered-file->buffer/imm32
1566
1567 e8/call clear-stream/disp32
1568
1569 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1570
1571
1572
1573 68/push "30 abcd/o"/imm32
1574 68/push _test-input-stream/imm32
1575
1576 e8/call write/disp32
1577
1578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1579
1580
1581 68/push _test-output-buffered-file/imm32
1582 68/push _test-input-stream/imm32
1583
1584 e8/call convert-data/disp32
1585
1586 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1587
1588
1589
1590 68/push _test-output-buffered-file/imm32
1591
1592 e8/call flush/disp32
1593
1594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1595
1596
1597 68/push "F - test-convert-data-byte-then-name"/imm32
1598 68/push "30 abcd/o \n"/imm32
1599 68/push _test-output-stream/imm32
1600
1601 e8/call check-stream-equal/disp32
1602
1603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1604
1605 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1606 5d/pop-to-ebp
1607 c3/return
1608
1609 test-convert-data-multiple-words:
1610
1611
1612 55/push-ebp
1613 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1614
1615
1616
1617 68/push _test-input-stream/imm32
1618
1619 e8/call clear-stream/disp32
1620
1621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1622
1623
1624 68/push _test-output-stream/imm32
1625
1626 e8/call clear-stream/disp32
1627
1628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1629
1630
1631 68/push $_test-output-buffered-file->buffer/imm32
1632
1633 e8/call clear-stream/disp32
1634
1635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1636
1637
1638
1639 68/push "30 abcd/o 42e1/imm32"/imm32
1640 68/push _test-input-stream/imm32
1641
1642 e8/call write/disp32
1643
1644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1645
1646
1647 68/push _test-output-buffered-file/imm32
1648 68/push _test-input-stream/imm32
1649
1650 e8/call convert-data/disp32
1651
1652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1653
1654
1655
1656 68/push _test-output-buffered-file/imm32
1657
1658 e8/call flush/disp32
1659
1660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1661 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1687
1688
1689 68/push "F - test-convert-data-multiple-words"/imm32
1690 68/push "30 abcd/o e1 42 00 00 \n"/imm32
1691 68/push _test-output-stream/imm32
1692
1693 e8/call check-stream-equal/disp32
1694
1695 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1696
1697 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1698 5d/pop-to-ebp
1699 c3/return
1700
1701 test-convert-data-trailing-comment:
1702
1703
1704 55/push-ebp
1705 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1706
1707
1708
1709 68/push _test-input-stream/imm32
1710
1711 e8/call clear-stream/disp32
1712
1713 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1714
1715
1716 68/push _test-output-stream/imm32
1717
1718 e8/call clear-stream/disp32
1719
1720 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1721
1722
1723 68/push $_test-output-buffered-file->buffer/imm32
1724
1725 e8/call clear-stream/disp32
1726
1727 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1728
1729
1730
1731 68/push "30/imm32 # comment"/imm32
1732 68/push _test-input-stream/imm32
1733
1734 e8/call write/disp32
1735
1736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1737
1738
1739 68/push _test-output-buffered-file/imm32
1740 68/push _test-input-stream/imm32
1741
1742 e8/call convert-data/disp32
1743
1744 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1745
1746
1747
1748 68/push _test-output-buffered-file/imm32
1749
1750 e8/call flush/disp32
1751
1752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1753 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
1779
1780
1781 68/push "F - test-convert-data-trailing-comment"/imm32
1782 68/push "30 00 00 00 # comment"/imm32
1783 68/push _test-output-stream/imm32
1784
1785 e8/call check-stream-equal/disp32
1786
1787 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1788
1789 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1790 5d/pop-to-ebp
1791 c3/return
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803 convert-instruction:
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825 55/push-ebp
1826 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1827
1828 50/push-eax
1829 51/push-ecx
1830 52/push-edx
1831
1832 68/push 0/imm32/end
1833 68/push 0/imm32/start
1834 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1835
1836
1837 51/push-ecx
1838 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1839
1840 e8/call next-word/disp32
1841
1842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1843 $convert-instruction:check0:
1844
1845
1846
1847 51/push-ecx
1848
1849 e8/call slice-empty?/disp32
1850
1851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1852
1853 3d/compare-eax-and 0/imm32/false
1854 75/jump-if-!= $convert-instruction:pass-through/disp8
1855 $convert-instruction:check1:
1856
1857
1858 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1859
1860 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1861 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1862
1863 3d/compare-eax-and 0x23/imm32/hash
1864 74/jump-if-= $convert-instruction:pass-through/disp8
1865 $convert-instruction:check2:
1866
1867
1868 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1869
1870 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1871 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1872
1873 3d/compare-eax-and 0x3a/imm32/colon
1874 75/jump-if-!= $convert-instruction:really-convert/disp8
1875 $convert-instruction:pass-through:
1876
1877
1878 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1879 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1880
1881 e8/call write-stream-data/disp32
1882
1883 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1884
1885 eb/jump $convert-instruction:end/disp8
1886 $convert-instruction:really-convert:
1887
1888
1889 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1890 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1891
1892 e8/call emit-opcodes/disp32
1893
1894 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1895
1896
1897 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1898 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1899
1900 e8/call emit-modrm/disp32
1901
1902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1903
1904
1905 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1906 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1907
1908 e8/call emit-sib/disp32
1909
1910 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1911
1912
1913 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1914 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1915
1916 e8/call emit-disp/disp32
1917
1918 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1919
1920
1921 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1922 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1923
1924 e8/call emit-imm/disp32
1925
1926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1927
1928
1929 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1930 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1931
1932 e8/call emit-line-in-comment/disp32
1933
1934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1935 $convert-instruction:end:
1936
1937 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1938
1939 5a/pop-to-edx
1940 59/pop-to-ecx
1941 58/pop-to-eax
1942
1943 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1944 5d/pop-to-ebp
1945 c3/return
1946
1947 emit-opcodes:
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981 55/push-ebp
1982 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1983
1984 50/push-eax
1985 51/push-ecx
1986 52/push-edx
1987 53/push-ebx
1988
1989 68/push 0/imm32/end
1990 68/push 0/imm32/start
1991 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1992
1993 68/push 0/imm32/end
1994 68/push 0/imm32/start
1995 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1996
1997
1998 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1999
2000 e8/call rewind-stream/disp32
2001
2002 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2003 $emit-opcodes:op1:
2004
2005
2006 51/push-ecx
2007 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2008
2009 e8/call next-word/disp32
2010
2011 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2012
2013
2014
2015 51/push-ecx
2016
2017 e8/call slice-empty?/disp32
2018
2019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2020
2021 3d/compare-eax-and 0/imm32/false
2022 0f 85/jump-if-!= $emit-opcodes:end/disp32
2023
2024
2025 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . .
2026
2027 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2028 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2029
2030 3d/compare-eax-and 0x23/imm32/hash
2031 0f 84/jump-if-= $emit-opcodes:end/disp32
2032
2033
2034 51/push-ecx
2035 68/push 0x2f/imm32/slash
2036 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 .
2037 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
2038
2039 e8/call next-token-from-slice/disp32
2040
2041 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2042
2043
2044 51/push-ecx
2045 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2046
2047 e8/call write-slice-buffered/disp32
2048
2049 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2050
2051
2052 68/push Space/imm32
2053 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2054
2055 e8/call write-buffered/disp32
2056
2057 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2058
2059
2060
2061 68/push "0f"/imm32
2062 51/push-ecx
2063
2064 e8/call slice-equal?/disp32
2065
2066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2067
2068 3d/compare-eax-and 0/imm32/false
2069 75/jump-if-!= $emit-opcodes:op2/disp8
2070
2071
2072
2073 68/push "f2"/imm32
2074 51/push-ecx
2075
2076 e8/call slice-equal?/disp32
2077
2078 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2079
2080 3d/compare-eax-and 0/imm32/false
2081 75/jump-if-!= $emit-opcodes:op2/disp8
2082
2083
2084
2085 68/push "f3"/imm32
2086 51/push-ecx
2087
2088 e8/call slice-equal?/disp32
2089
2090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2091
2092 3d/compare-eax-and 0/imm32/false
2093 75/jump-if-!= $emit-opcodes:op2/disp8
2094
2095 e9/jump $emit-opcodes:end/disp32
2096 $emit-opcodes:op2:
2097
2098
2099 52/push-edx
2100 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2101
2102 e8/call next-word/disp32
2103
2104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2105
2106
2107
2108 52/push-edx
2109
2110 e8/call slice-empty?/disp32
2111
2112 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2113
2114 3d/compare-eax-and 0/imm32/false
2115 0f 85/jump-if-!= $emit-opcodes:end/disp32
2116
2117
2118 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2119
2120 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2121 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2122
2123 3d/compare-eax-and 0x23/imm32/hash
2124 0f 84/jump-if-= $emit-opcodes:end/disp32
2125
2126
2127 52/push-edx
2128 68/push 0x2f/imm32/slash
2129 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2130 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2131
2132 e8/call next-token-from-slice/disp32
2133
2134 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2135
2136
2137 52/push-edx
2138 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2139
2140 e8/call write-slice-buffered/disp32
2141
2142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2143
2144
2145 68/push Space/imm32
2146 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2147
2148 e8/call write-buffered/disp32
2149
2150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2151
2152
2153
2154 68/push "0f"/imm32
2155 51/push-ecx
2156
2157 e8/call slice-equal?/disp32
2158
2159 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2160
2161 3d/compare-eax-and 0/imm32/false
2162 0f 85/jump-if-!= $emit-opcodes:end/disp32
2163
2164
2165
2166 68/push "0f"/imm32
2167 52/push-edx
2168
2169 e8/call slice-equal?/disp32
2170
2171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2172
2173 3d/compare-eax-and 0/imm32/false
2174 0f 84/jump-if-= $emit-opcodes:end/disp32
2175 $emit-opcodes:op3:
2176
2177
2178 52/push-edx
2179 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2180
2181 e8/call next-word/disp32
2182
2183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2184
2185
2186
2187 52/push-edx
2188
2189 e8/call slice-empty?/disp32
2190
2191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2192
2193 3d/compare-eax-and 0/imm32/false
2194 0f 85/jump-if-!= $emit-opcodes:end/disp32
2195
2196
2197 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2198
2199 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2200 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2201
2202 3d/compare-eax-and 0x23/imm32/hash
2203 0f 84/jump-if-= $emit-opcodes:end/disp32
2204
2205
2206 52/push-edx
2207 68/push 0x2f/imm32/slash
2208 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2209 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2210
2211 e8/call next-token-from-slice/disp32
2212
2213 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2214
2215
2216 52/push-edx
2217 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2218
2219 e8/call write-slice-buffered/disp32
2220
2221 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2222
2223
2224 68/push Space/imm32
2225 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2226
2227 e8/call write-buffered/disp32
2228
2229 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2230 $emit-opcodes:end:
2231
2232 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2233
2234 5b/pop-to-ebx
2235 5a/pop-to-edx
2236 59/pop-to-ecx
2237 58/pop-to-eax
2238
2239 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2240 5d/pop-to-ebp
2241 c3/return
2242
2243 emit-modrm:
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270 55/push-ebp
2271 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2272
2273 50/push-eax
2274 51/push-ecx
2275 52/push-edx
2276 53/push-ebx
2277 56/push-esi
2278 57/push-edi
2279
2280 68/push 0/imm32/end
2281 68/push 0/imm32/start
2282 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2283
2284 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2285
2286 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2287
2288 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2289
2290 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2291
2292
2293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2294
2295 e8/call rewind-stream/disp32
2296
2297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2298 +-- 33 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2331 $emit-modrm:loop:
2332
2333
2334 51/push-ecx
2335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2336
2337 e8/call next-word/disp32
2338
2339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2340 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
2380 $emit-modrm:check0:
2381
2382
2383
2384 51/push-ecx
2385
2386 e8/call slice-empty?/disp32
2387
2388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2389
2390 3d/compare-eax-and 0/imm32/false
2391 0f 85/jump-if-!= $emit-modrm:break/disp32
2392 $emit-modrm:check1:
2393
2394
2395 52/push-edx
2396
2397 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2398
2399 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2400 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2401
2402 5a/pop-to-edx
2403
2404 3d/compare-eax-and 0x23/imm32/hash
2405 0f 84/jump-if-= $emit-modrm:break/disp32
2406 $emit-modrm:check-for-mod:
2407
2408
2409
2410 68/push "mod"/imm32
2411 51/push-ecx
2412
2413 e8/call has-metadata?/disp32
2414
2415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2416
2417 3d/compare-eax-and 0/imm32/false
2418 74/jump-if-= $emit-modrm:check-for-rm32/disp8
2419 $emit-modrm:mod:
2420
2421
2422
2423 51/push-ecx
2424
2425 e8/call parse-datum-of-word/disp32
2426
2427 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2428
2429 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2430
2431 ba/copy-to-edx 1/imm32/true
2432
2433 e9/jump $emit-modrm:loop/disp32
2434 $emit-modrm:check-for-rm32:
2435
2436
2437
2438 68/push "rm32"/imm32
2439 51/push-ecx
2440
2441 e8/call has-metadata?/disp32
2442
2443 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2444
2445 3d/compare-eax-and 0/imm32/false
2446 74/jump-if-= $emit-modrm:check-for-r32/disp8
2447 $emit-modrm:rm32:
2448
2449
2450
2451 51/push-ecx
2452
2453 e8/call parse-datum-of-word/disp32
2454
2455 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2456
2457 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2458
2459 ba/copy-to-edx 1/imm32/true
2460
2461 e9/jump $emit-modrm:loop/disp32
2462 $emit-modrm:check-for-r32:
2463
2464
2465
2466 68/push "r32"/imm32
2467 51/push-ecx
2468
2469 e8/call has-metadata?/disp32
2470
2471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2472
2473 3d/compare-eax-and 0/imm32/false
2474 74/jump-if-= $emit-modrm:check-for-subop/disp8
2475 $emit-modrm:r32:
2476
2477
2478
2479 51/push-ecx
2480
2481 e8/call parse-datum-of-word/disp32
2482
2483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2484
2485 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2486
2487 ba/copy-to-edx 1/imm32/true
2488
2489 e9/jump $emit-modrm:loop/disp32
2490 $emit-modrm:check-for-subop:
2491
2492
2493
2494 68/push "subop"/imm32
2495 51/push-ecx
2496
2497 e8/call has-metadata?/disp32
2498
2499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2500
2501 3d/compare-eax-and 0/imm32/false
2502 0f 84/jump-if-= $emit-modrm:loop/disp32
2503 $emit-modrm:subop:
2504
2505
2506
2507 51/push-ecx
2508
2509 e8/call parse-datum-of-word/disp32
2510
2511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2512
2513 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2514
2515 ba/copy-to-edx 1/imm32/true
2516
2517 e9/jump $emit-modrm:loop/disp32
2518 $emit-modrm:break:
2519
2520 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2521 74/jump-if-= $emit-modrm:end/disp8
2522 $emit-modrm:calculate:
2523
2524 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2525
2526 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2527
2528 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2529 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2530
2531 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2532
2533 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2534 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2535 $emit-modrm:emit:
2536
2537
2538 68/push 1/imm32
2539 53/push-ebx
2540 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2541
2542 e8/call emit-hex/disp32
2543
2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2545 $emit-modrm:end:
2546
2547 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2548
2549 5f/pop-to-edi
2550 5e/pop-to-esi
2551 5b/pop-to-ebx
2552 5a/pop-to-edx
2553 59/pop-to-ecx
2554 58/pop-to-eax
2555
2556 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2557 5d/pop-to-ebp
2558 c3/return
2559
2560 emit-sib:
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586 55/push-ebp
2587 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2588
2589 50/push-eax
2590 51/push-ecx
2591 52/push-edx
2592 53/push-ebx
2593 56/push-esi
2594 57/push-edi
2595
2596 68/push 0/imm32/end
2597 68/push 0/imm32/start
2598 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2599
2600 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2601
2602 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2603
2604 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2605
2606 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2607
2608
2609 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2610
2611 e8/call rewind-stream/disp32
2612
2613 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2614 $emit-sib:loop:
2615 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2641
2642
2643 51/push-ecx
2644 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2645
2646 e8/call next-word/disp32
2647
2648 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2649 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
2689 $emit-sib:check0:
2690
2691
2692
2693 51/push-ecx
2694
2695 e8/call slice-empty?/disp32
2696
2697 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2698
2699 3d/compare-eax-and 0/imm32/false
2700 0f 85/jump-if-!= $emit-sib:break/disp32
2701 $emit-sib:check1:
2702
2703
2704 52/push-edx
2705
2706 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2707
2708 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2709 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2710
2711 5a/pop-to-edx
2712
2713 3d/compare-eax-and 0x23/imm32/hash
2714 0f 84/jump-if-= $emit-sib:break/disp32
2715 $emit-sib:check-for-scale:
2716
2717
2718
2719 68/push "scale"/imm32
2720 51/push-ecx
2721
2722 e8/call has-metadata?/disp32
2723
2724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2725
2726 3d/compare-eax-and 0/imm32/false
2727 74/jump-if-= $emit-sib:check-for-base/disp8
2728 $emit-sib:scale:
2729
2730
2731
2732 51/push-ecx
2733
2734 e8/call parse-datum-of-word/disp32
2735
2736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2737
2738 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2739
2740 ba/copy-to-edx 1/imm32/true
2741
2742 e9/jump $emit-sib:loop/disp32
2743 $emit-sib:check-for-base:
2744
2745
2746
2747 68/push "base"/imm32
2748 51/push-ecx
2749
2750 e8/call has-metadata?/disp32
2751
2752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2753
2754 3d/compare-eax-and 0/imm32/false
2755 74/jump-if-= $emit-sib:check-for-index/disp8
2756 $emit-sib:base:
2757
2758
2759
2760 51/push-ecx
2761
2762 e8/call parse-datum-of-word/disp32
2763
2764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2765
2766 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2767
2768 ba/copy-to-edx 1/imm32/true
2769
2770 e9/jump $emit-sib:loop/disp32
2771 $emit-sib:check-for-index:
2772
2773
2774
2775 68/push "index"/imm32
2776 51/push-ecx
2777
2778 e8/call has-metadata?/disp32
2779
2780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2781
2782 3d/compare-eax-and 0/imm32/false
2783 0f 84/jump-if-= $emit-sib:loop/disp32
2784 $emit-sib:index:
2785
2786
2787
2788 51/push-ecx
2789
2790 e8/call parse-datum-of-word/disp32
2791
2792 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2793
2794 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2795
2796 ba/copy-to-edx 1/imm32/true
2797
2798 e9/jump $emit-sib:loop/disp32
2799 $emit-sib:break:
2800
2801 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32/false
2802 74/jump-if-= $emit-sib:end/disp8
2803 $emit-sib:calculate:
2804
2805 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2806
2807 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 2/imm8
2808
2809 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2810 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2811
2812 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2813
2814 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2815 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2816 $emit-sib:emit:
2817
2818
2819 68/push 1/imm32
2820 53/push-ebx
2821 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2822
2823 e8/call emit-hex/disp32
2824
2825 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2826 $emit-sib:end:
2827
2828 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2829
2830 5f/pop-to-edi
2831 5e/pop-to-esi
2832 5b/pop-to-ebx
2833 5a/pop-to-edx
2834 59/pop-to-ecx
2835 58/pop-to-eax
2836
2837 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2838 5d/pop-to-ebp
2839 c3/return
2840
2841 emit-disp:
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860 55/push-ebp
2861 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2862
2863 50/push-eax
2864 51/push-ecx
2865 52/push-edx
2866
2867 68/push 0/imm32/end
2868 68/push 0/imm32/start
2869 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2870
2871
2872 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2873
2874 e8/call rewind-stream/disp32
2875
2876 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2877 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
2903 $emit-disp:loop:
2904
2905
2906 51/push-ecx
2907 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2908
2909 e8/call next-word/disp32
2910
2911 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2912 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
2952 $emit-disp:check0:
2953
2954
2955
2956 51/push-ecx
2957
2958 e8/call slice-empty?/disp32
2959
2960 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2961
2962 3d/compare-eax-and 0/imm32/false
2963 0f 85/jump-if-!= $emit-disp:break/disp32
2964 $emit-disp:check1:
2965
2966
2967 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2968
2969 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2970 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2971
2972 3d/compare-eax-and 0x23/imm32/hash
2973 0f 84/jump-if-= $emit-disp:break/disp32
2974 $emit-disp:check-for-disp32:
2975
2976
2977
2978 68/push "disp32"/imm32
2979 51/push-ecx
2980
2981 e8/call has-metadata?/disp32
2982
2983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2984
2985 3d/compare-eax-and 0/imm32/false
2986 74/jump-if-= $emit-disp:check-for-disp16/disp8
2987 $emit-disp:disp32:
2988
2989
2990 68/push 4/imm32
2991 51/push-ecx
2992 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2993
2994 e8/call emit/disp32
2995
2996 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2997
2998 e9/jump $emit-disp:break/disp32
2999 $emit-disp:check-for-disp16:
3000
3001
3002
3003 68/push "disp16"/imm32
3004 51/push-ecx
3005
3006 e8/call has-metadata?/disp32
3007
3008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3009
3010 3d/compare-eax-and 0/imm32/false
3011 74/jump-if-= $emit-disp:check-for-disp8/disp8
3012 $emit-disp:disp16:
3013
3014
3015 68/push 2/imm32
3016 51/push-ecx
3017 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3018
3019 e8/call emit/disp32
3020
3021 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3022
3023 e9/jump $emit-disp:break/disp32
3024 $emit-disp:check-for-disp8:
3025
3026
3027
3028 68/push "disp8"/imm32
3029 51/push-ecx
3030
3031 e8/call has-metadata?/disp32
3032
3033 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3034
3035 3d/compare-eax-and 0/imm32/false
3036 0f 84/jump-if-= $emit-disp:loop/disp32
3037 $emit-disp:disp8:
3038
3039
3040 68/push 1/imm32
3041 51/push-ecx
3042 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3043
3044 e8/call emit/disp32
3045
3046 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3047
3048 $emit-disp:break:
3049
3050 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3051
3052 5a/pop-to-edx
3053 59/pop-to-ecx
3054 58/pop-to-eax
3055
3056 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3057 5d/pop-to-ebp
3058 c3/return
3059
3060 emit-imm:
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079 55/push-ebp
3080 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3081
3082 50/push-eax
3083 51/push-ecx
3084 52/push-edx
3085
3086 68/push 0/imm32/end
3087 68/push 0/imm32/start
3088 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3089
3090
3091 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3092
3093 e8/call rewind-stream/disp32
3094
3095 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3096 +-- 26 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
3122 $emit-imm:loop:
3123
3124
3125 51/push-ecx
3126 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3127
3128 e8/call next-word/disp32
3129
3130 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3131 +-- 40 lines: #? # dump word-slice --------------------------------------------------------------------------------------------------------------------------------------------------
3171 $emit-imm:check0:
3172
3173
3174
3175 51/push-ecx
3176
3177 e8/call slice-empty?/disp32
3178
3179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3180
3181 3d/compare-eax-and 0/imm32/false
3182 0f 85/jump-if-!= $emit-imm:break/disp32
3183 $emit-imm:check1:
3184
3185
3186 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3187
3188 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3189 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3190
3191 3d/compare-eax-and 0x23/imm32/hash
3192 0f 84/jump-if-= $emit-imm:break/disp32
3193 $emit-imm:check-for-imm32:
3194
3195
3196
3197 68/push "imm32"/imm32
3198 51/push-ecx
3199
3200 e8/call has-metadata?/disp32
3201
3202 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3203
3204 3d/compare-eax-and 0/imm32/false
3205 74/jump-if-= $emit-imm:check-for-imm16/disp8
3206 $emit-imm:imm32:
3207
3208
3209 68/push 4/imm32
3210 51/push-ecx
3211 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3212
3213 e8/call emit/disp32
3214
3215 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3216
3217 e9/jump $emit-imm:break/disp32
3218 $emit-imm:check-for-imm16:
3219
3220
3221
3222 68/push "imm16"/imm32
3223 51/push-ecx
3224
3225 e8/call has-metadata?/disp32
3226
3227 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3228
3229 3d/compare-eax-and 0/imm32/false
3230 74/jump-if-= $emit-imm:check-for-imm8/disp8
3231 $emit-imm:imm16:
3232
3233
3234 68/push 2/imm32
3235 51/push-ecx
3236 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3237
3238 e8/call emit/disp32
3239
3240 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3241
3242 e9/jump $emit-imm:break/disp32
3243 $emit-imm:check-for-imm8:
3244
3245
3246
3247 68/push "imm8"/imm32
3248 51/push-ecx
3249
3250 e8/call has-metadata?/disp32
3251
3252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3253
3254 3d/compare-eax-and 0/imm32/false
3255 0f 84/jump-if-= $emit-imm:loop/disp32
3256 $emit-imm:imm8:
3257
3258
3259 68/push 1/imm32
3260 51/push-ecx
3261 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3262
3263 e8/call emit/disp32
3264
3265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3266
3267 $emit-imm:break:
3268
3269 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3270
3271 5a/pop-to-edx
3272 59/pop-to-ecx
3273 58/pop-to-eax
3274
3275 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3276 5d/pop-to-ebp
3277 c3/return
3278
3279 emit-line-in-comment:
3280
3281 55/push-ebp
3282 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3283
3284
3285 68/push " # "/imm32
3286 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3287
3288 e8/call write-buffered/disp32
3289
3290 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3291
3292
3293 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3294 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3295
3296 e8/call write-stream-data/disp32
3297
3298 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3299 $emit-line-in-comment:end:
3300
3301 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3302 5d/pop-to-ebp
3303 c3/return
3304
3305 test-convert-instruction-passes-comments-through:
3306
3307
3308 55/push-ebp
3309 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3310
3311
3312
3313 68/push _test-input-stream/imm32
3314
3315 e8/call clear-stream/disp32
3316
3317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3318
3319
3320 68/push _test-output-stream/imm32
3321
3322 e8/call clear-stream/disp32
3323
3324 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3325
3326
3327 68/push $_test-output-buffered-file->buffer/imm32
3328
3329 e8/call clear-stream/disp32
3330
3331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3332
3333
3334
3335 68/push "# abcd"/imm32
3336 68/push _test-input-stream/imm32
3337
3338 e8/call write/disp32
3339
3340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3341
3342
3343 68/push _test-output-buffered-file/imm32
3344 68/push _test-input-stream/imm32
3345
3346 e8/call convert-instruction/disp32
3347
3348 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3349
3350
3351
3352 68/push _test-output-buffered-file/imm32
3353
3354 e8/call flush/disp32
3355
3356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3357
3358
3359 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3360 68/push "# abcd"/imm32
3361 68/push _test-output-stream/imm32
3362
3363 e8/call check-stream-equal/disp32
3364
3365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3366
3367 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3368 5d/pop-to-ebp
3369 c3/return
3370
3371 test-convert-instruction-passes-labels-through:
3372
3373
3374 55/push-ebp
3375 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3376
3377
3378
3379 68/push _test-input-stream/imm32
3380
3381 e8/call clear-stream/disp32
3382
3383 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3384
3385
3386 68/push _test-output-stream/imm32
3387
3388 e8/call clear-stream/disp32
3389
3390 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3391
3392
3393 68/push $_test-output-buffered-file->buffer/imm32
3394
3395 e8/call clear-stream/disp32
3396
3397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3398
3399
3400
3401 68/push "ab: # cd"/imm32
3402 68/push _test-input-stream/imm32
3403
3404 e8/call write/disp32
3405
3406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3407
3408
3409 68/push _test-output-buffered-file/imm32
3410 68/push _test-input-stream/imm32
3411
3412 e8/call convert-instruction/disp32
3413
3414 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3415
3416
3417
3418 68/push _test-output-buffered-file/imm32
3419
3420 e8/call flush/disp32
3421
3422 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3423
3424
3425 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3426 68/push "ab: # cd"/imm32
3427 68/push _test-output-stream/imm32
3428
3429 e8/call check-stream-equal/disp32
3430
3431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3432
3433 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3434 5d/pop-to-ebp
3435 c3/return
3436
3437 test-convert-instruction-handles-single-opcode:
3438
3439
3440 55/push-ebp
3441 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3442
3443
3444
3445 68/push _test-input-stream/imm32
3446
3447 e8/call clear-stream/disp32
3448
3449 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3450
3451
3452 68/push _test-output-stream/imm32
3453
3454 e8/call clear-stream/disp32
3455
3456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3457
3458
3459 68/push $_test-output-buffered-file->buffer/imm32
3460
3461 e8/call clear-stream/disp32
3462
3463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3464
3465
3466
3467 68/push "ab/cd # comment"/imm32
3468 68/push _test-input-stream/imm32
3469
3470 e8/call write/disp32
3471
3472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3473
3474
3475 68/push _test-output-buffered-file/imm32
3476 68/push _test-input-stream/imm32
3477
3478 e8/call convert-instruction/disp32
3479
3480 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3481
3482
3483
3484 68/push _test-output-buffered-file/imm32
3485
3486 e8/call flush/disp32
3487
3488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3489 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3515
3516
3517 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3518 68/push "ab # ab/cd # comment"/imm32
3519 68/push _test-output-stream/imm32
3520
3521 e8/call check-stream-equal/disp32
3522
3523 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3524
3525 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3526 5d/pop-to-ebp
3527 c3/return
3528
3529 test-convert-instruction-handles-0f-opcode:
3530
3531
3532 55/push-ebp
3533 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3534
3535
3536
3537 68/push _test-input-stream/imm32
3538
3539 e8/call clear-stream/disp32
3540
3541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3542
3543
3544 68/push _test-output-stream/imm32
3545
3546 e8/call clear-stream/disp32
3547
3548 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3549
3550
3551 68/push $_test-output-buffered-file->buffer/imm32
3552
3553 e8/call clear-stream/disp32
3554
3555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3556
3557
3558
3559 68/push "0f/m1 ab/m2 # comment"/imm32
3560 68/push _test-input-stream/imm32
3561
3562 e8/call write/disp32
3563
3564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3565
3566
3567 68/push _test-output-buffered-file/imm32
3568 68/push _test-input-stream/imm32
3569
3570 e8/call convert-instruction/disp32
3571
3572 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3573
3574
3575
3576 68/push _test-output-buffered-file/imm32
3577
3578 e8/call flush/disp32
3579
3580 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3581 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3607
3608
3609 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3610 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3611 68/push _test-output-stream/imm32
3612
3613 e8/call check-stream-equal/disp32
3614
3615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3616
3617 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3618 5d/pop-to-ebp
3619 c3/return
3620
3621 test-convert-instruction-handles-f2-opcode:
3622
3623
3624 55/push-ebp
3625 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3626
3627
3628
3629 68/push _test-input-stream/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 68/push _test-output-stream/imm32
3637
3638 e8/call clear-stream/disp32
3639
3640 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3641
3642
3643 68/push $_test-output-buffered-file->buffer/imm32
3644
3645 e8/call clear-stream/disp32
3646
3647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3648
3649
3650
3651 68/push "f2/m1 ab/m2 # comment"/imm32
3652 68/push _test-input-stream/imm32
3653
3654 e8/call write/disp32
3655
3656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3657
3658
3659 68/push _test-output-buffered-file/imm32
3660 68/push _test-input-stream/imm32
3661
3662 e8/call convert-instruction/disp32
3663
3664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3665
3666
3667
3668 68/push _test-output-buffered-file/imm32
3669
3670 e8/call flush/disp32
3671
3672 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3673 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3699
3700
3701 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3702 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3703 68/push _test-output-stream/imm32
3704
3705 e8/call check-stream-equal/disp32
3706
3707 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3708
3709 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3710 5d/pop-to-ebp
3711 c3/return
3712
3713 test-convert-instruction-handles-f3-opcode:
3714
3715
3716 55/push-ebp
3717 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3718
3719
3720
3721 68/push _test-input-stream/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 68/push _test-output-stream/imm32
3729
3730 e8/call clear-stream/disp32
3731
3732 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3733
3734
3735 68/push $_test-output-buffered-file->buffer/imm32
3736
3737 e8/call clear-stream/disp32
3738
3739 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3740
3741
3742
3743 68/push "f3/m1 ab/m2 # comment"/imm32
3744 68/push _test-input-stream/imm32
3745
3746 e8/call write/disp32
3747
3748 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3749
3750
3751 68/push _test-output-buffered-file/imm32
3752 68/push _test-input-stream/imm32
3753
3754 e8/call convert-instruction/disp32
3755
3756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3757
3758
3759
3760 68/push _test-output-buffered-file/imm32
3761
3762 e8/call flush/disp32
3763
3764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3765 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3791
3792
3793 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3794 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3795 68/push _test-output-stream/imm32
3796
3797 e8/call check-stream-equal/disp32
3798
3799 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3800
3801 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3802 5d/pop-to-ebp
3803 c3/return
3804
3805 test-convert-instruction-handles-f2-0f-opcode:
3806
3807
3808 55/push-ebp
3809 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3810
3811
3812
3813 68/push _test-input-stream/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 68/push _test-output-stream/imm32
3821
3822 e8/call clear-stream/disp32
3823
3824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3825
3826
3827 68/push $_test-output-buffered-file->buffer/imm32
3828
3829 e8/call clear-stream/disp32
3830
3831 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3832
3833
3834
3835 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
3836 68/push _test-input-stream/imm32
3837
3838 e8/call write/disp32
3839
3840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3841
3842
3843 68/push _test-output-buffered-file/imm32
3844 68/push _test-input-stream/imm32
3845
3846 e8/call convert-instruction/disp32
3847
3848 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3849
3850
3851
3852 68/push _test-output-buffered-file/imm32
3853
3854 e8/call flush/disp32
3855
3856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3857 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3883
3884
3885 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
3886 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
3887 68/push _test-output-stream/imm32
3888
3889 e8/call check-stream-equal/disp32
3890
3891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3892
3893 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3894 5d/pop-to-ebp
3895 c3/return
3896
3897 test-convert-instruction-handles-f3-0f-opcode:
3898
3899
3900 55/push-ebp
3901 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3902
3903
3904
3905 68/push _test-input-stream/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 68/push _test-output-stream/imm32
3913
3914 e8/call clear-stream/disp32
3915
3916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3917
3918
3919 68/push $_test-output-buffered-file->buffer/imm32
3920
3921 e8/call clear-stream/disp32
3922
3923 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3924
3925
3926
3927 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
3928 68/push _test-input-stream/imm32
3929
3930 e8/call write/disp32
3931
3932 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3933
3934
3935 68/push _test-output-buffered-file/imm32
3936 68/push _test-input-stream/imm32
3937
3938 e8/call convert-instruction/disp32
3939
3940 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3941
3942
3943
3944 68/push _test-output-buffered-file/imm32
3945
3946 e8/call flush/disp32
3947
3948 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3949 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
3975
3976
3977 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
3978 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
3979 68/push _test-output-stream/imm32
3980
3981 e8/call check-stream-equal/disp32
3982
3983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3984
3985 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3986 5d/pop-to-ebp
3987 c3/return
3988
3989 test-convert-instruction-handles-unused-opcodes:
3990
3991
3992 55/push-ebp
3993 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3994
3995
3996
3997 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4005
4006 e8/call clear-stream/disp32
4007
4008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4009
4010
4011 68/push $_test-output-buffered-file->buffer/imm32
4012
4013 e8/call clear-stream/disp32
4014
4015 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4016
4017
4018
4019 68/push "ab/m1 cd/m2 # comment"/imm32
4020 68/push _test-input-stream/imm32
4021
4022 e8/call write/disp32
4023
4024 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4025
4026
4027 68/push _test-output-buffered-file/imm32
4028 68/push _test-input-stream/imm32
4029
4030 e8/call convert-instruction/disp32
4031
4032 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4033
4034
4035
4036 68/push _test-output-buffered-file/imm32
4037
4038 e8/call flush/disp32
4039
4040 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4041 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4067
4068
4069 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4070 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4071 68/push _test-output-stream/imm32
4072
4073 e8/call check-stream-equal/disp32
4074
4075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4076
4077 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4078 5d/pop-to-ebp
4079 c3/return
4080
4081 test-convert-instruction-handles-unused-second-opcodes:
4082
4083
4084 55/push-ebp
4085 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4086
4087
4088
4089 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4097
4098 e8/call clear-stream/disp32
4099
4100 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4101
4102
4103 68/push $_test-output-buffered-file->buffer/imm32
4104
4105 e8/call clear-stream/disp32
4106
4107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4108
4109
4110
4111 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4112 68/push _test-input-stream/imm32
4113
4114 e8/call write/disp32
4115
4116 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4117
4118
4119 68/push _test-output-buffered-file/imm32
4120 68/push _test-input-stream/imm32
4121
4122 e8/call convert-instruction/disp32
4123
4124 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4125
4126
4127
4128 68/push _test-output-buffered-file/imm32
4129
4130 e8/call flush/disp32
4131
4132 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4133 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4159
4160
4161 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4162 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4163 68/push _test-output-stream/imm32
4164
4165 e8/call check-stream-equal/disp32
4166
4167 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4168
4169 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4170 5d/pop-to-ebp
4171 c3/return
4172
4173 test-convert-instruction-handles-unused-second-opcodes-2:
4174
4175
4176 55/push-ebp
4177 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4178
4179
4180
4181 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4189
4190 e8/call clear-stream/disp32
4191
4192 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4193
4194
4195 68/push $_test-output-buffered-file->buffer/imm32
4196
4197 e8/call clear-stream/disp32
4198
4199 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4200
4201
4202
4203 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4204 68/push _test-input-stream/imm32
4205
4206 e8/call write/disp32
4207
4208 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4209
4210
4211 68/push _test-output-buffered-file/imm32
4212 68/push _test-input-stream/imm32
4213
4214 e8/call convert-instruction/disp32
4215
4216 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4217
4218
4219
4220 68/push _test-output-buffered-file/imm32
4221
4222 e8/call flush/disp32
4223
4224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4225 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4251
4252
4253 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4254 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4255 68/push _test-output-stream/imm32
4256
4257 e8/call check-stream-equal/disp32
4258
4259 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4260
4261 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4262 5d/pop-to-ebp
4263 c3/return
4264
4265 test-convert-instruction-emits-modrm-byte:
4266
4267
4268 55/push-ebp
4269 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4270
4271
4272
4273 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4281
4282 e8/call clear-stream/disp32
4283
4284 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4285
4286
4287 68/push $_test-output-buffered-file->buffer/imm32
4288
4289 e8/call clear-stream/disp32
4290
4291 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4292
4293
4294
4295 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4296 68/push _test-input-stream/imm32
4297
4298 e8/call write/disp32
4299
4300 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4301
4302
4303 68/push _test-output-buffered-file/imm32
4304 68/push _test-input-stream/imm32
4305
4306 e8/call convert-instruction/disp32
4307
4308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4309
4310
4311
4312 68/push _test-output-buffered-file/imm32
4313
4314 e8/call flush/disp32
4315
4316 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4317 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4343
4344
4345 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4346 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4347 68/push _test-output-stream/imm32
4348
4349 e8/call check-stream-equal/disp32
4350
4351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4352
4353 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4354 5d/pop-to-ebp
4355 c3/return
4356
4357 test-convert-instruction-emits-modrm-byte-with-non-zero-mod:
4358
4359 55/push-ebp
4360 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4361
4362
4363
4364 68/push _test-input-stream/imm32
4365
4366 e8/call clear-stream/disp32
4367
4368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4369
4370
4371 68/push _test-output-stream/imm32
4372
4373 e8/call clear-stream/disp32
4374
4375 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4376
4377
4378 68/push $_test-output-buffered-file->buffer/imm32
4379
4380 e8/call clear-stream/disp32
4381
4382 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4383
4384
4385
4386 68/push "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4387 68/push _test-input-stream/imm32
4388
4389 e8/call write/disp32
4390
4391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4392
4393
4394 68/push _test-output-buffered-file/imm32
4395 68/push _test-input-stream/imm32
4396
4397 e8/call convert-instruction/disp32
4398
4399 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4400
4401
4402 68/push _test-output-buffered-file/imm32
4403
4404 e8/call flush/disp32
4405
4406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4407 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4433
4434
4435
4436 68/push "F - test-convert-instruction-foo"/imm32
4437 68/push "01 cb # 01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4438 68/push _test-output-stream/imm32
4439
4440 e8/call check-stream-equal/disp32
4441
4442 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4443
4444 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4445 5d/pop-to-ebp
4446 c3/return
4447
4448 test-convert-instruction-emits-modrm-byte-from-subop:
4449
4450
4451 55/push-ebp
4452 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4453
4454
4455
4456 68/push _test-input-stream/imm32
4457
4458 e8/call clear-stream/disp32
4459
4460 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4461
4462
4463 68/push _test-output-stream/imm32
4464
4465 e8/call clear-stream/disp32
4466
4467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4468
4469
4470 68/push $_test-output-buffered-file->buffer/imm32
4471
4472 e8/call clear-stream/disp32
4473
4474 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4475
4476
4477
4478 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4479 68/push _test-input-stream/imm32
4480
4481 e8/call write/disp32
4482
4483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4484
4485
4486 68/push _test-output-buffered-file/imm32
4487 68/push _test-input-stream/imm32
4488
4489 e8/call convert-instruction/disp32
4490
4491 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4492
4493
4494
4495 68/push _test-output-buffered-file/imm32
4496
4497 e8/call flush/disp32
4498
4499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4500 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4526
4527
4528 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4529 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4530 68/push _test-output-stream/imm32
4531
4532 e8/call check-stream-equal/disp32
4533
4534 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4535
4536 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4537 5d/pop-to-ebp
4538 c3/return
4539
4540 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4541
4542
4543 55/push-ebp
4544 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4545
4546
4547
4548 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4556
4557 e8/call clear-stream/disp32
4558
4559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4560
4561
4562 68/push $_test-output-buffered-file->buffer/imm32
4563
4564 e8/call clear-stream/disp32
4565
4566 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4567
4568
4569
4570 68/push "8b/copy 0/rm32 1/r32"/imm32
4571 68/push _test-input-stream/imm32
4572
4573 e8/call write/disp32
4574
4575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4576
4577
4578 68/push _test-output-buffered-file/imm32
4579 68/push _test-input-stream/imm32
4580
4581 e8/call convert-instruction/disp32
4582
4583 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4584
4585
4586
4587 68/push _test-output-buffered-file/imm32
4588
4589 e8/call flush/disp32
4590
4591 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4592 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4618
4619
4620 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4621 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4622 68/push _test-output-stream/imm32
4623
4624 e8/call check-stream-equal/disp32
4625
4626 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4627
4628 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4629 5d/pop-to-ebp
4630 c3/return
4631
4632 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4633
4634
4635 55/push-ebp
4636 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4637
4638
4639
4640 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4648
4649 e8/call clear-stream/disp32
4650
4651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4652
4653
4654 68/push $_test-output-buffered-file->buffer/imm32
4655
4656 e8/call clear-stream/disp32
4657
4658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4659
4660
4661
4662 68/push "8b/copy 0/mod 1/r32"/imm32
4663 68/push _test-input-stream/imm32
4664
4665 e8/call write/disp32
4666
4667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4668
4669
4670 68/push _test-output-buffered-file/imm32
4671 68/push _test-input-stream/imm32
4672
4673 e8/call convert-instruction/disp32
4674
4675 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4676
4677
4678
4679 68/push _test-output-buffered-file/imm32
4680
4681 e8/call flush/disp32
4682
4683 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4684 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4710
4711
4712 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4713 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4714 68/push _test-output-stream/imm32
4715
4716 e8/call check-stream-equal/disp32
4717
4718 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4719
4720 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4721 5d/pop-to-ebp
4722 c3/return
4723
4724 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4725
4726
4727 55/push-ebp
4728 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4729
4730
4731
4732 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4740
4741 e8/call clear-stream/disp32
4742
4743 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4744
4745
4746 68/push $_test-output-buffered-file->buffer/imm32
4747
4748 e8/call clear-stream/disp32
4749
4750 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4751
4752
4753
4754 68/push "8b/copy 0/mod 0/rm32"/imm32
4755 68/push _test-input-stream/imm32
4756
4757 e8/call write/disp32
4758
4759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4760
4761
4762 68/push _test-output-buffered-file/imm32
4763 68/push _test-input-stream/imm32
4764
4765 e8/call convert-instruction/disp32
4766
4767 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4768
4769
4770
4771 68/push _test-output-buffered-file/imm32
4772
4773 e8/call flush/disp32
4774
4775 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4776 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4802
4803
4804 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4805 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4806 68/push _test-output-stream/imm32
4807
4808 e8/call check-stream-equal/disp32
4809
4810 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4811
4812 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4813 5d/pop-to-ebp
4814 c3/return
4815
4816 test-convert-instruction-emits-sib-byte:
4817
4818
4819 55/push-ebp
4820 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4821
4822
4823
4824 68/push _test-input-stream/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 68/push _test-output-stream/imm32
4832
4833 e8/call clear-stream/disp32
4834
4835 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4836
4837
4838 68/push $_test-output-buffered-file->buffer/imm32
4839
4840 e8/call clear-stream/disp32
4841
4842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4843
4844
4845
4846 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4847 68/push _test-input-stream/imm32
4848
4849 e8/call write/disp32
4850
4851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4852
4853
4854 68/push _test-output-buffered-file/imm32
4855 68/push _test-input-stream/imm32
4856
4857 e8/call convert-instruction/disp32
4858
4859 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4860
4861
4862
4863 68/push _test-output-buffered-file/imm32
4864
4865 e8/call flush/disp32
4866
4867 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4868 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4894
4895
4896 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
4897 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4898 68/push _test-output-stream/imm32
4899
4900 e8/call check-stream-equal/disp32
4901
4902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4903
4904 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4905 5d/pop-to-ebp
4906 c3/return
4907
4908 test-convert-instruction-emits-sib-byte-with-missing-base:
4909
4910
4911 55/push-ebp
4912 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4913
4914
4915
4916 68/push _test-input-stream/imm32
4917
4918 e8/call clear-stream/disp32
4919
4920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4921
4922
4923 68/push _test-output-stream/imm32
4924
4925 e8/call clear-stream/disp32
4926
4927 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4928
4929
4930 68/push $_test-output-buffered-file->buffer/imm32
4931
4932 e8/call clear-stream/disp32
4933
4934 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4935
4936
4937
4938 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4939 68/push _test-input-stream/imm32
4940
4941 e8/call write/disp32
4942
4943 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4944
4945
4946 68/push _test-output-buffered-file/imm32
4947 68/push _test-input-stream/imm32
4948
4949 e8/call convert-instruction/disp32
4950
4951 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4952
4953
4954
4955 68/push _test-output-buffered-file/imm32
4956
4957 e8/call flush/disp32
4958
4959 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4960 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
4986
4987
4988 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
4989 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4990 68/push _test-output-stream/imm32
4991
4992 e8/call check-stream-equal/disp32
4993
4994 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4995
4996 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4997 5d/pop-to-ebp
4998 c3/return
4999
5000 test-convert-instruction-emits-sib-byte-with-missing-index:
5001
5002
5003 55/push-ebp
5004 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5005
5006
5007
5008 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5016
5017 e8/call clear-stream/disp32
5018
5019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5020
5021
5022 68/push $_test-output-buffered-file->buffer/imm32
5023
5024 e8/call clear-stream/disp32
5025
5026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5027
5028
5029
5030 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5031 68/push _test-input-stream/imm32
5032
5033 e8/call write/disp32
5034
5035 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5036
5037
5038 68/push _test-output-buffered-file/imm32
5039 68/push _test-input-stream/imm32
5040
5041 e8/call convert-instruction/disp32
5042
5043 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5044
5045
5046
5047 68/push _test-output-buffered-file/imm32
5048
5049 e8/call flush/disp32
5050
5051 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5052 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5078
5079
5080 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5081 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5082 68/push _test-output-stream/imm32
5083
5084 e8/call check-stream-equal/disp32
5085
5086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5087
5088 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5089 5d/pop-to-ebp
5090 c3/return
5091
5092 test-convert-instruction-emits-sib-byte-with-missing-scale:
5093
5094
5095 55/push-ebp
5096 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5097
5098
5099
5100 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5108
5109 e8/call clear-stream/disp32
5110
5111 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5112
5113
5114 68/push $_test-output-buffered-file->buffer/imm32
5115
5116 e8/call clear-stream/disp32
5117
5118 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5119
5120
5121
5122 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5123 68/push _test-input-stream/imm32
5124
5125 e8/call write/disp32
5126
5127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5128
5129
5130 68/push _test-output-buffered-file/imm32
5131 68/push _test-input-stream/imm32
5132
5133 e8/call convert-instruction/disp32
5134
5135 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5136
5137
5138
5139 68/push _test-output-buffered-file/imm32
5140
5141 e8/call flush/disp32
5142
5143 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5144 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5170
5171
5172 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5173 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5174 68/push _test-output-stream/imm32
5175
5176 e8/call check-stream-equal/disp32
5177
5178 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5179
5180 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5181 5d/pop-to-ebp
5182 c3/return
5183
5184 test-convert-instruction-handles-disp32-operand:
5185
5186
5187 55/push-ebp
5188 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5189
5190
5191
5192 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5200
5201 e8/call clear-stream/disp32
5202
5203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5204
5205
5206 68/push $_test-output-buffered-file->buffer/imm32
5207
5208 e8/call clear-stream/disp32
5209
5210 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5211
5212
5213
5214 68/push "e8/call 20/disp32"/imm32
5215 68/push _test-input-stream/imm32
5216
5217 e8/call write/disp32
5218
5219 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5220
5221
5222 68/push _test-output-buffered-file/imm32
5223 68/push _test-input-stream/imm32
5224
5225 e8/call convert-instruction/disp32
5226
5227 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5228
5229
5230
5231 68/push _test-output-buffered-file/imm32
5232
5233 e8/call flush/disp32
5234
5235 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5236 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5262
5263
5264 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5265 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5266 68/push _test-output-stream/imm32
5267
5268 e8/call check-stream-equal/disp32
5269
5270 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5271
5272 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5273 5d/pop-to-ebp
5274 c3/return
5275
5276 test-convert-instruction-handles-disp16-operand:
5277
5278
5279 55/push-ebp
5280 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5281
5282
5283
5284 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5292
5293 e8/call clear-stream/disp32
5294
5295 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5296
5297
5298 68/push $_test-output-buffered-file->buffer/imm32
5299
5300 e8/call clear-stream/disp32
5301
5302 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5303
5304
5305
5306 68/push "e8/call 20/disp16"/imm32
5307 68/push _test-input-stream/imm32
5308
5309 e8/call write/disp32
5310
5311 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5312
5313
5314 68/push _test-output-buffered-file/imm32
5315 68/push _test-input-stream/imm32
5316
5317 e8/call convert-instruction/disp32
5318
5319 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5320
5321
5322
5323 68/push _test-output-buffered-file/imm32
5324
5325 e8/call flush/disp32
5326
5327 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5328 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5354
5355
5356 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5357 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5358 68/push _test-output-stream/imm32
5359
5360 e8/call check-stream-equal/disp32
5361
5362 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5363
5364 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5365 5d/pop-to-ebp
5366 c3/return
5367
5368 test-convert-instruction-handles-disp8-operand:
5369
5370
5371 55/push-ebp
5372 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5373
5374
5375
5376 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5384
5385 e8/call clear-stream/disp32
5386
5387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5388
5389
5390 68/push $_test-output-buffered-file->buffer/imm32
5391
5392 e8/call clear-stream/disp32
5393
5394 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5395
5396
5397
5398 68/push "eb/jump 20/disp8"/imm32
5399 68/push _test-input-stream/imm32
5400
5401 e8/call write/disp32
5402
5403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5404
5405
5406 68/push _test-output-buffered-file/imm32
5407 68/push _test-input-stream/imm32
5408
5409 e8/call convert-instruction/disp32
5410
5411 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5412
5413
5414
5415 68/push _test-output-buffered-file/imm32
5416
5417 e8/call flush/disp32
5418
5419 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5420 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5446
5447
5448 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5449 68/push "eb 20 # eb/jump 20/disp8"/imm32
5450 68/push _test-output-stream/imm32
5451
5452 e8/call check-stream-equal/disp32
5453
5454 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5455
5456 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5457 5d/pop-to-ebp
5458 c3/return
5459
5460 test-convert-instruction-handles-disp8-name:
5461
5462
5463 55/push-ebp
5464 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5465
5466
5467
5468 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5476
5477 e8/call clear-stream/disp32
5478
5479 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5480
5481
5482 68/push $_test-output-buffered-file->buffer/imm32
5483
5484 e8/call clear-stream/disp32
5485
5486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5487
5488
5489
5490 68/push "eb/jump xyz/disp8"/imm32
5491 68/push _test-input-stream/imm32
5492
5493 e8/call write/disp32
5494
5495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5496
5497
5498 68/push _test-output-buffered-file/imm32
5499 68/push _test-input-stream/imm32
5500
5501 e8/call convert-instruction/disp32
5502
5503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5504
5505
5506
5507 68/push _test-output-buffered-file/imm32
5508
5509 e8/call flush/disp32
5510
5511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5512 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5538
5539
5540 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5541 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5542 68/push _test-output-stream/imm32
5543
5544 e8/call check-stream-equal/disp32
5545
5546 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5547
5548 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5549 5d/pop-to-ebp
5550 c3/return
5551
5552 test-convert-instruction-handles-imm32-operand:
5553
5554
5555 55/push-ebp
5556 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5557
5558
5559
5560 68/push _test-input-stream/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 68/push _test-output-stream/imm32
5568
5569 e8/call clear-stream/disp32
5570
5571 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5572
5573
5574 68/push $_test-output-buffered-file->buffer/imm32
5575
5576 e8/call clear-stream/disp32
5577
5578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5579
5580
5581
5582 68/push "68/push 0x20/imm32"/imm32
5583 68/push _test-input-stream/imm32
5584
5585 e8/call write/disp32
5586
5587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5588
5589
5590 68/push _test-output-buffered-file/imm32
5591 68/push _test-input-stream/imm32
5592
5593 e8/call convert-instruction/disp32
5594
5595 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5596
5597
5598
5599 68/push _test-output-buffered-file/imm32
5600
5601 e8/call flush/disp32
5602
5603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5604 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5630
5631
5632 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5633 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5634 68/push _test-output-stream/imm32
5635
5636 e8/call check-stream-equal/disp32
5637
5638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5639
5640 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5641 5d/pop-to-ebp
5642 c3/return
5643
5644 test-convert-instruction-handles-imm16-operand:
5645
5646
5647
5648 55/push-ebp
5649 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5650
5651
5652
5653 68/push _test-input-stream/imm32
5654
5655 e8/call clear-stream/disp32
5656
5657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5658
5659
5660 68/push _test-output-stream/imm32
5661
5662 e8/call clear-stream/disp32
5663
5664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5665
5666
5667 68/push $_test-output-buffered-file->buffer/imm32
5668
5669 e8/call clear-stream/disp32
5670
5671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5672
5673
5674
5675 68/push "68/push 0x20/imm16"/imm32
5676 68/push _test-input-stream/imm32
5677
5678 e8/call write/disp32
5679
5680 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5681
5682
5683 68/push _test-output-buffered-file/imm32
5684 68/push _test-input-stream/imm32
5685
5686 e8/call convert-instruction/disp32
5687
5688 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5689
5690
5691
5692 68/push _test-output-buffered-file/imm32
5693
5694 e8/call flush/disp32
5695
5696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5697 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5723
5724
5725 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5726 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5727 68/push _test-output-stream/imm32
5728
5729 e8/call check-stream-equal/disp32
5730
5731 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5732
5733 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5734 5d/pop-to-ebp
5735 c3/return
5736
5737 test-convert-instruction-handles-imm8-operand:
5738
5739
5740
5741 55/push-ebp
5742 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5743
5744
5745
5746 68/push _test-input-stream/imm32
5747
5748 e8/call clear-stream/disp32
5749
5750 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5751
5752
5753 68/push _test-output-stream/imm32
5754
5755 e8/call clear-stream/disp32
5756
5757 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5758
5759
5760 68/push $_test-output-buffered-file->buffer/imm32
5761
5762 e8/call clear-stream/disp32
5763
5764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5765
5766
5767
5768 68/push "68/push 0x20/imm8"/imm32
5769 68/push _test-input-stream/imm32
5770
5771 e8/call write/disp32
5772
5773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5774
5775
5776 68/push _test-output-buffered-file/imm32
5777 68/push _test-input-stream/imm32
5778
5779 e8/call convert-instruction/disp32
5780
5781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5782
5783
5784
5785 68/push _test-output-buffered-file/imm32
5786
5787 e8/call flush/disp32
5788
5789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5790 +-- 26 lines: #? # dump output ------------------------------------------------------------------------------------------------------------------------------------------------------
5816
5817
5818 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
5819 68/push "68 20 # 68/push 0x20/imm8"/imm32
5820 68/push _test-output-stream/imm32
5821
5822 e8/call check-stream-equal/disp32
5823
5824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5825
5826 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5827 5d/pop-to-ebp
5828 c3/return
5829
5830
5831 parse-datum-of-word:
5832
5833 55/push-ebp
5834 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5835
5836 51/push-ecx
5837 56/push-esi
5838
5839 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
5840
5841 68/push 0/imm32/end
5842 68/push 0/imm32/start
5843 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
5844
5845
5846 51/push-ecx
5847 68/push 0x2f/imm32/slash
5848 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
5849 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
5850
5851 e8/call next-token-from-slice/disp32
5852
5853 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
5854
5855
5856 51/push-ecx
5857
5858 e8/call parse-hex-int-from-slice/disp32
5859
5860 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5861 $parse-datum-of-word:end:
5862
5863 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5864
5865 5e/pop-to-esi
5866 59/pop-to-ecx
5867
5868 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5869 5d/pop-to-ebp
5870 c3/return
5871
5872