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 == code
31
32
33
34
35 Entry:
36
37 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
38
39
40
41 68/push Heap/imm32
42 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
43
44 e8/call new-segment/disp32
45
46 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
47
48
49 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-size/disp32
50
51 e8/call initialize-trace-stream/disp32
52
53 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
54
55
56
57 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
58 7e/jump-if-<= $subx-survey-main:interactive/disp8
59
60
61
62 68/push "test"/imm32
63 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
64
65 e8/call kernel-string-equal?/disp32
66
67 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
68
69 3d/compare-eax-and 0/imm32/false
70 74/jump-if-= $subx-survey-main:interactive/disp8
71
72 e8/call run-tests/disp32
73
74 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
75 eb/jump $subx-survey-main:end/disp8
76 $subx-survey-main:interactive:
77
78
79
80 68/push Stdout/imm32
81 68/push Stdin/imm32
82
83 e8/call subx-survey/disp32
84
85 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
86
87
88
89
90
91
92
93
94
95 bb/copy-to-ebx 0/imm32
96 $subx-survey-main:end:
97 e8/call syscall_exit/disp32
98
99 subx-survey:
100
101
102
103
104
105
106
107
108 55/push-ebp
109 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
110
111 51/push-ecx
112 52/push-edx
113 56/push-esi
114
115
116
117 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
118
119 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Max-labels/disp32
120
121 68/push 0/imm32/read
122
123 68/push 0/imm32/write
124 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
125
126
127 2b/subtract 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
128
129 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Input-size/disp32
130
131 68/push 0/imm32/read
132
133 68/push 0/imm32/write
134 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
135
136
137 56/push-esi
138 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
139
140 e8/call slurp/disp32
141
142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
143
144
145 52/push-edx
146 56/push-esi
147
148 e8/call compute-addresses/disp32
149
150 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
151
152
153 52/push-edx
154 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
155
156 e8/call emit-labels/disp32
157
158 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
159
160
161 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
162
163 e8/call flush/disp32
164
165 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
166 $subx-survey:end:
167
168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x18/imm32
169 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Max-labels/disp32
170 03/add 0/mod/indirect 5/rm32/.disp32 . . 4/r32/esp Input-size/disp32
171
172 5e/pop-to-esi
173 5a/pop-to-edx
174 59/pop-to-ecx
175
176 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
177 5d/pop-to-ebp
178 c3/return
179
180 test-subx-survey-computes-addresses:
181
182
183
184
185
186
187
188
189
190
191
192 55/push-ebp
193 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
194
195
196
197 68/push _test-input-stream/imm32
198
199 e8/call clear-stream/disp32
200
201 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
202
203
204 68/push $_test-input-buffered-file->buffer/imm32
205
206 e8/call clear-stream/disp32
207
208 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
209
210
211 68/push _test-output-stream/imm32
212
213 e8/call clear-stream/disp32
214
215 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
216
217
218 68/push $_test-output-buffered-file->buffer/imm32
219
220 e8/call clear-stream/disp32
221
222 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
223
224
225
226 68/push "== code\n"/imm32
227 68/push _test-input-stream/imm32
228
229 e8/call write/disp32
230
231 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
232
233
234 68/push "ab x/imm32\n"/imm32
235 68/push _test-input-stream/imm32
236
237 e8/call write/disp32
238
239 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
240
241
242 68/push "== data\n"/imm32
243 68/push _test-input-stream/imm32
244
245 e8/call write/disp32
246
247 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
248
249
250 68/push "x:\n"/imm32
251 68/push _test-input-stream/imm32
252
253 e8/call write/disp32
254
255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
256
257
258 68/push "01\n"/imm32
259 68/push _test-input-stream/imm32
260
261 e8/call write/disp32
262
263 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
264
265
266 68/push _test-output-buffered-file/imm32
267 68/push _test-input-buffered-file/imm32
268
269 e8/call subx-survey/disp32
270
271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
272
273 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
299
300
301 68/push "F - test-subx-survey-computes-addresses/0"/imm32
302 68/push "label 'x' is at address 0x00007c05."/imm32
303
304 e8/call check-trace-contains/disp32
305
306 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
307
308 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
309 5d/pop-to-ebp
310 c3/return
311
312 test-subx-survey-computes-addresses-with-padding:
313
314
315
316
317
318
319
320
321
322
323
324 55/push-ebp
325 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
326
327
328
329 68/push _test-input-stream/imm32
330
331 e8/call clear-stream/disp32
332
333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
334
335
336 68/push $_test-input-buffered-file->buffer/imm32
337
338 e8/call clear-stream/disp32
339
340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
341
342
343 68/push _test-output-stream/imm32
344
345 e8/call clear-stream/disp32
346
347 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
348
349
350 68/push $_test-output-buffered-file->buffer/imm32
351
352 e8/call clear-stream/disp32
353
354 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
355
356
357
358 68/push "== code\n"/imm32
359 68/push _test-input-stream/imm32
360
361 e8/call write/disp32
362
363 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
364
365
366 68/push "ab x/imm32\n"/imm32
367 68/push _test-input-stream/imm32
368
369 e8/call write/disp32
370
371 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
372
373
374 68/push "== data 0x7c10\n"/imm32
375 68/push _test-input-stream/imm32
376
377 e8/call write/disp32
378
379 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
380
381
382 68/push "x:\n"/imm32
383 68/push _test-input-stream/imm32
384
385 e8/call write/disp32
386
387 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
388
389
390 68/push "01\n"/imm32
391 68/push _test-input-stream/imm32
392
393 e8/call write/disp32
394
395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
396
397
398 68/push _test-output-buffered-file/imm32
399 68/push _test-input-buffered-file/imm32
400
401 e8/call subx-survey/disp32
402
403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
404
405 +-- 26 lines: #? # dump *Trace-stream -----------------------------------------------------------------------------------------------------------------------------------------------
431
432
433 68/push "F - test-subx-survey-computes-addresses-with-padding/0"/imm32
434 68/push "label 'x' is at address 0x00007c10."/imm32
435
436 e8/call check-trace-contains/disp32
437
438 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
439
440 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
441 5d/pop-to-ebp
442 c3/return
443
444 compute-addresses:
445
446
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 insert-slice-or-abort/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