https://github.com/akkartik/mu/blob/master/apps/mu.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169 == data
170
171 Program:
172 0/imm32
173
174 == code
175
176 Entry:
177
178 89/<- %ebp 4/r32/esp
179 (new-segment Heap-size Heap)
180
181 {
182
183 81 7/subop/compare *ebp 1/imm32
184 7e/jump-if-lesser-or-equal break/disp8
185
186 (kernel-string-equal? *(ebp+8) "test")
187 3d/compare-eax-and 0/imm32
188 74/jump-if-equal break/disp8
189
190 (run-tests)
191
192 8b/-> *Num-test-failures 3/r32/ebx
193 eb/jump $mu-main:end/disp8
194 }
195
196 (convert-mu Stdin Stdout)
197 (flush Stdout)
198
199 bb/copy-to-ebx 0/imm32
200 $mu-main:end:
201 b8/copy-to-eax 1/imm32/exit
202 cd/syscall 0x80/imm8
203
204 convert-mu:
205
206 55/push-ebp
207 89/<- %ebp 4/r32/esp
208
209 (parse-mu *(ebp+8))
210 (check-mu-types)
211 (emit-subx *(ebp+0xc))
212 $convert-mu:end:
213
214 89/<- %esp 5/r32/ebp
215 5d/pop-to-ebp
216 c3/return
217
218 test-convert-empty-input:
219
220
221 55/push-ebp
222 89/<- %ebp 4/r32/esp
223
224 (clear-stream _test-input-stream)
225 (clear-stream _test-input-buffered-file->buffer)
226 (clear-stream _test-output-stream)
227 (clear-stream _test-output-buffered-file->buffer)
228
229 (convert-mu _test-input-buffered-file _test-output-buffered-file)
230 (flush _test-output-buffered-file)
231 (check-stream-equal _test-output-stream "" "F - test-convert-empty-input")
232
233 89/<- %esp 5/r32/ebp
234 5d/pop-to-ebp
235 c3/return
236
237 test-convert-function-skeleton:
238
239
240
241
242
243
244
245
246
247
248
249
250
251 55/push-ebp
252 89/<- %ebp 4/r32/esp
253
254 (clear-stream _test-input-stream)
255 (clear-stream _test-input-buffered-file->buffer)
256 (clear-stream _test-output-stream)
257 (clear-stream _test-output-buffered-file->buffer)
258
259 (write _test-input-stream "fn foo {\n")
260 (write _test-input-stream "}\n")
261
262 (convert-mu _test-input-buffered-file _test-output-buffered-file)
263 (flush _test-output-buffered-file)
264 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
270
271 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-skeleton/0")
272 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-skeleton/1")
273 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-skeleton/2")
274 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-skeleton/3")
275 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-skeleton/4")
276 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-skeleton/5")
277 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-skeleton/6")
278 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-skeleton/7")
279
280 89/<- %esp 5/r32/ebp
281 5d/pop-to-ebp
282 c3/return
283
284 test-convert-multiple-function-skeletons:
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308 55/push-ebp
309 89/<- %ebp 4/r32/esp
310
311 (clear-stream _test-input-stream)
312 (clear-stream _test-input-buffered-file->buffer)
313 (clear-stream _test-output-stream)
314 (clear-stream _test-output-buffered-file->buffer)
315
316 (write _test-input-stream "fn foo {\n")
317 (write _test-input-stream "}\n")
318 (write _test-input-stream "fn bar {\n")
319 (write _test-input-stream "}\n")
320
321 (convert-mu _test-input-buffered-file _test-output-buffered-file)
322 (flush _test-output-buffered-file)
323 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
329
330 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-multiple-function-skeletons/0")
331 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-multiple-function-skeletons/1")
332 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-multiple-function-skeletons/2")
333 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/3")
334 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-multiple-function-skeletons/4")
335 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/5")
336 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/6")
337 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-multiple-function-skeletons/7")
338
339 (check-next-stream-line-equal _test-output-stream "bar:" "F - test-convert-multiple-function-skeletons/10")
340 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-multiple-function-skeletons/11")
341 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-multiple-function-skeletons/12")
342 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/13")
343 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-multiple-function-skeletons/14")
344 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/15")
345 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/16")
346 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-multiple-function-skeletons/17")
347
348 89/<- %esp 5/r32/ebp
349 5d/pop-to-ebp
350 c3/return
351
352 test-convert-function-with-arg:
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371 55/push-ebp
372 89/<- %ebp 4/r32/esp
373
374 (clear-stream _test-input-stream)
375 (clear-stream _test-input-buffered-file->buffer)
376 (clear-stream _test-output-stream)
377 (clear-stream _test-output-buffered-file->buffer)
378
379 (write _test-input-stream "fn foo {\n")
380 (write _test-input-stream "}\n")
381
382 (convert-mu _test-input-buffered-file _test-output-buffered-file)
383 (flush _test-output-buffered-file)
384 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
390
391 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-skeleton/0")
392 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-skeleton/1")
393 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-skeleton/2")
394 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-skeleton/3")
395 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-skeleton/4")
396 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-skeleton/5")
397 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-skeleton/6")
398 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-skeleton/7")
399
400 89/<- %esp 5/r32/ebp
401 5d/pop-to-ebp
402 c3/return
403
404 parse-mu:
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428 55/push-ebp
429 89/<- %ebp 4/r32/esp
430
431 50/push-eax
432 51/push-ecx
433 52/push-edx
434 57/push-edi
435
436 81 5/subop/subtract %esp 0x200/imm32
437 68/push 0x200/imm32/length
438 68/push 0/imm32/read
439 68/push 0/imm32/write
440 89/<- %ecx 4/r32/esp
441
442 68/push 0/imm32/end
443 68/push 0/imm32/start
444 89/<- %edx 4/r32/esp
445
446 bf/copy-to-edi Program/imm32
447 {
448 $parse-mu:line-loop:
449 (clear-stream %ecx)
450 (read-line-buffered *(ebp+8) %ecx)
451
452 81 7/subop/compare *ecx 0/imm32
453 0f 84/jump-if-equal break/disp32
454 +-- 6 lines: #? # dump line ---------------------------------------------------------------------------------------------------------------------------
460 {
461 $parse-mu:word-loop:
462 (next-word-or-string %ecx %edx)
463
464 (slice-empty? %edx)
465 3d/compare-eax-and 0/imm32
466 0f 85/jump-if-not-equal break/disp32
467
468
469 8b/-> *edx 0/r32/eax
470 8a/copy-byte *eax 0/r32/AL
471 81 4/subop/and %eax 0xff/imm32
472
473 3d/compare-eax-and 0x23/imm32/hash
474 0f 84/jump-if-equal break/disp32
475
476 {
477 (slice-equal? %edx "fn")
478 3d/compare-eax-and 0/imm32
479 0f 84/jump-if-equal break/disp32
480
481 (allocate Heap *Function-size)
482 (populate-mu-function-header %ecx %eax)
483 (populate-mu-function-body *(ebp+8) %eax)
484
485 89/<- *edi 0/r32/eax
486
487 8d/address-> *(eax+0x10) 7/r32/edi
488 e9/jump $parse-mu:word-loop/disp32
489 }
490
491 e9/jump $parse-mu:abort/disp32
492 }
493 e9/jump loop/disp32
494 }
495 $parse-mu:end:
496
497 81 0/subop/add %esp 0x214/imm32
498
499 5f/pop-to-edi
500 5a/pop-to-edx
501 59/pop-to-ecx
502 58/pop-to-eax
503
504 89/<- %esp 5/r32/ebp
505 5d/pop-to-ebp
506 c3/return
507
508 $parse-mu:abort:
509
510 (write-buffered Stderr "unexpected top-level command: ")
511 (write-buffered Stderr %edx)
512 (write-buffered Stderr "\n")
513 (flush Stderr)
514
515 bb/copy-to-ebx 1/imm32
516 b8/copy-to-eax 1/imm32/exit
517 cd/syscall 0x80/imm8
518
519
520
521
522
523
524
525 populate-mu-function-header:
526
527 55/push-ebp
528 89/<- %ebp 4/r32/esp
529
530 50/push-eax
531 51/push-ecx
532 57/push-edi
533
534 8b/-> *(ebp+0xc) 7/r32/edi
535
536 68/push 0/imm32/end
537 68/push 0/imm32/start
538 89/<- %ecx 4/r32/esp
539
540 (next-word *(ebp+8) %ecx)
541 (slice-to-string Heap %ecx)
542 89/<- *edi 0/r32/eax
543
544 (next-word *(ebp+8) %ecx)
545 (slice-equal? %ecx "{")
546 3d/compare-eax-and 0/imm32
547 74/jump-if-equal $populate-mu-function-header:abort/disp8
548
549 {
550
551 (next-word *(ebp+8) %ecx)
552
553 (slice-empty? %ecx)
554 3d/compare-eax-and 0/imm32
555 75/jump-if-not-equal break/disp8
556
557
558 8b/-> *edx 0/r32/eax
559 8a/copy-byte *eax 0/r32/AL
560 81 4/subop/and %eax 0xff/imm32
561
562 3d/compare-eax-and 0x23/imm32/hash
563 74/jump-if-equal break/disp8
564
565 eb/jump $populate-mu-function-header:abort/disp8
566 }
567 $populate-mu-function-header:end:
568
569 81 0/subop/add %esp 8/imm32
570
571 5f/pop-to-edi
572 59/pop-to-ecx
573 58/pop-to-eax
574
575 89/<- %esp 5/r32/ebp
576 5d/pop-to-ebp
577 c3/return
578
579 $populate-mu-function-header:abort:
580
581 (write-buffered Stderr "function header not in form 'fn <name> {' -- '")
582 (rewind-stream *(ebp+8))
583 (write-stream 2 *(ebp+8))
584 (write-buffered Stderr "'\n")
585 (flush Stderr)
586
587 bb/copy-to-ebx 1/imm32
588 b8/copy-to-eax 1/imm32/exit
589 cd/syscall 0x80/imm8
590
591
592
593
594 populate-mu-function-body:
595
596 55/push-ebp
597 89/<- %ebp 4/r32/esp
598
599 50/push-eax
600 51/push-ecx
601 52/push-edx
602 53/push-ebx
603
604 81 5/subop/subtract %esp 0x200/imm32
605 68/push 0x200/imm32/length
606 68/push 0/imm32/read
607 68/push 0/imm32/write
608 89/<- %ecx 4/r32/esp
609
610 68/push 0/imm32/end
611 68/push 0/imm32/start
612 89/<- %edx 4/r32/esp
613
614 bb/copy-to-ebx 1/imm32
615 {
616 $populate-mu-function-body:line-loop:
617
618 81 7/subop/compare %ebx 0/imm32
619 0f 84/jump-if-equal break/disp32
620
621 (clear-stream %ecx)
622 (read-line-buffered *(ebp+8) %ecx)
623
624 81 7/subop/compare *ecx 0/imm32
625 0f 84/jump-if-equal break/disp32
626
627 (next-word %ecx %edx)
628
629 (slice-empty? %ecx)
630 3d/compare-eax-and 0/imm32
631 75/jump-if-not-equal loop/disp8
632
633
634 8b/-> *edx 0/r32/eax
635 8a/copy-byte *eax 0/r32/AL
636 81 4/subop/and %eax 0xff/imm32
637
638 3d/compare-eax-and 0x23/imm32/hash
639 74/jump-if-equal loop/disp8
640 {
641
642 {
643 (slice-equal? %ecx "{")
644 3d/compare-eax-and 0/imm32
645 74/jump-if-equal break/disp8
646 43/increment-ebx
647 eb/jump $curly-found:end/disp8
648 }
649
650 {
651 (slice-equal? %ecx "}")
652 3d/compare-eax-and 0/imm32
653 74/jump-if-equal break/disp8
654 4b/decrement-ebx
655 eb/jump $curly-found:end/disp8
656 }
657
658 eb/jump $populate-mu-function-body:end/disp8
659 }
660
661 $curly-found:end:
662
663 (next-word %ecx %edx)
664
665 (slice-empty? %ecx)
666 3d/compare-eax-and 0/imm32
667 0f 85/jump-if-not-equal loop/disp32
668
669
670 8b/-> *edx 0/r32/eax
671 8a/copy-byte *eax 0/r32/AL
672 81 4/subop/and %eax 0xff/imm32
673
674 3d/compare-eax-and 0x23/imm32/hash
675 0f 84/jump-if-equal loop/disp32
676
677 eb/jump $populate-mu-function-body:abort/disp8
678 }
679 $populate-mu-function-body:end:
680
681 81 0/subop/add %esp 0x214/imm32
682
683 5b/pop-to-ebx
684 5a/pop-to-edx
685 59/pop-to-ecx
686 58/pop-to-eax
687
688 89/<- %esp 5/r32/ebp
689 5d/pop-to-ebp
690 c3/return
691
692 $populate-mu-function-body:abort:
693
694 (write-buffered Stderr "'{' or '}' should be on its own line, but got '")
695 (rewind-stream %ecx)
696 (write-stream 2 %ecx)
697 (write-buffered Stderr "'\n")
698 (flush Stderr)
699
700 bb/copy-to-ebx 1/imm32
701 b8/copy-to-eax 1/imm32/exit
702 cd/syscall 0x80/imm8
703
704
705 check-mu-types:
706
707 55/push-ebp
708 89/<- %ebp 4/r32/esp
709
710 $check-types:end:
711
712 89/<- %esp 5/r32/ebp
713 5d/pop-to-ebp
714 c3/return
715
716 emit-subx:
717
718 55/push-ebp
719 89/<- %ebp 4/r32/esp
720
721 50/push-eax
722 51/push-ecx
723 57/push-edi
724
725 8b/-> *(ebp+8) 7/r32/edi
726
727 8b/-> *Program 1/r32/ecx
728 {
729
730 81 7/subop/compare %ecx 0/imm32
731 0f 84/jump-if-equal break/disp32
732 (emit-subx-function %edi %ecx)
733
734 8b/-> *(ecx+0x10) 1/r32/ecx
735 e9/jump loop/disp32
736 }
737 $emit-subx:end:
738
739 5f/pop-to-edi
740 59/pop-to-ecx
741 58/pop-to-eax
742
743 89/<- %esp 5/r32/ebp
744 5d/pop-to-ebp
745 c3/return
746
747
748
749
750
751
752
753 emit-subx-function:
754
755 55/push-ebp
756 89/<- %ebp 4/r32/esp
757
758 50/push-eax
759 51/push-ecx
760 57/push-edi
761
762 8b/-> *(ebp+8) 7/r32/edi
763
764 8b/-> *(ebp+0xc) 1/r32/ecx
765
766 (write-buffered %edi *ecx)
767 (write-buffered %edi ":\n")
768 (emit-subx-prologue %edi)
769 (emit-subx-block %edi *(ecx+4))
770 (emit-subx-epilogue %edi)
771 $emit-subx-function:end:
772
773 5f/pop-to-edi
774 59/pop-to-ecx
775 58/pop-to-eax
776
777 89/<- %esp 5/r32/ebp
778 5d/pop-to-ebp
779 c3/return
780
781 emit-subx-block:
782
783 55/push-ebp
784 89/<- %ebp 4/r32/esp
785
786 $emit-subx-block:end:
787
788 89/<- %esp 5/r32/ebp
789 5d/pop-to-ebp
790 c3/return
791
792 emit-subx-statement:
793
794 55/push-ebp
795 89/<- %ebp 4/r32/esp
796
797 50/push-eax
798 51/push-ecx
799
800 8b/-> *(ebp+0x18) 1/r32/ecx
801 {
802
803 81 7/subop/compare *(ebp+0xc) 0/imm32
804 0f 84/jump-if-equal $emit-subx-statement:abort/disp32
805
806 (mu-stmt-matches-primitive? *(ebp+0xc) %ecx)
807 3d/compare-eax-and 0/imm32
808 75/jump-if-not-equal break/disp8
809
810
811 8b/-> *(ecx+0x10) 1/r32/ecx
812 e9/jump loop/disp32
813 }
814 $emit-subx-statement:end:
815
816 59/pop-to-ecx
817 58/pop-to-eax
818
819 89/<- %esp 5/r32/ebp
820 5d/pop-to-ebp
821 c3/return
822
823 $emit-subx-statement:abort:
824
825 (write-buffered Stderr "couldn't translate '")
826
827 (write-buffered Stderr "'\n")
828 (flush Stderr)
829
830 bb/copy-to-ebx 1/imm32
831 b8/copy-to-eax 1/imm32/exit
832 cd/syscall 0x80/imm8
833
834
835 mu-stmt-matches-primitive?:
836
837 55/push-ebp
838 89/<- %ebp 4/r32/esp
839
840 51/push-ecx
841
842 8b/-> *(ebp+8) 1/r32/ecx
843 8b/-> *(ebp+0xc) 0/r32/eax
844 (string-equal? *ecx *eax)
845 $mu-stmt-matches-primitive?:end:
846
847 59/pop-to-ecx
848
849 89/<- %esp 5/r32/ebp
850 5d/pop-to-ebp
851 c3/return
852
853 test-emit-subx-statement-primitive:
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876 55/push-ebp
877 89/<- %ebp 4/r32/esp
878
879 (clear-stream _test-output-stream)
880 (clear-stream _test-output-buffered-file->buffer)
881
882 68/push 0/imm32/next
883 68/push -8/imm32/stack-offset
884 68/push 0/imm32/int
885 68/push "foo"/imm32
886 89/<- %ecx 4/r32/esp
887
888 68/push 0/imm32/next
889 51/push-ecx/var-foo
890 89/<- %edx 4/r32/esp
891
892 68/push 0/imm32/next
893 68/push 0/imm32/outputs
894 52/push-edx/operand
895 68/push "increment"/imm32/operation
896 89/<- %edx 4/r32/esp
897
898 68/push 0/imm32/next
899 68/push "ff 0/subop/increment"/imm32
900 68/push 0/imm32/type-int
901 68/push 0/imm32/storage-memory
902 68/push "increment"/imm32/name
903 89/<- %ebx 4/r32/esp
904
905 (emit-subx-statement _test-output-buffered-file %edx %ecx 0 %ebx 0)
906 (flush _test-output-buffered-file)
907 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
913
914 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp-8)" "F - test-emit-subx-statement-primitive/0")
915
916 81 0/subop/add %esp 0x3c/imm32
917
918 89/<- %esp 5/r32/ebp
919 5d/pop-to-ebp
920 c3/return
921
922 test-emit-subx-statement-function-call:
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946 55/push-ebp
947 89/<- %ebp 4/r32/esp
948
949 (clear-stream _test-output-stream)
950 (clear-stream _test-output-buffered-file->buffer)
951
952 68/push 0/imm32/next
953 68/push -8/imm32/stack-offset
954 68/push 0/imm32/int
955 68/push "var"/imm32
956 89/<- %ecx 4/r32/esp
957
958 68/push 0/imm32/next
959 51/push-ecx/var
960 89/<- %edx 4/r32/esp
961
962 68/push 0/imm32/next
963 68/push 0/imm32/outputs
964 52/push-edx/operand
965 68/push "f"/imm32/operation
966 89/<- %edx 4/r32/esp
967
968 68/push 0/imm32/next
969 68/push "f2"/imm32
970 68/push 0/imm32/type-int
971 68/push 0/imm32/storage-memory
972 68/push "f"/imm32/name
973 89/<- %ebx 4/r32/esp
974
975 (emit-subx-statement _test-output-buffered-file %edx %ecx 0 0 %ebx)
976 (flush _test-output-buffered-file)
977 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
983
984 (check-next-stream-line-equal _test-output-stream "f2 *(ebp-8)" "F - test-emit-subx-statement-function-call/0")
985
986 81 0/subop/add %esp 0x3c/imm32
987
988 89/<- %esp 5/r32/ebp
989 5d/pop-to-ebp
990 c3/return
991
992 emit-subx-prologue:
993
994 55/push-ebp
995 89/<- %ebp 4/r32/esp
996
997 (write-buffered *(ebp+8) "# . prologue\n")
998 (write-buffered *(ebp+8) "55/push-ebp\n")
999 (write-buffered *(ebp+8) "89/<- %ebp 4/r32/esp\n")
1000 $emit-subx-prologue:end:
1001
1002 89/<- %esp 5/r32/ebp
1003 5d/pop-to-ebp
1004 c3/return
1005
1006 emit-subx-epilogue:
1007
1008 55/push-ebp
1009 89/<- %ebp 4/r32/esp
1010
1011 (write-buffered *(ebp+8) "# . epilogue\n")
1012 (write-buffered *(ebp+8) "89/<- %esp 5/r32/ebp\n")
1013 (write-buffered *(ebp+8) "5d/pop-to-ebp\n")
1014 (write-buffered *(ebp+8) "c3/return\n")
1015 $emit-subx-epilogue:end:
1016
1017 89/<- %esp 5/r32/ebp
1018 5d/pop-to-ebp
1019 c3/return