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-lesser-or-equal $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
50 74/jump-if-equal $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 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32
60 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . .
61
62
63 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32
64
65
66 50/push-eax/ed
67 68/push Stderr/imm32
68 68/push Stdout/imm32
69 68/push Stdin/imm32
70
71 e8/call subx-pack/disp32
72
73 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
74
75 bb/copy-to-ebx 0/imm32
76 $subx-pack-main:end:
77 b8/copy-to-eax 1/imm32/exit
78 cd/syscall 0x80/imm8
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100 subx-pack:
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124 55/push-ebp
125 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
126
127 50/push-eax
128 51/push-ecx
129 52/push-edx
130 53/push-ebx
131
132 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
133 68/push 0x200/imm32/length
134 68/push 0/imm32/read
135 68/push 0/imm32/write
136 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
137
138 68/push 0/imm32/end
139 68/push 0/imm32/start
140 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
141
142 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
143 $subx-pack:loop:
144
145
146 51/push-ecx
147
148 e8/call clear-stream/disp32
149
150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
151
152
153 51/push-ecx
154 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
155
156 e8/call read-line-buffered/disp32
157
158 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
159 $subx-pack:check0:
160
161 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
162 0f 84/jump-if-equal $subx-pack:break/disp32
163 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
189
190
191 52/push-edx
192 51/push-ecx
193
194 e8/call next-word/disp32
195
196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
197 $subx-pack:check1:
198
199
200
201 52/push-edx
202
203 e8/call slice-empty?/disp32
204
205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
206
207 3d/compare-eax-and 0/imm32
208 0f 85/jump-if-not-equal $subx-pack:pass-through/disp32
209 $subx-pack:check2:
210 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
250
251
252
253 68/push "=="/imm32
254 52/push-edx
255
256 e8/call slice-equal?/disp32
257
258 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
259
260 3d/compare-eax-and 0/imm32
261 0f 84/jump-if-equal $subx-pack:check3/disp32
262
263
264 52/push-edx
265 51/push-ecx
266
267 e8/call next-word/disp32
268
269 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
270 +-- 40 lines: #? # dump segment name ---------------------------------------------------------------------------------------------------------------------
310
311
312 68/push "code"/imm32
313 52/push-edx
314
315 e8/call slice-equal?/disp32
316
317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
318
319 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
320
321 eb/jump $subx-pack:pass-through/disp8
322 $subx-pack:check3:
323
324
325
326 51/push-ecx
327
328 e8/call rewind-stream/disp32
329
330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
331
332 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32
333 74/jump-if-equal $subx-pack:data/disp8
334 $subx-pack:code:
335
336
337 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
338 51/push-ecx
339
340 e8/call convert-instruction/disp32
341
342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
343
344 e9/jump $subx-pack:loop/disp32
345 $subx-pack:data:
346
347
348 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
349 51/push-ecx
350
351 e8/call convert-data/disp32
352
353 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
354
355 e9/jump $subx-pack:loop/disp32
356 $subx-pack:pass-through:
357
358
359 51/push-ecx
360 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
361
362 e8/call write-stream-data/disp32
363
364 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
365
366 e9/jump $subx-pack:loop/disp32
367 $subx-pack:break:
368
369
370 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
371
372 e8/call flush/disp32
373
374 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
375 $subx-pack:end:
376
377 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
378
379 5b/pop-to-ebx
380 5a/pop-to-edx
381 59/pop-to-ecx
382 58/pop-to-eax
383
384 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
385 5d/pop-to-ebp
386 c3/return
387
388 test-subx-pack-passes-empty-lines-through:
389
390
391 55/push-ebp
392 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
393
394
395
396 68/push _test-input-stream/imm32
397
398 e8/call clear-stream/disp32
399
400 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
401
402
403 68/push _test-input-buffered-file->buffer/imm32
404
405 e8/call clear-stream/disp32
406
407 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
408
409
410 68/push _test-output-stream/imm32
411
412 e8/call clear-stream/disp32
413
414 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
415
416
417 68/push _test-output-buffered-file->buffer/imm32
418
419 e8/call clear-stream/disp32
420
421 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
422
423
424
425 68/push _test-output-buffered-file/imm32
426 68/push _test-input-buffered-file/imm32
427
428 e8/call subx-pack/disp32
429
430 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
431
432
433
434 68/push _test-output-buffered-file/imm32
435
436 e8/call flush/disp32
437
438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
439
440
441 68/push "F - test-subx-pack-passes-empty-lines-through"/imm32
442 68/push ""/imm32
443 68/push _test-output-stream/imm32
444
445 e8/call check-stream-equal/disp32
446
447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
448
449 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
450 5d/pop-to-ebp
451 c3/return
452
453 test-subx-pack-passes-lines-with-just-whitespace-through:
454
455
456 55/push-ebp
457 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
458
459
460
461 68/push _test-input-stream/imm32
462
463 e8/call clear-stream/disp32
464
465 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
466
467
468 68/push _test-input-buffered-file->buffer/imm32
469
470 e8/call clear-stream/disp32
471
472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
473
474
475 68/push _test-output-stream/imm32
476
477 e8/call clear-stream/disp32
478
479 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
480
481
482 68/push _test-output-buffered-file->buffer/imm32
483
484 e8/call clear-stream/disp32
485
486 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
487
488
489
490 68/push " "/imm32
491 68/push _test-input-stream/imm32
492
493 e8/call write/disp32
494
495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
496
497
498 68/push _test-output-buffered-file/imm32
499 68/push _test-input-buffered-file/imm32
500
501 e8/call subx-pack/disp32
502
503 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
504
505
506
507 68/push _test-output-buffered-file/imm32
508
509 e8/call flush/disp32
510
511 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
512
513
514 68/push "F - test-subx-pack-passes-with-just-whitespace-through"/imm32
515 68/push " "/imm32
516 68/push _test-output-stream/imm32
517
518 e8/call check-next-stream-line-equal/disp32
519
520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
521
522 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
523 5d/pop-to-ebp
524 c3/return
525
526 test-subx-pack-passes-segment-headers-through:
527
528
529 55/push-ebp
530 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
531
532
533
534 68/push _test-input-stream/imm32
535
536 e8/call clear-stream/disp32
537
538 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
539
540
541 68/push _test-input-buffered-file->buffer/imm32
542
543 e8/call clear-stream/disp32
544
545 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
546
547
548 68/push _test-output-stream/imm32
549
550 e8/call clear-stream/disp32
551
552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
553
554
555 68/push _test-output-buffered-file->buffer/imm32
556
557 e8/call clear-stream/disp32
558
559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
560
561
562
563 68/push "== abcd 0x1"/imm32
564 68/push _test-input-stream/imm32
565
566 e8/call write/disp32
567
568 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
569
570
571 68/push _test-output-buffered-file/imm32
572 68/push _test-input-buffered-file/imm32
573
574 e8/call subx-pack/disp32
575
576 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
577
578
579
580 68/push _test-output-buffered-file/imm32
581
582 e8/call flush/disp32
583
584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
585
586
587 68/push "F - test-subx-pack-passes-segment-headers-through"/imm32
588 68/push "== abcd 0x1"/imm32
589 68/push _test-output-stream/imm32
590
591 e8/call check-stream-equal/disp32
592
593 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
594
595 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
596 5d/pop-to-ebp
597 c3/return
598
599 test-subx-pack-in-data-segment:
600
601
602 55/push-ebp
603 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
604
605
606
607 68/push _test-input-stream/imm32
608
609 e8/call clear-stream/disp32
610
611 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
612
613
614 68/push _test-input-buffered-file->buffer/imm32
615
616 e8/call clear-stream/disp32
617
618 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
619
620
621 68/push _test-output-stream/imm32
622
623 e8/call clear-stream/disp32
624
625 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
626
627
628 68/push _test-output-buffered-file->buffer/imm32
629
630 e8/call clear-stream/disp32
631
632 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
633
634
635
636
637
638
639 68/push "== code 0x1\n"/imm32
640 68/push _test-input-stream/imm32
641
642 e8/call write/disp32
643
644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
645
646
647 68/push "== data 0x2\n"/imm32
648 68/push _test-input-stream/imm32
649
650 e8/call write/disp32
651
652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
653
654
655 68/push "3 4/imm32\n"/imm32
656 68/push _test-input-stream/imm32
657
658 e8/call write/disp32
659
660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
661
662
663 68/push _test-output-buffered-file/imm32
664 68/push _test-input-buffered-file/imm32
665
666 e8/call subx-pack/disp32
667
668 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
669
670 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
696
697
698 68/push _test-output-buffered-file/imm32
699
700 e8/call flush/disp32
701
702 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
703
704
705 68/push "F - test-subx-pack-in-data-segment/0"/imm32
706 68/push "== code 0x1"/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/1"/imm32
715 68/push "== data 0x2"/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
723 68/push "F - test-subx-pack-in-data-segment/2"/imm32
724 68/push "03 04 00 00 00 "/imm32
725 68/push _test-output-stream/imm32
726
727 e8/call check-next-stream-line-equal/disp32
728
729 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
730
731 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
732 5d/pop-to-ebp
733 c3/return
734
735 test-subx-pack-code-and-data-segments:
736
737
738 55/push-ebp
739 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
740
741
742
743 68/push _test-input-stream/imm32
744
745 e8/call clear-stream/disp32
746
747 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
748
749
750 68/push _test-input-buffered-file->buffer/imm32
751
752 e8/call clear-stream/disp32
753
754 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
755
756
757 68/push _test-output-stream/imm32
758
759 e8/call clear-stream/disp32
760
761 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
762
763
764 68/push _test-output-buffered-file->buffer/imm32
765
766 e8/call clear-stream/disp32
767
768 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
769
770
771
772
773
774
775
776
777 68/push "== code 0x1\n"/imm32
778 68/push _test-input-stream/imm32
779
780 e8/call write/disp32
781
782 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
783
784
785 68/push "e8/call 20/disp32\n"/imm32
786 68/push _test-input-stream/imm32
787
788 e8/call write/disp32
789
790 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
791
792
793 68/push "68/push 0x20/imm8\n"/imm32
794 68/push _test-input-stream/imm32
795
796 e8/call write/disp32
797
798 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
799
800
801 68/push "== data 0x2\n"/imm32
802 68/push _test-input-stream/imm32
803
804 e8/call write/disp32
805
806 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
807
808
809 68/push "3 4/imm32\n"/imm32
810 68/push _test-input-stream/imm32
811
812 e8/call write/disp32
813
814 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
815
816
817 68/push _test-output-buffered-file/imm32
818 68/push _test-input-buffered-file/imm32
819
820 e8/call subx-pack/disp32
821
822 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
823
824
825
826
827
828
829 +-- 26 lines: #? # debug print ---------------------------------------------------------------------------------------------------------------------------
855
856
857 68/push _test-output-buffered-file/imm32
858
859 e8/call flush/disp32
860
861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
862
863
864 68/push "F - test-subx-pack-code-and-data-segments/0"/imm32
865 68/push "== code 0x1"/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/1"/imm32
874 68/push "e8 20 00 00 00 # e8/call 20/disp32"/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/2"/imm32
883 68/push "68 20 # 68/push 0x20/imm8"/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/3"/imm32
892 68/push "== data 0x2"/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
900 68/push "F - test-subx-pack-code-and-data-segments/4"/imm32
901 68/push "03 04 00 00 00 "/imm32
902 68/push _test-output-stream/imm32
903
904 e8/call check-next-stream-line-equal/disp32
905
906 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
907
908 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
909 5d/pop-to-ebp
910 c3/return
911
912 convert-data:
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933 55/push-ebp
934 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
935
936 50/push-eax
937 51/push-ecx
938 52/push-edx
939
940 68/push 0/imm32/end
941 68/push 0/imm32/start
942 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
943 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
969 $convert-data:loop:
970
971
972 51/push-ecx
973 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
974
975 e8/call next-word/disp32
976
977 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
978 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
1018 $convert-data:check0:
1019
1020
1021
1022 51/push-ecx
1023
1024 e8/call slice-empty?/disp32
1025
1026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1027
1028 3d/compare-eax-and 0/imm32
1029 0f 85/jump-if-not-equal $convert-data:break/disp32
1030 $convert-data:check-for-comment:
1031
1032
1033 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1034
1035 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1036 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1037
1038 3d/compare-eax-and 0x23/imm32/hash
1039 75/jump-if-not-equal $convert-data:check-for-label/disp8
1040 $convert-data:comment:
1041
1042
1043 51/push-ecx
1044 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1045
1046 e8/call write-slice-buffered/disp32
1047
1048 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1049
1050 0f 85/jump-if-not-equal $convert-data:end/disp32
1051 $convert-data:check-for-label:
1052
1053
1054 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1055
1056 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1057 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1058
1059 3d/compare-eax-and 0x3a/imm32/colon
1060 75/jump-if-not-equal $convert-data:check-for-imm32/disp8
1061 $convert-data:label:
1062
1063
1064 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1065 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1066
1067 e8/call write-stream-data/disp32
1068
1069 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1070
1071 75/jump-if-not-equal $convert-data:end/disp8
1072 $convert-data:check-for-imm32:
1073
1074
1075
1076 68/push "imm32"/imm32
1077 51/push-ecx
1078
1079 e8/call has-metadata?/disp32
1080
1081 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1082
1083 3d/compare-eax-and 0/imm32
1084 74/jump-if-equal $convert-data:single-byte/disp8
1085 $convert-data:imm32:
1086
1087
1088 68/push 4/imm32
1089 51/push-ecx
1090 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1091
1092 e8/call emit/disp32
1093
1094 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1095 e9/jump $convert-data:loop/disp32
1096 $convert-data:single-byte:
1097
1098
1099 68/push 1/imm32
1100 51/push-ecx
1101 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1102
1103 e8/call emit/disp32
1104
1105 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1106 e9/jump $convert-data:loop/disp32
1107 $convert-data:break:
1108
1109
1110 68/push Newline/imm32
1111 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1112
1113 e8/call write-buffered/disp32
1114
1115 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1116 $convert-data:end:
1117
1118 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1119
1120 5a/pop-to-edx
1121 59/pop-to-ecx
1122 58/pop-to-eax
1123
1124 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1125 5d/pop-to-ebp
1126 c3/return
1127
1128 test-convert-data-passes-comments-through:
1129
1130
1131 55/push-ebp
1132 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1133
1134
1135
1136 68/push _test-input-stream/imm32
1137
1138 e8/call clear-stream/disp32
1139
1140 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1141
1142
1143 68/push _test-output-stream/imm32
1144
1145 e8/call clear-stream/disp32
1146
1147 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1148
1149
1150 68/push _test-output-buffered-file->buffer/imm32
1151
1152 e8/call clear-stream/disp32
1153
1154 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1155
1156
1157
1158 68/push "# abcd"/imm32
1159 68/push _test-input-stream/imm32
1160
1161 e8/call write/disp32
1162
1163 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1164
1165
1166 68/push _test-output-buffered-file/imm32
1167 68/push _test-input-stream/imm32
1168
1169 e8/call convert-data/disp32
1170
1171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1172
1173
1174
1175 68/push _test-output-buffered-file/imm32
1176
1177 e8/call flush/disp32
1178
1179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1180 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1206
1207
1208 68/push "F - test-convert-data-passes-comments-through"/imm32
1209 68/push "# abcd"/imm32
1210 68/push _test-output-stream/imm32
1211
1212 e8/call check-stream-equal/disp32
1213
1214 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1215
1216 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1217 5d/pop-to-ebp
1218 c3/return
1219
1220 test-convert-data-passes-labels-through:
1221
1222
1223 55/push-ebp
1224 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1225
1226
1227
1228 68/push _test-input-stream/imm32
1229
1230 e8/call clear-stream/disp32
1231
1232 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1233
1234
1235 68/push _test-output-stream/imm32
1236
1237 e8/call clear-stream/disp32
1238
1239 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1240
1241
1242 68/push _test-output-buffered-file->buffer/imm32
1243
1244 e8/call clear-stream/disp32
1245
1246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1247
1248
1249
1250 68/push "ab: # cd"/imm32
1251 68/push _test-input-stream/imm32
1252
1253 e8/call write/disp32
1254
1255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1256
1257
1258 68/push _test-output-buffered-file/imm32
1259 68/push _test-input-stream/imm32
1260
1261 e8/call convert-data/disp32
1262
1263 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1264
1265
1266
1267 68/push _test-output-buffered-file/imm32
1268
1269 e8/call flush/disp32
1270
1271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1272
1273
1274 68/push "F - test-convert-data-passes-labels-through"/imm32
1275 68/push "ab: # cd"/imm32
1276 68/push _test-output-stream/imm32
1277
1278 e8/call check-stream-equal/disp32
1279
1280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1281
1282 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1283 5d/pop-to-ebp
1284 c3/return
1285
1286 test-convert-data-passes-names-through:
1287
1288
1289
1290 55/push-ebp
1291 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1292
1293
1294
1295 68/push _test-input-stream/imm32
1296
1297 e8/call clear-stream/disp32
1298
1299 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1300
1301
1302 68/push _test-output-stream/imm32
1303
1304 e8/call clear-stream/disp32
1305
1306 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1307
1308
1309 68/push _test-output-buffered-file->buffer/imm32
1310
1311 e8/call clear-stream/disp32
1312
1313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1314
1315
1316
1317 68/push "abcd/imm32"/imm32
1318 68/push _test-input-stream/imm32
1319
1320 e8/call write/disp32
1321
1322 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1323
1324
1325 68/push _test-output-buffered-file/imm32
1326 68/push _test-input-stream/imm32
1327
1328 e8/call convert-data/disp32
1329
1330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1331
1332
1333
1334 68/push _test-output-buffered-file/imm32
1335
1336 e8/call flush/disp32
1337
1338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1339
1340
1341 68/push "F - test-convert-data-passes-names-through"/imm32
1342 68/push "abcd/imm32 \n"/imm32
1343 68/push _test-output-stream/imm32
1344
1345 e8/call check-stream-equal/disp32
1346
1347 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1348
1349 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1350 5d/pop-to-ebp
1351 c3/return
1352
1353 test-convert-data-handles-imm32:
1354
1355
1356 55/push-ebp
1357 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1358
1359
1360
1361 68/push _test-input-stream/imm32
1362
1363 e8/call clear-stream/disp32
1364
1365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1366
1367
1368 68/push _test-output-stream/imm32
1369
1370 e8/call clear-stream/disp32
1371
1372 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1373
1374
1375 68/push _test-output-buffered-file->buffer/imm32
1376
1377 e8/call clear-stream/disp32
1378
1379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1380
1381
1382
1383 68/push "30/imm32"/imm32
1384 68/push _test-input-stream/imm32
1385
1386 e8/call write/disp32
1387
1388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1389
1390
1391 68/push _test-output-buffered-file/imm32
1392 68/push _test-input-stream/imm32
1393
1394 e8/call convert-data/disp32
1395
1396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1397
1398
1399
1400 68/push _test-output-buffered-file/imm32
1401
1402 e8/call flush/disp32
1403
1404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1405
1406
1407 68/push "F - test-convert-data-handles-imm32"/imm32
1408 68/push "30 00 00 00 \n"/imm32
1409 68/push _test-output-stream/imm32
1410
1411 e8/call check-stream-equal/disp32
1412
1413 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1414
1415 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1416 5d/pop-to-ebp
1417 c3/return
1418
1419 test-convert-data-handles-single-byte:
1420
1421
1422
1423 55/push-ebp
1424 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1425
1426
1427
1428 68/push _test-input-stream/imm32
1429
1430 e8/call clear-stream/disp32
1431
1432 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1433
1434
1435 68/push _test-output-stream/imm32
1436
1437 e8/call clear-stream/disp32
1438
1439 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1440
1441
1442 68/push _test-output-buffered-file->buffer/imm32
1443
1444 e8/call clear-stream/disp32
1445
1446 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1447
1448
1449
1450 68/push "30/imm16"/imm32
1451 68/push _test-input-stream/imm32
1452
1453 e8/call write/disp32
1454
1455 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1456
1457
1458 68/push _test-output-buffered-file/imm32
1459 68/push _test-input-stream/imm32
1460
1461 e8/call convert-data/disp32
1462
1463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1464
1465
1466
1467 68/push _test-output-buffered-file/imm32
1468
1469 e8/call flush/disp32
1470
1471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1472
1473
1474 68/push "F - test-convert-data-handles-single-byte"/imm32
1475 68/push "30 \n"/imm32
1476 68/push _test-output-stream/imm32
1477
1478 e8/call check-stream-equal/disp32
1479
1480 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1481
1482 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1483 5d/pop-to-ebp
1484 c3/return
1485
1486 test-convert-data-multiple-bytes:
1487
1488
1489 55/push-ebp
1490 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1491
1492
1493
1494 68/push _test-input-stream/imm32
1495
1496 e8/call clear-stream/disp32
1497
1498 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1499
1500
1501 68/push _test-output-stream/imm32
1502
1503 e8/call clear-stream/disp32
1504
1505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1506
1507
1508 68/push _test-output-buffered-file->buffer/imm32
1509
1510 e8/call clear-stream/disp32
1511
1512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1513
1514
1515
1516 68/push "1 2"/imm32
1517 68/push _test-input-stream/imm32
1518
1519 e8/call write/disp32
1520
1521 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1522
1523
1524 68/push _test-output-buffered-file/imm32
1525 68/push _test-input-stream/imm32
1526
1527 e8/call convert-data/disp32
1528
1529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1530
1531
1532
1533 68/push _test-output-buffered-file/imm32
1534
1535 e8/call flush/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1538
1539
1540 68/push "F - test-convert-data-multiple-bytes"/imm32
1541 68/push "01 02 \n"/imm32
1542 68/push _test-output-stream/imm32
1543
1544 e8/call check-stream-equal/disp32
1545
1546 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1547
1548 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1549 5d/pop-to-ebp
1550 c3/return
1551
1552 test-convert-data-byte-then-name:
1553
1554
1555 55/push-ebp
1556 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1557
1558
1559
1560 68/push _test-input-stream/imm32
1561
1562 e8/call clear-stream/disp32
1563
1564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1565
1566
1567 68/push _test-output-stream/imm32
1568
1569 e8/call clear-stream/disp32
1570
1571 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1572
1573
1574 68/push _test-output-buffered-file->buffer/imm32
1575
1576 e8/call clear-stream/disp32
1577
1578 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1579
1580
1581
1582 68/push "30 abcd/o"/imm32
1583 68/push _test-input-stream/imm32
1584
1585 e8/call write/disp32
1586
1587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1588
1589
1590 68/push _test-output-buffered-file/imm32
1591 68/push _test-input-stream/imm32
1592
1593 e8/call convert-data/disp32
1594
1595 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1596
1597
1598
1599 68/push _test-output-buffered-file/imm32
1600
1601 e8/call flush/disp32
1602
1603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1604
1605
1606 68/push "F - test-convert-data-byte-then-name"/imm32
1607 68/push "30 abcd/o \n"/imm32
1608 68/push _test-output-stream/imm32
1609
1610 e8/call check-stream-equal/disp32
1611
1612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1613
1614 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1615 5d/pop-to-ebp
1616 c3/return
1617
1618 test-convert-data-multiple-words:
1619
1620
1621 55/push-ebp
1622 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1623
1624
1625
1626 68/push _test-input-stream/imm32
1627
1628 e8/call clear-stream/disp32
1629
1630 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1631
1632
1633 68/push _test-output-stream/imm32
1634
1635 e8/call clear-stream/disp32
1636
1637 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1638
1639
1640 68/push _test-output-buffered-file->buffer/imm32
1641
1642 e8/call clear-stream/disp32
1643
1644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1645
1646
1647
1648 68/push "30 abcd/o 42e1/imm32"/imm32
1649 68/push _test-input-stream/imm32
1650
1651 e8/call write/disp32
1652
1653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1654
1655
1656 68/push _test-output-buffered-file/imm32
1657 68/push _test-input-stream/imm32
1658
1659 e8/call convert-data/disp32
1660
1661 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1662
1663
1664
1665 68/push _test-output-buffered-file/imm32
1666
1667 e8/call flush/disp32
1668
1669 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1670 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1696
1697
1698 68/push "F - test-convert-data-multiple-words"/imm32
1699 68/push "30 abcd/o e1 42 00 00 \n"/imm32
1700 68/push _test-output-stream/imm32
1701
1702 e8/call check-stream-equal/disp32
1703
1704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1705
1706 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1707 5d/pop-to-ebp
1708 c3/return
1709
1710 test-convert-data-trailing-comment:
1711
1712
1713 55/push-ebp
1714 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1715
1716
1717
1718 68/push _test-input-stream/imm32
1719
1720 e8/call clear-stream/disp32
1721
1722 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1723
1724
1725 68/push _test-output-stream/imm32
1726
1727 e8/call clear-stream/disp32
1728
1729 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1730
1731
1732 68/push _test-output-buffered-file->buffer/imm32
1733
1734 e8/call clear-stream/disp32
1735
1736 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1737
1738
1739
1740 68/push "30/imm32 # comment"/imm32
1741 68/push _test-input-stream/imm32
1742
1743 e8/call write/disp32
1744
1745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1746
1747
1748 68/push _test-output-buffered-file/imm32
1749 68/push _test-input-stream/imm32
1750
1751 e8/call convert-data/disp32
1752
1753 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1754
1755
1756
1757 68/push _test-output-buffered-file/imm32
1758
1759 e8/call flush/disp32
1760
1761 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1762 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1788
1789
1790 68/push "F - test-convert-data-trailing-comment"/imm32
1791 68/push "30 00 00 00 # comment"/imm32
1792 68/push _test-output-stream/imm32
1793
1794 e8/call check-stream-equal/disp32
1795
1796 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1797
1798 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1799 5d/pop-to-ebp
1800 c3/return
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812 convert-instruction:
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834 55/push-ebp
1835 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1836
1837 50/push-eax
1838 51/push-ecx
1839 52/push-edx
1840
1841 68/push 0/imm32/end
1842 68/push 0/imm32/start
1843 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1844
1845
1846 51/push-ecx
1847 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1848
1849 e8/call next-word/disp32
1850
1851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1852 $convert-instruction:check0:
1853
1854
1855
1856 51/push-ecx
1857
1858 e8/call slice-empty?/disp32
1859
1860 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1861
1862 3d/compare-eax-and 0/imm32
1863 75/jump-if-not-equal $convert-instruction:pass-through/disp8
1864 $convert-instruction:check1:
1865
1866
1867 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
1868
1869 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1870 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
1871
1872 3d/compare-eax-and 0x23/imm32/hash
1873 74/jump-if-equal $convert-instruction:pass-through/disp8
1874 $convert-instruction:check2:
1875
1876
1877 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
1878
1879 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1880 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 0/r32/AL -1/disp8 .
1881
1882 3d/compare-eax-and 0x3a/imm32/colon
1883 75/jump-if-not-equal $convert-instruction:really-convert/disp8
1884 $convert-instruction:pass-through:
1885
1886
1887 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1888 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1889
1890 e8/call write-stream-data/disp32
1891
1892 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1893
1894 eb/jump $convert-instruction:end/disp8
1895 $convert-instruction:really-convert:
1896
1897
1898 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1899 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1900
1901 e8/call emit-opcodes/disp32
1902
1903 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1904
1905
1906 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1907 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1908
1909 e8/call emit-modrm/disp32
1910
1911 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1912
1913
1914 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1915 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1916
1917 e8/call emit-sib/disp32
1918
1919 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1920
1921
1922 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1923 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1924
1925 e8/call emit-disp/disp32
1926
1927 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1928
1929
1930 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1931 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1932
1933 e8/call emit-imm/disp32
1934
1935 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1936
1937
1938 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1939 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1940
1941 e8/call emit-line-in-comment/disp32
1942
1943 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1944 $convert-instruction:end:
1945
1946 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1947
1948 5a/pop-to-edx
1949 59/pop-to-ecx
1950 58/pop-to-eax
1951
1952 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1953 5d/pop-to-ebp
1954 c3/return
1955
1956 emit-opcodes:
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
1982
1983
1984
1985
1986
1987
1988
1989
1990 55/push-ebp
1991 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1992
1993 50/push-eax
1994 51/push-ecx
1995 52/push-edx
1996 53/push-ebx
1997
1998 68/push 0/imm32/end
1999 68/push 0/imm32/start
2000 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2001
2002 68/push 0/imm32/end
2003 68/push 0/imm32/start
2004 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
2005
2006
2007 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2008
2009 e8/call rewind-stream/disp32
2010
2011 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2012 $emit-opcodes:op1:
2013
2014
2015 51/push-ecx
2016 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2017
2018 e8/call next-word/disp32
2019
2020 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2021
2022
2023
2024 51/push-ecx
2025
2026 e8/call slice-empty?/disp32
2027
2028 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2029
2030 3d/compare-eax-and 0/imm32
2031 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2032
2033
2034 8b/copy 0/mod/indirect 1/rm32/ecx . . . 3/r32/ebx . .
2035
2036 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2037 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2038
2039 3d/compare-eax-and 0x23/imm32/hash
2040 0f 84/jump-if-equal $emit-opcodes:end/disp32
2041
2042
2043 51/push-ecx
2044 68/push 0x2f/imm32/slash
2045 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 .
2046 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
2047
2048 e8/call next-token-from-slice/disp32
2049
2050 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2051
2052
2053 51/push-ecx
2054 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2055
2056 e8/call write-slice-buffered/disp32
2057
2058 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2059
2060
2061 68/push Space/imm32
2062 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2063
2064 e8/call write-buffered/disp32
2065
2066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2067
2068
2069
2070 68/push "0f"/imm32
2071 51/push-ecx
2072
2073 e8/call slice-equal?/disp32
2074
2075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2076
2077 3d/compare-eax-and 0/imm32
2078 75/jump-if-not-equal $emit-opcodes:op2/disp8
2079
2080
2081
2082 68/push "f2"/imm32
2083 51/push-ecx
2084
2085 e8/call slice-equal?/disp32
2086
2087 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2088
2089 3d/compare-eax-and 0/imm32
2090 75/jump-if-not-equal $emit-opcodes:op2/disp8
2091
2092
2093
2094 68/push "f3"/imm32
2095 51/push-ecx
2096
2097 e8/call slice-equal?/disp32
2098
2099 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2100
2101 3d/compare-eax-and 0/imm32
2102 75/jump-if-not-equal $emit-opcodes:op2/disp8
2103
2104 e9/jump $emit-opcodes:end/disp32
2105 $emit-opcodes:op2:
2106
2107
2108 52/push-edx
2109 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2110
2111 e8/call next-word/disp32
2112
2113 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2114
2115
2116
2117 52/push-edx
2118
2119 e8/call slice-empty?/disp32
2120
2121 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2122
2123 3d/compare-eax-and 0/imm32
2124 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2125
2126
2127 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2128
2129 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2130 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2131
2132 3d/compare-eax-and 0x23/imm32/hash
2133 0f 84/jump-if-equal $emit-opcodes:end/disp32
2134
2135
2136 52/push-edx
2137 68/push 0x2f/imm32/slash
2138 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2139 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2140
2141 e8/call next-token-from-slice/disp32
2142
2143 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2144
2145
2146 52/push-edx
2147 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2148
2149 e8/call write-slice-buffered/disp32
2150
2151 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2152
2153
2154 68/push Space/imm32
2155 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2156
2157 e8/call write-buffered/disp32
2158
2159 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2160
2161
2162
2163 68/push "0f"/imm32
2164 51/push-ecx
2165
2166 e8/call slice-equal?/disp32
2167
2168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2169
2170 3d/compare-eax-and 0/imm32
2171 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2172
2173
2174
2175 68/push "0f"/imm32
2176 52/push-edx
2177
2178 e8/call slice-equal?/disp32
2179
2180 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2181
2182 3d/compare-eax-and 0/imm32
2183 0f 84/jump-if-equal $emit-opcodes:end/disp32
2184 $emit-opcodes:op3:
2185
2186
2187 52/push-edx
2188 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2189
2190 e8/call next-word/disp32
2191
2192 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2193
2194
2195
2196 52/push-edx
2197
2198 e8/call slice-empty?/disp32
2199
2200 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2201
2202 3d/compare-eax-and 0/imm32
2203 0f 85/jump-if-not-equal $emit-opcodes:end/disp32
2204
2205
2206 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
2207
2208 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2209 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
2210
2211 3d/compare-eax-and 0x23/imm32/hash
2212 0f 84/jump-if-equal $emit-opcodes:end/disp32
2213
2214
2215 52/push-edx
2216 68/push 0x2f/imm32/slash
2217 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2218 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2219
2220 e8/call next-token-from-slice/disp32
2221
2222 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2223
2224
2225 52/push-edx
2226 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2227
2228 e8/call write-slice-buffered/disp32
2229
2230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2231
2232
2233 68/push Space/imm32
2234 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2235
2236 e8/call write-buffered/disp32
2237
2238 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2239 $emit-opcodes:end:
2240
2241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2242
2243 5b/pop-to-ebx
2244 5a/pop-to-edx
2245 59/pop-to-ecx
2246 58/pop-to-eax
2247
2248 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2249 5d/pop-to-ebp
2250 c3/return
2251
2252 emit-modrm:
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279 55/push-ebp
2280 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2281
2282 50/push-eax
2283 51/push-ecx
2284 52/push-edx
2285 53/push-ebx
2286 56/push-esi
2287 57/push-edi
2288
2289 68/push 0/imm32/end
2290 68/push 0/imm32/start
2291 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2292
2293 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2294
2295 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2296
2297 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2298
2299 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2300
2301
2302 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2303
2304 e8/call rewind-stream/disp32
2305
2306 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2307 +-- 33 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2340 $emit-modrm:loop:
2341
2342
2343 51/push-ecx
2344 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2345
2346 e8/call next-word/disp32
2347
2348 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2349 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2389 $emit-modrm:check0:
2390
2391
2392
2393 51/push-ecx
2394
2395 e8/call slice-empty?/disp32
2396
2397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2398
2399 3d/compare-eax-and 0/imm32
2400 0f 85/jump-if-not-equal $emit-modrm:break/disp32
2401 $emit-modrm:check1:
2402
2403
2404 52/push-edx
2405
2406 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2407
2408 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2409 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2410
2411 5a/pop-to-edx
2412
2413 3d/compare-eax-and 0x23/imm32/hash
2414 0f 84/jump-if-equal $emit-modrm:break/disp32
2415 $emit-modrm:check-for-mod:
2416
2417
2418
2419 68/push "mod"/imm32
2420 51/push-ecx
2421
2422 e8/call has-metadata?/disp32
2423
2424 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2425
2426 3d/compare-eax-and 0/imm32
2427 74/jump-if-equal $emit-modrm:check-for-rm32/disp8
2428 $emit-modrm:mod:
2429
2430
2431
2432 51/push-ecx
2433
2434 e8/call parse-datum-of-word/disp32
2435
2436 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2437
2438 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2439
2440 ba/copy-to-edx 1/imm32/true
2441
2442 e9/jump $emit-modrm:loop/disp32
2443 $emit-modrm:check-for-rm32:
2444
2445
2446
2447 68/push "rm32"/imm32
2448 51/push-ecx
2449
2450 e8/call has-metadata?/disp32
2451
2452 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2453
2454 3d/compare-eax-and 0/imm32
2455 74/jump-if-equal $emit-modrm:check-for-r32/disp8
2456 $emit-modrm:rm32:
2457
2458
2459
2460 51/push-ecx
2461
2462 e8/call parse-datum-of-word/disp32
2463
2464 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2465
2466 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2467
2468 ba/copy-to-edx 1/imm32/true
2469
2470 e9/jump $emit-modrm:loop/disp32
2471 $emit-modrm:check-for-r32:
2472
2473
2474
2475 68/push "r32"/imm32
2476 51/push-ecx
2477
2478 e8/call has-metadata?/disp32
2479
2480 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2481
2482 3d/compare-eax-and 0/imm32
2483 74/jump-if-equal $emit-modrm:check-for-subop/disp8
2484 $emit-modrm:r32:
2485
2486
2487
2488 51/push-ecx
2489
2490 e8/call parse-datum-of-word/disp32
2491
2492 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2493
2494 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2495
2496 ba/copy-to-edx 1/imm32/true
2497
2498 e9/jump $emit-modrm:loop/disp32
2499 $emit-modrm:check-for-subop:
2500
2501
2502
2503 68/push "subop"/imm32
2504 51/push-ecx
2505
2506 e8/call has-metadata?/disp32
2507
2508 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2509
2510 3d/compare-eax-and 0/imm32
2511 0f 84/jump-if-equal $emit-modrm:loop/disp32
2512 $emit-modrm:subop:
2513
2514
2515
2516 51/push-ecx
2517
2518 e8/call parse-datum-of-word/disp32
2519
2520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2521
2522 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2523
2524 ba/copy-to-edx 1/imm32/true
2525
2526 e9/jump $emit-modrm:loop/disp32
2527 $emit-modrm:break:
2528
2529 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32
2530 74/jump-if-equal $emit-modrm:end/disp8
2531 $emit-modrm:calculate:
2532
2533 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2534
2535 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2536
2537 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2538 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2539
2540 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2541
2542 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2543 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2544 $emit-modrm:emit:
2545
2546
2547 68/push 1/imm32
2548 53/push-ebx
2549 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2550
2551 e8/call emit-hex/disp32
2552
2553 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2554 $emit-modrm:end:
2555
2556 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2557
2558 5f/pop-to-edi
2559 5e/pop-to-esi
2560 5b/pop-to-ebx
2561 5a/pop-to-edx
2562 59/pop-to-ecx
2563 58/pop-to-eax
2564
2565 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2566 5d/pop-to-ebp
2567 c3/return
2568
2569 emit-sib:
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595 55/push-ebp
2596 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2597
2598 50/push-eax
2599 51/push-ecx
2600 52/push-edx
2601 53/push-ebx
2602 56/push-esi
2603 57/push-edi
2604
2605 68/push 0/imm32/end
2606 68/push 0/imm32/start
2607 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2608
2609 31/xor 3/mod/direct 2/rm32/edx . . . 2/r32/edx . .
2610
2611 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2612
2613 31/xor 3/mod/direct 6/rm32/esi . . . 6/r32/esi . .
2614
2615 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
2616
2617
2618 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2619
2620 e8/call rewind-stream/disp32
2621
2622 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2623 $emit-sib:loop:
2624 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2650
2651
2652 51/push-ecx
2653 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2654
2655 e8/call next-word/disp32
2656
2657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2658 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2698 $emit-sib:check0:
2699
2700
2701
2702 51/push-ecx
2703
2704 e8/call slice-empty?/disp32
2705
2706 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2707
2708 3d/compare-eax-and 0/imm32
2709 0f 85/jump-if-not-equal $emit-sib:break/disp32
2710 $emit-sib:check1:
2711
2712
2713 52/push-edx
2714
2715 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2716
2717 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2718 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2719
2720 5a/pop-to-edx
2721
2722 3d/compare-eax-and 0x23/imm32/hash
2723 0f 84/jump-if-equal $emit-sib:break/disp32
2724 $emit-sib:check-for-scale:
2725
2726
2727
2728 68/push "scale"/imm32
2729 51/push-ecx
2730
2731 e8/call has-metadata?/disp32
2732
2733 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2734
2735 3d/compare-eax-and 0/imm32
2736 74/jump-if-equal $emit-sib:check-for-base/disp8
2737 $emit-sib:scale:
2738
2739
2740
2741 51/push-ecx
2742
2743 e8/call parse-datum-of-word/disp32
2744
2745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2746
2747 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2748
2749 ba/copy-to-edx 1/imm32/true
2750
2751 e9/jump $emit-sib:loop/disp32
2752 $emit-sib:check-for-base:
2753
2754
2755
2756 68/push "base"/imm32
2757 51/push-ecx
2758
2759 e8/call has-metadata?/disp32
2760
2761 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2762
2763 3d/compare-eax-and 0/imm32
2764 74/jump-if-equal $emit-sib:check-for-index/disp8
2765 $emit-sib:base:
2766
2767
2768
2769 51/push-ecx
2770
2771 e8/call parse-datum-of-word/disp32
2772
2773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2774
2775 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
2776
2777 ba/copy-to-edx 1/imm32/true
2778
2779 e9/jump $emit-sib:loop/disp32
2780 $emit-sib:check-for-index:
2781
2782
2783
2784 68/push "index"/imm32
2785 51/push-ecx
2786
2787 e8/call has-metadata?/disp32
2788
2789 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2790
2791 3d/compare-eax-and 0/imm32
2792 0f 84/jump-if-equal $emit-sib:loop/disp32
2793 $emit-sib:index:
2794
2795
2796
2797 51/push-ecx
2798
2799 e8/call parse-datum-of-word/disp32
2800
2801 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2802
2803 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
2804
2805 ba/copy-to-edx 1/imm32/true
2806
2807 e9/jump $emit-sib:loop/disp32
2808 $emit-sib:break:
2809
2810 81 7/subop/compare 3/mod/direct 2/rm32/edx . . . . . 0/imm32
2811 74/jump-if-equal $emit-sib:end/disp8
2812 $emit-sib:calculate:
2813
2814 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 3/imm32/0b11
2815
2816 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 2/imm8
2817
2818 81 4/subop/and 3/mod/direct 7/rm32/edi . . . . . 7/imm32/0b111
2819 09/or 3/mod/direct 3/rm32/ebx . . . 7/r32/edi . .
2820
2821 c1/shift 4/subop/left 3/mod/direct 3/rm32/ebx . . . . . 3/imm8
2822
2823 81 4/subop/and 3/mod/direct 6/rm32/esi . . . . . 7/imm32/0b111
2824 09/or 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
2825 $emit-sib:emit:
2826
2827
2828 68/push 1/imm32
2829 53/push-ebx
2830 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2831
2832 e8/call emit-hex/disp32
2833
2834 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2835 $emit-sib:end:
2836
2837 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2838
2839 5f/pop-to-edi
2840 5e/pop-to-esi
2841 5b/pop-to-ebx
2842 5a/pop-to-edx
2843 59/pop-to-ecx
2844 58/pop-to-eax
2845
2846 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2847 5d/pop-to-ebp
2848 c3/return
2849
2850 emit-disp:
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869 55/push-ebp
2870 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2871
2872 50/push-eax
2873 51/push-ecx
2874 52/push-edx
2875
2876 68/push 0/imm32/end
2877 68/push 0/imm32/start
2878 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2879
2880
2881 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2882
2883 e8/call rewind-stream/disp32
2884
2885 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2886 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
2912 $emit-disp:loop:
2913
2914
2915 51/push-ecx
2916 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2917
2918 e8/call next-word/disp32
2919
2920 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2921 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
2961 $emit-disp:check0:
2962
2963
2964
2965 51/push-ecx
2966
2967 e8/call slice-empty?/disp32
2968
2969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2970
2971 3d/compare-eax-and 0/imm32
2972 0f 85/jump-if-not-equal $emit-disp:break/disp32
2973 $emit-disp:check1:
2974
2975
2976 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2977
2978 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2979 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
2980
2981 3d/compare-eax-and 0x23/imm32/hash
2982 0f 84/jump-if-equal $emit-disp:break/disp32
2983 $emit-disp:check-for-disp32:
2984
2985
2986
2987 68/push "disp32"/imm32
2988 51/push-ecx
2989
2990 e8/call has-metadata?/disp32
2991
2992 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2993
2994 3d/compare-eax-and 0/imm32
2995 74/jump-if-equal $emit-disp:check-for-disp16/disp8
2996 $emit-disp:disp32:
2997
2998
2999 68/push 4/imm32
3000 51/push-ecx
3001 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3002
3003 e8/call emit/disp32
3004
3005 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3006
3007 e9/jump $emit-disp:break/disp32
3008 $emit-disp:check-for-disp16:
3009
3010
3011
3012 68/push "disp16"/imm32
3013 51/push-ecx
3014
3015 e8/call has-metadata?/disp32
3016
3017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3018
3019 3d/compare-eax-and 0/imm32
3020 74/jump-if-equal $emit-disp:check-for-disp8/disp8
3021 $emit-disp:disp16:
3022
3023
3024 68/push 2/imm32
3025 51/push-ecx
3026 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3027
3028 e8/call emit/disp32
3029
3030 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3031
3032 e9/jump $emit-disp:break/disp32
3033 $emit-disp:check-for-disp8:
3034
3035
3036
3037 68/push "disp8"/imm32
3038 51/push-ecx
3039
3040 e8/call has-metadata?/disp32
3041
3042 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3043
3044 3d/compare-eax-and 0/imm32
3045 0f 84/jump-if-equal $emit-disp:loop/disp32
3046 $emit-disp:disp8:
3047
3048
3049 68/push 1/imm32
3050 51/push-ecx
3051 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3052
3053 e8/call emit/disp32
3054
3055 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3056
3057 $emit-disp:break:
3058
3059 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3060
3061 5a/pop-to-edx
3062 59/pop-to-ecx
3063 58/pop-to-eax
3064
3065 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3066 5d/pop-to-ebp
3067 c3/return
3068
3069 emit-imm:
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088 55/push-ebp
3089 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3090
3091 50/push-eax
3092 51/push-ecx
3093 52/push-edx
3094
3095 68/push 0/imm32/end
3096 68/push 0/imm32/start
3097 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3098
3099
3100 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3101
3102 e8/call rewind-stream/disp32
3103
3104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3105 +-- 26 lines: #? # dump line -----------------------------------------------------------------------------------------------------------------------------
3131 $emit-imm:loop:
3132
3133
3134 51/push-ecx
3135 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3136
3137 e8/call next-word/disp32
3138
3139 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3140 +-- 40 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
3180 $emit-imm:check0:
3181
3182
3183
3184 51/push-ecx
3185
3186 e8/call slice-empty?/disp32
3187
3188 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3189
3190 3d/compare-eax-and 0/imm32
3191 0f 85/jump-if-not-equal $emit-imm:break/disp32
3192 $emit-imm:check1:
3193
3194
3195 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
3196
3197 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
3198 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 0/r32/AL . .
3199
3200 3d/compare-eax-and 0x23/imm32/hash
3201 0f 84/jump-if-equal $emit-imm:break/disp32
3202 $emit-imm:check-for-imm32:
3203
3204
3205
3206 68/push "imm32"/imm32
3207 51/push-ecx
3208
3209 e8/call has-metadata?/disp32
3210
3211 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3212
3213 3d/compare-eax-and 0/imm32
3214 74/jump-if-equal $emit-imm:check-for-imm16/disp8
3215 $emit-imm:imm32:
3216
3217
3218 68/push 4/imm32
3219 51/push-ecx
3220 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3221
3222 e8/call emit/disp32
3223
3224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3225
3226 e9/jump $emit-imm:break/disp32
3227 $emit-imm:check-for-imm16:
3228
3229
3230
3231 68/push "imm16"/imm32
3232 51/push-ecx
3233
3234 e8/call has-metadata?/disp32
3235
3236 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3237
3238 3d/compare-eax-and 0/imm32
3239 74/jump-if-equal $emit-imm:check-for-imm8/disp8
3240 $emit-imm:imm16:
3241
3242
3243 68/push 2/imm32
3244 51/push-ecx
3245 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3246
3247 e8/call emit/disp32
3248
3249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3250
3251 e9/jump $emit-imm:break/disp32
3252 $emit-imm:check-for-imm8:
3253
3254
3255
3256 68/push "imm8"/imm32
3257 51/push-ecx
3258
3259 e8/call has-metadata?/disp32
3260
3261 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3262
3263 3d/compare-eax-and 0/imm32
3264 0f 84/jump-if-equal $emit-imm:loop/disp32
3265 $emit-imm:imm8:
3266
3267
3268 68/push 1/imm32
3269 51/push-ecx
3270 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3271
3272 e8/call emit/disp32
3273
3274 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3275
3276 $emit-imm:break:
3277
3278 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3279
3280 5a/pop-to-edx
3281 59/pop-to-ecx
3282 58/pop-to-eax
3283
3284 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3285 5d/pop-to-ebp
3286 c3/return
3287
3288 emit-line-in-comment:
3289
3290 55/push-ebp
3291 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3292
3293
3294 68/push " # "/imm32
3295 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3296
3297 e8/call write-buffered/disp32
3298
3299 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3300
3301
3302 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3303 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3304
3305 e8/call write-stream-data/disp32
3306
3307 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3308 $emit-line-in-comment:end:
3309
3310 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3311 5d/pop-to-ebp
3312 c3/return
3313
3314 test-convert-instruction-passes-comments-through:
3315
3316
3317 55/push-ebp
3318 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3319
3320
3321
3322 68/push _test-input-stream/imm32
3323
3324 e8/call clear-stream/disp32
3325
3326 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3327
3328
3329 68/push _test-output-stream/imm32
3330
3331 e8/call clear-stream/disp32
3332
3333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3334
3335
3336 68/push _test-output-buffered-file->buffer/imm32
3337
3338 e8/call clear-stream/disp32
3339
3340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3341
3342
3343
3344 68/push "# abcd"/imm32
3345 68/push _test-input-stream/imm32
3346
3347 e8/call write/disp32
3348
3349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3350
3351
3352 68/push _test-output-buffered-file/imm32
3353 68/push _test-input-stream/imm32
3354
3355 e8/call convert-instruction/disp32
3356
3357 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3358
3359
3360
3361 68/push _test-output-buffered-file/imm32
3362
3363 e8/call flush/disp32
3364
3365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3366
3367
3368 68/push "F - test-convert-instruction-passes-comments-through"/imm32
3369 68/push "# abcd"/imm32
3370 68/push _test-output-stream/imm32
3371
3372 e8/call check-stream-equal/disp32
3373
3374 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3375
3376 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3377 5d/pop-to-ebp
3378 c3/return
3379
3380 test-convert-instruction-passes-labels-through:
3381
3382
3383 55/push-ebp
3384 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3385
3386
3387
3388 68/push _test-input-stream/imm32
3389
3390 e8/call clear-stream/disp32
3391
3392 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3393
3394
3395 68/push _test-output-stream/imm32
3396
3397 e8/call clear-stream/disp32
3398
3399 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3400
3401
3402 68/push _test-output-buffered-file->buffer/imm32
3403
3404 e8/call clear-stream/disp32
3405
3406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3407
3408
3409
3410 68/push "ab: # cd"/imm32
3411 68/push _test-input-stream/imm32
3412
3413 e8/call write/disp32
3414
3415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3416
3417
3418 68/push _test-output-buffered-file/imm32
3419 68/push _test-input-stream/imm32
3420
3421 e8/call convert-instruction/disp32
3422
3423 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3424
3425
3426
3427 68/push _test-output-buffered-file/imm32
3428
3429 e8/call flush/disp32
3430
3431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3432
3433
3434 68/push "F - test-convert-instruction-passes-labels-through"/imm32
3435 68/push "ab: # cd"/imm32
3436 68/push _test-output-stream/imm32
3437
3438 e8/call check-stream-equal/disp32
3439
3440 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3441
3442 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3443 5d/pop-to-ebp
3444 c3/return
3445
3446 test-convert-instruction-handles-single-opcode:
3447
3448
3449 55/push-ebp
3450 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3451
3452
3453
3454 68/push _test-input-stream/imm32
3455
3456 e8/call clear-stream/disp32
3457
3458 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3459
3460
3461 68/push _test-output-stream/imm32
3462
3463 e8/call clear-stream/disp32
3464
3465 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3466
3467
3468 68/push _test-output-buffered-file->buffer/imm32
3469
3470 e8/call clear-stream/disp32
3471
3472 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3473
3474
3475
3476 68/push "ab/cd # comment"/imm32
3477 68/push _test-input-stream/imm32
3478
3479 e8/call write/disp32
3480
3481 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3482
3483
3484 68/push _test-output-buffered-file/imm32
3485 68/push _test-input-stream/imm32
3486
3487 e8/call convert-instruction/disp32
3488
3489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3490
3491
3492
3493 68/push _test-output-buffered-file/imm32
3494
3495 e8/call flush/disp32
3496
3497 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3498 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3524
3525
3526 68/push "F - test-convert-instruction-handles-single-opcode"/imm32
3527 68/push "ab # ab/cd # comment"/imm32
3528 68/push _test-output-stream/imm32
3529
3530 e8/call check-stream-equal/disp32
3531
3532 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3533
3534 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3535 5d/pop-to-ebp
3536 c3/return
3537
3538 test-convert-instruction-handles-0f-opcode:
3539
3540
3541 55/push-ebp
3542 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3543
3544
3545
3546 68/push _test-input-stream/imm32
3547
3548 e8/call clear-stream/disp32
3549
3550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3551
3552
3553 68/push _test-output-stream/imm32
3554
3555 e8/call clear-stream/disp32
3556
3557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3558
3559
3560 68/push _test-output-buffered-file->buffer/imm32
3561
3562 e8/call clear-stream/disp32
3563
3564 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3565
3566
3567
3568 68/push "0f/m1 ab/m2 # comment"/imm32
3569 68/push _test-input-stream/imm32
3570
3571 e8/call write/disp32
3572
3573 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3574
3575
3576 68/push _test-output-buffered-file/imm32
3577 68/push _test-input-stream/imm32
3578
3579 e8/call convert-instruction/disp32
3580
3581 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3582
3583
3584
3585 68/push _test-output-buffered-file/imm32
3586
3587 e8/call flush/disp32
3588
3589 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3590 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3616
3617
3618 68/push "F - test-convert-instruction-handles-0f-opcode"/imm32
3619 68/push "0f ab # 0f/m1 ab/m2 # comment"/imm32
3620 68/push _test-output-stream/imm32
3621
3622 e8/call check-stream-equal/disp32
3623
3624 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3625
3626 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3627 5d/pop-to-ebp
3628 c3/return
3629
3630 test-convert-instruction-handles-f2-opcode:
3631
3632
3633 55/push-ebp
3634 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3635
3636
3637
3638 68/push _test-input-stream/imm32
3639
3640 e8/call clear-stream/disp32
3641
3642 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3643
3644
3645 68/push _test-output-stream/imm32
3646
3647 e8/call clear-stream/disp32
3648
3649 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3650
3651
3652 68/push _test-output-buffered-file->buffer/imm32
3653
3654 e8/call clear-stream/disp32
3655
3656 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3657
3658
3659
3660 68/push "f2/m1 ab/m2 # comment"/imm32
3661 68/push _test-input-stream/imm32
3662
3663 e8/call write/disp32
3664
3665 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3666
3667
3668 68/push _test-output-buffered-file/imm32
3669 68/push _test-input-stream/imm32
3670
3671 e8/call convert-instruction/disp32
3672
3673 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3674
3675
3676
3677 68/push _test-output-buffered-file/imm32
3678
3679 e8/call flush/disp32
3680
3681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3682 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3708
3709
3710 68/push "F - test-convert-instruction-handles-f2-opcode"/imm32
3711 68/push "f2 ab # f2/m1 ab/m2 # comment"/imm32
3712 68/push _test-output-stream/imm32
3713
3714 e8/call check-stream-equal/disp32
3715
3716 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3717
3718 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3719 5d/pop-to-ebp
3720 c3/return
3721
3722 test-convert-instruction-handles-f3-opcode:
3723
3724
3725 55/push-ebp
3726 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3727
3728
3729
3730 68/push _test-input-stream/imm32
3731
3732 e8/call clear-stream/disp32
3733
3734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3735
3736
3737 68/push _test-output-stream/imm32
3738
3739 e8/call clear-stream/disp32
3740
3741 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3742
3743
3744 68/push _test-output-buffered-file->buffer/imm32
3745
3746 e8/call clear-stream/disp32
3747
3748 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3749
3750
3751
3752 68/push "f3/m1 ab/m2 # comment"/imm32
3753 68/push _test-input-stream/imm32
3754
3755 e8/call write/disp32
3756
3757 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3758
3759
3760 68/push _test-output-buffered-file/imm32
3761 68/push _test-input-stream/imm32
3762
3763 e8/call convert-instruction/disp32
3764
3765 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3766
3767
3768
3769 68/push _test-output-buffered-file/imm32
3770
3771 e8/call flush/disp32
3772
3773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3774 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3800
3801
3802 68/push "F - test-convert-instruction-handles-f3-opcode"/imm32
3803 68/push "f3 ab # f3/m1 ab/m2 # comment"/imm32
3804 68/push _test-output-stream/imm32
3805
3806 e8/call check-stream-equal/disp32
3807
3808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3809
3810 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3811 5d/pop-to-ebp
3812 c3/return
3813
3814 test-convert-instruction-handles-f2-0f-opcode:
3815
3816
3817 55/push-ebp
3818 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3819
3820
3821
3822 68/push _test-input-stream/imm32
3823
3824 e8/call clear-stream/disp32
3825
3826 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3827
3828
3829 68/push _test-output-stream/imm32
3830
3831 e8/call clear-stream/disp32
3832
3833 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3834
3835
3836 68/push _test-output-buffered-file->buffer/imm32
3837
3838 e8/call clear-stream/disp32
3839
3840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3841
3842
3843
3844 68/push "f2/m1 0f/m2 ab/m3 # comment"/imm32
3845 68/push _test-input-stream/imm32
3846
3847 e8/call write/disp32
3848
3849 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3850
3851
3852 68/push _test-output-buffered-file/imm32
3853 68/push _test-input-stream/imm32
3854
3855 e8/call convert-instruction/disp32
3856
3857 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3858
3859
3860
3861 68/push _test-output-buffered-file/imm32
3862
3863 e8/call flush/disp32
3864
3865 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3866 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3892
3893
3894 68/push "F - test-convert-instruction-handles-f2-0f-opcode"/imm32
3895 68/push "f2 0f ab # f2/m1 0f/m2 ab/m3 # comment"/imm32
3896 68/push _test-output-stream/imm32
3897
3898 e8/call check-stream-equal/disp32
3899
3900 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3901
3902 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3903 5d/pop-to-ebp
3904 c3/return
3905
3906 test-convert-instruction-handles-f3-0f-opcode:
3907
3908
3909 55/push-ebp
3910 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3911
3912
3913
3914 68/push _test-input-stream/imm32
3915
3916 e8/call clear-stream/disp32
3917
3918 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3919
3920
3921 68/push _test-output-stream/imm32
3922
3923 e8/call clear-stream/disp32
3924
3925 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3926
3927
3928 68/push _test-output-buffered-file->buffer/imm32
3929
3930 e8/call clear-stream/disp32
3931
3932 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3933
3934
3935
3936 68/push "f3/m1 0f/m2 ab/m3 # comment"/imm32
3937 68/push _test-input-stream/imm32
3938
3939 e8/call write/disp32
3940
3941 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3942
3943
3944 68/push _test-output-buffered-file/imm32
3945 68/push _test-input-stream/imm32
3946
3947 e8/call convert-instruction/disp32
3948
3949 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3950
3951
3952
3953 68/push _test-output-buffered-file/imm32
3954
3955 e8/call flush/disp32
3956
3957 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3958 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3984
3985
3986 68/push "F - test-convert-instruction-handles-f3-0f-opcode"/imm32
3987 68/push "f3 0f ab # f3/m1 0f/m2 ab/m3 # comment"/imm32
3988 68/push _test-output-stream/imm32
3989
3990 e8/call check-stream-equal/disp32
3991
3992 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3993
3994 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3995 5d/pop-to-ebp
3996 c3/return
3997
3998 test-convert-instruction-handles-unused-opcodes:
3999
4000
4001 55/push-ebp
4002 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4003
4004
4005
4006 68/push _test-input-stream/imm32
4007
4008 e8/call clear-stream/disp32
4009
4010 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4011
4012
4013 68/push _test-output-stream/imm32
4014
4015 e8/call clear-stream/disp32
4016
4017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4018
4019
4020 68/push _test-output-buffered-file->buffer/imm32
4021
4022 e8/call clear-stream/disp32
4023
4024 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4025
4026
4027
4028 68/push "ab/m1 cd/m2 # comment"/imm32
4029 68/push _test-input-stream/imm32
4030
4031 e8/call write/disp32
4032
4033 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4034
4035
4036 68/push _test-output-buffered-file/imm32
4037 68/push _test-input-stream/imm32
4038
4039 e8/call convert-instruction/disp32
4040
4041 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4042
4043
4044
4045 68/push _test-output-buffered-file/imm32
4046
4047 e8/call flush/disp32
4048
4049 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4050 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4076
4077
4078 68/push "F - test-convert-instruction-handles-unused-opcodes"/imm32
4079 68/push "ab # ab/m1 cd/m2 # comment"/imm32
4080 68/push _test-output-stream/imm32
4081
4082 e8/call check-stream-equal/disp32
4083
4084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4085
4086 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4087 5d/pop-to-ebp
4088 c3/return
4089
4090 test-convert-instruction-handles-unused-second-opcodes:
4091
4092
4093 55/push-ebp
4094 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4095
4096
4097
4098 68/push _test-input-stream/imm32
4099
4100 e8/call clear-stream/disp32
4101
4102 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4103
4104
4105 68/push _test-output-stream/imm32
4106
4107 e8/call clear-stream/disp32
4108
4109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4110
4111
4112 68/push _test-output-buffered-file->buffer/imm32
4113
4114 e8/call clear-stream/disp32
4115
4116 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4117
4118
4119
4120 68/push "f2/m1 ab/m2 cd/m3 # comment"/imm32
4121 68/push _test-input-stream/imm32
4122
4123 e8/call write/disp32
4124
4125 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4126
4127
4128 68/push _test-output-buffered-file/imm32
4129 68/push _test-input-stream/imm32
4130
4131 e8/call convert-instruction/disp32
4132
4133 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4134
4135
4136
4137 68/push _test-output-buffered-file/imm32
4138
4139 e8/call flush/disp32
4140
4141 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4142 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4168
4169
4170 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4171 68/push "f2 ab # f2/m1 ab/m2 cd/m3 # comment"/imm32
4172 68/push _test-output-stream/imm32
4173
4174 e8/call check-stream-equal/disp32
4175
4176 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4177
4178 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4179 5d/pop-to-ebp
4180 c3/return
4181
4182 test-convert-instruction-handles-unused-second-opcodes-2:
4183
4184
4185 55/push-ebp
4186 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4187
4188
4189
4190 68/push _test-input-stream/imm32
4191
4192 e8/call clear-stream/disp32
4193
4194 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4195
4196
4197 68/push _test-output-stream/imm32
4198
4199 e8/call clear-stream/disp32
4200
4201 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4202
4203
4204 68/push _test-output-buffered-file->buffer/imm32
4205
4206 e8/call clear-stream/disp32
4207
4208 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4209
4210
4211
4212 68/push "f3/m1 ab/m2 cd/m3 # comment"/imm32
4213 68/push _test-input-stream/imm32
4214
4215 e8/call write/disp32
4216
4217 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4218
4219
4220 68/push _test-output-buffered-file/imm32
4221 68/push _test-input-stream/imm32
4222
4223 e8/call convert-instruction/disp32
4224
4225 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4226
4227
4228
4229 68/push _test-output-buffered-file/imm32
4230
4231 e8/call flush/disp32
4232
4233 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4234 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4260
4261
4262 68/push "F - test-convert-instruction-handles-unused-second-opcodes"/imm32
4263 68/push "f3 ab # f3/m1 ab/m2 cd/m3 # comment"/imm32
4264 68/push _test-output-stream/imm32
4265
4266 e8/call check-stream-equal/disp32
4267
4268 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4269
4270 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4271 5d/pop-to-ebp
4272 c3/return
4273
4274 test-convert-instruction-emits-modrm-byte:
4275
4276
4277 55/push-ebp
4278 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4279
4280
4281
4282 68/push _test-input-stream/imm32
4283
4284 e8/call clear-stream/disp32
4285
4286 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4287
4288
4289 68/push _test-output-stream/imm32
4290
4291 e8/call clear-stream/disp32
4292
4293 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4294
4295
4296 68/push _test-output-buffered-file->buffer/imm32
4297
4298 e8/call clear-stream/disp32
4299
4300 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4301
4302
4303
4304 68/push "8b/copy 0/mod 0/rm32 1/r32"/imm32
4305 68/push _test-input-stream/imm32
4306
4307 e8/call write/disp32
4308
4309 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4310
4311
4312 68/push _test-output-buffered-file/imm32
4313 68/push _test-input-stream/imm32
4314
4315 e8/call convert-instruction/disp32
4316
4317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4318
4319
4320
4321 68/push _test-output-buffered-file/imm32
4322
4323 e8/call flush/disp32
4324
4325 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4326 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4352
4353
4354 68/push "F - test-convert-instruction-emits-modrm-byte"/imm32
4355 68/push "8b 08 # 8b/copy 0/mod 0/rm32 1/r32"/imm32
4356 68/push _test-output-stream/imm32
4357
4358 e8/call check-stream-equal/disp32
4359
4360 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4361
4362 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4363 5d/pop-to-ebp
4364 c3/return
4365
4366 test-convert-instruction-emits-modrm-byte-with-non-zero-mod:
4367
4368 55/push-ebp
4369 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4370
4371
4372
4373 68/push _test-input-stream/imm32
4374
4375 e8/call clear-stream/disp32
4376
4377 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4378
4379
4380 68/push _test-output-stream/imm32
4381
4382 e8/call clear-stream/disp32
4383
4384 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4385
4386
4387 68/push _test-output-buffered-file->buffer/imm32
4388
4389 e8/call clear-stream/disp32
4390
4391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4392
4393
4394
4395 68/push "01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4396 68/push _test-input-stream/imm32
4397
4398 e8/call write/disp32
4399
4400 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4401
4402
4403 68/push _test-output-buffered-file/imm32
4404 68/push _test-input-stream/imm32
4405
4406 e8/call convert-instruction/disp32
4407
4408 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4409
4410
4411 68/push _test-output-buffered-file/imm32
4412
4413 e8/call flush/disp32
4414
4415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4416 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4442
4443
4444
4445 68/push "F - test-convert-instruction-foo"/imm32
4446 68/push "01 cb # 01/add 3/mod/direct 3/rm32/ebx 1/r32/ecx"/imm32
4447 68/push _test-output-stream/imm32
4448
4449 e8/call check-stream-equal/disp32
4450
4451 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4452
4453 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4454 5d/pop-to-ebp
4455 c3/return
4456
4457 test-convert-instruction-emits-modrm-byte-from-subop:
4458
4459
4460 55/push-ebp
4461 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4462
4463
4464
4465 68/push _test-input-stream/imm32
4466
4467 e8/call clear-stream/disp32
4468
4469 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4470
4471
4472 68/push _test-output-stream/imm32
4473
4474 e8/call clear-stream/disp32
4475
4476 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4477
4478
4479 68/push _test-output-buffered-file->buffer/imm32
4480
4481 e8/call clear-stream/disp32
4482
4483 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4484
4485
4486
4487 68/push "ff 6/subop/push 0/mod 0/rm32"/imm32
4488 68/push _test-input-stream/imm32
4489
4490 e8/call write/disp32
4491
4492 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4493
4494
4495 68/push _test-output-buffered-file/imm32
4496 68/push _test-input-stream/imm32
4497
4498 e8/call convert-instruction/disp32
4499
4500 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4501
4502
4503
4504 68/push _test-output-buffered-file/imm32
4505
4506 e8/call flush/disp32
4507
4508 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4509 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4535
4536
4537 68/push "F - test-convert-instruction-emits-modrm-byte-from-subop"/imm32
4538 68/push "ff 30 # ff 6/subop/push 0/mod 0/rm32"/imm32
4539 68/push _test-output-stream/imm32
4540
4541 e8/call check-stream-equal/disp32
4542
4543 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4544
4545 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4546 5d/pop-to-ebp
4547 c3/return
4548
4549 test-convert-instruction-emits-modrm-byte-with-missing-mod:
4550
4551
4552 55/push-ebp
4553 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4554
4555
4556
4557 68/push _test-input-stream/imm32
4558
4559 e8/call clear-stream/disp32
4560
4561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4562
4563
4564 68/push _test-output-stream/imm32
4565
4566 e8/call clear-stream/disp32
4567
4568 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4569
4570
4571 68/push _test-output-buffered-file->buffer/imm32
4572
4573 e8/call clear-stream/disp32
4574
4575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4576
4577
4578
4579 68/push "8b/copy 0/rm32 1/r32"/imm32
4580 68/push _test-input-stream/imm32
4581
4582 e8/call write/disp32
4583
4584 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4585
4586
4587 68/push _test-output-buffered-file/imm32
4588 68/push _test-input-stream/imm32
4589
4590 e8/call convert-instruction/disp32
4591
4592 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4593
4594
4595
4596 68/push _test-output-buffered-file/imm32
4597
4598 e8/call flush/disp32
4599
4600 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4601 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4627
4628
4629 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-mod"/imm32
4630 68/push "8b 08 # 8b/copy 0/rm32 1/r32"/imm32
4631 68/push _test-output-stream/imm32
4632
4633 e8/call check-stream-equal/disp32
4634
4635 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4636
4637 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4638 5d/pop-to-ebp
4639 c3/return
4640
4641 test-convert-instruction-emits-modrm-byte-with-missing-rm32:
4642
4643
4644 55/push-ebp
4645 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4646
4647
4648
4649 68/push _test-input-stream/imm32
4650
4651 e8/call clear-stream/disp32
4652
4653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4654
4655
4656 68/push _test-output-stream/imm32
4657
4658 e8/call clear-stream/disp32
4659
4660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4661
4662
4663 68/push _test-output-buffered-file->buffer/imm32
4664
4665 e8/call clear-stream/disp32
4666
4667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4668
4669
4670
4671 68/push "8b/copy 0/mod 1/r32"/imm32
4672 68/push _test-input-stream/imm32
4673
4674 e8/call write/disp32
4675
4676 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4677
4678
4679 68/push _test-output-buffered-file/imm32
4680 68/push _test-input-stream/imm32
4681
4682 e8/call convert-instruction/disp32
4683
4684 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4685
4686
4687
4688 68/push _test-output-buffered-file/imm32
4689
4690 e8/call flush/disp32
4691
4692 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4693 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4719
4720
4721 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-rm32"/imm32
4722 68/push "8b 08 # 8b/copy 0/mod 1/r32"/imm32
4723 68/push _test-output-stream/imm32
4724
4725 e8/call check-stream-equal/disp32
4726
4727 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4728
4729 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4730 5d/pop-to-ebp
4731 c3/return
4732
4733 test-convert-instruction-emits-modrm-byte-with-missing-r32:
4734
4735
4736 55/push-ebp
4737 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4738
4739
4740
4741 68/push _test-input-stream/imm32
4742
4743 e8/call clear-stream/disp32
4744
4745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4746
4747
4748 68/push _test-output-stream/imm32
4749
4750 e8/call clear-stream/disp32
4751
4752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4753
4754
4755 68/push _test-output-buffered-file->buffer/imm32
4756
4757 e8/call clear-stream/disp32
4758
4759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4760
4761
4762
4763 68/push "8b/copy 0/mod 0/rm32"/imm32
4764 68/push _test-input-stream/imm32
4765
4766 e8/call write/disp32
4767
4768 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4769
4770
4771 68/push _test-output-buffered-file/imm32
4772 68/push _test-input-stream/imm32
4773
4774 e8/call convert-instruction/disp32
4775
4776 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4777
4778
4779
4780 68/push _test-output-buffered-file/imm32
4781
4782 e8/call flush/disp32
4783
4784 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4785 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4811
4812
4813 68/push "F - test-convert-instruction-emits-modrm-byte-with-missing-r32"/imm32
4814 68/push "8b 00 # 8b/copy 0/mod 0/rm32"/imm32
4815 68/push _test-output-stream/imm32
4816
4817 e8/call check-stream-equal/disp32
4818
4819 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4820
4821 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4822 5d/pop-to-ebp
4823 c3/return
4824
4825 test-convert-instruction-emits-sib-byte:
4826
4827
4828 55/push-ebp
4829 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4830
4831
4832
4833 68/push _test-input-stream/imm32
4834
4835 e8/call clear-stream/disp32
4836
4837 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4838
4839
4840 68/push _test-output-stream/imm32
4841
4842 e8/call clear-stream/disp32
4843
4844 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4845
4846
4847 68/push _test-output-buffered-file->buffer/imm32
4848
4849 e8/call clear-stream/disp32
4850
4851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4852
4853
4854
4855 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4856 68/push _test-input-stream/imm32
4857
4858 e8/call write/disp32
4859
4860 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4861
4862
4863 68/push _test-output-buffered-file/imm32
4864 68/push _test-input-stream/imm32
4865
4866 e8/call convert-instruction/disp32
4867
4868 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4869
4870
4871
4872 68/push _test-output-buffered-file/imm32
4873
4874 e8/call flush/disp32
4875
4876 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4877 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4903
4904
4905 68/push "F - test-convert-instruction-emits-sib-byte"/imm32
4906 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index 0/scale"/imm32
4907 68/push _test-output-stream/imm32
4908
4909 e8/call check-stream-equal/disp32
4910
4911 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4912
4913 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4914 5d/pop-to-ebp
4915 c3/return
4916
4917 test-convert-instruction-emits-sib-byte-with-missing-base:
4918
4919
4920 55/push-ebp
4921 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4922
4923
4924
4925 68/push _test-input-stream/imm32
4926
4927 e8/call clear-stream/disp32
4928
4929 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4930
4931
4932 68/push _test-output-stream/imm32
4933
4934 e8/call clear-stream/disp32
4935
4936 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4937
4938
4939 68/push _test-output-buffered-file->buffer/imm32
4940
4941 e8/call clear-stream/disp32
4942
4943 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4944
4945
4946
4947 68/push "8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4948 68/push _test-input-stream/imm32
4949
4950 e8/call write/disp32
4951
4952 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4953
4954
4955 68/push _test-output-buffered-file/imm32
4956 68/push _test-input-stream/imm32
4957
4958 e8/call convert-instruction/disp32
4959
4960 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4961
4962
4963
4964 68/push _test-output-buffered-file/imm32
4965
4966 e8/call flush/disp32
4967
4968 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4969 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
4995
4996
4997 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-base"/imm32
4998 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 1/index 0/scale"/imm32
4999 68/push _test-output-stream/imm32
5000
5001 e8/call check-stream-equal/disp32
5002
5003 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5004
5005 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5006 5d/pop-to-ebp
5007 c3/return
5008
5009 test-convert-instruction-emits-sib-byte-with-missing-index:
5010
5011
5012 55/push-ebp
5013 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5014
5015
5016
5017 68/push _test-input-stream/imm32
5018
5019 e8/call clear-stream/disp32
5020
5021 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5022
5023
5024 68/push _test-output-stream/imm32
5025
5026 e8/call clear-stream/disp32
5027
5028 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5029
5030
5031 68/push _test-output-buffered-file->buffer/imm32
5032
5033 e8/call clear-stream/disp32
5034
5035 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5036
5037
5038
5039 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5040 68/push _test-input-stream/imm32
5041
5042 e8/call write/disp32
5043
5044 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5045
5046
5047 68/push _test-output-buffered-file/imm32
5048 68/push _test-input-stream/imm32
5049
5050 e8/call convert-instruction/disp32
5051
5052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5053
5054
5055
5056 68/push _test-output-buffered-file/imm32
5057
5058 e8/call flush/disp32
5059
5060 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5061 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5087
5088
5089 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-index"/imm32
5090 68/push "8b 0c 00 # 8b/copy 0/mod 4/rm32 1/r32 0/base 0/scale"/imm32
5091 68/push _test-output-stream/imm32
5092
5093 e8/call check-stream-equal/disp32
5094
5095 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5096
5097 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5098 5d/pop-to-ebp
5099 c3/return
5100
5101 test-convert-instruction-emits-sib-byte-with-missing-scale:
5102
5103
5104 55/push-ebp
5105 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5106
5107
5108
5109 68/push _test-input-stream/imm32
5110
5111 e8/call clear-stream/disp32
5112
5113 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5114
5115
5116 68/push _test-output-stream/imm32
5117
5118 e8/call clear-stream/disp32
5119
5120 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5121
5122
5123 68/push _test-output-buffered-file->buffer/imm32
5124
5125 e8/call clear-stream/disp32
5126
5127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5128
5129
5130
5131 68/push "8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5132 68/push _test-input-stream/imm32
5133
5134 e8/call write/disp32
5135
5136 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5137
5138
5139 68/push _test-output-buffered-file/imm32
5140 68/push _test-input-stream/imm32
5141
5142 e8/call convert-instruction/disp32
5143
5144 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5145
5146
5147
5148 68/push _test-output-buffered-file/imm32
5149
5150 e8/call flush/disp32
5151
5152 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5153 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5179
5180
5181 68/push "F - test-convert-instruction-emits-sib-byte-with-missing-scale"/imm32
5182 68/push "8b 0c 08 # 8b/copy 0/mod 4/rm32 1/r32 0/base 1/index"/imm32
5183 68/push _test-output-stream/imm32
5184
5185 e8/call check-stream-equal/disp32
5186
5187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5188
5189 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5190 5d/pop-to-ebp
5191 c3/return
5192
5193 test-convert-instruction-handles-disp32-operand:
5194
5195
5196 55/push-ebp
5197 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5198
5199
5200
5201 68/push _test-input-stream/imm32
5202
5203 e8/call clear-stream/disp32
5204
5205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5206
5207
5208 68/push _test-output-stream/imm32
5209
5210 e8/call clear-stream/disp32
5211
5212 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5213
5214
5215 68/push _test-output-buffered-file->buffer/imm32
5216
5217 e8/call clear-stream/disp32
5218
5219 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5220
5221
5222
5223 68/push "e8/call 20/disp32"/imm32
5224 68/push _test-input-stream/imm32
5225
5226 e8/call write/disp32
5227
5228 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5229
5230
5231 68/push _test-output-buffered-file/imm32
5232 68/push _test-input-stream/imm32
5233
5234 e8/call convert-instruction/disp32
5235
5236 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5237
5238
5239
5240 68/push _test-output-buffered-file/imm32
5241
5242 e8/call flush/disp32
5243
5244 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5245 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5271
5272
5273 68/push "F - test-convert-instruction-handles-disp32-operand"/imm32
5274 68/push "e8 20 00 00 00 # e8/call 20/disp32"/imm32
5275 68/push _test-output-stream/imm32
5276
5277 e8/call check-stream-equal/disp32
5278
5279 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5280
5281 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5282 5d/pop-to-ebp
5283 c3/return
5284
5285 test-convert-instruction-handles-disp16-operand:
5286
5287
5288 55/push-ebp
5289 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5290
5291
5292
5293 68/push _test-input-stream/imm32
5294
5295 e8/call clear-stream/disp32
5296
5297 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5298
5299
5300 68/push _test-output-stream/imm32
5301
5302 e8/call clear-stream/disp32
5303
5304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5305
5306
5307 68/push _test-output-buffered-file->buffer/imm32
5308
5309 e8/call clear-stream/disp32
5310
5311 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5312
5313
5314
5315 68/push "e8/call 20/disp16"/imm32
5316 68/push _test-input-stream/imm32
5317
5318 e8/call write/disp32
5319
5320 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5321
5322
5323 68/push _test-output-buffered-file/imm32
5324 68/push _test-input-stream/imm32
5325
5326 e8/call convert-instruction/disp32
5327
5328 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5329
5330
5331
5332 68/push _test-output-buffered-file/imm32
5333
5334 e8/call flush/disp32
5335
5336 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5337 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5363
5364
5365 68/push "F - test-convert-instruction-handles-disp16-operand"/imm32
5366 68/push "e8 20 00 # e8/call 20/disp16"/imm32
5367 68/push _test-output-stream/imm32
5368
5369 e8/call check-stream-equal/disp32
5370
5371 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5372
5373 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5374 5d/pop-to-ebp
5375 c3/return
5376
5377 test-convert-instruction-handles-disp8-operand:
5378
5379
5380 55/push-ebp
5381 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5382
5383
5384
5385 68/push _test-input-stream/imm32
5386
5387 e8/call clear-stream/disp32
5388
5389 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5390
5391
5392 68/push _test-output-stream/imm32
5393
5394 e8/call clear-stream/disp32
5395
5396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5397
5398
5399 68/push _test-output-buffered-file->buffer/imm32
5400
5401 e8/call clear-stream/disp32
5402
5403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5404
5405
5406
5407 68/push "eb/jump 20/disp8"/imm32
5408 68/push _test-input-stream/imm32
5409
5410 e8/call write/disp32
5411
5412 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5413
5414
5415 68/push _test-output-buffered-file/imm32
5416 68/push _test-input-stream/imm32
5417
5418 e8/call convert-instruction/disp32
5419
5420 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5421
5422
5423
5424 68/push _test-output-buffered-file/imm32
5425
5426 e8/call flush/disp32
5427
5428 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5429 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5455
5456
5457 68/push "F - test-convert-instruction-handles-disp8-operand"/imm32
5458 68/push "eb 20 # eb/jump 20/disp8"/imm32
5459 68/push _test-output-stream/imm32
5460
5461 e8/call check-stream-equal/disp32
5462
5463 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5464
5465 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5466 5d/pop-to-ebp
5467 c3/return
5468
5469 test-convert-instruction-handles-disp8-name:
5470
5471
5472 55/push-ebp
5473 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5474
5475
5476
5477 68/push _test-input-stream/imm32
5478
5479 e8/call clear-stream/disp32
5480
5481 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5482
5483
5484 68/push _test-output-stream/imm32
5485
5486 e8/call clear-stream/disp32
5487
5488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5489
5490
5491 68/push _test-output-buffered-file->buffer/imm32
5492
5493 e8/call clear-stream/disp32
5494
5495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5496
5497
5498
5499 68/push "eb/jump xyz/disp8"/imm32
5500 68/push _test-input-stream/imm32
5501
5502 e8/call write/disp32
5503
5504 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5505
5506
5507 68/push _test-output-buffered-file/imm32
5508 68/push _test-input-stream/imm32
5509
5510 e8/call convert-instruction/disp32
5511
5512 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5513
5514
5515
5516 68/push _test-output-buffered-file/imm32
5517
5518 e8/call flush/disp32
5519
5520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5521 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5547
5548
5549 68/push "F - test-convert-instruction-handles-disp8-name"/imm32
5550 68/push "eb xyz/disp8 # eb/jump xyz/disp8"/imm32
5551 68/push _test-output-stream/imm32
5552
5553 e8/call check-stream-equal/disp32
5554
5555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5556
5557 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5558 5d/pop-to-ebp
5559 c3/return
5560
5561 test-convert-instruction-handles-imm32-operand:
5562
5563
5564 55/push-ebp
5565 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5566
5567
5568
5569 68/push _test-input-stream/imm32
5570
5571 e8/call clear-stream/disp32
5572
5573 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5574
5575
5576 68/push _test-output-stream/imm32
5577
5578 e8/call clear-stream/disp32
5579
5580 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5581
5582
5583 68/push _test-output-buffered-file->buffer/imm32
5584
5585 e8/call clear-stream/disp32
5586
5587 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5588
5589
5590
5591 68/push "68/push 0x20/imm32"/imm32
5592 68/push _test-input-stream/imm32
5593
5594 e8/call write/disp32
5595
5596 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5597
5598
5599 68/push _test-output-buffered-file/imm32
5600 68/push _test-input-stream/imm32
5601
5602 e8/call convert-instruction/disp32
5603
5604 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5605
5606
5607
5608 68/push _test-output-buffered-file/imm32
5609
5610 e8/call flush/disp32
5611
5612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5613 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5639
5640
5641 68/push "F - test-convert-instruction-handles-imm32-operand"/imm32
5642 68/push "68 20 00 00 00 # 68/push 0x20/imm32"/imm32
5643 68/push _test-output-stream/imm32
5644
5645 e8/call check-stream-equal/disp32
5646
5647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5648
5649 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5650 5d/pop-to-ebp
5651 c3/return
5652
5653 test-convert-instruction-handles-imm16-operand:
5654
5655
5656
5657 55/push-ebp
5658 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5659
5660
5661
5662 68/push _test-input-stream/imm32
5663
5664 e8/call clear-stream/disp32
5665
5666 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5667
5668
5669 68/push _test-output-stream/imm32
5670
5671 e8/call clear-stream/disp32
5672
5673 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5674
5675
5676 68/push _test-output-buffered-file->buffer/imm32
5677
5678 e8/call clear-stream/disp32
5679
5680 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5681
5682
5683
5684 68/push "68/push 0x20/imm16"/imm32
5685 68/push _test-input-stream/imm32
5686
5687 e8/call write/disp32
5688
5689 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5690
5691
5692 68/push _test-output-buffered-file/imm32
5693 68/push _test-input-stream/imm32
5694
5695 e8/call convert-instruction/disp32
5696
5697 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5698
5699
5700
5701 68/push _test-output-buffered-file/imm32
5702
5703 e8/call flush/disp32
5704
5705 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5706 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5732
5733
5734 68/push "F - test-convert-instruction-handles-imm16-operand"/imm32
5735 68/push "68 20 00 # 68/push 0x20/imm16"/imm32
5736 68/push _test-output-stream/imm32
5737
5738 e8/call check-stream-equal/disp32
5739
5740 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5741
5742 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5743 5d/pop-to-ebp
5744 c3/return
5745
5746 test-convert-instruction-handles-imm8-operand:
5747
5748
5749
5750 55/push-ebp
5751 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5752
5753
5754
5755 68/push _test-input-stream/imm32
5756
5757 e8/call clear-stream/disp32
5758
5759 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5760
5761
5762 68/push _test-output-stream/imm32
5763
5764 e8/call clear-stream/disp32
5765
5766 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5767
5768
5769 68/push _test-output-buffered-file->buffer/imm32
5770
5771 e8/call clear-stream/disp32
5772
5773 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5774
5775
5776
5777 68/push "68/push 0x20/imm8"/imm32
5778 68/push _test-input-stream/imm32
5779
5780 e8/call write/disp32
5781
5782 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5783
5784
5785 68/push _test-output-buffered-file/imm32
5786 68/push _test-input-stream/imm32
5787
5788 e8/call convert-instruction/disp32
5789
5790 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5791
5792
5793
5794 68/push _test-output-buffered-file/imm32
5795
5796 e8/call flush/disp32
5797
5798 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5799 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
5825
5826
5827 68/push "F - test-convert-instruction-handles-imm8-operand"/imm32
5828 68/push "68 20 # 68/push 0x20/imm8"/imm32
5829 68/push _test-output-stream/imm32
5830
5831 e8/call check-stream-equal/disp32
5832
5833 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5834
5835 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5836 5d/pop-to-ebp
5837 c3/return
5838
5839
5840 parse-datum-of-word:
5841
5842 55/push-ebp
5843 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
5844
5845 51/push-ecx
5846 56/push-esi
5847
5848 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
5849
5850 68/push 0/imm32/end
5851 68/push 0/imm32/start
5852 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
5853
5854
5855 51/push-ecx
5856 68/push 0x2f/imm32/slash
5857 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
5858 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
5859
5860 e8/call next-token-from-slice/disp32
5861
5862 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
5863
5864
5865 51/push-ecx
5866
5867 e8/call parse-hex-int/disp32
5868
5869 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5870 $parse-datum-of-word:end:
5871
5872 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
5873
5874 5e/pop-to-esi
5875 59/pop-to-ecx
5876
5877 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5878 5d/pop-to-ebp
5879 c3/return
5880
5881