https://github.com/akkartik/mu/blob/main/linux/labels_baremetal.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 == code
40
41
42
43
44 Entry:
45
46 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
47
48
49
50 68/push Heap/imm32
51 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
52
53 e8/call new-segment/disp32
54
55 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
56
57
58 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-size/disp32
59
60 e8/call initialize-trace-stream/disp32
61
62 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
63
64
65
66 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
67 7e/jump-if-<= $subx-labels-main:interactive/disp8
68
69
70
71 68/push "test"/imm32
72 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
73
74 e8/call kernel-string-equal?/disp32
75
76 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
77
78 3d/compare-eax-and 0/imm32/false
79 74/jump-if-= $subx-labels-main:interactive/disp8
80
81
82 e8/call run-tests/disp32
83
84 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
85 eb/jump $subx-labels-main:end/disp8
86 $subx-labels-main:interactive:
87
88
89
90 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x1000/imm32
91
92 68/push 0x1000/imm32
93
94 68/push 0/imm32/read
95
96 68/push 0/imm32/write
97
98 bb/copy-to-ebx Label-file/imm32
99 b9/copy-to-ecx 0/imm32/read-mode
100 ba/copy-to-edx 0x180/imm32/permissions
101 e8/call syscall_open/disp32
102 50/push-eax
103 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
104
105
106 68/push Stdout/imm32
107 56/push-esi
108 68/push Stdin/imm32
109
110 e8/call subx-labels/disp32
111
112 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
113
114
115
116
117
118
119
120
121
122 bb/copy-to-ebx 0/imm32
123 $subx-labels-main:end:
124 e8/call syscall_exit/disp32
125
126 == data
127
128 Label-file:
129 6c/l 61/a 62/b 65/e 6c/l 73/s 00/nul
130
131 == code
132
133 subx-labels:
134
135
136
137
138
139
140
141
142 55/push-ebp
143 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
144
145 52/push-edx
146 56/push-esi
147
148
149
150 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
151
152 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Max-labels/disp32
153
154 68/push 0/imm32/read
155
156 68/push 0/imm32/write
157 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
158
159
160 52/push-edx
161 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
162
163 e8/call load-labels/disp32
164
165 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
166
167
168 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
169
170 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Input-size/disp32
171
172 68/push 0/imm32/read
173
174 68/push 0/imm32/write
175 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
176
177
178 56/push-esi
179 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
180
181 e8/call slurp/disp32
182
183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
184
185
186 52/push-edx
187 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
188 56/push-esi
189
190 e8/call emit-output/disp32
191
192 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
193
194
195 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
196
197 e8/call flush/disp32
198
199 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
200 $subx-labels:end:
201
202 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x18/imm32
203 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
204 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
205
206 5e/pop-to-esi
207 5a/pop-to-edx
208
209 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
210 5d/pop-to-ebp
211 c3/return
212
213 load-labels:
214
215
216
217
218
219
220
221
222
223
224
225
226
227 55/push-ebp
228 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
229
230 50/push-eax
231 51/push-ecx
232 52/push-edx
233 56/push-esi
234 57/push-edi
235
236 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
237 68/push 0x200/imm32/size
238 68/push 0/imm32/read
239 68/push 0/imm32/write
240 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
241
242 68/push 0/imm32/end
243 68/push 0/imm32/start
244 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
245 $load-labels:loop:
246
247
248 51/push-ecx
249
250 e8/call clear-stream/disp32
251
252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
253
254
255 51/push-ecx
256 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
257
258 e8/call read-line-buffered/disp32
259
260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
261 +-- 33 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
294
295 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
296 0f 84/jump-if-= $load-labels:end/disp32
297
298
299 52/push-edx
300 51/push-ecx
301
302 e8/call next-word/disp32
303
304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
305 +-- 33 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
338
339
340
341 68/push Heap/imm32
342 68/push 0xc/imm32/row-size
343 52/push-edx
344 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
345
346 e8/call get-or-insert-slice/disp32
347
348 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
349
350 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
351
352
353 52/push-edx
354 51/push-ecx
355
356 e8/call next-word/disp32
357
358 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
359
360
361 52/push-edx
362
363 e8/call parse-hex-int-from-slice/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
366
367 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
368
369 89/copy 0/mod/indirect 7/rm32/edi . . 6/r32/esi . .
370
371 e9/jump $load-labels:loop/disp32
372 $load-labels:end:
373
374 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
375
376 5f/pop-to-edi
377 5e/pop-to-esi
378 5a/pop-to-edx
379 59/pop-to-ecx
380 58/pop-to-eax
381
382 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
383 5d/pop-to-ebp
384 c3/return
385
386
387 == data
388
389 emit-output:datum:
390 0/imm32/start
391 0/imm32/end
392
393 == code
394
395 emit-output:
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460 55/push-ebp
461 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
462
463 50/push-eax
464 51/push-ecx
465 52/push-edx
466 53/push-ebx
467 56/push-esi
468 57/push-edi
469
470 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
471 68/push 0x200/imm32/size
472 68/push 0/imm32/read
473 68/push 0/imm32/write
474 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
475
476 68/push 0/imm32/end
477 68/push 0/imm32/start
478 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
479
480 bb/copy-to-ebx 0x7c00/imm32
481 $emit-output:line-loop:
482
483
484 51/push-ecx
485
486 e8/call clear-stream/disp32
487
488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
489
490
491 51/push-ecx
492 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
493
494 e8/call read-line/disp32
495
496 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
497 +-- 33 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
530 $emit-output:check-for-end-of-input:
531
532 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
533 0f 84/jump-if-= $emit-output:end/disp32
534
535
536
537 51/push-ecx
538
539 e8/call num-bytes/disp32
540
541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
542
543 01/add 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
544
545
546 51/push-ecx
547
548 e8/call far-jump-or-call?/disp32
549
550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
551
552
553 51/push-ecx
554
555 e8/call rewind-stream/disp32
556
557 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
558 $emit-output:word-loop:
559
560
561 52/push-edx
562 51/push-ecx
563
564 e8/call next-word/disp32
565
566 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
567 +-- 33 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
600 $emit-output:check-for-end-of-line:
601
602
603
604 52/push-edx
605
606 e8/call slice-empty?/disp32
607
608 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
609
610 3d/compare-eax-and 0/imm32/false
611 0f 85/jump-if-!= $emit-output:next-line/disp32
612 $emit-output:check-for-comment:
613
614
615 8b/copy 0/mod/indirect 2/rm32/edx . . . 6/r32/esi . .
616
617 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
618 8a/copy-byte 0/mod/indirect 6/rm32/esi . . . 0/r32/AL . .
619
620 3d/compare-eax-and 0x23/imm32/hash
621 0f 84/jump-if-= $emit-output:next-line/disp32
622 $emit-output:check-for-label:
623
624
625
626 52/push-edx
627
628 e8/call label?/disp32
629
630 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
631
632 3d/compare-eax-and 0/imm32/false
633 0f 85/jump-if-!= $emit-output:line-loop/disp32
634 $emit-output:check-for-segment-header:
635
636
637
638 68/push "=="/imm32
639 52/push-edx
640
641 e8/call slice-equal?/disp32
642
643 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
644
645 3d/compare-eax-and 0/imm32/false
646 0f 84/jump-if-= $emit-output:2-character/disp32
647
648
649
650 52/push-edx
651 51/push-ecx
652
653 e8/call next-word/disp32
654
655 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
656
657
658
659 52/push-edx
660 51/push-ecx
661
662 e8/call next-word/disp32
663
664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
665
666
667 52/push-edx
668
669 e8/call slice-empty?/disp32
670
671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
672
673 3d/compare-eax-and 0/imm32/false
674 0f 85/jump-if-!= $emit-output:padding-done/disp32
675
676
677 52/push-edx
678
679 e8/call parse-hex-int-from-slice/disp32
680
681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
682
683
684
685 68/push "# "/imm32
686 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
687
688 e8/call write-buffered/disp32
689
690 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
691
692
693 53/push-ebx
694 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
695
696 e8/call write-int32-hex-buffered/disp32
697
698 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
699
700
701 68/push Newline/imm32
702 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
703
704 e8/call write-buffered/disp32
705
706 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
707 $emit-output:padding-loop:
708
709 39/compare 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
710 73/jump-if-addr>= $emit-output:padding-loop-done/disp8
711
712 53/push-ebx
713 81 4/subop/and 3/mod/direct 3/rm32/ebx . . . . . 7/imm32
714 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32
715 5b/pop-to-ebx
716 75/jump-if-!= $emit-output:padding-core/disp8
717
718
719 68/push Newline/imm32
720 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
721
722 e8/call write-buffered/disp32
723
724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
725 $emit-output:padding-core:
726
727
728 68/push "00 "/imm32
729 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
730
731 e8/call write-buffered/disp32
732
733 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
734
735 43/increment-ebx
736
737 eb/jump $emit-output:padding-loop/disp8
738 $emit-output:padding-loop-done:
739
740
741 68/push Newline/imm32
742 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
743
744 e8/call write-buffered/disp32
745
746 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
747 $emit-output:padding-done:
748
749
750
751 68/push "# "/imm32
752 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
753
754 e8/call write-buffered/disp32
755
756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
757
758
759 53/push-ebx
760 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
761
762 e8/call write-int32-hex-buffered/disp32
763
764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
765
766
767 68/push Newline/imm32
768 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
769
770 e8/call write-buffered/disp32
771
772 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
773
774 e9/jump $emit-output:line-loop/disp32
775 $emit-output:2-character:
776
777
778 8b/copy 1/mod/*+disp8 2/rm32/edx . . . 0/r32/eax 4/disp8 .
779 2b/subtract 0/mod/indirect 2/rm32/edx . . . 0/r32/eax . .
780
781 3d/compare-eax-and 2/imm32
782 75/jump-if-!= $emit-output:check-metadata/disp8
783
784
785 52/push-edx
786 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
787
788 e8/call write-slice-buffered/disp32
789
790 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
791
792
793 68/push Space/imm32
794 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
795
796 e8/call write-buffered/disp32
797
798 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
799
800 e9/jump $emit-output:word-loop/disp32
801 $emit-output:check-metadata:
802
803
804
805 68/push emit-output:datum/imm32
806 68/push 0x2f/imm32/slash
807 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
808 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
809
810 e8/call next-token-from-slice/disp32
811
812 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
813 +-- 33 lines: #? # dump datum ------------------------------------------------------------------------------------------------------------------------------------------
846
847
848
849 68/push "label table"/imm32
850 68/push 0xc/imm32/row-size
851 68/push emit-output:datum/imm32
852 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
853
854 e8/call get-slice/disp32
855
856 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
857
858 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
859 $emit-output:check-imm8:
860
861
862
863 68/push "imm8"/imm32
864 52/push-edx
865
866 e8/call has-metadata?/disp32
867
868 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
869
870 3d/compare-eax-and 0/imm32/false
871 74/jump-if-= $emit-output:check-imm16/disp8
872 $emit-output:emit-imm8:
873
874
875 68/push 1/imm32
876 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
877 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
878
879 e8/call emit-hex/disp32
880
881 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
882
883 e9/jump $emit-output:word-loop/disp32
884 $emit-output:check-imm16:
885
886
887
888 68/push "imm16"/imm32
889 52/push-edx
890
891 e8/call has-metadata?/disp32
892
893 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
894
895 3d/compare-eax-and 0/imm32/false
896 74/jump-if-= $emit-output:check-imm32/disp8
897 +-- 33 lines: #? # dump *address ---------------------------------------------------------------------------------------------------------------------------------------
930 $emit-output:emit-imm16:
931
932
933 68/push 2/imm32
934 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
935 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
936
937 e8/call emit-hex/disp32
938
939 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
940
941
942 e9/jump $emit-output:word-loop/disp32
943 $emit-output:check-imm32:
944
945
946
947 68/push "imm32"/imm32
948 52/push-edx
949
950 e8/call has-metadata?/disp32
951
952 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
953
954 3d/compare-eax-and 0/imm32/false
955 74/jump-if-= $emit-output:check-disp8/disp8
956 +-- 33 lines: #? # dump *address ---------------------------------------------------------------------------------------------------------------------------------------
989 $emit-output:emit-imm32:
990
991
992 68/push 4/imm32
993 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
994 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
995
996 e8/call emit-hex/disp32
997
998 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
999
1000 e9/jump $emit-output:word-loop/disp32
1001 $emit-output:check-disp8:
1002
1003
1004
1005 68/push "disp8"/imm32
1006 52/push-edx
1007
1008 e8/call has-metadata?/disp32
1009
1010 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1011
1012 3d/compare-eax-and 0/imm32/false
1013 74/jump-if-= $emit-output:check-disp16/disp8
1014 $emit-output:emit-disp8:
1015
1016
1017 68/push 1/imm32
1018 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1019 29/subtract 3/mod/direct 0/rm32/eax . . . 3/r32/ebx . .
1020 50/push-eax
1021 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1022
1023 e8/call emit-hex/disp32
1024
1025 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1026
1027 e9/jump $emit-output:word-loop/disp32
1028 $emit-output:check-disp16:
1029
1030
1031
1032 68/push "disp16"/imm32
1033 52/push-edx
1034
1035 e8/call has-metadata?/disp32
1036
1037 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1038
1039 3d/compare-eax-and 0/imm32/false
1040 74/jump-if-= $emit-output:check-disp32/disp8
1041 $emit-output:emit-disp16:
1042
1043
1044 68/push 2/imm32
1045 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1046 29/subtract 3/mod/direct 0/rm32/eax . . . 3/r32/ebx . .
1047 50/push-eax
1048 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1049
1050 e8/call emit-hex/disp32
1051
1052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1053
1054 e9/jump $emit-output:word-loop/disp32
1055 $emit-output:check-disp32:
1056
1057
1058
1059 68/push "disp32"/imm32
1060 52/push-edx
1061
1062 e8/call has-metadata?/disp32
1063
1064 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1065
1066 3d/compare-eax-and 0/imm32/false
1067 0f 84/jump-if-= $emit-output:abort/disp32
1068 $emit-output:emit-disp32:
1069
1070 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1071
1072 81 7/subop/compare 3/mod/direct 7/rm32/edi . . . . . 0/imm32/false
1073 74/jump-if-= $emit-output:really-emit-disp32/disp8
1074 29/subtract 3/mod/direct 0/rm32/eax . . . 3/r32/ebx . .
1075 $emit-output:really-emit-disp32:
1076
1077
1078 68/push 4/imm32
1079 50/push-eax
1080 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1081
1082 e8/call emit-hex/disp32
1083
1084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1085
1086 e9/jump $emit-output:word-loop/disp32
1087 $emit-output:next-line:
1088
1089
1090 68/push Newline/imm32
1091 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1092
1093 e8/call write-buffered/disp32
1094
1095 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1096
1097 e9/jump $emit-output:line-loop/disp32
1098 $emit-output:end:
1099
1100 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
1101
1102 5f/pop-to-edi
1103 5e/pop-to-esi
1104 5b/pop-to-ebx
1105 5a/pop-to-edx
1106 59/pop-to-ecx
1107 58/pop-to-eax
1108
1109 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1110 5d/pop-to-ebp
1111 c3/return
1112
1113 $emit-output:abort:
1114
1115
1116
1117 68/push "emit-output: missing metadata in "/imm32
1118 68/push 2/imm32/stderr
1119
1120 e8/call _write/disp32
1121
1122 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1123
1124
1125 52/push-edx
1126 68/push Stderr/imm32
1127
1128 e8/call write-slice-buffered/disp32
1129
1130 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1131
1132
1133 68/push Stderr/imm32
1134
1135 e8/call flush/disp32
1136
1137 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1138
1139 bb/copy-to-ebx 1/imm32
1140 e8/call syscall_exit/disp32
1141
1142
1143 test-emit-output-non-far-control-flow:
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164 55/push-ebp
1165 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1166
1167
1168
1169 68/push _test-input-stream/imm32
1170
1171 e8/call clear-stream/disp32
1172
1173 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1174
1175
1176 68/push _test-output-stream/imm32
1177
1178 e8/call clear-stream/disp32
1179
1180 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1181
1182
1183 68/push $_test-output-buffered-file->buffer/imm32
1184
1185 e8/call clear-stream/disp32
1186
1187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1188
1189 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xc0/imm32
1190 68/push 0xc0/imm32/size
1191 68/push 0/imm32/read
1192 68/push 0/imm32/write
1193 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1194
1195 68/push 0/imm32
1196 68/push 0/imm32
1197 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1198
1199
1200
1201 68/push "== code\n"/imm32
1202 68/push _test-input-stream/imm32
1203
1204 e8/call write/disp32
1205
1206 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1207
1208
1209 68/push "ab cd ef gh\n"/imm32
1210 68/push _test-input-stream/imm32
1211
1212 e8/call write/disp32
1213
1214 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1215
1216
1217 68/push "ij x/disp32\n"/imm32
1218 68/push _test-input-stream/imm32
1219
1220 e8/call write/disp32
1221
1222 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1223
1224
1225 68/push "== data\n"/imm32
1226 68/push _test-input-stream/imm32
1227
1228 e8/call write/disp32
1229
1230 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1231
1232
1233 68/push "00\n"/imm32
1234 68/push _test-input-stream/imm32
1235
1236 e8/call write/disp32
1237
1238 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1239
1240
1241 68/push "34\n"/imm32
1242 68/push _test-input-stream/imm32
1243
1244 e8/call write/disp32
1245
1246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1247
1248 68/push 0x11223344/imm32/label-address
1249
1250 53/push-ebx
1251 68/push "x"/imm32
1252 68/push Heap/imm32
1253 e8/call copy-array/disp32
1254 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1255 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 .
1256 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . .
1257
1258 52/push-edx
1259
1260 e8/call stream-add2/disp32
1261
1262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
1263
1264
1265
1266 52/push-edx
1267 68/push _test-output-buffered-file/imm32
1268 68/push _test-input-stream/imm32
1269
1270 e8/call emit-output/disp32
1271
1272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1273
1274
1275
1276 68/push _test-output-buffered-file/imm32
1277
1278 e8/call flush/disp32
1279
1280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1281 +-- 33 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1314
1315
1316 68/push "F - test-emit-output-non-far-control-flow/0"/imm32
1317 68/push "# 0x00007c00"/imm32
1318 68/push _test-output-stream/imm32
1319
1320 e8/call check-next-stream-line-equal/disp32
1321
1322 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1323
1324
1325 68/push "F - test-emit-output-non-far-control-flow/1"/imm32
1326 68/push "ab cd ef gh "/imm32
1327 68/push _test-output-stream/imm32
1328
1329 e8/call check-next-stream-line-equal/disp32
1330
1331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1332
1333
1334 68/push "F - test-emit-output-non-far-control-flow/2"/imm32
1335 68/push "ij 44 33 22 11 "/imm32
1336 68/push _test-output-stream/imm32
1337
1338 e8/call check-next-stream-line-equal/disp32
1339
1340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1341
1342
1343 68/push "F - test-emit-output-non-far-control-flow/3"/imm32
1344 68/push "# 0x00007c09"/imm32
1345 68/push _test-output-stream/imm32
1346
1347 e8/call check-next-stream-line-equal/disp32
1348
1349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1350
1351
1352 68/push "F - test-emit-output-non-far-control-flow/3"/imm32
1353 68/push "00 "/imm32
1354 68/push _test-output-stream/imm32
1355
1356 e8/call check-next-stream-line-equal/disp32
1357
1358 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1359
1360
1361 68/push "F - test-emit-output-non-far-control-flow/4"/imm32
1362 68/push "34 "/imm32
1363 68/push _test-output-stream/imm32
1364
1365 e8/call check-next-stream-line-equal/disp32
1366
1367 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1368
1369 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1370 5d/pop-to-ebp
1371 c3/return
1372
1373 test-emit-output-with-padding:
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392 55/push-ebp
1393 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1394
1395
1396
1397 68/push _test-input-stream/imm32
1398
1399 e8/call clear-stream/disp32
1400
1401 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1402
1403
1404 68/push _test-output-stream/imm32
1405
1406 e8/call clear-stream/disp32
1407
1408 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1409
1410
1411 68/push $_test-output-buffered-file->buffer/imm32
1412
1413 e8/call clear-stream/disp32
1414
1415 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1416
1417 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xc0/imm32
1418 68/push 0xc0/imm32/size
1419 68/push 0/imm32/read
1420 68/push 0/imm32/write
1421 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1422
1423 68/push 0/imm32
1424 68/push 0/imm32
1425 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1426
1427
1428
1429 68/push "== code\n"/imm32
1430 68/push _test-input-stream/imm32
1431
1432 e8/call write/disp32
1433
1434 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1435
1436
1437 68/push "ab cd ef gh\n"/imm32
1438 68/push _test-input-stream/imm32
1439
1440 e8/call write/disp32
1441
1442 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1443
1444
1445 68/push "== data 0x7c10\n"/imm32
1446 68/push _test-input-stream/imm32
1447
1448 e8/call write/disp32
1449
1450 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1451
1452
1453 68/push "34\n"/imm32
1454 68/push _test-input-stream/imm32
1455
1456 e8/call write/disp32
1457
1458 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1459
1460
1461
1462 52/push-edx
1463 68/push _test-output-buffered-file/imm32
1464 68/push _test-input-stream/imm32
1465
1466 e8/call emit-output/disp32
1467
1468 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1469
1470
1471
1472 68/push _test-output-buffered-file/imm32
1473
1474 e8/call flush/disp32
1475
1476 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1477 +-- 33 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1510
1511
1512 68/push "F - test-emit-output-with-padding/0"/imm32
1513 68/push "# 0x00007c00"/imm32
1514 68/push _test-output-stream/imm32
1515
1516 e8/call check-next-stream-line-equal/disp32
1517
1518 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1519
1520
1521 68/push "F - test-emit-output-with-padding/1"/imm32
1522 68/push "ab cd ef gh "/imm32
1523 68/push _test-output-stream/imm32
1524
1525 e8/call check-next-stream-line-equal/disp32
1526
1527 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1528
1529
1530 68/push "F - test-emit-output-with-padding/0"/imm32
1531 68/push "# 0x00007c04"/imm32
1532 68/push _test-output-stream/imm32
1533
1534 e8/call check-next-stream-line-equal/disp32
1535
1536 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1537
1538
1539 68/push "F - test-emit-output-with-padding/2"/imm32
1540 68/push "00 00 00 00 "/imm32
1541 68/push _test-output-stream/imm32
1542
1543 e8/call check-next-stream-line-equal/disp32
1544
1545 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1546
1547
1548 68/push "F - test-emit-output-with-padding/3"/imm32
1549 68/push "00 00 00 00 00 00 00 00 "/imm32
1550 68/push _test-output-stream/imm32
1551
1552 e8/call check-next-stream-line-equal/disp32
1553
1554 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1555
1556
1557 68/push "F - test-emit-output-with-padding/0"/imm32
1558 68/push "# 0x00007c10"/imm32
1559 68/push _test-output-stream/imm32
1560
1561 e8/call check-next-stream-line-equal/disp32
1562
1563 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1564
1565
1566 68/push "F - test-emit-output-with-padding/4"/imm32
1567 68/push "34 "/imm32
1568 68/push _test-output-stream/imm32
1569
1570 e8/call check-next-stream-line-equal/disp32
1571
1572 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1573
1574 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1575 5d/pop-to-ebp
1576 c3/return
1577
1578 test-emit-output-code-label:
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596 55/push-ebp
1597 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1598
1599
1600
1601 68/push _test-input-stream/imm32
1602
1603 e8/call clear-stream/disp32
1604
1605 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1606
1607
1608 68/push _test-output-stream/imm32
1609
1610 e8/call clear-stream/disp32
1611
1612 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1613
1614
1615 68/push $_test-output-buffered-file->buffer/imm32
1616
1617 e8/call clear-stream/disp32
1618
1619 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1620
1621 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xc0/imm32
1622 68/push 0xc0/imm32/size
1623 68/push 0/imm32/read
1624 68/push 0/imm32/write
1625 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1626
1627 68/push 0/imm32
1628 68/push 0/imm32
1629 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1630
1631
1632
1633 68/push "== code\n"/imm32
1634 68/push _test-input-stream/imm32
1635
1636 e8/call write/disp32
1637
1638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1639
1640
1641 68/push "ab cd\n"/imm32
1642 68/push _test-input-stream/imm32
1643
1644 e8/call write/disp32
1645
1646 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1647
1648
1649 68/push "ef gh\n"/imm32
1650 68/push _test-input-stream/imm32
1651
1652 e8/call write/disp32
1653
1654 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1655
1656
1657 68/push "e8 l1/disp32\n"/imm32
1658 68/push _test-input-stream/imm32
1659
1660 e8/call write/disp32
1661
1662 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1663
1664 68/push 0x7c10/imm32/label-address
1665
1666 53/push-ebx
1667 68/push "l1"/imm32
1668 68/push Heap/imm32
1669 e8/call copy-array/disp32
1670 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1671 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 .
1672 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . .
1673
1674 52/push-edx
1675
1676 e8/call stream-add2/disp32
1677
1678 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
1679
1680
1681
1682 52/push-edx
1683 68/push _test-output-buffered-file/imm32
1684 68/push _test-input-stream/imm32
1685
1686 e8/call emit-output/disp32
1687
1688 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1689
1690
1691
1692 68/push _test-output-buffered-file/imm32
1693
1694 e8/call flush/disp32
1695
1696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1697 +-- 33 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1730
1731
1732 68/push "F - test-emit-output-code-label/0"/imm32
1733 68/push "# 0x00007c00"/imm32
1734 68/push _test-output-stream/imm32
1735
1736 e8/call check-next-stream-line-equal/disp32
1737
1738 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1739
1740
1741 68/push "F - test-emit-output-code-label/1"/imm32
1742 68/push "ab cd "/imm32
1743 68/push _test-output-stream/imm32
1744
1745 e8/call check-next-stream-line-equal/disp32
1746
1747 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1748
1749
1750 68/push "F - test-emit-output-code-label/2"/imm32
1751 68/push "ef gh "/imm32
1752 68/push _test-output-stream/imm32
1753
1754 e8/call check-next-stream-line-equal/disp32
1755
1756 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1757
1758
1759 68/push "F - test-emit-output-code-label/3"/imm32
1760 68/push "e8 07 00 00 00 "/imm32
1761 68/push _test-output-stream/imm32
1762
1763 e8/call check-next-stream-line-equal/disp32
1764
1765 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1766
1767 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1768 5d/pop-to-ebp
1769 c3/return
1770
1771 test-emit-output-code-label-absolute:
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789 55/push-ebp
1790 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1791
1792
1793
1794 68/push _test-input-stream/imm32
1795
1796 e8/call clear-stream/disp32
1797
1798 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1799
1800
1801 68/push _test-output-stream/imm32
1802
1803 e8/call clear-stream/disp32
1804
1805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1806
1807
1808 68/push $_test-output-buffered-file->buffer/imm32
1809
1810 e8/call clear-stream/disp32
1811
1812 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1813
1814 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xc0/imm32
1815 68/push 0xc0/imm32/size
1816 68/push 0/imm32/read
1817 68/push 0/imm32/write
1818 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1819
1820 68/push 0/imm32
1821 68/push 0/imm32
1822 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1823
1824
1825
1826 68/push "== code\n"/imm32
1827 68/push _test-input-stream/imm32
1828
1829 e8/call write/disp32
1830
1831 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1832
1833
1834 68/push "ab cd\n"/imm32
1835 68/push _test-input-stream/imm32
1836
1837 e8/call write/disp32
1838
1839 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1840
1841
1842 68/push "ef gh\n"/imm32
1843 68/push _test-input-stream/imm32
1844
1845 e8/call write/disp32
1846
1847 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1848
1849
1850 68/push "ij l1/imm32\n"/imm32
1851 68/push _test-input-stream/imm32
1852
1853 e8/call write/disp32
1854
1855 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1856
1857 68/push 0x1056/imm32/label-address
1858
1859 53/push-ebx
1860 68/push "l1"/imm32
1861 68/push Heap/imm32
1862 e8/call copy-array/disp32
1863 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1864 ff 6/subop/push 1/mod/*+disp8 3/rm32/ebx . . . . 4/disp8 .
1865 ff 6/subop/push 0/mod/indirect 3/rm32/ebx . . . . . .
1866
1867 52/push-edx
1868
1869 e8/call stream-add2/disp32
1870
1871 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
1872
1873
1874
1875 52/push-edx
1876 68/push _test-output-buffered-file/imm32
1877 68/push _test-input-stream/imm32
1878
1879 e8/call emit-output/disp32
1880
1881 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1882
1883
1884
1885 68/push _test-output-buffered-file/imm32
1886
1887 e8/call flush/disp32
1888
1889 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1890 +-- 33 lines: #? # dump output -----------------------------------------------------------------------------------------------------------------------------------------
1923
1924
1925 68/push "F - test-emit-output-code-label-absolute/0"/imm32
1926 68/push "# 0x00007c00"/imm32
1927 68/push _test-output-stream/imm32
1928
1929 e8/call check-next-stream-line-equal/disp32
1930
1931 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1932
1933
1934 68/push "F - test-emit-output-code-label-absolute/1"/imm32
1935 68/push "ab cd "/imm32
1936 68/push _test-output-stream/imm32
1937
1938 e8/call check-next-stream-line-equal/disp32
1939
1940 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1941
1942
1943 68/push "F - test-emit-output-code-label-absolute/2"/imm32
1944 68/push "ef gh "/imm32
1945 68/push _test-output-stream/imm32
1946
1947 e8/call check-next-stream-line-equal/disp32
1948
1949 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1950
1951
1952 68/push "F - test-emit-output-code-label-absolute/3"/imm32
1953 68/push "ij 56 10 00 00 "/imm32
1954 68/push _test-output-stream/imm32
1955
1956 e8/call check-next-stream-line-equal/disp32
1957
1958 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1959
1960 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1961 5d/pop-to-ebp
1962 c3/return
1963
1964
1965
1966 far-jump-or-call?:
1967
1968 55/push-ebp
1969 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1970
1971 50/push-eax
1972 51/push-ecx
1973 52/push-edx
1974 53/push-ebx
1975
1976 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 .
1977
1978 68/push 0/imm32/end
1979 68/push 0/imm32/start
1980 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
1981
1982 68/push 0/imm32/end
1983 68/push 0/imm32/start
1984 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1985
1986 bf/copy-to-edi 0/imm32/false
1987 $far-jump-or-call?:check-first-word:
1988
1989
1990 52/push-edx
1991 51/push-ecx
1992
1993 e8/call next-word/disp32
1994
1995 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1996
1997
1998
1999 52/push-edx
2000
2001 e8/call slice-empty?/disp32
2002
2003 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2004
2005 3d/compare-eax-and 0/imm32/false
2006 0f 85/jump-if-!= $far-jump-or-call?:end/disp32
2007
2008
2009 53/push-ebx
2010 68/push 0x2f/imm32/slash
2011 ff 6/subop/push 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
2012 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
2013
2014 e8/call next-token-from-slice/disp32
2015
2016 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2017
2018
2019
2020 68/push "e8"/imm32
2021 53/push-ebx
2022
2023 e8/call slice-equal?/disp32
2024
2025 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2026
2027 3d/compare-eax-and 0/imm32/false
2028 75/jump-if-!= $far-jump-or-call?:return-true/disp8
2029
2030
2031
2032 68/push "e9"/imm32
2033 53/push-ebx
2034
2035 e8/call slice-equal?/disp32
2036
2037 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2038
2039 3d/compare-eax-and 0/imm32/false
2040 75/jump-if-!= $far-jump-or-call?:return-true/disp8
2041
2042
2043
2044 68/push "0f"/imm32
2045 53/push-ebx
2046
2047 e8/call slice-equal?/disp32
2048
2049 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2050
2051 3d/compare-eax-and 0/imm32/false
2052 74/jump-if-= $far-jump-or-call?:end/disp8
2053 $far-jump-or-call?:check-second-word:
2054
2055
2056 52/push-edx
2057 51/push-ecx
2058
2059 e8/call next-word/disp32
2060
2061 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2062
2063
2064
2065 52/push-edx
2066
2067 e8/call slice-empty?/disp32
2068
2069 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2070
2071 3d/compare-eax-and 0/imm32/false
2072 75/jump-if-!= $far-jump-or-call?:end/disp8
2073
2074
2075 8b/copy 0/mod/indirect 2/rm32/edx . . . 0/r32/eax . .
2076
2077 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2078 25/and-eax-with 0xff/imm32
2079
2080 3d/compare-eax-and 0x38/imm32/8
2081 75/jump-if-!= $far-jump-or-call?:end/disp8
2082
2083 $far-jump-or-call?:return-true:
2084 bf/copy-to-edi 1/imm32/true
2085 $far-jump-or-call?:end:
2086
2087 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2088
2089 5b/pop-to-ebx
2090 5a/pop-to-edx
2091 59/pop-to-ecx
2092 58/pop-to-eax
2093
2094 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2095 5d/pop-to-ebp
2096 c3/return
2097
2098
2099
2100 stream-add2:
2101
2102 55/push-ebp
2103 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2104
2105 50/push-eax
2106 51/push-ecx
2107 52/push-edx
2108 56/push-esi
2109
2110 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
2111
2112
2113 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2114
2115 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 0/r32/eax 0xc/disp8 .
2116
2117
2118 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 8/disp8 .
2119
2120 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 2/index/edx . 2/r32/edx 0xc/disp8 .
2121
2122 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . .
2123 73/jump-if-addr>= $stream-add2:abort/disp8
2124
2125 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0xc/disp8 .
2126 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2127
2128 05/add-to-eax 4/imm32
2129
2130 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . .
2131 73/jump-if-addr>= $stream-add2:abort/disp8
2132
2133 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x10/disp8 .
2134 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2135
2136 05/add-to-eax 4/imm32
2137
2138 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . .
2139 73/jump-if-addr>= $stream-add2:abort/disp8
2140
2141 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x14/disp8 .
2142 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2143
2144 81 0/subop/add 0/mod/indirect 6/rm32/esi . . . . . 0xc/imm32
2145 $stream-add2:end:
2146
2147 5e/pop-to-esi
2148 5a/pop-to-edx
2149 59/pop-to-ecx
2150 58/pop-to-eax
2151
2152 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2153 5d/pop-to-ebp
2154 c3/return
2155
2156 $stream-add2:abort:
2157
2158
2159 68/push "overflow in stream-add2\n"/imm32
2160 68/push 2/imm32/stderr
2161
2162 e8/call _write/disp32
2163
2164 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2165
2166 bb/copy-to-ebx 1/imm32
2167 e8/call syscall_exit/disp32
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177 trace-slsns:
2178
2179 55/push-ebp
2180 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2181
2182
2183 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2184 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
2185
2186 e8/call write/disp32
2187
2188 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2189
2190
2191 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
2192 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
2193
2194 e8/call write-slice/disp32
2195
2196 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2197
2198
2199 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
2200 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
2201
2202 e8/call write/disp32
2203
2204 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2205
2206
2207 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 .
2208 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
2209
2210 e8/call write-int32-hex/disp32
2211
2212 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2213
2214
2215 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
2216
2217 e8/call trace/disp32
2218
2219 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2220 $trace-slsns:end:
2221
2222 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2223 5d/pop-to-ebp
2224 c3/return
2225
2226 test-trace-slsns:
2227
2228 55/push-ebp
2229 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2230
2231
2232 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32
2233 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32
2234
2235 b8/copy-to-eax "b"/imm32
2236 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2237 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2238 05/add-to-eax 4/imm32
2239
2240 51/push-ecx
2241 50/push-eax
2242 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
2243
2244
2245 68/push " e"/imm32
2246 68/push 3/imm32
2247 68/push "c "/imm32
2248 53/push-ebx
2249 68/push "A"/imm32
2250
2251 e8/call trace-slsns/disp32
2252
2253 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
2254 +-- 26 lines: #? # dump *Trace-stream ----------------------------------------------------------------------------------------------------------------------------------
2280
2281
2282 68/push "F - test-trace-slsls"/imm32
2283 68/push "Abc 0x00000003 e"/imm32
2284
2285 e8/call check-trace-contains/disp32
2286
2287 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2288
2289 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2290 5d/pop-to-ebp
2291 c3/return
2292
2293 num-bytes:
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310 55/push-ebp
2311 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2312
2313 51/push-ecx
2314 52/push-edx
2315 53/push-ebx
2316
2317 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
2318
2319 68/push 0/imm32/end
2320 68/push 0/imm32/start
2321 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2322 +-- 26 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------
2348
2349
2350 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2351
2352 e8/call rewind-stream/disp32
2353
2354 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2355 $num-bytes:loop:
2356
2357
2358 51/push-ecx
2359 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2360
2361 e8/call next-word/disp32
2362
2363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2364 +-- 40 lines: #? # dump word-slice -------------------------------------------------------------------------------------------------------------------------------------
2404 $num-bytes:check0:
2405
2406
2407 50/push-eax
2408
2409
2410 51/push-ecx
2411
2412 e8/call slice-empty?/disp32
2413
2414 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2415
2416 3d/compare-eax-and 0/imm32/false
2417
2418 58/pop-to-eax
2419 75/jump-if-!= $num-bytes:end/disp8
2420 $num-bytes:check-for-comment:
2421
2422
2423 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
2424
2425 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2426 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 3/r32/BL . .
2427
2428 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x23/imm32/hash
2429 74/jump-if-= $num-bytes:end/disp8
2430 $num-bytes:check-for-label:
2431
2432
2433 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 2/r32/edx 4/disp8 .
2434
2435 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
2436 8a/copy-byte 1/mod/*+disp8 2/rm32/edx . . . 3/r32/BL -1/disp8 .
2437
2438 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x3a/imm32/colon
2439 74/jump-if-= $num-bytes:end/disp8
2440 $num-bytes:check-for-segment-header:
2441
2442
2443 50/push-eax
2444
2445
2446 68/push "=="/imm32
2447 51/push-ecx
2448
2449 e8/call slice-equal?/disp32
2450
2451 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2452
2453 3d/compare-eax-and 0/imm32/false
2454
2455 58/pop-to-eax
2456 75/jump-if-!= $num-bytes:end/disp8
2457 $num-bytes:loop-body:
2458
2459
2460 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . .
2461
2462
2463 51/push-ecx
2464
2465 e8/call compute-width-of-slice/disp32
2466
2467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2468
2469 01/add 3/mod/direct 0/rm32/eax . . . 2/r32/edx . .
2470 e9/jump $num-bytes:loop/disp32
2471 $num-bytes:end:
2472
2473
2474 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
2475
2476 e8/call rewind-stream/disp32
2477
2478 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2479
2480 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2481
2482 5b/pop-to-ebx
2483 5a/pop-to-edx
2484 59/pop-to-ecx
2485
2486 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2487 5d/pop-to-ebp
2488 c3/return
2489
2490 test-num-bytes-handles-empty-string:
2491
2492
2493 55/push-ebp
2494 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2495
2496
2497
2498 68/push _test-input-stream/imm32
2499
2500 e8/call clear-stream/disp32
2501
2502 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2503
2504
2505 68/push _test-output-stream/imm32
2506
2507 e8/call clear-stream/disp32
2508
2509 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2510
2511
2512
2513 68/push _test-input-stream/imm32
2514
2515 e8/call num-bytes/disp32
2516
2517 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2518
2519
2520 68/push "F - test-num-bytes-handles-empty-string"/imm32
2521 68/push 0/imm32/true
2522 50/push-eax
2523
2524 e8/call check-ints-equal/disp32
2525
2526 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2527
2528 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2529 5d/pop-to-ebp
2530 c3/return
2531
2532 test-num-bytes-ignores-comments:
2533
2534
2535 55/push-ebp
2536 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2537
2538
2539
2540 68/push _test-input-stream/imm32
2541
2542 e8/call clear-stream/disp32
2543
2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2545
2546
2547 68/push _test-output-stream/imm32
2548
2549 e8/call clear-stream/disp32
2550
2551 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2552
2553
2554
2555 68/push "# abcd"/imm32
2556 68/push _test-input-stream/imm32
2557
2558 e8/call write/disp32
2559
2560 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2561
2562
2563 68/push _test-input-stream/imm32
2564
2565 e8/call num-bytes/disp32
2566
2567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2568
2569
2570 68/push "F - test-num-bytes-ignores-comments"/imm32
2571 68/push 0/imm32/true
2572 50/push-eax
2573
2574 e8/call check-ints-equal/disp32
2575
2576 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2577
2578 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2579 5d/pop-to-ebp
2580 c3/return
2581
2582 test-num-bytes-ignores-labels:
2583
2584
2585 55/push-ebp
2586 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2587
2588
2589
2590 68/push _test-input-stream/imm32
2591
2592 e8/call clear-stream/disp32
2593
2594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2595
2596
2597 68/push _test-output-stream/imm32
2598
2599 e8/call clear-stream/disp32
2600
2601 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2602
2603
2604
2605 68/push "ab: # cd"/imm32
2606 68/push _test-input-stream/imm32
2607
2608 e8/call write/disp32
2609
2610 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2611
2612
2613 68/push _test-input-stream/imm32
2614
2615 e8/call num-bytes/disp32
2616
2617 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2618
2619
2620 68/push "F - test-num-bytes-ignores-labels"/imm32
2621 68/push 0/imm32/true
2622 50/push-eax
2623
2624 e8/call check-ints-equal/disp32
2625
2626 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2627
2628 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2629 5d/pop-to-ebp
2630 c3/return
2631
2632 test-num-bytes-ignores-segment-headers:
2633
2634
2635 55/push-ebp
2636 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2637
2638
2639
2640 68/push _test-input-stream/imm32
2641
2642 e8/call clear-stream/disp32
2643
2644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2645
2646
2647 68/push _test-output-stream/imm32
2648
2649 e8/call clear-stream/disp32
2650
2651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2652
2653
2654
2655 68/push "== ab cd"/imm32
2656 68/push _test-input-stream/imm32
2657
2658 e8/call write/disp32
2659
2660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2661
2662
2663 68/push _test-input-stream/imm32
2664
2665 e8/call num-bytes/disp32
2666
2667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2668
2669
2670 68/push "F - test-num-bytes-ignores-segment-headers"/imm32
2671 68/push 0/imm32/true
2672 50/push-eax
2673
2674 e8/call check-ints-equal/disp32
2675
2676 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2677
2678 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2679 5d/pop-to-ebp
2680 c3/return
2681
2682 test-num-bytes-counts-words-by-default:
2683
2684
2685 55/push-ebp
2686 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2687
2688
2689
2690 68/push _test-input-stream/imm32
2691
2692 e8/call clear-stream/disp32
2693
2694 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2695
2696
2697 68/push _test-output-stream/imm32
2698
2699 e8/call clear-stream/disp32
2700
2701 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2702
2703
2704
2705 68/push "ab cd ef"/imm32
2706 68/push _test-input-stream/imm32
2707
2708 e8/call write/disp32
2709
2710 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2711
2712
2713 68/push _test-input-stream/imm32
2714
2715 e8/call num-bytes/disp32
2716
2717 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2718
2719
2720 68/push "F - test-num-bytes-counts-words-by-default"/imm32
2721 68/push 3/imm32/true
2722 50/push-eax
2723
2724 e8/call check-ints-equal/disp32
2725
2726 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2727
2728 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2729 5d/pop-to-ebp
2730 c3/return
2731
2732 test-num-bytes-ignores-trailing-comment:
2733
2734
2735 55/push-ebp
2736 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2737
2738
2739
2740 68/push _test-input-stream/imm32
2741
2742 e8/call clear-stream/disp32
2743
2744 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2745
2746
2747 68/push _test-output-stream/imm32
2748
2749 e8/call clear-stream/disp32
2750
2751 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2752
2753
2754
2755 68/push "ab cd # ef"/imm32
2756 68/push _test-input-stream/imm32
2757
2758 e8/call write/disp32
2759
2760 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2761
2762
2763 68/push _test-input-stream/imm32
2764
2765 e8/call num-bytes/disp32
2766
2767 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2768
2769
2770 68/push "F - test-num-bytes-ignores-trailing-comment"/imm32
2771 68/push 2/imm32/true
2772 50/push-eax
2773
2774 e8/call check-ints-equal/disp32
2775
2776 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2777
2778 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2779 5d/pop-to-ebp
2780 c3/return
2781
2782 test-num-bytes-handles-imm32:
2783
2784
2785 55/push-ebp
2786 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2787
2788
2789
2790 68/push _test-input-stream/imm32
2791
2792 e8/call clear-stream/disp32
2793
2794 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2795
2796
2797 68/push _test-output-stream/imm32
2798
2799 e8/call clear-stream/disp32
2800
2801 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2802
2803
2804
2805 68/push "ab cd/imm32 ef"/imm32
2806 68/push _test-input-stream/imm32
2807
2808 e8/call write/disp32
2809
2810 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2811
2812
2813 68/push _test-input-stream/imm32
2814
2815 e8/call num-bytes/disp32
2816
2817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2818
2819
2820 68/push "F - test-num-bytes-handles-imm32"/imm32
2821 68/push 6/imm32/true
2822 50/push-eax
2823
2824 e8/call check-ints-equal/disp32
2825
2826 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2827
2828 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2829 5d/pop-to-ebp
2830 c3/return
2831
2832