https://github.com/akkartik/mu/blob/main/linux/survey_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 == code
33
34
35
36
37 Entry:
38
39 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
40
41
42
43 68/push Heap/imm32
44 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
45
46 e8/call new-segment/disp32
47
48 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
49
50
51 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-size/disp32
52
53 e8/call initialize-trace-stream/disp32
54
55 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
56
57
58
59 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
60 7e/jump-if-<= $subx-survey-main:interactive/disp8
61
62
63
64 68/push "test"/imm32
65 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
66
67 e8/call kernel-string-equal?/disp32
68
69 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
70
71 3d/compare-eax-and 0/imm32/false
72 74/jump-if-= $subx-survey-main:interactive/disp8
73
74 e8/call run-tests/disp32
75
76 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
77 eb/jump $subx-survey-main:end/disp8
78 $subx-survey-main:interactive:
79
80
81
82 68/push Stdout/imm32
83 68/push Stdin/imm32
84
85 e8/call subx-survey/disp32
86
87 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
88
89
90
91
92
93
94
95
96
97 bb/copy-to-ebx 0/imm32
98 $subx-survey-main:end:
99 e8/call syscall_exit/disp32
100
101 subx-survey:
102
103
104
105
106
107
108
109
110 55/push-ebp
111 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
112
113 51/push-ecx
114 52/push-edx
115 56/push-esi
116
117
118
119 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
120
121 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Max-labels/disp32
122
123 68/push 0/imm32/read
124
125 68/push 0/imm32/write
126 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
127
128
129 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
130
131 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Input-size/disp32
132
133 68/push 0/imm32/read
134
135 68/push 0/imm32/write
136 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
137
138
139 56/push-esi
140 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
141
142 e8/call slurp/disp32
143
144 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
145
146
147 52/push-edx
148 56/push-esi
149
150 e8/call compute-addresses/disp32
151
152 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
153
154
155 52/push-edx
156 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
157
158 e8/call emit-labels/disp32
159
160 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
161
162
163 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
164
165 e8/call flush/disp32
166
167 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
168 $subx-survey:end:
169
170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x18/imm32
171 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
172 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
173
174 5e/pop-to-esi
175 5a/pop-to-edx
176 59/pop-to-ecx
177
178 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
179 5d/pop-to-ebp
180 c3/return
181
182 test-subx-survey-computes-addresses:
183
184
185
186
187
188
189
190
191
192
193
194 55/push-ebp
195 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
196
197
198
199 68/push _test-input-stream/imm32
200
201 e8/call clear-stream/disp32
202
203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
204
205
206 68/push $_test-input-buffered-file->buffer/imm32
207
208 e8/call clear-stream/disp32
209
210 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
211
212
213 68/push _test-output-stream/imm32
214
215 e8/call clear-stream/disp32
216
217 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
218
219
220 68/push $_test-output-buffered-file->buffer/imm32
221
222 e8/call clear-stream/disp32
223
224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
225
226
227
228 68/push "== code\n"/imm32
229 68/push _test-input-stream/imm32
230
231 e8/call write/disp32
232
233 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
234
235
236 68/push "ab x/imm32\n"/imm32
237 68/push _test-input-stream/imm32
238
239 e8/call write/disp32
240
241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
242
243
244 68/push "== data\n"/imm32
245 68/push _test-input-stream/imm32
246
247 e8/call write/disp32
248
249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
250
251
252 68/push "x:\n"/imm32
253 68/push _test-input-stream/imm32
254
255 e8/call write/disp32
256
257 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
258
259
260 68/push "01\n"/imm32
261 68/push _test-input-stream/imm32
262
263 e8/call write/disp32
264
265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
266
267
268 68/push _test-output-buffered-file/imm32
269 68/push _test-input-buffered-file/imm32
270
271 e8/call subx-survey/disp32
272
273 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
274
275 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
301
302
303 68/push "F - test-subx-survey-computes-addresses/0"/imm32
304 68/push "label 'x' is at address 0x00007c05."/imm32
305
306 e8/call check-trace-contains/disp32
307
308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
309
310 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
311 5d/pop-to-ebp
312 c3/return
313
314 test-subx-survey-computes-addresses-with-padding:
315
316
317
318
319
320
321
322
323
324
325
326 55/push-ebp
327 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
328
329
330
331 68/push _test-input-stream/imm32
332
333 e8/call clear-stream/disp32
334
335 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
336
337
338 68/push $_test-input-buffered-file->buffer/imm32
339
340 e8/call clear-stream/disp32
341
342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
343
344
345 68/push _test-output-stream/imm32
346
347 e8/call clear-stream/disp32
348
349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
350
351
352 68/push $_test-output-buffered-file->buffer/imm32
353
354 e8/call clear-stream/disp32
355
356 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
357
358
359
360 68/push "== code\n"/imm32
361 68/push _test-input-stream/imm32
362
363 e8/call write/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
366
367
368 68/push "ab x/imm32\n"/imm32
369 68/push _test-input-stream/imm32
370
371 e8/call write/disp32
372
373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
374
375
376 68/push "== data 0x7c10\n"/imm32
377 68/push _test-input-stream/imm32
378
379 e8/call write/disp32
380
381 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
382
383
384 68/push "x:\n"/imm32
385 68/push _test-input-stream/imm32
386
387 e8/call write/disp32
388
389 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
390
391
392 68/push "01\n"/imm32
393 68/push _test-input-stream/imm32
394
395 e8/call write/disp32
396
397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
398
399
400 68/push _test-output-buffered-file/imm32
401 68/push _test-input-buffered-file/imm32
402
403 e8/call subx-survey/disp32
404
405 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
406
407 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
433
434
435 68/push "F - test-subx-survey-computes-addresses-with-padding/0"/imm32
436 68/push "label 'x' is at address 0x00007c10."/imm32
437
438 e8/call check-trace-contains/disp32
439
440 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
441
442 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
443 5d/pop-to-ebp
444 c3/return
445
446 compute-addresses:
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480 55/push-ebp
481 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
482
483 50/push-eax
484 51/push-ecx
485 52/push-edx
486 53/push-ebx
487 56/push-esi
488 57/push-edi
489
490 be/copy-to-esi 0x7c00/imm32
491
492 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
493 68/push 0x200/imm32/size
494 68/push 0/imm32/read
495 68/push 0/imm32/write
496 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
497
498 68/push 0/imm32
499 68/push 0/imm32
500 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
501 $compute-addresses:line-loop:
502
503
504 51/push-ecx
505
506 e8/call clear-stream/disp32
507
508 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
509
510
511 51/push-ecx
512 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
513
514 e8/call read-line/disp32
515
516 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
517
518 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
519 3d/compare-eax-and 0/imm32
520 0f 84/jump-if-= $compute-addresses:end/disp32
521 +-- 33 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
554 $compute-addresses:word-loop:
555
556
557 52/push-edx
558 51/push-ecx
559
560 e8/call next-word/disp32
561
562 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
563 $compute-addresses:case-empty:
564
565
566
567 52/push-edx
568
569 e8/call slice-empty?/disp32
570
571 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
572
573 3d/compare-eax-and 0/imm32/false
574 0f 85/jump-if-!= $compute-addresses:line-loop/disp32
575 $compute-addresses:case-comment:
576
577
578 68/push "#"/imm32
579 52/push-edx
580
581 e8/call slice-starts-with?/disp32
582
583 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
584
585 3d/compare-eax-and 0/imm32/false
586 0f 85/jump-if-!= $compute-addresses:line-loop/disp32
587 $compute-addresses:case-segment-header:
588
589
590
591 68/push "=="/imm32
592 52/push-edx
593
594 e8/call slice-equal?/disp32
595
596 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
597
598 3d/compare-eax-and 0/imm32/false
599 0f 84/jump-if-= $compute-addresses:case-label/disp32
600
601
602 52/push-edx
603 51/push-ecx
604
605 e8/call next-word/disp32
606
607 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
608
609
610
611 52/push-edx
612
613 e8/call slice-empty?/disp32
614
615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
616
617 3d/compare-eax-and 0/imm32/false
618 0f 85/jump-if-!= $compute-addresses:abort/disp32
619
620
621 52/push-edx
622 51/push-ecx
623
624 e8/call next-word/disp32
625
626 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
627
628
629
630 52/push-edx
631
632 e8/call slice-empty?/disp32
633
634 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
635
636 3d/compare-eax-and 0/imm32/false
637 0f 85/jump-if-!= $compute-addresses:line-loop/disp32
638
639
640 52/push-edx
641
642 e8/call parse-hex-int-from-slice/disp32
643
644 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
645
646 39/compare 3/mod/direct 0/rm32/eax . . . 6/r32/esi . .
647 0f 82/jump-if-addr< $compute-addresses:error-bad-segment-address/disp32
648
649 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
650
651 e9/jump $compute-addresses:line-loop/disp32
652 $compute-addresses:case-label:
653
654
655
656 52/push-edx
657
658 e8/call label?/disp32
659
660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
661
662 3d/compare-eax-and 0/imm32/false
663 0f 84/jump-if-= $compute-addresses:case-default/disp32
664
665 ff 1/subop/decrement 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 .
666
667
668 68/push Heap/imm32
669 68/push 0xc/imm32/row-size
670 52/push-edx
671 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
672
673 e8/call get-or-insert-slice/disp32
674
675 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
676
677 89/copy 0/mod/indirect 0/rm32/eax . . . 6/r32/esi . .
678
679
680 68/push "."/imm32
681 56/push-esi
682 68/push "' is at address "/imm32
683 52/push-edx
684 68/push "label '"/imm32
685
686 e8/call trace-slsns/disp32
687
688 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
689
690 e9/jump $compute-addresses:word-loop/disp32
691 $compute-addresses:case-default:
692
693
694 52/push-edx
695
696 e8/call compute-width-of-slice/disp32
697
698 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
699
700 01/add 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
701 +-- 41 lines: #? # dump segment-offset ----------------------------------------------------------------------------------------------------------------------------------------------
742 e9/jump $compute-addresses:word-loop/disp32
743 $compute-addresses:end:
744
745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
746
747 5f/pop-to-edi
748 5e/pop-to-esi
749 5b/pop-to-ebx
750 5a/pop-to-edx
751 59/pop-to-ecx
752 58/pop-to-eax
753
754 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
755 5d/pop-to-ebp
756 c3/return
757
758 $compute-addresses:abort:
759
760
761 68/push "'==' must be followed by segment name and optionally an address\n"/imm32
762 68/push 2/imm32/stderr
763
764 e8/call _write/disp32
765
766 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
767
768 bb/copy-to-ebx 1/imm32
769 e8/call syscall_exit/disp32
770
771
772 $compute-addresses:error-bad-segment-address:
773
774
775 68/push "'==' specifies an address that implies negative padding\n"/imm32
776 68/push 2/imm32/stderr
777
778 e8/call _write/disp32
779
780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
781
782 bb/copy-to-ebx 1/imm32
783 e8/call syscall_exit/disp32
784
785
786 test-compute-addresses:
787
788
789
790
791
792
793
794
795
796
797
798
799 55/push-ebp
800 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
801
802
803
804 68/push _test-input-stream/imm32
805
806 e8/call clear-stream/disp32
807
808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
809
810 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x18/imm32
811 68/push 0x18/imm32/size
812 68/push 0/imm32/read
813 68/push 0/imm32/write
814 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
815
816
817
818 68/push "== code\n"/imm32
819 68/push _test-input-stream/imm32
820
821 e8/call write/disp32
822
823 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
824
825
826 68/push "ab x/imm32 # skip comment\n"/imm32
827 68/push _test-input-stream/imm32
828
829 e8/call write/disp32
830
831 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
832
833
834 68/push "== data\n"/imm32
835 68/push _test-input-stream/imm32
836
837 e8/call write/disp32
838
839 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
840
841
842 68/push "00\n"/imm32
843 68/push _test-input-stream/imm32
844
845 e8/call write/disp32
846
847 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
848
849
850 68/push "x:\n"/imm32
851 68/push _test-input-stream/imm32
852
853 e8/call write/disp32
854
855 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
856
857
858 68/push "34\n"/imm32
859 68/push _test-input-stream/imm32
860
861 e8/call write/disp32
862
863 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
864
865
866 52/push-edx
867 68/push _test-input-stream/imm32
868
869 e8/call compute-addresses/disp32
870
871 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
872 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
898
899
900 68/push "F - test-compute-addresses"/imm32
901 68/push "label 'x' is at address 0x00007c06."/imm32
902
903 e8/call check-trace-contains/disp32
904
905 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
906
907
908 68/push "F - test-compute-addresses-maintains-labels-write-index"/imm32
909 68/push 0xc/imm32/1-entry
910 ff 6/subop/push 0/mod/indirect 2/rm32/edx . . . . . .
911
912 e8/call check-ints-equal/disp32
913
914 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
915
916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x24/imm32
917
918 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
919 5d/pop-to-ebp
920 c3/return
921
922 emit-labels:
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937 55/push-ebp
938 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
939
940 50/push-eax
941 51/push-ecx
942 52/push-edx
943 56/push-esi
944
945 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 .
946
947 8d/copy-address 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 0xc/disp8 .
948
949 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . .
950 8d/copy-address 0/mod/indirect 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx . .
951 $emit-labels:loop:
952
953 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
954 0f 83/jump-if-addr>= $emit-labels:end/disp32
955
956
957 ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 .
958 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
959
960 e8/call lookup/disp32
961
962 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
963
964 81 0/subop/add 3/mod/direct 1/rm32/ecx . . . . . 8/imm32
965
966
967 50/push-eax
968 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
969
970 e8/call write-buffered/disp32
971
972 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
973
974
975 68/push Space/imm32
976 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
977
978 e8/call write-buffered/disp32
979
980 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
981
982
983 68/push Stderr/imm32
984
985 e8/call flush/disp32
986
987 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
988
989
990 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
991 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
992
993 e8/call write-int32-hex-buffered/disp32
994
995 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
996
997 81 0/subop/add 3/mod/direct 1/rm32/ecx . . . . . 4/imm32
998
999
1000 68/push Newline/imm32
1001 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1002
1003 e8/call write-buffered/disp32
1004
1005 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1006
1007 e9/jump $emit-labels:loop/disp32
1008 $emit-labels:end:
1009
1010 5e/pop-to-esi
1011 5a/pop-to-edx
1012 59/pop-to-ecx
1013 58/pop-to-eax
1014
1015 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1016 5d/pop-to-ebp
1017 c3/return
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028 trace-slsns:
1029
1030 55/push-ebp
1031 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1032
1033
1034 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1035 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
1036
1037 e8/call write/disp32
1038
1039 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1040
1041
1042 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
1043 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
1044
1045 e8/call write-slice/disp32
1046
1047 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1048
1049
1050 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
1051 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
1052
1053 e8/call write/disp32
1054
1055 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1056
1057
1058 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 .
1059 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32
1060
1061 e8/call write-int32-hex/disp32
1062
1063 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1064
1065
1066 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
1067
1068 e8/call trace/disp32
1069
1070 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1071 $trace-slsns:end:
1072
1073 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1074 5d/pop-to-ebp
1075 c3/return
1076
1077 test-trace-slsns:
1078
1079 55/push-ebp
1080 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1081
1082
1083 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32
1084 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32
1085
1086 b8/copy-to-eax "b"/imm32
1087 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1088 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1089 05/add-to-eax 4/imm32
1090
1091 51/push-ecx
1092 50/push-eax
1093 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1094
1095
1096 68/push " e"/imm32
1097 68/push 3/imm32
1098 68/push "c "/imm32
1099 53/push-ebx
1100 68/push "A"/imm32
1101
1102 e8/call trace-slsns/disp32
1103
1104 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
1105 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
1131
1132
1133 68/push "F - test-trace-slsls"/imm32
1134 68/push "Abc 0x00000003 e"/imm32
1135
1136 e8/call check-trace-contains/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1139
1140 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1141 5d/pop-to-ebp
1142 c3/return
1143
1144