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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247 == data
248
249 Program:
250 0/imm32
251
252 Function-name:
253 0/imm32
254 Function-subx-name:
255 4/imm32
256 Function-inouts:
257 8/imm32
258 Function-outputs:
259 0xc/imm32
260 Function-body:
261 0x10/imm32
262 Function-next:
263 0x14/imm32
264 Function-size:
265 0x18/imm32/24
266
267 Primitive-name:
268 0/imm32
269 Primitive-inouts:
270 4/imm32
271 Primitive-outputs:
272 8/imm32
273 Primitive-subx-name:
274 0xc/imm32
275 Primitive-subx-rm32:
276 0x10/imm32
277 Primitive-subx-r32:
278 0x14/imm32
279 Primitive-subx-imm32:
280 0x18/imm32
281 Primitive-write-only-output:
282 0x1c/imm32
283 Primitive-next:
284 0x20/imm32
285 Primitive-size:
286 0x24/imm32/36
287
288 Stmt-tag:
289 0/imm32
290
291 Block-statements:
292 4/imm32
293
294 Stmt1-operation:
295 4/imm32
296 Stmt1-inouts:
297 8/imm32
298 Stmt1-outputs:
299 0xc/imm32
300
301 Vardef-var:
302 4/imm32
303
304 Regvardef-operation:
305 4/imm32
306 Regvardef-inouts:
307 8/imm32
308 Regvardef-var:
309 0xc/imm32
310
311 Named-block-name:
312 4/imm32
313 Named-block-statements:
314 8/imm32
315
316 Stmt-size:
317 0x10/imm32
318
319 Var-name:
320 0/imm32
321 Var-type:
322 4/imm32
323 Var-block:
324 8/imm32
325 Var-stack-offset:
326 0xc/imm32
327 Var-register:
328 0x10/imm32
329 Var-size:
330 0x14/imm32
331
332 Any-register:
333
334 1/imm32
335
336 2a/asterisk
337
338 List-value:
339 0/imm32
340 List-next:
341 4/imm32
342 List-size:
343 8/imm32
344
345
346
347
348
349
350
351 Tree-left:
352 0/imm32
353 Tree-right:
354 4/imm32
355 Tree-size:
356 8/imm32
357
358 Max-type-id:
359 0x10000/imm32
360
361 == code
362
363 Entry:
364
365 89/<- %ebp 4/r32/esp
366 (new-segment *Heap-size Heap)
367
368 {
369
370 81 7/subop/compare *ebp 1/imm32
371 7e/jump-if-<= break/disp8
372
373 (kernel-string-equal? *(ebp+8) "test")
374 3d/compare-eax-and 0/imm32
375 74/jump-if-= break/disp8
376
377 (run-tests)
378
379 8b/-> *Num-test-failures 3/r32/ebx
380 eb/jump $mu-main:end/disp8
381 }
382
383 (convert-mu Stdin Stdout)
384 (flush Stdout)
385
386 bb/copy-to-ebx 0/imm32
387 $mu-main:end:
388 b8/copy-to-eax 1/imm32/exit
389 cd/syscall 0x80/imm8
390
391 convert-mu:
392
393 55/push-ebp
394 89/<- %ebp 4/r32/esp
395
396 (parse-mu *(ebp+8))
397 (check-mu-types)
398 (emit-subx *(ebp+0xc))
399 $convert-mu:end:
400
401 89/<- %esp 5/r32/ebp
402 5d/pop-to-ebp
403 c3/return
404
405 test-convert-empty-input:
406
407
408 55/push-ebp
409 89/<- %ebp 4/r32/esp
410
411 (clear-stream _test-input-stream)
412 (clear-stream $_test-input-buffered-file->buffer)
413 (clear-stream _test-output-stream)
414 (clear-stream $_test-output-buffered-file->buffer)
415
416 (convert-mu _test-input-buffered-file _test-output-buffered-file)
417 (flush _test-output-buffered-file)
418 (check-stream-equal _test-output-stream "" "F - test-convert-empty-input")
419
420 89/<- %esp 5/r32/ebp
421 5d/pop-to-ebp
422 c3/return
423
424 test-convert-function-skeleton:
425
426
427
428
429
430
431
432
433
434
435
436
437
438 55/push-ebp
439 89/<- %ebp 4/r32/esp
440
441 (clear-stream _test-input-stream)
442 (clear-stream $_test-input-buffered-file->buffer)
443 (clear-stream _test-output-stream)
444 (clear-stream $_test-output-buffered-file->buffer)
445
446 (write _test-input-stream "fn foo {\n")
447 (write _test-input-stream "}\n")
448
449 (convert-mu _test-input-buffered-file _test-output-buffered-file)
450 (flush _test-output-buffered-file)
451 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
457
458 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-skeleton/0")
459 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-skeleton/1")
460 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-skeleton/2")
461 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-skeleton/3")
462 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-skeleton/4")
463 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-skeleton/5")
464 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-skeleton/6")
465 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-skeleton/7")
466
467 89/<- %esp 5/r32/ebp
468 5d/pop-to-ebp
469 c3/return
470
471 test-convert-multiple-function-skeletons:
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495 55/push-ebp
496 89/<- %ebp 4/r32/esp
497
498 (clear-stream _test-input-stream)
499 (clear-stream $_test-input-buffered-file->buffer)
500 (clear-stream _test-output-stream)
501 (clear-stream $_test-output-buffered-file->buffer)
502
503 (write _test-input-stream "fn foo {\n")
504 (write _test-input-stream "}\n")
505 (write _test-input-stream "fn bar {\n")
506 (write _test-input-stream "}\n")
507
508 (convert-mu _test-input-buffered-file _test-output-buffered-file)
509 (flush _test-output-buffered-file)
510 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
516
517 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-multiple-function-skeletons/0")
518 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-multiple-function-skeletons/1")
519 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-multiple-function-skeletons/2")
520 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/3")
521 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-multiple-function-skeletons/4")
522 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/5")
523 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/6")
524 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-multiple-function-skeletons/7")
525
526 (check-next-stream-line-equal _test-output-stream "bar:" "F - test-convert-multiple-function-skeletons/10")
527 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-multiple-function-skeletons/11")
528 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-multiple-function-skeletons/12")
529 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-multiple-function-skeletons/13")
530 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-multiple-function-skeletons/14")
531 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-multiple-function-skeletons/15")
532 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-multiple-function-skeletons/16")
533 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-multiple-function-skeletons/17")
534
535 89/<- %esp 5/r32/ebp
536 5d/pop-to-ebp
537 c3/return
538
539 test-convert-function-with-arg:
540
541
542
543
544
545
546
547
548
549
550
551
552
553 55/push-ebp
554 89/<- %ebp 4/r32/esp
555
556 (clear-stream _test-input-stream)
557 (clear-stream $_test-input-buffered-file->buffer)
558 (clear-stream _test-output-stream)
559 (clear-stream $_test-output-buffered-file->buffer)
560
561 (write _test-input-stream "fn foo n : int {\n")
562 (write _test-input-stream "}\n")
563
564 (convert-mu _test-input-buffered-file _test-output-buffered-file)
565 (flush _test-output-buffered-file)
566 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
572
573 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg/0")
574 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-with-arg/1")
575 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-with-arg/2")
576 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg/3")
577 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-with-arg/4")
578 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg/5")
579 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-with-arg/6")
580 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-with-arg/7")
581
582 89/<- %esp 5/r32/ebp
583 5d/pop-to-ebp
584 c3/return
585
586 test-convert-function-with-arg-and-body:
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604 55/push-ebp
605 89/<- %ebp 4/r32/esp
606
607 (clear-stream _test-input-stream)
608 (clear-stream $_test-input-buffered-file->buffer)
609 (clear-stream _test-output-stream)
610 (clear-stream $_test-output-buffered-file->buffer)
611
612 (write _test-input-stream "fn foo n : int {\n")
613 (write _test-input-stream " increment n\n")
614 (write _test-input-stream "}\n")
615
616 (convert-mu _test-input-buffered-file _test-output-buffered-file)
617 (flush _test-output-buffered-file)
618 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
624
625 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-with-arg-and-body/0")
626 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-with-arg-and-body/1")
627 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-with-arg-and-body/2")
628 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-with-arg-and-body/3")
629 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-with-arg-and-body/4")
630 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp+0x00000008)" "F - test-convert-function-with-arg-and-body/5")
631 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-with-arg-and-body/6")
632 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-with-arg-and-body/7")
633 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-with-arg-and-body/8")
634 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-with-arg-and-body/9")
635 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-with-arg-and-body/10")
636
637 89/<- %esp 5/r32/ebp
638 5d/pop-to-ebp
639 c3/return
640
641 test-convert-function-distinguishes-args:
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659 55/push-ebp
660 89/<- %ebp 4/r32/esp
661
662 (clear-stream _test-input-stream)
663 (clear-stream $_test-input-buffered-file->buffer)
664 (clear-stream _test-output-stream)
665 (clear-stream $_test-output-buffered-file->buffer)
666
667 (write _test-input-stream "fn foo a: int, b: int {\n")
668 (write _test-input-stream " increment b\n")
669 (write _test-input-stream "}\n")
670
671 (convert-mu _test-input-buffered-file _test-output-buffered-file)
672 (flush _test-output-buffered-file)
673 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
679
680 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-distinguishes-args/0")
681 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-distinguishes-args/1")
682 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-distinguishes-args/2")
683 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-distinguishes-args/3")
684 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-distinguishes-args/4")
685 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp+0x0000000c)" "F - test-convert-function-distinguishes-args/5")
686 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-distinguishes-args/6")
687 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-distinguishes-args/7")
688 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-distinguishes-args/8")
689 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-distinguishes-args/9")
690 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-distinguishes-args/10")
691
692 89/<- %esp 5/r32/ebp
693 5d/pop-to-ebp
694 c3/return
695
696 test-convert-function-returns-result:
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716 55/push-ebp
717 89/<- %ebp 4/r32/esp
718
719 (clear-stream _test-input-stream)
720 (clear-stream $_test-input-buffered-file->buffer)
721 (clear-stream _test-output-stream)
722 (clear-stream $_test-output-buffered-file->buffer)
723
724 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n")
725 (write _test-input-stream " result <- copy a\n")
726 (write _test-input-stream " result <- increment\n")
727 (write _test-input-stream "}\n")
728
729 (convert-mu _test-input-buffered-file _test-output-buffered-file)
730 (flush _test-output-buffered-file)
731 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
737
738 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-returns-result/0")
739 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-returns-result/1")
740 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-returns-result/2")
741 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-returns-result/3")
742 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-returns-result/4")
743 (check-next-stream-line-equal _test-output-stream "8b/copy-from *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-returns-result/5")
744 (check-next-stream-line-equal _test-output-stream "40/increment-eax" "F - test-convert-function-returns-result/6")
745 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-returns-result/7")
746 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-returns-result/8")
747 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-returns-result/9")
748 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-returns-result/10")
749 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-returns-result/11")
750
751 89/<- %esp 5/r32/ebp
752 5d/pop-to-ebp
753 c3/return
754
755 test-convert-function-literal-arg:
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775 55/push-ebp
776 89/<- %ebp 4/r32/esp
777
778 (clear-stream _test-input-stream)
779 (clear-stream $_test-input-buffered-file->buffer)
780 (clear-stream _test-output-stream)
781 (clear-stream $_test-output-buffered-file->buffer)
782
783 (write _test-input-stream "fn foo a: int, b: int -> result/eax: int {\n")
784 (write _test-input-stream " result <- copy a\n")
785 (write _test-input-stream " result <- add 1\n")
786 (write _test-input-stream "}\n")
787
788 (convert-mu _test-input-buffered-file _test-output-buffered-file)
789 (flush _test-output-buffered-file)
790 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
796
797 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-literal-arg/0")
798 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-literal-arg/1")
799 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-literal-arg/2")
800 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-literal-arg/3")
801 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-literal-arg/4")
802 (check-next-stream-line-equal _test-output-stream "8b/copy-from *(ebp+0x00000008) 0x00000000/r32" "F - test-convert-function-literal-arg/5")
803 (check-next-stream-line-equal _test-output-stream "05/add-to-eax 1/imm32" "F - test-convert-function-literal-arg/6")
804 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-literal-arg/7")
805 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-literal-arg/8")
806 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-literal-arg/9")
807 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-literal-arg/10")
808 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-literal-arg/11")
809
810 89/<- %esp 5/r32/ebp
811 5d/pop-to-ebp
812 c3/return
813
814 test-convert-function-literal-arg-2:
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834 55/push-ebp
835 89/<- %ebp 4/r32/esp
836
837 (clear-stream _test-input-stream)
838 (clear-stream $_test-input-buffered-file->buffer)
839 (clear-stream _test-output-stream)
840 (clear-stream $_test-output-buffered-file->buffer)
841
842 (write _test-input-stream "fn foo a: int, b: int -> result/ebx: int {\n")
843 (write _test-input-stream " result <- copy a\n")
844 (write _test-input-stream " result <- add 1\n")
845 (write _test-input-stream "}\n")
846
847 (convert-mu _test-input-buffered-file _test-output-buffered-file)
848 (flush _test-output-buffered-file)
849 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
855
856 (check-next-stream-line-equal _test-output-stream "foo:" "F - test-convert-function-literal-arg-2/0")
857 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-literal-arg-2/1")
858 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-literal-arg-2/2")
859 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-literal-arg-2/3")
860 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-literal-arg-2/4")
861 (check-next-stream-line-equal _test-output-stream "8b/copy-from *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-literal-arg-2/5")
862 (check-next-stream-line-equal _test-output-stream "81 0/subop/add %ebx 1/imm32" "F - test-convert-function-literal-arg-2/6")
863 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-literal-arg-2/7")
864 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-literal-arg-2/8")
865 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-literal-arg-2/9")
866 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-literal-arg-2/10")
867 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-literal-arg-2/11")
868
869 89/<- %esp 5/r32/ebp
870 5d/pop-to-ebp
871 c3/return
872
873 test-convert-function-call-with-literal-arg:
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908 55/push-ebp
909 89/<- %ebp 4/r32/esp
910
911 (clear-stream _test-input-stream)
912 (clear-stream $_test-input-buffered-file->buffer)
913 (clear-stream _test-output-stream)
914 (clear-stream $_test-output-buffered-file->buffer)
915
916 (write _test-input-stream "fn main -> result/ebx: int {\n")
917 (write _test-input-stream " result <- do-add 3 4\n")
918 (write _test-input-stream "}\n")
919 (write _test-input-stream "fn do-add a: int, b: int -> result/ebx: int {\n")
920 (write _test-input-stream " result <- copy a\n")
921 (write _test-input-stream " result <- add b\n")
922 (write _test-input-stream "}\n")
923
924 (convert-mu _test-input-buffered-file _test-output-buffered-file)
925 (flush _test-output-buffered-file)
926 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
932
933 (check-next-stream-line-equal _test-output-stream "main:" "F - test-convert-function-call-with-literal-arg/0")
934 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-call-with-literal-arg/1")
935 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-call-with-literal-arg/2")
936 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/3")
937 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-call-with-literal-arg/4")
938 (check-next-stream-line-equal _test-output-stream "(do-add 3 4)" "F - test-convert-function-call-with-literal-arg/5")
939 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-call-with-literal-arg/6")
940 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-call-with-literal-arg/7")
941 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/8")
942 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/9")
943 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-call-with-literal-arg/10")
944 (check-next-stream-line-equal _test-output-stream "do-add:" "F - test-convert-function-call-with-literal-arg/11")
945 (check-next-stream-line-equal _test-output-stream "# . prologue" "F - test-convert-function-call-with-literal-arg/12")
946 (check-next-stream-line-equal _test-output-stream "55/push-ebp" "F - test-convert-function-call-with-literal-arg/13")
947 (check-next-stream-line-equal _test-output-stream "89/<- %ebp 4/r32/esp" "F - test-convert-function-call-with-literal-arg/14")
948 (check-next-stream-line-equal _test-output-stream "{" "F - test-convert-function-call-with-literal-arg/15")
949 (check-next-stream-line-equal _test-output-stream "8b/copy-from *(ebp+0x00000008) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/16")
950 (check-next-stream-line-equal _test-output-stream "03/add *(ebp+0x0000000c) 0x00000003/r32" "F - test-convert-function-call-with-literal-arg/17")
951 (check-next-stream-line-equal _test-output-stream "}" "F - test-convert-function-call-with-literal-arg/18")
952 (check-next-stream-line-equal _test-output-stream "# . epilogue" "F - test-convert-function-call-with-literal-arg/19")
953 (check-next-stream-line-equal _test-output-stream "89/<- %esp 5/r32/ebp" "F - test-convert-function-call-with-literal-arg/20")
954 (check-next-stream-line-equal _test-output-stream "5d/pop-to-ebp" "F - test-convert-function-call-with-literal-arg/21")
955 (check-next-stream-line-equal _test-output-stream "c3/return" "F - test-convert-function-call-with-literal-arg/22")
956
957 89/<- %esp 5/r32/ebp
958 5d/pop-to-ebp
959 c3/return
960
961
962
963
964
965 parse-mu:
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991 55/push-ebp
992 89/<- %ebp 4/r32/esp
993
994 50/push-eax
995 51/push-ecx
996 52/push-edx
997 53/push-ebx
998 57/push-edi
999
1000 81 5/subop/subtract %esp 0x200/imm32
1001 68/push 0x200/imm32/length
1002 68/push 0/imm32/read
1003 68/push 0/imm32/write
1004 89/<- %ecx 4/r32/esp
1005
1006 68/push 0/imm32/end
1007 68/push 0/imm32/start
1008 89/<- %edx 4/r32/esp
1009
1010 bf/copy-to-edi Program/imm32
1011
1012 81 5/subop/subtract %esp 0x400/imm32
1013 68/push 0x400/imm32/length
1014 68/push 0/imm32/top
1015 89/<- %ebx 4/r32/esp
1016 {
1017 $parse-mu:line-loop:
1018 (clear-stream %ecx)
1019 (read-line-buffered *(ebp+8) %ecx)
1020
1021 81 7/subop/compare *ecx 0/imm32
1022 0f 84/jump-if-= break/disp32
1023 +-- 6 lines: #? # dump line ---------------------------------------------------------------------------------------------------------------------------
1029 (next-word-or-string %ecx %edx)
1030
1031 (slice-empty? %edx)
1032 3d/compare-eax-and 0/imm32
1033 0f 85/jump-if-!= loop/disp32
1034
1035
1036 8b/-> *edx 0/r32/eax
1037 8a/copy-byte *eax 0/r32/AL
1038 81 4/subop/and %eax 0xff/imm32
1039
1040 3d/compare-eax-and 0x23/imm32/hash
1041 0f 84/jump-if-= loop/disp32
1042
1043 {
1044 $parse-mu:fn:
1045 (slice-equal? %edx "fn")
1046 3d/compare-eax-and 0/imm32
1047 0f 84/jump-if-= break/disp32
1048
1049 (allocate Heap *Function-size)
1050 (zero-out %eax *Function-size)
1051 (clear-stack %ebx)
1052 (populate-mu-function-header %ecx %eax %ebx)
1053 (populate-mu-function-body *(ebp+8) %eax %ebx)
1054
1055 89/<- *edi 0/r32/eax
1056
1057 8d/address-> *(eax+0x14) 7/r32/edi
1058 e9/jump $parse-mu:line-loop/disp32
1059 }
1060
1061 e9/jump $parse-mu:error1/disp32
1062 }
1063 $parse-mu:end:
1064
1065 81 0/subop/add %esp 0x630/imm32
1066
1067 5f/pop-to-edi
1068 5b/pop-to-ebx
1069 5a/pop-to-edx
1070 59/pop-to-ecx
1071 58/pop-to-eax
1072
1073 89/<- %esp 5/r32/ebp
1074 5d/pop-to-ebp
1075 c3/return
1076
1077 $parse-mu:error1:
1078
1079 (write-buffered Stderr "unexpected top-level command: ")
1080 (write-slice-buffered Stderr %edx)
1081 (write-buffered Stderr "\n")
1082 (flush Stderr)
1083
1084 bb/copy-to-ebx 1/imm32
1085 b8/copy-to-eax 1/imm32/exit
1086 cd/syscall 0x80/imm8
1087
1088
1089 $parse-mu:error2:
1090
1091 (print-int32-buffered Stderr *ebx)
1092 (write-buffered Stderr " vars not reclaimed after fn '")
1093 (write-slice-buffered Stderr *eax)
1094 (write-buffered Stderr "'\n")
1095 (flush Stderr)
1096
1097 bb/copy-to-ebx 1/imm32
1098 b8/copy-to-eax 1/imm32/exit
1099 cd/syscall 0x80/imm8
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113 populate-mu-function-header:
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144 55/push-ebp
1145 89/<- %ebp 4/r32/esp
1146
1147 50/push-eax
1148 51/push-ecx
1149 52/push-edx
1150 53/push-ebx
1151 57/push-edi
1152
1153 8b/-> *(ebp+0xc) 7/r32/edi
1154
1155 68/push 0/imm32/end
1156 68/push 0/imm32/start
1157 89/<- %ecx 4/r32/esp
1158
1159 ba/copy-to-edx 8/imm32
1160
1161 (next-word *(ebp+8) %ecx)
1162
1163
1164 (slice-equal? %ecx "{")
1165 3d/compare-eax-and 0/imm32
1166 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1167
1168 (slice-equal? %ecx "->")
1169 3d/compare-eax-and 0/imm32
1170 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1171
1172 (slice-equal? %ecx "}")
1173 3d/compare-eax-and 0/imm32
1174 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1175
1176 (slice-to-string Heap %ecx)
1177 89/<- *edi 0/r32/eax
1178
1179 89/<- *(edi+4) 0/r32/eax
1180
1181 {
1182 $populate-mu-function-header:check-for-inout:
1183 (next-word *(ebp+8) %ecx)
1184
1185 (slice-equal? %ecx "{")
1186 3d/compare-eax-and 0/imm32
1187 0f 85/jump-if-!= $populate-mu-function-header:done/disp32
1188
1189 (slice-equal? %ecx "->")
1190 3d/compare-eax-and 0/imm32
1191 0f 85/jump-if-!= break/disp32
1192
1193 (slice-equal? %ecx "}")
1194 3d/compare-eax-and 0/imm32
1195 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1196
1197 (parse-var-with-type %ecx *(ebp+8))
1198 89/<- %ebx 0/r32/eax
1199
1200 81 7/subop/compare *(ebx+0x10) 0/imm32
1201 0f 85/jump-if-!= $populate-mu-function-header:error2/disp32
1202
1203 89/<- *(ebx+0xc) 2/r32/edx
1204
1205 (size-of %ebx)
1206 01/add %edx 0/r32/eax
1207
1208 (append-list Heap %ebx *(edi+8))
1209 89/<- *(edi+8) 0/r32/eax
1210 (push *(ebp+0x10) %ebx)
1211
1212 e9/jump loop/disp32
1213 }
1214
1215 {
1216 $parse-var-with-type:check-for-out:
1217 (next-word *(ebp+8) %ecx)
1218
1219 (slice-equal? %ecx "{")
1220 3d/compare-eax-and 0/imm32
1221 0f 85/jump-if-!= break/disp32
1222
1223 (slice-equal? %ecx "->")
1224 3d/compare-eax-and 0/imm32
1225 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1226
1227 (slice-equal? %ecx "}")
1228 3d/compare-eax-and 0/imm32
1229 0f 85/jump-if-!= $populate-mu-function-header:error1/disp32
1230
1231 (parse-var-with-type %ecx *(ebp+8))
1232 89/<- %ebx 0/r32/eax
1233
1234 81 7/subop/compare *(ebx+0x10) 0/imm32
1235 0f 84/jump-if-= $populate-mu-function-header:error3/disp32
1236 (append-list Heap %ebx *(edi+0xc))
1237 89/<- *(edi+0xc) 0/r32/eax
1238 e9/jump loop/disp32
1239 }
1240 $populate-mu-function-header:done:
1241 (check-no-tokens-left *(ebp+8))
1242 $populate-mu-function-header:end:
1243
1244 81 0/subop/add %esp 8/imm32
1245
1246 5f/pop-to-edi
1247 5b/pop-to-ebx
1248 5a/pop-to-edx
1249 59/pop-to-ecx
1250 58/pop-to-eax
1251
1252 89/<- %esp 5/r32/ebp
1253 5d/pop-to-ebp
1254 c3/return
1255
1256 $populate-mu-function-header:error1:
1257
1258 (write-buffered Stderr "function header not in form 'fn <name> [inouts] [-> outputs] {' -- '")
1259 (flush Stderr)
1260 (rewind-stream *(ebp+8))
1261 (write-stream 2 *(ebp+8))
1262 (write-buffered Stderr "'\n")
1263 (flush Stderr)
1264
1265 bb/copy-to-ebx 1/imm32
1266 b8/copy-to-eax 1/imm32/exit
1267 cd/syscall 0x80/imm8
1268
1269
1270 $populate-mu-function-header:error2:
1271
1272 (write-buffered Stderr "function input '")
1273 (write-buffered Stderr *ebx)
1274 (write-buffered Stderr "' cannot be in a register")
1275 (flush Stderr)
1276
1277 bb/copy-to-ebx 1/imm32
1278 b8/copy-to-eax 1/imm32/exit
1279 cd/syscall 0x80/imm8
1280
1281
1282 $populate-mu-function-header:error3:
1283
1284 (write-buffered Stderr "function input '")
1285 (write-buffered Stderr *eax)
1286 (write-buffered Stderr " must be in a register'")
1287 (flush Stderr)
1288 (rewind-stream *(ebp+8))
1289 (write-stream 2 *(ebp+8))
1290 (write-buffered Stderr "'\n")
1291 (flush Stderr)
1292
1293 bb/copy-to-ebx 1/imm32
1294 b8/copy-to-eax 1/imm32/exit
1295 cd/syscall 0x80/imm8
1296
1297
1298 test-function-header-with-arg:
1299
1300
1301 55/push-ebp
1302 89/<- %ebp 4/r32/esp
1303
1304 (clear-stream _test-input-stream)
1305 (write _test-input-stream "foo n : int {\n")
1306
1307 2b/subtract-> *Function-size 4/r32/esp
1308 89/<- %ecx 4/r32/esp
1309 (zero-out %ecx *Function-size)
1310
1311 81 5/subop/subtract %esp 0x10/imm32
1312 68/push 0x10/imm32/length
1313 68/push 0/imm32/top
1314 89/<- %ebx 4/r32/esp
1315
1316 (populate-mu-function-header _test-input-stream %ecx %ebx)
1317
1318 (check-strings-equal *ecx "foo" "F - test-function-header-with-arg/name")
1319
1320 8b/-> *(ecx+8) 2/r32/edx
1321
1322 8b/-> *edx 3/r32/ebx
1323 (check-strings-equal *ebx "n" "F - test-function-header-with-arg/inout:0")
1324 8b/-> *(ebx+4) 3/r32/ebx
1325 (check-ints-equal *ebx 1 "F - test-function-header-with-arg/inout:0/type:0")
1326 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-arg/inout:0/type:1")
1327
1328 89/<- %esp 5/r32/ebp
1329 5d/pop-to-ebp
1330 c3/return
1331
1332 test-function-header-with-multiple-args:
1333
1334
1335 55/push-ebp
1336 89/<- %ebp 4/r32/esp
1337
1338 (clear-stream _test-input-stream)
1339 (write _test-input-stream "foo a: int, b: int c: int {\n")
1340
1341 2b/subtract-> *Function-size 4/r32/esp
1342 89/<- %ecx 4/r32/esp
1343 (zero-out %ecx *Function-size)
1344
1345 81 5/subop/subtract %esp 0x10/imm32
1346 68/push 0x10/imm32/length
1347 68/push 0/imm32/top
1348 89/<- %ebx 4/r32/esp
1349
1350 (populate-mu-function-header _test-input-stream %ecx %ebx)
1351
1352 (check-strings-equal *ecx "foo")
1353
1354 8b/-> *(ecx+8) 2/r32/edx
1355 $test-function-header-with-multiple-args:inout0:
1356
1357 8b/-> *edx 3/r32/ebx
1358 (check-strings-equal *ebx "a" "F - test-function-header-with-multiple-args/inout:0")
1359 8b/-> *(ebx+4) 3/r32/ebx
1360 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args/inout:0/type:0")
1361 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args/inout:0/type:1")
1362
1363 8b/-> *(edx+4) 2/r32/edx
1364 $test-function-header-with-multiple-args:inout1:
1365
1366 8b/-> *edx 3/r32/ebx
1367 (check-strings-equal *ebx "b" "F - test-function-header-with-multiple-args/inout:1")
1368 8b/-> *(ebx+4) 3/r32/ebx
1369 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args/inout:1/type:0")
1370 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args/inout:1/type:1")
1371
1372 8b/-> *(edx+4) 2/r32/edx
1373 $test-function-header-with-multiple-args:inout2:
1374
1375 8b/-> *edx 3/r32/ebx
1376 (check-strings-equal *ebx "c" "F - test-function-header-with-multiple-args/inout:2")
1377 8b/-> *(ebx+4) 3/r32/ebx
1378 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args/inout:2/type:0")
1379 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args/inout:2/type:1")
1380
1381 89/<- %esp 5/r32/ebp
1382 5d/pop-to-ebp
1383 c3/return
1384
1385 test-function-with-multiple-args-and-outputs:
1386
1387
1388 55/push-ebp
1389 89/<- %ebp 4/r32/esp
1390
1391 (clear-stream _test-input-stream)
1392 (write _test-input-stream "foo a: int, b: int, c: int -> x/ecx: int y/edx : int {\n")
1393
1394 2b/subtract-> *Function-size 4/r32/esp
1395 89/<- %ecx 4/r32/esp
1396 (zero-out %ecx *Function-size)
1397
1398 81 5/subop/subtract %esp 0x10/imm32
1399 68/push 0x10/imm32/length
1400 68/push 0/imm32/top
1401 89/<- %ebx 4/r32/esp
1402
1403 (populate-mu-function-header _test-input-stream %ecx %ebx)
1404
1405 (check-strings-equal *ecx "foo")
1406
1407 8b/-> *(ecx+8) 2/r32/edx
1408
1409 8b/-> *edx 3/r32/ebx
1410 (check-strings-equal *ebx "a" "F - test-function-header-with-multiple-args-and-outputs/inout:0")
1411 8b/-> *(ebx+4) 3/r32/ebx
1412 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:0")
1413 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:0/type:1")
1414
1415 8b/-> *(edx+4) 2/r32/edx
1416
1417 8b/-> *edx 3/r32/ebx
1418 (check-strings-equal *ebx "b" "F - test-function-header-with-multiple-args-and-outputs/inout:1")
1419 8b/-> *(ebx+4) 3/r32/ebx
1420 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:0")
1421 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:1/type:1")
1422
1423 8b/-> *(edx+4) 2/r32/edx
1424
1425 8b/-> *edx 3/r32/ebx
1426 (check-strings-equal *ebx "c" "F - test-function-header-with-multiple-args-and-outputs/inout:2")
1427 8b/-> *(ebx+4) 3/r32/ebx
1428 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:0")
1429 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args-and-outputs/inout:2/type:1")
1430
1431 8b/-> *(ecx+0xc) 2/r32/edx
1432
1433 8b/-> *edx 3/r32/ebx
1434 (check-strings-equal *ebx "x" "F - test-function-header-with-multiple-args-and-outputs/output:0")
1435 (check-strings-equal *(ebx+0x10) "ecx" "F - test-function-header-with-multiple-args-and-outputs/output:0/register")
1436 8b/-> *(ebx+4) 3/r32/ebx
1437 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:1")
1438 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args-and-outputs/output:0/type:1")
1439
1440 8b/-> *(edx+4) 2/r32/edx
1441
1442 8b/-> *edx 3/r32/ebx
1443 (check-strings-equal *ebx "y" "F - test-function-header-with-multiple-args-and-outputs/output:1")
1444 (check-strings-equal *(ebx+0x10) "edx" "F - test-function-header-with-multiple-args-and-outputs/output:0/register")
1445 8b/-> *(ebx+4) 3/r32/ebx
1446 (check-ints-equal *ebx 1 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:1")
1447 (check-ints-equal *(ebx+4) 0 "F - test-function-header-with-multiple-args-and-outputs/output:1/type:1")
1448
1449 89/<- %esp 5/r32/ebp
1450 5d/pop-to-ebp
1451 c3/return
1452
1453
1454
1455
1456
1457
1458 parse-var-with-type:
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483 55/push-ebp
1484 89/<- %ebp 4/r32/esp
1485
1486 51/push-ecx
1487 52/push-edx
1488 53/push-ebx
1489 56/push-esi
1490 57/push-edi
1491
1492 (allocate Heap *Var-size)
1493 (zero-out %eax *Var-size)
1494 89/<- %edi 0/r32/eax
1495
1496 8b/-> *(ebp+8) 6/r32/esi
1497
1498 68/push 0/imm32/end
1499 68/push 0/imm32/start
1500 89/<- %ecx 4/r32/esp
1501 $parse-var-with-type:save-name:
1502
1503 (next-token-from-slice *esi *(esi+4) 0x2f %ecx)
1504
1505 8b/-> *(ecx+4) 2/r32/edx
1506
1507 {
1508 8b/-> *(ecx+4) 0/r32/eax
1509 48/decrement-eax
1510 8a/copy-byte *eax 3/r32/BL
1511 81 4/subop/and %ebx 0xff/imm32
1512 81 7/subop/compare %ebx 0x3a/imm32/colon
1513 75/jump-if-!= break/disp8
1514 89/<- *(ecx+4) 0/r32/eax
1515 }
1516
1517 {
1518 8b/-> *(ecx+4) 0/r32/eax
1519 48/decrement-eax
1520 8a/copy-byte *eax 3/r32/BL
1521 81 4/subop/and %ebx 0xff/imm32
1522 81 7/subop/compare %ebx 0x2c/imm32/comma
1523 75/jump-if-!= break/disp8
1524 89/<- *(ecx+4) 0/r32/eax
1525 }
1526 $parse-var-with-type:write-name:
1527 (slice-to-string Heap %ecx)
1528 89/<- *edi 0/r32/eax
1529
1530 $parse-var-with-type:save-register:
1531 (next-token-from-slice %edx *(esi+4) 0x2f %ecx)
1532
1533 {
1534 8b/-> *(ecx+4) 0/r32/eax
1535 48/decrement-eax
1536 8a/copy-byte *eax 3/r32/BL
1537 81 4/subop/and %ebx 0xff/imm32
1538 81 7/subop/compare %ebx 0x3a/imm32/colon
1539 75/jump-if-!= break/disp8
1540 89/<- *(ecx+4) 0/r32/eax
1541 }
1542
1543 {
1544 8b/-> *(ecx+4) 0/r32/eax
1545 48/decrement-eax
1546 8a/copy-byte *eax 3/r32/BL
1547 81 4/subop/and %ebx 0xff/imm32
1548 81 7/subop/compare %ebx 0x2c/imm32/comma
1549 75/jump-if-!= break/disp8
1550 89/<- *(ecx+4) 0/r32/eax
1551 }
1552
1553 {
1554 $parse-var-with-type:write-register:
1555
1556
1557 8b/-> *ecx 0/r32/eax
1558 39/compare 0/r32/eax *(ecx+4)
1559 76/jump-if-<= break/disp8
1560 (slice-to-string Heap %ecx)
1561 89/<- *(edi+0x10) 0/r32/eax
1562 }
1563 $parse-var-with-type:save-type:
1564 (parse-type Heap *(ebp+0xc))
1565 89/<- *(edi+4) 0/r32/eax
1566 $parse-var-with-type:end:
1567
1568 89/<- %eax 7/r32/edi
1569
1570 81 0/subop/add %esp 8/imm32
1571
1572 5f/pop-to-edi
1573 5e/pop-to-esi
1574 5b/pop-to-ebx
1575 5a/pop-to-edx
1576 59/pop-to-ecx
1577
1578 89/<- %esp 5/r32/ebp
1579 5d/pop-to-ebp
1580 c3/return
1581
1582 $parse-var-with-type:abort:
1583
1584 (write-buffered Stderr "var should have form 'name: type' in '")
1585 (flush Stderr)
1586 (rewind-stream *(ebp+0xc))
1587 (write-stream 2 *(ebp+0xc))
1588 (write-buffered Stderr "'\n")
1589 (flush Stderr)
1590
1591 bb/copy-to-ebx 1/imm32
1592 b8/copy-to-eax 1/imm32/exit
1593 cd/syscall 0x80/imm8
1594
1595
1596 parse-type:
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614 55/push-ebp
1615 89/<- %ebp 4/r32/esp
1616
1617 51/push-ecx
1618 52/push-edx
1619
1620 68/push 0/imm32
1621 68/push 0/imm32
1622 89/<- %ecx 4/r32/esp
1623
1624 (next-mu-token *(ebp+0xc) %ecx)
1625
1626
1627
1628
1629
1630 (slice-equal? %ecx "")
1631 3d/compare-eax-and 0/imm32
1632 0f 85/jump-if-not-equal $parse-type:abort/disp32
1633
1634 (slice-equal? %ecx "{")
1635 3d/compare-eax-and 0/imm32
1636 0f 85/jump-if-not-equal $parse-type:abort/disp32
1637
1638 (slice-equal? %ecx "}")
1639 3d/compare-eax-and 0/imm32
1640 0f 85/jump-if-not-equal $parse-type:abort/disp32
1641
1642 (slice-equal? %ecx "->")
1643 3d/compare-eax-and 0/imm32
1644 0f 85/jump-if-not-equal $parse-type:abort/disp32
1645
1646 (slice-equal? %ecx ")")
1647 3d/compare-eax-and 0/imm32
1648 b8/copy-to-eax 0/imm32
1649 0f 85/jump-if-not-equal $parse-type:end/disp32
1650
1651 (allocate *(ebp+8) *Tree-size)
1652 (zero-out %eax *Tree-size)
1653 89/<- %edx 0/r32/eax
1654 {
1655
1656 (slice-equal? %ecx "(")
1657 3d/compare-eax-and 0/imm32
1658 75/jump-if-not-equal break/disp8
1659
1660 (pos-slice Type-id %ecx)
1661
1662
1663
1664
1665 89/<- *edx 0/r32/eax
1666 e9/jump $parse-type:return-edx/disp32
1667 }
1668
1669
1670 (parse-type *(ebp+8) *(ebp+0xc))
1671
1672
1673 89/<- *edx 0/r32/eax
1674
1675 (parse-type-tree *(ebp+8) *(ebp+0xc))
1676
1677
1678
1679
1680 89/<- *(edx+4) 0/r32/eax
1681 $parse-type:return-edx:
1682 89/<- %eax 2/r32/edx
1683 $parse-type:end:
1684
1685 81 0/subop/add %esp 8/imm32
1686
1687 5a/pop-to-edx
1688 59/pop-to-ecx
1689
1690 89/<- %esp 5/r32/ebp
1691 5d/pop-to-ebp
1692 c3/return
1693
1694 $parse-type:abort:
1695
1696 (write-buffered Stderr "unexpected token when parsing type: '")
1697 (write-slice-buffered Stderr %ecx)
1698 (write-buffered Stderr "'\n")
1699 (flush Stderr)
1700
1701 bb/copy-to-ebx 1/imm32
1702 b8/copy-to-eax 1/imm32/exit
1703 cd/syscall 0x80/imm8
1704
1705
1706 parse-type-tree:
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717 55/push-ebp
1718 89/<- %ebp 4/r32/esp
1719
1720 51/push-ecx
1721 52/push-edx
1722
1723 (parse-type *(ebp+8) *(ebp+0xc))
1724
1725 3d/compare-eax-and 0/imm32
1726 74/jump-if-equal $parse-type-tree:end/disp8
1727
1728 89/<- %ecx 0/r32/eax
1729
1730 (allocate *(ebp+8) *Tree-size)
1731 (zero-out %eax *Tree-size)
1732 89/<- %edx 0/r32/eax
1733
1734 89/<- *edx 1/r32/ecx
1735
1736 (parse-type-tree *(ebp+8) *(ebp+0xc))
1737 89/<- *(edx+4) 0/r32/eax
1738 $parse-type-tree:return-edx:
1739 89/<- %eax 2/r32/edx
1740 $parse-type-tree:end:
1741
1742 5a/pop-to-edx
1743 59/pop-to-ecx
1744
1745 89/<- %esp 5/r32/ebp
1746 5d/pop-to-ebp
1747 c3/return
1748
1749 next-mu-token:
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812 55/push-ebp
1813 89/<- %ebp 4/r32/esp
1814
1815 50/push-eax
1816 51/push-ecx
1817 56/push-esi
1818 57/push-edi
1819
1820 8b/-> *(ebp+8) 6/r32/esi
1821
1822 8b/-> *(ebp+0xc) 7/r32/edi
1823 $next-mu-token:start:
1824 (skip-chars-matching-whitespace %esi)
1825 $next-mu-token:check0:
1826
1827
1828 8b/-> *(esi+4) 1/r32/ecx
1829
1830 3b/compare 1/r32/ecx *esi
1831 c7 0/subop/copy *edi 0/imm32
1832 c7 0/subop/copy *(edi+4) 0/imm32
1833 0f 8d/jump-if->= $next-mu-token:end/disp32
1834
1835 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
1836 89/<- *edi 0/r32/eax
1837
1838 31/xor %eax 0/r32/eax
1839 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
1840 {
1841 $next-mu-token:check-for-colon:
1842
1843 3d/compare-eax-and 0x3a/imm32/colon
1844 75/jump-if-!= break/disp8
1845
1846 ff 0/subop/increment *(esi+4)
1847
1848 e9/jump $next-mu-token:start/disp32
1849 }
1850 {
1851 $next-mu-token:check-for-comma:
1852
1853 3d/compare-eax-and 0x2c/imm32/comma
1854 75/jump-if-!= break/disp8
1855
1856 ff 0/subop/increment *(esi+4)
1857
1858 e9/jump $next-mu-token:start/disp32
1859 }
1860 {
1861 $next-mu-token:check-for-comment:
1862
1863 3d/compare-eax-and 0x23/imm32/pound
1864 75/jump-if-!= break/disp8
1865
1866 8b/-> *esi 0/r32/eax
1867 89/<- *(esi+4) 0/r32/eax
1868
1869 e9/jump $next-mu-token:done/disp32
1870 }
1871 {
1872 $next-mu-token:check-for-string-literal:
1873
1874 3d/compare-eax-and 0x22/imm32/dquote
1875 75/jump-if-!= break/disp8
1876 (skip-string %esi)
1877
1878 e9/jump $next-mu-token:done/disp32
1879 }
1880 {
1881 $next-mu-token:check-for-open-paren:
1882
1883 3d/compare-eax-and 0x28/imm32/open-paren
1884 75/jump-if-!= break/disp8
1885
1886 ff 0/subop/increment *(esi+4)
1887
1888 e9/jump $next-mu-token:done/disp32
1889 }
1890 {
1891 $next-mu-token:check-for-close-paren:
1892
1893 3d/compare-eax-and 0x29/imm32/close-paren
1894 75/jump-if-!= break/disp8
1895
1896 ff 0/subop/increment *(esi+4)
1897
1898 e9/jump $next-mu-token:done/disp32
1899 }
1900 {
1901 $next-mu-token:regular-word-without-metadata:
1902
1903
1904 8b/-> *(esi+4) 1/r32/ecx
1905
1906 3b/compare *esi 1/r32/ecx
1907 7d/jump-if->= break/disp8
1908
1909 31/xor %eax 0/r32/eax
1910 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
1911
1912 3d/compare-eax-and 0x20/imm32/space
1913 74/jump-if-= break/disp8
1914
1915 3d/compare-eax-and 0xd/imm32/carriage-return
1916 74/jump-if-= break/disp8
1917
1918 3d/compare-eax-and 0xa/imm32/newline
1919 74/jump-if-= break/disp8
1920
1921 3d/compare-eax-and 0x28/imm32/open-paren
1922 0f 84/jump-if-= break/disp32
1923
1924 3d/compare-eax-and 0x29/imm32/close-paren
1925 0f 84/jump-if-= break/disp32
1926
1927 3d/compare-eax-and 0x3a/imm32/colon
1928 0f 84/jump-if-= break/disp32
1929
1930 3d/compare-eax-and 0x2c/imm32/comma
1931 0f 84/jump-if-= break/disp32
1932
1933 ff 0/subop/increment *(esi+4)
1934
1935 e9/jump loop/disp32
1936 }
1937 $next-mu-token:done:
1938
1939 8b/-> *(esi+4) 1/r32/ecx
1940 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
1941 89/<- *(edi+4) 0/r32/eax
1942 {
1943 $next-mu-token:skip-trailing-delimiters:
1944
1945
1946 8b/-> *(esi+4) 1/r32/ecx
1947
1948 3b/compare *esi 1/r32/ecx
1949 7d/jump-if->= break/disp8
1950
1951 31/xor %eax 0/r32/eax
1952 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
1953
1954 {
1955 3d/compare-eax-and 0x3a/imm32/colon
1956 75/jump-if-!= break/disp8
1957
1958 ff 0/subop/increment *(esi+4)
1959
1960 eb/jump $next-mu-token:skip-trailing-delimiters/disp8
1961 }
1962
1963 {
1964 3d/compare-eax-and 0x2c/imm32/comma
1965 75/jump-if-!= break/disp8
1966
1967 ff 0/subop/increment *(esi+4)
1968
1969 eb/jump $next-mu-token:skip-trailing-delimiters/disp8
1970 }
1971
1972 }
1973 $next-mu-token:end:
1974
1975 5f/pop-to-edi
1976 5e/pop-to-esi
1977 59/pop-to-ecx
1978 58/pop-to-eax
1979
1980 89/<- %esp 5/r32/ebp
1981 5d/pop-to-ebp
1982 c3/return
1983
1984
1985
1986 pos-slice:
1987
1988 55/push-ebp
1989 89/<- %ebp 4/r32/esp
1990
1991 51/push-ecx
1992 52/push-edx
1993 53/push-ebx
1994 56/push-esi
1995
1996
1997
1998
1999
2000 8b/-> *(ebp+8) 6/r32/esi
2001
2002 b9/copy-to-ecx 0/imm32
2003
2004 8d/copy-address *(esi+0xc) 2/r32/edx
2005
2006 8b/-> *esi 3/r32/ebx
2007 8d/copy-address *(esi+ebx+0xc) 3/r32/ebx
2008 {
2009
2010
2011
2012
2013
2014 39/compare %edx 3/r32/ebx
2015 b8/copy-to-eax -1/imm32
2016 73/jump-if-addr>= $pos-slice:end/disp8
2017
2018 (slice-equal? *(ebp+0xc) *edx)
2019 3d/compare-eax-and 0/imm32
2020 75/jump-if-!= break/disp8
2021
2022 41/increment-ecx
2023
2024 81 0/subop/add %edx 4/imm32
2025
2026 eb/jump loop/disp8
2027 }
2028
2029 89/<- %eax 1/r32/ecx
2030 $pos-slice:end:
2031
2032
2033
2034
2035 5e/pop-to-esi
2036 5b/pop-to-ebx
2037 5a/pop-to-edx
2038 59/pop-to-ecx
2039
2040 89/<- %esp 5/r32/ebp
2041 5d/pop-to-ebp
2042 c3/return
2043
2044 == data
2045
2046 Type-id:
2047 0x18/imm32/write
2048 0/imm32/read
2049 0x100/imm32/length
2050
2051 "literal"/imm32
2052 "int"/imm32
2053 "addr"/imm32
2054 "array"/imm32
2055 "handle"/imm32
2056 "bool"/imm32
2057 0/imm32
2058 0/imm32
2059
2060 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2061 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2062 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2063 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2064 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2065 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2066 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32 0/imm32
2067
2068 == code
2069
2070 test-parse-var-with-type:
2071
2072 55/push-ebp
2073 89/<- %ebp 4/r32/esp
2074
2075 b8/copy-to-eax "x:"/imm32
2076 8b/-> *eax 1/r32/ecx
2077 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2078 05/add-to-eax 4/imm32
2079
2080 51/push-ecx
2081 50/push-eax
2082 89/<- %ecx 4/r32/esp
2083
2084 (clear-stream _test-input-stream)
2085 (write _test-input-stream "int")
2086
2087 (parse-var-with-type %ecx _test-input-stream)
2088 8b/-> *eax 2/r32/edx
2089 (check-strings-equal %edx "x" "F - test-var-with-type/name")
2090 8b/-> *(eax+4) 2/r32/edx
2091 (check-ints-equal *edx 1 "F - test-var-with-type/type")
2092 (check-ints-equal *(edx+4) 0 "F - test-var-with-type/type")
2093
2094 89/<- %esp 5/r32/ebp
2095 5d/pop-to-ebp
2096 c3/return
2097
2098 test-parse-var-with-type-and-register:
2099
2100 55/push-ebp
2101 89/<- %ebp 4/r32/esp
2102
2103 b8/copy-to-eax "x/eax"/imm32
2104 8b/-> *eax 1/r32/ecx
2105 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2106 05/add-to-eax 4/imm32
2107
2108 51/push-ecx
2109 50/push-eax
2110 89/<- %ecx 4/r32/esp
2111
2112 (clear-stream _test-input-stream)
2113 (write _test-input-stream ": int")
2114
2115 (parse-var-with-type %ecx _test-input-stream)
2116 8b/-> *eax 2/r32/edx
2117 (check-strings-equal %edx "x" "F - test-var-with-type-and-register/name")
2118 8b/-> *(eax+0x10) 2/r32/edx
2119 (check-strings-equal %edx "eax" "F - test-var-with-type-and-register/register")
2120 8b/-> *(eax+4) 2/r32/edx
2121 (check-ints-equal *edx 1 "F - test-var-with-type-and-register/type")
2122 (check-ints-equal *(edx+4) 0 "F - test-var-with-type-and-register/type")
2123
2124 89/<- %esp 5/r32/ebp
2125 5d/pop-to-ebp
2126 c3/return
2127
2128 test-parse-var-with-trailing-characters:
2129
2130 55/push-ebp
2131 89/<- %ebp 4/r32/esp
2132
2133 b8/copy-to-eax "x:"/imm32
2134 8b/-> *eax 1/r32/ecx
2135 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2136 05/add-to-eax 4/imm32
2137
2138 51/push-ecx
2139 50/push-eax
2140 89/<- %ecx 4/r32/esp
2141
2142 (clear-stream _test-input-stream)
2143 (write _test-input-stream "int,")
2144
2145 (parse-var-with-type %ecx _test-input-stream)
2146 8b/-> *eax 2/r32/edx
2147 (check-strings-equal %edx "x" "F - test-var-with-trailing-characters/name")
2148 8b/-> *(eax+0x10) 2/r32/edx
2149 (check-ints-equal %edx 0 "F - test-var-with-trailing-characters/register")
2150 8b/-> *(eax+4) 2/r32/edx
2151 (check-ints-equal *edx 1 "F - test-var-with-trailing-characters/type")
2152 (check-ints-equal *(edx+4) 0 "F - test-var-with-trailing-characters/type")
2153
2154 89/<- %esp 5/r32/ebp
2155 5d/pop-to-ebp
2156 c3/return
2157
2158 test-parse-var-with-register-and-trailing-characters:
2159
2160 55/push-ebp
2161 89/<- %ebp 4/r32/esp
2162
2163 b8/copy-to-eax "x/eax:"/imm32
2164 8b/-> *eax 1/r32/ecx
2165 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2166 05/add-to-eax 4/imm32
2167
2168 51/push-ecx
2169 50/push-eax
2170 89/<- %ecx 4/r32/esp
2171
2172 (clear-stream _test-input-stream)
2173 (write _test-input-stream "int,")
2174
2175 (parse-var-with-type %ecx _test-input-stream)
2176 8b/-> *eax 2/r32/edx
2177 (check-strings-equal %edx "x" "F - test-var-with-register-and-trailing-characters/name")
2178 8b/-> *(eax+0x10) 2/r32/edx
2179 (check-strings-equal %edx "eax" "F - test-var-with-register-and-trailing-characters/register")
2180 8b/-> *(eax+4) 2/r32/edx
2181 (check-ints-equal *edx 1 "F - test-var-with-register-and-trailing-characters/type")
2182 (check-ints-equal *(edx+4) 0 "F - test-var-with-register-and-trailing-characters/type")
2183
2184 89/<- %esp 5/r32/ebp
2185 5d/pop-to-ebp
2186 c3/return
2187
2188 test-parse-var-with-compound-type:
2189
2190 55/push-ebp
2191 89/<- %ebp 4/r32/esp
2192
2193 b8/copy-to-eax "x:"/imm32
2194 8b/-> *eax 1/r32/ecx
2195 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2196 05/add-to-eax 4/imm32
2197
2198 51/push-ecx
2199 50/push-eax
2200 89/<- %ecx 4/r32/esp
2201
2202 (clear-stream _test-input-stream)
2203 (write _test-input-stream "(addr int)")
2204
2205 (parse-var-with-type %ecx _test-input-stream)
2206 8b/-> *eax 2/r32/edx
2207 (check-strings-equal %edx "x" "F - test-var-with-compound-type/name")
2208 8b/-> *(eax+0x10) 2/r32/edx
2209 (check-ints-equal %edx 0 "F - test-var-with-compound-type/register")
2210
2211 8b/-> *(eax+4) 2/r32/edx
2212
2213 8b/-> *edx 0/r32/eax
2214 (check-ints-equal *eax 2 "F - test-var-with-compound-type/type:0")
2215
2216 8b/-> *(edx+4) 2/r32/edx
2217 8b/-> *edx 0/r32/eax
2218 (check-ints-equal *eax 1 "F - test-var-with-compound-type/type:1")
2219
2220 (check-ints-equal *(edx+4) 0 "F - test-var-with-compound-type/type:2")
2221
2222 89/<- %esp 5/r32/ebp
2223 5d/pop-to-ebp
2224 c3/return
2225
2226
2227
2228
2229 is-identifier?:
2230
2231 55/push-ebp
2232 89/<- %ebp 4/r32/esp
2233
2234 (slice-empty? *(ebp+8))
2235 3d/compare-eax-and 0/imm32
2236 75/jump-if-!= $is-identifier?:false/disp8
2237
2238 8b/-> *(ebp+8) 0/r32/eax
2239 8b/-> *eax 0/r32/eax
2240 8a/copy-byte *eax 0/r32/AL
2241 81 4/subop/and %eax 0xff/imm32
2242
2243 3d/compare-eax-and 0x24/imm32/$
2244 74/jump-if-= $is-identifier?:true/disp8
2245
2246 3d/compare-eax-and 0x5f/imm32/_
2247 74/jump-if-= $is-identifier?:true/disp8
2248
2249 25/and-eax-with 0x5f/imm32
2250
2251 3d/compare-eax-and 0x41/imm32/A
2252 7c/jump-if-< $is-identifier?:false/disp8
2253
2254 3d/compare-eax-and 0x5a/imm32/Z
2255 7f/jump-if-> $is-identifier?:false/disp8
2256
2257 $is-identifier?:true:
2258 b8/copy-to-eax 1/imm32/true
2259 eb/jump $is-identifier?:end/disp8
2260 $is-identifier?:false:
2261 b8/copy-to-eax 0/imm32/false
2262 $is-identifier?:end:
2263
2264 89/<- %esp 5/r32/ebp
2265 5d/pop-to-ebp
2266 c3/return
2267
2268 test-is-identifier-dollar:
2269
2270 55/push-ebp
2271 89/<- %ebp 4/r32/esp
2272
2273 b8/copy-to-eax "$a"/imm32
2274 8b/-> *eax 1/r32/ecx
2275 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2276 05/add-to-eax 4/imm32
2277
2278 51/push-ecx
2279 50/push-eax
2280 89/<- %ecx 4/r32/esp
2281
2282 (is-identifier? %ecx)
2283 (check-ints-equal %eax 1 "F - test-is-identifier-dollar")
2284
2285 89/<- %esp 5/r32/ebp
2286 5d/pop-to-ebp
2287 c3/return
2288
2289 test-is-identifier-underscore:
2290
2291 55/push-ebp
2292 89/<- %ebp 4/r32/esp
2293
2294 b8/copy-to-eax "_a"/imm32
2295 8b/-> *eax 1/r32/ecx
2296 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2297 05/add-to-eax 4/imm32
2298
2299 51/push-ecx
2300 50/push-eax
2301 89/<- %ecx 4/r32/esp
2302
2303 (is-identifier? %ecx)
2304 (check-ints-equal %eax 1 "F - test-is-identifier-underscore")
2305
2306 89/<- %esp 5/r32/ebp
2307 5d/pop-to-ebp
2308 c3/return
2309
2310 test-is-identifier-a:
2311
2312 55/push-ebp
2313 89/<- %ebp 4/r32/esp
2314
2315 b8/copy-to-eax "a$"/imm32
2316 8b/-> *eax 1/r32/ecx
2317 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2318 05/add-to-eax 4/imm32
2319
2320 51/push-ecx
2321 50/push-eax
2322 89/<- %ecx 4/r32/esp
2323
2324 (is-identifier? %ecx)
2325 (check-ints-equal %eax 1 "F - test-is-identifier-a")
2326
2327 89/<- %esp 5/r32/ebp
2328 5d/pop-to-ebp
2329 c3/return
2330
2331 test-is-identifier-z:
2332
2333 55/push-ebp
2334 89/<- %ebp 4/r32/esp
2335
2336 b8/copy-to-eax "z$"/imm32
2337 8b/-> *eax 1/r32/ecx
2338 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2339 05/add-to-eax 4/imm32
2340
2341 51/push-ecx
2342 50/push-eax
2343 89/<- %ecx 4/r32/esp
2344
2345 (is-identifier? %ecx)
2346 (check-ints-equal %eax 1 "F - test-is-identifier-z")
2347
2348 89/<- %esp 5/r32/ebp
2349 5d/pop-to-ebp
2350 c3/return
2351
2352 test-is-identifier-A:
2353
2354 55/push-ebp
2355 89/<- %ebp 4/r32/esp
2356
2357 b8/copy-to-eax "A$"/imm32
2358 8b/-> *eax 1/r32/ecx
2359 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2360 05/add-to-eax 4/imm32
2361
2362 51/push-ecx
2363 50/push-eax
2364 89/<- %ecx 4/r32/esp
2365
2366 (is-identifier? %ecx)
2367 (check-ints-equal %eax 1 "F - test-is-identifier-A")
2368
2369 89/<- %esp 5/r32/ebp
2370 5d/pop-to-ebp
2371 c3/return
2372
2373 test-is-identifier-Z:
2374
2375 55/push-ebp
2376 89/<- %ebp 4/r32/esp
2377
2378 b8/copy-to-eax "Z$"/imm32
2379 8b/-> *eax 1/r32/ecx
2380 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2381 05/add-to-eax 4/imm32
2382
2383 51/push-ecx
2384 50/push-eax
2385 89/<- %ecx 4/r32/esp
2386
2387 (is-identifier? %ecx)
2388 (check-ints-equal %eax 1 "F - test-is-identifier-Z")
2389
2390 89/<- %esp 5/r32/ebp
2391 5d/pop-to-ebp
2392 c3/return
2393
2394 test-is-identifier-@:
2395
2396
2397 55/push-ebp
2398 89/<- %ebp 4/r32/esp
2399
2400 b8/copy-to-eax "@a"/imm32
2401 8b/-> *eax 1/r32/ecx
2402 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2403 05/add-to-eax 4/imm32
2404
2405 51/push-ecx
2406 50/push-eax
2407 89/<- %ecx 4/r32/esp
2408
2409 (is-identifier? %ecx)
2410 (check-ints-equal %eax 0 "F - test-is-identifier-@")
2411
2412 89/<- %esp 5/r32/ebp
2413 5d/pop-to-ebp
2414 c3/return
2415
2416 test-is-identifier-square-bracket:
2417
2418
2419 55/push-ebp
2420 89/<- %ebp 4/r32/esp
2421
2422 b8/copy-to-eax "[a"/imm32
2423 8b/-> *eax 1/r32/ecx
2424 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2425 05/add-to-eax 4/imm32
2426
2427 51/push-ecx
2428 50/push-eax
2429 89/<- %ecx 4/r32/esp
2430
2431 (is-identifier? %ecx)
2432 (check-ints-equal %eax 0 "F - test-is-identifier-@")
2433
2434 89/<- %esp 5/r32/ebp
2435 5d/pop-to-ebp
2436 c3/return
2437
2438 test-is-identifier-backtick:
2439
2440
2441 55/push-ebp
2442 89/<- %ebp 4/r32/esp
2443
2444 b8/copy-to-eax "`a"/imm32
2445 8b/-> *eax 1/r32/ecx
2446 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2447 05/add-to-eax 4/imm32
2448
2449 51/push-ecx
2450 50/push-eax
2451 89/<- %ecx 4/r32/esp
2452
2453 (is-identifier? %ecx)
2454 (check-ints-equal %eax 0 "F - test-is-identifier-backtick")
2455
2456 89/<- %esp 5/r32/ebp
2457 5d/pop-to-ebp
2458 c3/return
2459
2460 test-is-identifier-curly-brace-open:
2461
2462
2463 55/push-ebp
2464 89/<- %ebp 4/r32/esp
2465
2466 b8/copy-to-eax "{a"/imm32
2467 8b/-> *eax 1/r32/ecx
2468 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2469 05/add-to-eax 4/imm32
2470
2471 51/push-ecx
2472 50/push-eax
2473 89/<- %ecx 4/r32/esp
2474
2475 (is-identifier? %ecx)
2476 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-open")
2477
2478 89/<- %esp 5/r32/ebp
2479 5d/pop-to-ebp
2480 c3/return
2481
2482 test-is-identifier-curly-brace-close:
2483
2484 55/push-ebp
2485 89/<- %ebp 4/r32/esp
2486
2487 b8/copy-to-eax "}a"/imm32
2488 8b/-> *eax 1/r32/ecx
2489 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2490 05/add-to-eax 4/imm32
2491
2492 51/push-ecx
2493 50/push-eax
2494 89/<- %ecx 4/r32/esp
2495
2496 (is-identifier? %ecx)
2497 (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-close")
2498
2499 89/<- %esp 5/r32/ebp
2500 5d/pop-to-ebp
2501 c3/return
2502
2503 test-is-identifier-hyphen:
2504
2505
2506 55/push-ebp
2507 89/<- %ebp 4/r32/esp
2508
2509 b8/copy-to-eax "-a"/imm32
2510 8b/-> *eax 1/r32/ecx
2511 8d/copy-address *(eax+ecx+4) 1/r32/ecx
2512 05/add-to-eax 4/imm32
2513
2514 51/push-ecx
2515 50/push-eax
2516 89/<- %ecx 4/r32/esp
2517
2518 (is-identifier? %ecx)
2519 (check-ints-equal %eax 0 "F - test-is-identifier-hyphen")
2520
2521 89/<- %esp 5/r32/ebp
2522 5d/pop-to-ebp
2523 c3/return
2524
2525 populate-mu-function-body:
2526
2527 55/push-ebp
2528 89/<- %ebp 4/r32/esp
2529
2530 50/push-eax
2531 56/push-esi
2532 57/push-edi
2533
2534 8b/-> *(ebp+8) 6/r32/esi
2535
2536 8b/-> *(ebp+0xc) 7/r32/edi
2537
2538 (parse-mu-block %esi *(ebp+0x10) %edi)
2539
2540 89/<- *(edi+0x10) 0/r32/eax
2541 $populate-mu-function-body:end:
2542
2543 5f/pop-to-edi
2544 5e/pop-to-esi
2545 58/pop-to-eax
2546
2547 89/<- %esp 5/r32/ebp
2548 5d/pop-to-ebp
2549 c3/return
2550
2551
2552 parse-mu-block:
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585 55/push-ebp
2586 89/<- %ebp 4/r32/esp
2587
2588 51/push-ecx
2589 52/push-edx
2590 53/push-ebx
2591 57/push-edi
2592
2593 81 5/subop/subtract %esp 0x200/imm32
2594 68/push 0x200/imm32/length
2595 68/push 0/imm32/read
2596 68/push 0/imm32/write
2597 89/<- %ecx 4/r32/esp
2598
2599 68/push 0/imm32/end
2600 68/push 0/imm32/start
2601 89/<- %edx 4/r32/esp
2602
2603 (allocate Heap *Stmt-size)
2604 (zero-out %eax *Stmt-size)
2605 89/<- %edi 0/r32/eax
2606 {
2607 $parse-mu-block:line-loop:
2608
2609 (clear-stream %ecx)
2610 (read-line-buffered *(ebp+8) %ecx)
2611
2612
2613
2614
2615
2616 81 7/subop/compare *ecx 0/imm32
2617 0f 84/jump-if-= break/disp32
2618
2619 (next-word %ecx %edx)
2620
2621
2622
2623
2624
2625 (slice-empty? %edx)
2626 3d/compare-eax-and 0/imm32
2627 0f 85/jump-if-!= loop/disp32
2628
2629
2630 8b/-> *edx 0/r32/eax
2631 8a/copy-byte *eax 0/r32/AL
2632 81 4/subop/and %eax 0xff/imm32
2633
2634 3d/compare-eax-and 0x23/imm32/hash
2635 0f 84/jump-if-= loop/disp32
2636
2637 {
2638 $parse-mu-block:check-for-block:
2639 (slice-equal? %edx "{")
2640 3d/compare-eax-and 0/imm32
2641 74/jump-if-= break/disp8
2642 (check-no-tokens-left %ecx)
2643
2644 (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10))
2645 (append-to-block Heap %edi %eax)
2646 e9/jump $parse-mu-block:line-loop/disp32
2647 }
2648
2649 $parse-mu-block:check-for-end:
2650 (slice-equal? %edx "}")
2651 3d/compare-eax-and 0/imm32
2652 0f 85/jump-if-!= break/disp32
2653
2654 {
2655 $parse-mu-block:check-for-named-block:
2656
2657 8b/-> *(edx+4) 0/r32/eax
2658 8a/copy-byte *eax 0/r32/AL
2659 81 4/subop/and %eax 0xff/imm32
2660
2661 3d/compare-eax-and 0x23/imm32/hash
2662 0f 85/jump-if-!= break/disp32
2663
2664 (parse-mu-named-block %edx %ecx *(ebp+8) *(ebp+0xc) *(ebp+0x10))
2665 (append-to-block Heap %edi %eax)
2666 e9/jump $parse-mu-block:line-loop/disp32
2667 }
2668
2669 {
2670 $parse-mu-block:check-for-var:
2671 (slice-equal? %edx "var")
2672 3d/compare-eax-and 0/imm32
2673 74/jump-if-= break/disp8
2674
2675 (parse-mu-var-def %ecx *(ebp+0xc))
2676 (append-to-block Heap %edi %eax)
2677 e9/jump $parse-mu-block:line-loop/disp32
2678 }
2679 $parse-mu-block:regular-stmt:
2680
2681 (parse-mu-stmt %ecx *(ebp+0xc) *(ebp+0x10))
2682 (append-to-block Heap %edi %eax)
2683 e9/jump loop/disp32
2684 }
2685
2686 89/<- %eax 7/r32/edi
2687 $parse-mu-block:end:
2688
2689 81 0/subop/add %esp 0x214/imm32
2690
2691 5f/pop-to-edi
2692 5b/pop-to-ebx
2693 5a/pop-to-edx
2694 59/pop-to-ecx
2695
2696 89/<- %esp 5/r32/ebp
2697 5d/pop-to-ebp
2698 c3/return
2699
2700 $parse-mu-block:abort:
2701
2702 (write-buffered Stderr "'{' or '}' should be on its own line, but got '")
2703 (rewind-stream %ecx)
2704 (write-stream 2 %ecx)
2705 (write-buffered Stderr "'\n")
2706 (flush Stderr)
2707
2708 bb/copy-to-ebx 1/imm32
2709 b8/copy-to-eax 1/imm32/exit
2710 cd/syscall 0x80/imm8
2711
2712
2713 check-no-tokens-left:
2714
2715 55/push-ebp
2716 89/<- %ebp 4/r32/esp
2717
2718 50/push-eax
2719 51/push-ecx
2720
2721 68/push 0/imm32/end
2722 68/push 0/imm32/start
2723 89/<- %ecx 4/r32/esp
2724
2725 (next-word *(ebp+8) %ecx)
2726
2727 (slice-empty? %ecx)
2728 3d/compare-eax-and 0/imm32
2729 75/jump-if-!= $check-no-tokens-left:end/disp8
2730
2731
2732 8b/-> *edx 0/r32/eax
2733 8a/copy-byte *eax 0/r32/AL
2734 81 4/subop/and %eax 0xff/imm32
2735
2736 3d/compare-eax-and 0x23/imm32/hash
2737 74/jump-if-= $check-no-tokens-left:end/disp8
2738
2739 (write-buffered Stderr "'{' or '}' should be on its own line, but got '")
2740 (rewind-stream %ecx)
2741 (write-stream 2 %ecx)
2742 (write-buffered Stderr "'\n")
2743 (flush Stderr)
2744
2745 bb/copy-to-ebx 1/imm32
2746 b8/copy-to-eax 1/imm32/exit
2747 cd/syscall 0x80/imm8
2748
2749 $check-no-tokens-left:end:
2750
2751 81 0/subop/add %esp 8/imm32
2752
2753 59/pop-to-ecx
2754 58/pop-to-eax
2755
2756 89/<- %esp 5/r32/ebp
2757 5d/pop-to-ebp
2758 c3/return
2759
2760 parse-mu-named-block:
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793 55/push-ebp
2794 89/<- %ebp 4/r32/esp
2795
2796 $parse-mu-named-block:end:
2797
2798
2799
2800 89/<- %esp 5/r32/ebp
2801 5d/pop-to-ebp
2802 c3/return
2803
2804 parse-mu-var-def:
2805
2806
2807
2808 55/push-ebp
2809 89/<- %ebp 4/r32/esp
2810
2811 51/push-ecx
2812 52/push-edx
2813
2814 68/push 0/imm32/end
2815 68/push 0/imm32/start
2816 89/<- %ecx 4/r32/esp
2817
2818 (next-word *(ebp+8) %ecx)
2819 (parse-var-with-type %ecx *(ebp+8))
2820 89/<- %edx 0/r32/eax
2821
2822 8b/-> *(edx+0x10) 0/r32/eax
2823 3d/compare-eax-and 0/imm32
2824 {
2825 75/jump-if-not-equal break/disp8
2826
2827 (new-vardef Heap %edx)
2828 eb/jump $parse-mu-var-def:end/disp8
2829 }
2830
2831 {
2832 74/jump-if-equal break/disp8
2833
2834 (next-word *(ebp+8) %ecx)
2835 (slice-equal? %ecx "<-")
2836 3d/compare-eax-and 0/imm32
2837 74/jump-if-equal $parse-mu-var-def:abort/disp8
2838
2839 (new-regvardef Heap %edx)
2840 (add-operation-and-inputs-to-stmt %eax *(ebp+8) *(ebp+0xc))
2841 }
2842 $parse-mu-var-def:end:
2843
2844 81 0/subop/add %esp 8/imm32
2845
2846 5a/pop-to-edx
2847 59/pop-to-ecx
2848
2849 89/<- %esp 5/r32/ebp
2850 5d/pop-to-ebp
2851 c3/return
2852
2853 $parse-mu-var-def:abort:
2854 (rewind-stream *(ebp+8))
2855
2856 (write-buffered Stderr "register variable requires a valid instruction to initialize but got '")
2857 (flush Stderr)
2858 (write-stream 2 *(ebp+8))
2859 (write-buffered Stderr "'\n")
2860 (flush Stderr)
2861
2862 bb/copy-to-ebx 1/imm32
2863 b8/copy-to-eax 1/imm32/exit
2864 cd/syscall 0x80/imm8
2865
2866
2867 test-parse-mu-var-def:
2868
2869
2870 55/push-ebp
2871 89/<- %ebp 4/r32/esp
2872
2873 (clear-stream _test-input-stream)
2874 (write _test-input-stream "n: int\n")
2875
2876 81 5/subop/subtract %esp 0x10/imm32
2877 68/push 0x10/imm32/length
2878 68/push 0/imm32/top
2879 89/<- %ecx 4/r32/esp
2880 (clear-stack %ecx)
2881
2882 (parse-mu-var-def _test-input-stream %ecx)
2883
2884 (check-ints-equal *eax 2 "F - test-parse-mu-var-def/tag")
2885 8b/-> *(eax+4) 0/r32/eax
2886 (check-strings-equal *eax "n" "F - test-parse-mu-var-def/var-name")
2887 (check-ints-equal *(eax+0x10) 0 "F - test-parse-mu-var-def/var-register")
2888
2889
2890
2891 8b/-> *(eax+4) 0/r32/eax
2892 (check-ints-equal *eax 1 "F - test-parse-mu-var-def/var-type:0")
2893 (check-ints-equal *(eax+4) 0 "F - test-parse-mu-var-def/var-type:0")
2894
2895 89/<- %esp 5/r32/ebp
2896 5d/pop-to-ebp
2897 c3/return
2898
2899 test-parse-mu-reg-var-def:
2900
2901
2902 55/push-ebp
2903 89/<- %ebp 4/r32/esp
2904
2905 (clear-stream _test-input-stream)
2906 (write _test-input-stream "n/eax: int <- copy 0\n")
2907
2908 81 5/subop/subtract %esp 0x10/imm32
2909 68/push 0x10/imm32/length
2910 68/push 0/imm32/top
2911 89/<- %ecx 4/r32/esp
2912 (clear-stack %ecx)
2913
2914 (parse-mu-var-def _test-input-stream %ecx)
2915
2916 (check-ints-equal *eax 3 "F - test-parse-mu-reg-var-def/tag")
2917 8b/-> *(eax+0xc) 0/r32/eax
2918 (check-strings-equal *eax "n" "F - test-parse-mu-reg-var-def/var-name")
2919 (check-strings-equal *(eax+0x10) "eax" "F - test-parse-mu-reg-var-def/var-register")
2920
2921
2922
2923 8b/-> *(eax+4) 0/r32/eax
2924 (check-ints-equal *eax 1 "F - test-parse-mu-reg-var-def/var-type:0")
2925 (check-ints-equal *(eax+4) 0 "F - test-parse-mu-reg-var-def/var-type:0")
2926
2927 89/<- %esp 5/r32/ebp
2928 5d/pop-to-ebp
2929 c3/return
2930
2931 parse-mu-stmt:
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945 55/push-ebp
2946 89/<- %ebp 4/r32/esp
2947
2948 51/push-ecx
2949 57/push-edi
2950
2951 68/push 0/imm32/end
2952 68/push 0/imm32/start
2953 89/<- %ecx 4/r32/esp
2954
2955 (allocate Heap *Stmt-size)
2956 (zero-out %eax *Stmt-size)
2957 89/<- %edi 0/r32/eax
2958
2959 c7 0/subop/copy *edi 1/imm32/stmt1
2960 {
2961 (stmt-has-outputs? *(ebp+8))
2962 3d/compare-eax-and 0/imm32
2963 0f 84/jump-if-= break/disp32
2964 {
2965 $parse-mu-stmt:read-outputs:
2966
2967 (next-word *(ebp+8) %ecx)
2968
2969 (slice-empty? %ecx)
2970 3d/compare-eax-and 0/imm32
2971 0f 85/jump-if-!= break/disp32
2972
2973 (slice-equal? %ecx "<-")
2974 3d/compare-eax-and 0/imm32
2975 75/jump-if-!= break/disp8
2976
2977 (is-identifier? %ecx)
2978 3d/compare-eax-and 0/imm32
2979 0f 84/jump-if-= $parse-mu-stmt:abort/disp32
2980
2981 (lookup-or-define-var %ecx *(ebp+0xc) *(ebp+0x10))
2982 (append-list Heap %eax *(edi+0xc))
2983 89/<- *(edi+0xc) 0/r32/eax
2984 e9/jump loop/disp32
2985 }
2986 }
2987 (add-operation-and-inputs-to-stmt %edi *(ebp+8) *(ebp+0xc))
2988 $parse-mu-stmt:end:
2989
2990 89/<- %eax 7/r32/edi
2991
2992 81 0/subop/add %esp 8/imm32
2993
2994 5f/pop-to-edi
2995 59/pop-to-ecx
2996
2997 89/<- %esp 5/r32/ebp
2998 5d/pop-to-ebp
2999 c3/return
3000
3001 $parse-mu-stmt:abort:
3002
3003 (write-buffered Stderr "invalid identifier '")
3004 (write-slice-buffered Stderr %ecx)
3005 (write-buffered Stderr "'\n")
3006 (flush Stderr)
3007
3008 bb/copy-to-ebx 1/imm32
3009 b8/copy-to-eax 1/imm32/exit
3010 cd/syscall 0x80/imm8
3011
3012
3013 add-operation-and-inputs-to-stmt:
3014
3015
3016
3017
3018
3019
3020
3021
3022 55/push-ebp
3023 89/<- %ebp 4/r32/esp
3024
3025 50/push-eax
3026 51/push-ecx
3027 57/push-edi
3028
3029 8b/-> *(ebp+8) 7/r32/edi
3030
3031 68/push 0/imm32/end
3032 68/push 0/imm32/start
3033 89/<- %ecx 4/r32/esp
3034 $add-operation-and-inputs-to-stmt:read-operation:
3035 (next-word *(ebp+0xc) %ecx)
3036 (slice-to-string Heap %ecx)
3037 89/<- *(edi+4) 0/r32/eax
3038 {
3039 $add-operation-and-inputs-to-stmt:read-inouts:
3040
3041 (next-word-or-string *(ebp+0xc) %ecx)
3042
3043 (slice-empty? %ecx)
3044 3d/compare-eax-and 0/imm32
3045 0f 85/jump-if-!= break/disp32
3046
3047 (slice-equal? %ecx "<-")
3048 3d/compare-eax-and 0/imm32
3049 0f 85/jump-if-!= $add-operation-and-inputs-to-stmt:abort/disp32
3050
3051 (lookup-var-or-literal %ecx *(ebp+0x10))
3052 (append-list Heap %eax *(edi+8))
3053 89/<- *(edi+8) 0/r32/eax
3054 e9/jump loop/disp32
3055 }
3056 $add-operation-and-inputs-to-stmt:end:
3057
3058 81 0/subop/add %esp 8/imm32
3059
3060 5f/pop-to-edi
3061 59/pop-to-ecx
3062 58/pop-to-eax
3063
3064 89/<- %esp 5/r32/ebp
3065 5d/pop-to-ebp
3066 c3/return
3067
3068 $add-operation-and-inputs-to-stmt:abort:
3069
3070 (rewind-stream *(ebp+8))
3071 (write-buffered Stderr "invalid identifier '")
3072 (flush Stderr)
3073 (write-stream 2 *(ebp+8))
3074 (write-buffered Stderr "'\n")
3075 (flush Stderr)
3076
3077 bb/copy-to-ebx 1/imm32
3078 b8/copy-to-eax 1/imm32/exit
3079 cd/syscall 0x80/imm8
3080
3081
3082 stmt-has-outputs?:
3083
3084 55/push-ebp
3085 89/<- %ebp 4/r32/esp
3086
3087 51/push-ecx
3088
3089 68/push 0/imm32/end
3090 68/push 0/imm32/start
3091 89/<- %ecx 4/r32/esp
3092
3093 b8/copy-to-eax 0/imm32/false
3094 (rewind-stream *(ebp+8))
3095 {
3096 (next-word-or-string *(ebp+8) %ecx)
3097
3098 (slice-empty? %ecx)
3099 3d/compare-eax-and 0/imm32
3100 b8/copy-to-eax 0/imm32/false/result
3101 0f 85/jump-if-!= break/disp32
3102
3103
3104 8b/-> *ecx 0/r32/eax
3105 8a/copy-byte *eax 0/r32/AL
3106 81 4/subop/and %eax 0xff/imm32
3107
3108 3d/compare-eax-and 0x23/imm32/hash
3109 b8/copy-to-eax 0/imm32/false/result
3110 0f 84/jump-if-= break/disp32
3111
3112 (slice-equal? %ecx "<-")
3113 3d/compare-eax-and 0/imm32
3114 74/jump-if-= loop/disp8
3115 b8/copy-to-eax 1/imm32/true
3116 }
3117 $stmt-has-outputs:end:
3118 (rewind-stream *(ebp+8))
3119
3120 81 0/subop/add %esp 8/imm32
3121
3122 59/pop-to-ecx
3123
3124 89/<- %esp 5/r32/ebp
3125 5d/pop-to-ebp
3126 c3/return
3127
3128
3129
3130 lookup-var-or-literal:
3131
3132 55/push-ebp
3133 89/<- %ebp 4/r32/esp
3134
3135 51/push-ecx
3136 56/push-esi
3137
3138 8b/-> *(ebp+8) 6/r32/esi
3139
3140 (slice-empty? %esi)
3141 3d/compare-eax-and 0/imm32
3142 0f 85/jump-if-!= $lookup-var-or-literal:abort/disp32
3143
3144 8b/-> *esi 1/r32/ecx
3145 8a/copy-byte *ecx 1/r32/CL
3146 81 4/subop/and %ecx 0xff/imm32
3147
3148 (is-decimal-digit? %ecx)
3149 81 7/subop/compare %eax 0/imm32
3150 {
3151 74/jump-if-= break/disp8
3152 (new-literal-integer Heap %esi)
3153 }
3154
3155 {
3156 75/jump-if-!= break/disp8
3157 (lookup-var %esi *(ebp+0xc))
3158 }
3159 $lookup-var-or-literal:end:
3160
3161 5e/pop-to-esi
3162 59/pop-to-ecx
3163
3164 89/<- %esp 5/r32/ebp
3165 5d/pop-to-ebp
3166 c3/return
3167
3168 $lookup-var-or-literal:abort:
3169 (write-buffered Stderr "empty variable!")
3170 (flush Stderr)
3171
3172 bb/copy-to-ebx 1/imm32
3173 b8/copy-to-eax 1/imm32/exit
3174 cd/syscall 0x80/imm8
3175
3176
3177
3178 lookup-var:
3179
3180 55/push-ebp
3181 89/<- %ebp 4/r32/esp
3182
3183 (slice-to-string Heap *(ebp+8))
3184
3185 (lookup-var-helper %eax *(ebp+0xc))
3186
3187 3d/compare-eax-and 0/imm32
3188 74/jump-if-= $lookup-var:abort/disp8
3189 $lookup-var:end:
3190
3191 89/<- %esp 5/r32/ebp
3192 5d/pop-to-ebp
3193 c3/return
3194
3195 $lookup-var:abort:
3196 (write-buffered Stderr "unknown variable '")
3197 (write-slice-buffered Stderr *(ebp+8))
3198 (write-buffered Stderr "'\n")
3199 (flush Stderr)
3200
3201 bb/copy-to-ebx 1/imm32
3202 b8/copy-to-eax 1/imm32/exit
3203 cd/syscall 0x80/imm8
3204
3205
3206
3207 lookup-var-helper:
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218 55/push-ebp
3219 89/<- %ebp 4/r32/esp
3220
3221 52/push-edx
3222 53/push-ebx
3223 56/push-esi
3224
3225 8b/-> *(ebp+0xc) 6/r32/esi
3226
3227 8b/-> *esi 3/r32/ebx
3228
3229 3b/compare 0/r32/eax *(esi+4)
3230 0f 8f/jump-if-> $lookup-var-helper:error1/disp32
3231
3232 8d/copy-address *(esi+8) 2/r32/edx
3233
3234 81 5/subop/subtract %ebx 4/imm32
3235 8d/copy-address *(esi+ebx+8) 3/r32/ebx
3236 {
3237
3238 39/compare %ebx 2/r32/edx
3239 b8/copy-to-eax 0/imm32
3240 0f 82/jump-if-addr< break/disp32
3241
3242 8b/-> *ebx 0/r32/eax
3243
3244 (string-equal? *eax *(ebp+8))
3245 3d/compare-eax-and 0/imm32
3246 8b/-> *ebx 0/r32/eax
3247 75/jump-if-!= break/disp8
3248
3249 81 5/subop/subtract %ebx 4/imm32
3250 e9/jump loop/disp32
3251 }
3252 $lookup-var-helper:end:
3253
3254 5e/pop-to-esi
3255 5b/pop-to-ebx
3256 5a/pop-to-edx
3257
3258 89/<- %esp 5/r32/ebp
3259 5d/pop-to-ebp
3260 c3/return
3261
3262 $lookup-var-helper:error1:
3263 (write-buffered Stderr "malformed stack when looking up '")
3264 (write-slice-buffered Stderr *(ebp+8))
3265 (write-buffered Stderr "'\n")
3266 (flush Stderr)
3267
3268 bb/copy-to-ebx 1/imm32
3269 b8/copy-to-eax 1/imm32/exit
3270 cd/syscall 0x80/imm8
3271
3272
3273
3274 lookup-or-define-var:
3275
3276 55/push-ebp
3277 89/<- %ebp 4/r32/esp
3278
3279 51/push-ecx
3280
3281 (slice-to-string Heap *(ebp+8))
3282 89/<- %ecx 0/r32/eax
3283
3284 (lookup-var-helper *(ebp+8) *(ebp+0xc))
3285 {
3286
3287 3d/compare-eax-and 0/imm32
3288 75/jump-if-!= break/disp8
3289
3290 {
3291 (find-in-function-outputs *(ebp+0x10) %ecx)
3292 3d/compare-eax-and 0/imm32
3293
3294 0f 84/jump-if-!= $lookup-var:abort/disp32
3295 }
3296 }
3297 $lookup-or-define-var:end:
3298
3299 59/pop-to-ecx
3300
3301 89/<- %esp 5/r32/ebp
3302 5d/pop-to-ebp
3303 c3/return
3304
3305 find-in-function-outputs:
3306
3307 55/push-ebp
3308 89/<- %ebp 4/r32/esp
3309
3310 51/push-ecx
3311
3312 8b/-> *(ebp+8) 1/r32/ecx
3313 8b/-> *(ecx+0xc) 1/r32/ecx
3314
3315 {
3316 81 7/subop/compare %ecx 0/imm32
3317 74/jump-if-= break/disp8
3318
3319 8b/-> *ecx 0/r32/eax
3320
3321 50/push-eax
3322 (string-equal? *eax *(ebp+0xc))
3323 3d/compare-eax-and 0/imm32
3324 58/pop-to-eax
3325 75/jump-if-!= $find-in-function-outputs:end/disp8
3326
3327 8b/-> *(ecx+4) 1/r32/ecx
3328 eb/jump loop/disp8
3329 }
3330 b8/copy-to-eax 0/imm32
3331 $find-in-function-outputs:end:
3332
3333 59/pop-to-ecx
3334
3335 89/<- %esp 5/r32/ebp
3336 5d/pop-to-ebp
3337 c3/return
3338
3339 test-parse-mu-stmt:
3340
3341
3342 55/push-ebp
3343 89/<- %ebp 4/r32/esp
3344
3345 (clear-stream _test-input-stream)
3346 (write _test-input-stream "increment n\n")
3347
3348 81 5/subop/subtract %esp 0x10/imm32
3349 68/push 0x10/imm32/length
3350 68/push 0/imm32/top
3351 89/<- %ecx 4/r32/esp
3352 (clear-stack %ecx)
3353
3354 81 5/subop/subtract %esp 0x14/imm32
3355 89/<- %edx 4/r32/esp
3356 (zero-out %edx 0x14)
3357
3358 c7 0/subop/copy *edx "n"/imm32
3359
3360 (push %ecx %edx)
3361
3362 (parse-mu-stmt _test-input-stream %ecx)
3363
3364 (check-ints-equal *eax 1 "F - test-parse-mu-stmt/tag")
3365 (check-strings-equal *(eax+4) "increment" "F - test-parse-mu-stmt/name")
3366
3367 8b/-> *(eax+8) 2/r32/edx
3368
3369 8b/-> *edx 3/r32/ebx
3370 (check-strings-equal *ebx "n" "F - test-parse-mu-stmt/inout:0")
3371
3372 89/<- %esp 5/r32/ebp
3373 5d/pop-to-ebp
3374 c3/return
3375
3376 new-function:
3377
3378 55/push-ebp
3379 89/<- %ebp 4/r32/esp
3380
3381 51/push-ecx
3382
3383 (allocate *(ebp+8) *Function-size)
3384 8b/-> *(ebp+0xc) 1/r32/ecx
3385 89/<- *eax 1/r32/ecx
3386 8b/-> *(ebp+0x10) 1/r32/ecx
3387 89/<- *(eax+4) 1/r32/ecx
3388 8b/-> *(ebp+0x14) 1/r32/ecx
3389 89/<- *(eax+8) 1/r32/ecx
3390 8b/-> *(ebp+0x18) 1/r32/ecx
3391 89/<- *(eax+0xc) 1/r32/ecx
3392 8b/-> *(ebp+0x1c) 1/r32/ecx
3393 89/<- *(eax+0x10) 1/r32/ecx
3394 8b/-> *(ebp+0x20) 1/r32/ecx
3395 89/<- *(eax+0x14) 1/r32/ecx
3396 $new-function:end:
3397
3398 59/pop-to-ecx
3399
3400 89/<- %esp 5/r32/ebp
3401 5d/pop-to-ebp
3402 c3/return
3403
3404 new-var:
3405
3406 55/push-ebp
3407 89/<- %ebp 4/r32/esp
3408
3409 51/push-ecx
3410
3411 (allocate *(ebp+8) *Var-size)
3412 8b/-> *(ebp+0xc) 1/r32/ecx
3413 89/<- *eax 1/r32/ecx
3414 8b/-> *(ebp+0x10) 1/r32/ecx
3415 89/<- *(eax+4) 1/r32/ecx
3416 8b/-> *(ebp+0x14) 1/r32/ecx
3417 89/<- *(eax+8) 1/r32/ecx
3418 8b/-> *(ebp+0x18) 1/r32/ecx
3419 89/<- *(eax+0xc) 1/r32/ecx
3420 8b/-> *(ebp+0x1c) 1/r32/ecx
3421 89/<- *(eax+0x10) 1/r32/ecx
3422 $new-var:end:
3423
3424 59/pop-to-ecx
3425
3426 89/<- %esp 5/r32/ebp
3427 5d/pop-to-ebp
3428 c3/return
3429
3430 new-literal-integer:
3431
3432 55/push-ebp
3433 89/<- %ebp 4/r32/esp
3434
3435 51/push-ecx
3436
3437 (is-hex-int? *(ebp+0xc))
3438 3d/compare-eax-and 0/imm32
3439 0f 84/jump-if-= $new-literal-integer:abort/disp32
3440
3441 (slice-to-string Heap *(ebp+0xc))
3442 89/<- %ecx 0/r32/eax
3443
3444 (allocate *(ebp+8) *Var-size)
3445 89/<- *eax 1/r32/ecx
3446 89/<- %ecx 0/r32/eax
3447 (allocate *(ebp+8) *Tree-size)
3448 89/<- *(ecx+4) 0/r32/eax
3449 89/<- %eax 1/r32/ecx
3450 c7 0/subop/copy *(eax+8) 0/imm32
3451 c7 0/subop/copy *(eax+0xc) 0/imm32
3452 c7 0/subop/copy *(eax+0x10) 0/imm32
3453 $new-literal-integer:end:
3454
3455 59/pop-to-ecx
3456
3457 89/<- %esp 5/r32/ebp
3458 5d/pop-to-ebp
3459 c3/return
3460
3461 $new-literal-integer:abort:
3462 (write-buffered Stderr "variable cannot begin with a digit '")
3463 (write-slice-buffered Stderr *(ebp+0xc))
3464 (write-buffered Stderr "'\n")
3465 (flush Stderr)
3466
3467 bb/copy-to-ebx 1/imm32
3468 b8/copy-to-eax 1/imm32/exit
3469 cd/syscall 0x80/imm8
3470
3471
3472 new-block:
3473
3474 55/push-ebp
3475 89/<- %ebp 4/r32/esp
3476
3477 51/push-ecx
3478
3479 (allocate *(ebp+8) *Stmt-size)
3480 (zero-out %eax *Stmt-size)
3481 c7 0/subop/copy *eax 0/imm32/tag/block
3482 8b/-> *(ebp+0xc) 1/r32/ecx
3483 89/<- *(eax+4) 1/r32/ecx
3484 $new-block:end:
3485
3486 59/pop-to-ecx
3487
3488 89/<- %esp 5/r32/ebp
3489 5d/pop-to-ebp
3490 c3/return
3491
3492 new-vardef:
3493
3494 55/push-ebp
3495 89/<- %ebp 4/r32/esp
3496
3497 51/push-ecx
3498
3499 (allocate *(ebp+8) *Stmt-size)
3500 (zero-out %eax *Stmt-size)
3501 c7 0/subop/copy *eax 2/imm32/tag/var-on-stack
3502
3503 8b/-> *(ebp+0xc) 1/r32/ecx
3504 89/<- *(eax+4) 1/r32/ecx
3505 $new-vardef:end:
3506
3507 59/pop-to-ecx
3508
3509 89/<- %esp 5/r32/ebp
3510 5d/pop-to-ebp
3511 c3/return
3512
3513 new-regvardef:
3514
3515 55/push-ebp
3516 89/<- %ebp 4/r32/esp
3517
3518 51/push-ecx
3519
3520 (allocate *(ebp+8) *Stmt-size)
3521 (zero-out %eax *Stmt-size)
3522 c7 0/subop/copy *eax 3/imm32/tag/var-in-register
3523 8b/-> *(ebp+0xc) 1/r32/ecx
3524 89/<- *(eax+0xc) 1/r32/ecx
3525 $new-regvardef:end:
3526
3527 59/pop-to-ecx
3528
3529 89/<- %esp 5/r32/ebp
3530 5d/pop-to-ebp
3531 c3/return
3532
3533 new-named-block:
3534
3535 55/push-ebp
3536 89/<- %ebp 4/r32/esp
3537
3538 51/push-ecx
3539
3540 (allocate *(ebp+8) *Stmt-size)
3541 (zero-out %eax *Stmt-size)
3542 c7 0/subop/copy *eax 4/imm32/tag/named-block
3543 8b/-> *(ebp+0xc) 1/r32/ecx
3544 89/<- *(eax+4) 1/r32/ecx
3545 8b/-> *(ebp+0x10) 1/r32/ecx
3546 89/<- *(eax+8) 1/r32/ecx
3547 $new-named-block:end:
3548
3549 59/pop-to-ecx
3550
3551 89/<- %esp 5/r32/ebp
3552 5d/pop-to-ebp
3553 c3/return
3554
3555 new-list:
3556
3557 55/push-ebp
3558 89/<- %ebp 4/r32/esp
3559
3560 51/push-ecx
3561
3562 (allocate *(ebp+8) *List-size)
3563 8b/-> *(ebp+0xc) 1/r32/ecx
3564 89/<- *eax 1/r32/ecx
3565 8b/-> *(ebp+0x10) 1/r32/ecx
3566 89/<- *(eax+4) 1/r32/ecx
3567 $new-list:end:
3568
3569 59/pop-to-ecx
3570
3571 89/<- %esp 5/r32/ebp
3572 5d/pop-to-ebp
3573 c3/return
3574
3575 append-list:
3576
3577 55/push-ebp
3578 89/<- %ebp 4/r32/esp
3579
3580 51/push-ecx
3581
3582 (allocate *(ebp+8) *List-size)
3583 8b/-> *(ebp+0xc) 1/r32/ecx
3584 89/<- *eax 1/r32/ecx
3585
3586 81 7/subop/compare *(ebp+0x10) 0/imm32
3587 74/jump-if-= $new-list:end/disp8
3588
3589
3590 8b/-> *(ebp+0x10) 1/r32/ecx
3591
3592 {
3593 81 7/subop/compare *(ecx+4) 0/imm32
3594 74/jump-if-= break/disp8
3595
3596 8b/-> *(ecx+4) 1/r32/ecx
3597 eb/jump loop/disp8
3598 }
3599
3600 89/<- *(ecx+4) 0/r32/eax
3601
3602 8b/-> *(ebp+0x10) 0/r32/eax
3603 $append-list:end:
3604
3605 59/pop-to-ecx
3606
3607 89/<- %esp 5/r32/ebp
3608 5d/pop-to-ebp
3609 c3/return
3610
3611 append-to-block:
3612
3613 55/push-ebp
3614 89/<- %ebp 4/r32/esp
3615
3616 56/push-esi
3617
3618 8b/-> *(ebp+0xc) 6/r32/esi
3619 (append-list *(ebp+8) *(ebp+0x10) *(esi+4))
3620 89/<- *(esi+4) 0/r32/eax
3621 $append-to-block:end:
3622
3623 5e/pop-to-esi
3624
3625 89/<- %esp 5/r32/ebp
3626 5d/pop-to-ebp
3627 c3/return
3628
3629
3630
3631
3632
3633 check-mu-types:
3634
3635 55/push-ebp
3636 89/<- %ebp 4/r32/esp
3637
3638 $check-mu-types:end:
3639
3640 89/<- %esp 5/r32/ebp
3641 5d/pop-to-ebp
3642 c3/return
3643
3644 size-of:
3645
3646 55/push-ebp
3647 89/<- %ebp 4/r32/esp
3648
3649 b8/copy-to-eax 4/imm32
3650 $size-of:end:
3651
3652 89/<- %esp 5/r32/ebp
3653 5d/pop-to-ebp
3654 c3/return
3655
3656
3657
3658
3659
3660 emit-subx:
3661
3662 55/push-ebp
3663 89/<- %ebp 4/r32/esp
3664
3665 50/push-eax
3666 51/push-ecx
3667 57/push-edi
3668
3669 8b/-> *(ebp+8) 7/r32/edi
3670
3671 8b/-> *Program 1/r32/ecx
3672 {
3673
3674 81 7/subop/compare %ecx 0/imm32
3675 0f 84/jump-if-= break/disp32
3676 (emit-subx-function %edi %ecx)
3677
3678 8b/-> *(ecx+0x14) 1/r32/ecx
3679 e9/jump loop/disp32
3680 }
3681 $emit-subx:end:
3682
3683 5f/pop-to-edi
3684 59/pop-to-ecx
3685 58/pop-to-eax
3686
3687 89/<- %esp 5/r32/ebp
3688 5d/pop-to-ebp
3689 c3/return
3690
3691 emit-subx-function:
3692
3693 55/push-ebp
3694 89/<- %ebp 4/r32/esp
3695
3696 50/push-eax
3697 51/push-ecx
3698 57/push-edi
3699
3700 8b/-> *(ebp+8) 7/r32/edi
3701
3702 8b/-> *(ebp+0xc) 1/r32/ecx
3703
3704 (write-buffered %edi *ecx)
3705 (write-buffered %edi ":\n")
3706 (emit-subx-prologue %edi)
3707 (emit-subx-block %edi *(ecx+0x10))
3708 (emit-subx-epilogue %edi)
3709 $emit-subx-function:end:
3710
3711 5f/pop-to-edi
3712 59/pop-to-ecx
3713 58/pop-to-eax
3714
3715 89/<- %esp 5/r32/ebp
3716 5d/pop-to-ebp
3717 c3/return
3718
3719 emit-subx-block:
3720
3721 55/push-ebp
3722 89/<- %ebp 4/r32/esp
3723
3724 8b/-> *(ebp+0xc) 6/r32/esi
3725 8b/-> *(esi+4) 6/r32/esi
3726
3727 {
3728 $emit-subx-block:check-empty:
3729 81 7/subop/compare %esi 0/imm32
3730 0f 84/jump-if-= break/disp32
3731 (write-buffered *(ebp+8) "{\n")
3732 {
3733 $emit-subx-block:stmt:
3734 81 7/subop/compare %esi 0/imm32
3735 74/jump-if-= break/disp8
3736 (emit-subx-statement *(ebp+8) *esi Primitives *Program)
3737 (write-buffered *(ebp+8) Newline)
3738 8b/-> *(esi+4) 6/r32/esi
3739 eb/jump loop/disp8
3740 }
3741 (write-buffered *(ebp+8) "}\n")
3742 }
3743 $emit-subx-block:end:
3744
3745 89/<- %esp 5/r32/ebp
3746 5d/pop-to-ebp
3747 c3/return
3748
3749 emit-subx-statement:
3750
3751 55/push-ebp
3752 89/<- %ebp 4/r32/esp
3753
3754 50/push-eax
3755 51/push-ecx
3756
3757 {
3758 $emit-subx-statement:primitive:
3759 (find-matching-primitive *(ebp+0x10) *(ebp+0xc))
3760 3d/compare-eax-and 0/imm32
3761 74/jump-if-= break/disp8
3762 (emit-subx-primitive *(ebp+8) *(ebp+0xc) %eax)
3763 e9/jump $emit-subx-statement:end/disp32
3764 }
3765
3766 {
3767 $emit-subx-statement:call:
3768 (find-matching-function *(ebp+0x14) *(ebp+0xc))
3769 3d/compare-eax-and 0/imm32
3770 74/jump-if-= break/disp8
3771 (emit-subx-call *(ebp+8) *(ebp+0xc) %eax)
3772 e9/jump $emit-subx-statement:end/disp32
3773 }
3774
3775 e9/jump $emit-subx-statement:abort/disp32
3776 $emit-subx-statement:end:
3777
3778 59/pop-to-ecx
3779 58/pop-to-eax
3780
3781 89/<- %esp 5/r32/ebp
3782 5d/pop-to-ebp
3783 c3/return
3784
3785 $emit-subx-statement:abort:
3786
3787 (write-buffered Stderr "couldn't translate '")
3788
3789 (write-buffered Stderr "'\n")
3790 (flush Stderr)
3791
3792 bb/copy-to-ebx 1/imm32
3793 b8/copy-to-eax 1/imm32/exit
3794 cd/syscall 0x80/imm8
3795
3796
3797
3798
3799 == data
3800 Primitives:
3801
3802 _Primitive-inc-eax:
3803
3804 "increment"/imm32/name
3805 0/imm32/no-inouts
3806 Single-int-var-in-eax/imm32/outputs
3807 "40/increment-eax"/imm32/subx-name
3808 0/imm32/no-rm32
3809 0/imm32/no-r32
3810 0/imm32/no-imm32
3811 0/imm32/output-is-write-only
3812 _Primitive-inc-ecx/imm32/next
3813 _Primitive-inc-ecx:
3814
3815 "increment"/imm32/name
3816 0/imm32/no-inouts
3817 Single-int-var-in-ecx/imm32/outputs
3818 "41/increment-ecx"/imm32/subx-name
3819 0/imm32/no-rm32
3820 0/imm32/no-r32
3821 0/imm32/no-imm32
3822 0/imm32/output-is-write-only
3823 _Primitive-inc-edx/imm32/next
3824 _Primitive-inc-edx:
3825
3826 "increment"/imm32/name
3827 0/imm32/no-inouts
3828 Single-int-var-in-edx/imm32/outputs
3829 "42/increment-edx"/imm32/subx-name
3830 0/imm32/no-rm32
3831 0/imm32/no-r32
3832 0/imm32/no-imm32
3833 0/imm32/output-is-write-only
3834 _Primitive-inc-ebx/imm32/next
3835 _Primitive-inc-ebx:
3836
3837 "increment"/imm32/name
3838 0/imm32/no-inouts
3839 Single-int-var-in-ebx/imm32/outputs
3840 "43/increment-ebx"/imm32/subx-name
3841 0/imm32/no-rm32
3842 0/imm32/no-r32
3843 0/imm32/no-imm32
3844 0/imm32/output-is-write-only
3845 _Primitive-inc-esi/imm32/next
3846 _Primitive-inc-esi:
3847
3848 "increment"/imm32/name
3849 0/imm32/no-inouts
3850 Single-int-var-in-esi/imm32/outputs
3851 "46/increment-esi"/imm32/subx-name
3852 0/imm32/no-rm32
3853 0/imm32/no-r32
3854 0/imm32/no-imm32
3855 0/imm32/output-is-write-only
3856 _Primitive-inc-edi/imm32/next
3857 _Primitive-inc-edi:
3858
3859 "increment"/imm32/name
3860 0/imm32/no-inouts
3861 Single-int-var-in-edi/imm32/outputs
3862 "47/increment-edi"/imm32/subx-name
3863 0/imm32/no-rm32
3864 0/imm32/no-r32
3865 0/imm32/no-imm32
3866 0/imm32/output-is-write-only
3867 _Primitive-dec-eax/imm32/next
3868 _Primitive-dec-eax:
3869
3870 "decrement"/imm32/name
3871 0/imm32/no-inouts
3872 Single-int-var-in-eax/imm32/outputs
3873 "48/decrement-eax"/imm32/subx-name
3874 0/imm32/no-rm32
3875 0/imm32/no-r32
3876 0/imm32/no-imm32
3877 0/imm32/output-is-write-only
3878 _Primitive-dec-ecx/imm32/next
3879 _Primitive-dec-ecx:
3880
3881 "decrement"/imm32/name
3882 0/imm32/no-inouts
3883 Single-int-var-in-ecx/imm32/outputs
3884 "49/decrement-ecx"/imm32/subx-name
3885 0/imm32/no-rm32
3886 0/imm32/no-r32
3887 0/imm32/no-imm32
3888 0/imm32/output-is-write-only
3889 _Primitive-dec-edx/imm32/next
3890 _Primitive-dec-edx:
3891
3892 "decrement"/imm32/name
3893 0/imm32/no-inouts
3894 Single-int-var-in-edx/imm32/outputs
3895 "4a/decrement-edx"/imm32/subx-name
3896 0/imm32/no-rm32
3897 0/imm32/no-r32
3898 0/imm32/no-imm32
3899 0/imm32/output-is-write-only
3900 _Primitive-dec-ebx/imm32/next
3901 _Primitive-dec-ebx:
3902
3903 "decrement"/imm32/name
3904 0/imm32/no-inouts
3905 Single-int-var-in-ebx/imm32/outputs
3906 "4b/decrement-ebx"/imm32/subx-name
3907 0/imm32/no-rm32
3908 0/imm32/no-r32
3909 0/imm32/no-imm32
3910 0/imm32/output-is-write-only
3911 _Primitive-dec-esi/imm32/next
3912 _Primitive-dec-esi:
3913
3914 "decrement"/imm32/name
3915 0/imm32/no-inouts
3916 Single-int-var-in-esi/imm32/outputs
3917 "4e/decrement-esi"/imm32/subx-name
3918 0/imm32/no-rm32
3919 0/imm32/no-r32
3920 0/imm32/no-imm32
3921 0/imm32/output-is-write-only
3922 _Primitive-dec-edi/imm32/next
3923 _Primitive-dec-edi:
3924
3925 "decrement"/imm32/name
3926 0/imm32/no-inouts
3927 Single-int-var-in-edi/imm32/outputs
3928 "4f/decrement-edi"/imm32/subx-name
3929 0/imm32/no-rm32
3930 0/imm32/no-r32
3931 0/imm32/no-imm32
3932 0/imm32/output-is-write-only
3933 _Primitive-inc-mem/imm32/next
3934 _Primitive-inc-mem:
3935
3936 "increment"/imm32/name
3937 Single-int-var-on-stack/imm32/inouts
3938 0/imm32/no-outputs
3939 "ff 0/subop/increment"/imm32/subx-name
3940 1/imm32/rm32-is-first-inout
3941 0/imm32/no-r32
3942 0/imm32/no-imm32
3943 0/imm32/output-is-write-only
3944 _Primitive-inc-reg/imm32/next
3945 _Primitive-inc-reg:
3946
3947 "increment"/imm32/name
3948 0/imm32/no-inouts
3949 Single-int-var-in-some-register/imm32/outputs
3950 "ff 0/subop/increment"/imm32/subx-name
3951 3/imm32/rm32-is-first-output
3952 0/imm32/no-r32
3953 0/imm32/no-imm32
3954 0/imm32/output-is-write-only
3955 _Primitive-dec-mem/imm32/next
3956 _Primitive-dec-mem:
3957
3958 "decrement"/imm32/name
3959 Single-int-var-on-stack/imm32/inouts
3960 0/imm32/no-outputs
3961 "ff 1/subop/decrement"/imm32/subx-name
3962 1/imm32/rm32-is-first-inout
3963 0/imm32/no-r32
3964 0/imm32/no-imm32
3965 0/imm32/output-is-write-only
3966 _Primitive-dec-reg/imm32/next
3967 _Primitive-dec-reg:
3968
3969 "decrement"/imm32/name
3970 0/imm32/no-inouts
3971 Single-int-var-in-some-register/imm32/outputs
3972 "ff 1/subop/decrement"/imm32/subx-name
3973 3/imm32/rm32-is-first-output
3974 0/imm32/no-r32
3975 0/imm32/no-imm32
3976 0/imm32/output-is-write-only
3977 _Primitive-add-to-eax/imm32/next
3978
3979 _Primitive-add-to-eax:
3980
3981 "add"/imm32/name
3982 Single-lit-var/imm32/inouts
3983 Single-int-var-in-eax/imm32/outputs
3984 "05/add-to-eax"/imm32/subx-name
3985 0/imm32/no-rm32
3986 0/imm32/no-r32
3987 1/imm32/imm32-is-first-inout
3988 0/imm32/output-is-write-only
3989 _Primitive-add-reg-to-reg/imm32/next
3990 _Primitive-add-reg-to-reg:
3991
3992 "add"/imm32/name
3993 Single-int-var-in-some-register/imm32/inouts
3994 Single-int-var-in-some-register/imm32/outputs
3995 "01/add-to"/imm32/subx-name
3996 3/imm32/rm32-is-first-output
3997 1/imm32/r32-is-first-inout
3998 0/imm32/no-imm32
3999 0/imm32/output-is-write-only
4000 _Primitive-add-reg-to-mem/imm32/next
4001 _Primitive-add-reg-to-mem:
4002
4003 "add-to"/imm32/name
4004 Int-var-and-second-int-var-in-some-register/imm32/inouts
4005 0/imm32/outputs
4006 "01/add-to"/imm32/subx-name
4007 1/imm32/rm32-is-first-inout
4008 2/imm32/r32-is-second-inout
4009 0/imm32/no-imm32
4010 0/imm32/output-is-write-only
4011 _Primitive-add-mem-to-reg/imm32/next
4012 _Primitive-add-mem-to-reg:
4013
4014 "add"/imm32/name
4015 Single-int-var-on-stack/imm32/inouts
4016 Single-int-var-in-some-register/imm32/outputs
4017 "03/add"/imm32/subx-name
4018 1/imm32/rm32-is-first-inout
4019 3/imm32/r32-is-first-output
4020 0/imm32/no-imm32
4021 0/imm32/output-is-write-only
4022 _Primitive-add-lit-to-reg/imm32/next
4023 _Primitive-add-lit-to-reg:
4024
4025 "add"/imm32/name
4026 Single-lit-var/imm32/inouts
4027 Single-int-var-in-some-register/imm32/outputs
4028 "81 0/subop/add"/imm32/subx-name
4029 3/imm32/rm32-is-first-output
4030 0/imm32/no-r32
4031 1/imm32/imm32-is-first-inout
4032 0/imm32/output-is-write-only
4033 _Primitive-add-lit-to-mem/imm32/next
4034 _Primitive-add-lit-to-mem:
4035
4036 "add-to"/imm32/name
4037 Int-var-and-literal/imm32/inouts
4038 0/imm32/outputs
4039 "81 0/subop/add"/imm32/subx-name
4040 1/imm32/rm32-is-first-inout
4041 0/imm32/no-r32
4042 2/imm32/imm32-is-first-inout
4043 0/imm32/output-is-write-only
4044 _Primitive-subtract-from-eax/imm32/next
4045
4046 _Primitive-subtract-from-eax:
4047
4048 "subtract"/imm32/name
4049 Single-lit-var/imm32/inouts
4050 Single-int-var-in-eax/imm32/outputs
4051 "2d/subtract-from-eax"/imm32/subx-name
4052 0/imm32/no-rm32
4053 0/imm32/no-r32
4054 1/imm32/imm32-is-first-inout
4055 0/imm32/output-is-write-only
4056 _Primitive-subtract-reg-from-reg/imm32/next
4057 _Primitive-subtract-reg-from-reg:
4058
4059 "subtract"/imm32/name
4060 Single-int-var-in-some-register/imm32/inouts
4061 Single-int-var-in-some-register/imm32/outputs
4062 "29/subtract-from"/imm32/subx-name
4063 3/imm32/rm32-is-first-output
4064 1/imm32/r32-is-first-inout
4065 0/imm32/no-imm32
4066 0/imm32/output-is-write-only
4067 _Primitive-subtract-reg-from-mem/imm32/next
4068 _Primitive-subtract-reg-from-mem:
4069
4070 "subtract-from"/imm32/name
4071 Int-var-and-second-int-var-in-some-register/imm32/inouts
4072 0/imm32/outputs
4073 "29/subtract-from"/imm32/subx-name
4074 1/imm32/rm32-is-first-inout
4075 2/imm32/r32-is-second-inout
4076 0/imm32/no-imm32
4077 0/imm32/output-is-write-only
4078 _Primitive-subtract-mem-from-reg/imm32/next
4079 _Primitive-subtract-mem-from-reg:
4080
4081 "subtract"/imm32/name
4082 Single-int-var-on-stack/imm32/inouts
4083 Single-int-var-in-some-register/imm32/outputs
4084 "2b/subtract"/imm32/subx-name
4085 1/imm32/rm32-is-first-inout
4086 3/imm32/r32-is-first-output
4087 0/imm32/no-imm32
4088 0/imm32/output-is-write-only
4089 _Primitive-subtract-lit-from-reg/imm32/next
4090 _Primitive-subtract-lit-from-reg:
4091
4092 "subtract"/imm32/name
4093 Single-lit-var/imm32/inouts
4094 Single-int-var-in-some-register/imm32/outputs
4095 "81 5/subop/subtract"/imm32/subx-name
4096 3/imm32/rm32-is-first-output
4097 0/imm32/no-r32
4098 1/imm32/imm32-is-first-inout
4099 0/imm32/output-is-write-only
4100 _Primitive-subtract-lit-from-mem/imm32/next
4101 _Primitive-subtract-lit-from-mem:
4102
4103 "subtract-from"/imm32/name
4104 Int-var-and-literal/imm32/inouts
4105 0/imm32/outputs
4106 "81 5/subop/subtract"/imm32/subx-name
4107 1/imm32/rm32-is-first-inout
4108 0/imm32/no-r32
4109 2/imm32/imm32-is-first-inout
4110 0/imm32/output-is-write-only
4111 _Primitive-and-with-eax/imm32/next
4112
4113 _Primitive-and-with-eax:
4114
4115 "and"/imm32/name
4116 Single-lit-var/imm32/inouts
4117 Single-int-var-in-eax/imm32/outputs
4118 "25/and-with-eax"/imm32/subx-name
4119 0/imm32/no-rm32
4120 0/imm32/no-r32
4121 1/imm32/imm32-is-first-inout
4122 0/imm32/output-is-write-only
4123 _Primitive-and-reg-with-reg/imm32/next
4124 _Primitive-and-reg-with-reg:
4125
4126 "and"/imm32/name
4127 Single-int-var-in-some-register/imm32/inouts
4128 Single-int-var-in-some-register/imm32/outputs
4129 "21/and-with"/imm32/subx-name
4130 3/imm32/rm32-is-first-output
4131 1/imm32/r32-is-first-inout
4132 0/imm32/no-imm32
4133 0/imm32/output-is-write-only
4134 _Primitive-and-reg-with-mem/imm32/next
4135 _Primitive-and-reg-with-mem:
4136
4137 "and-with"/imm32/name
4138 Int-var-and-second-int-var-in-some-register/imm32/inouts
4139 0/imm32/outputs
4140 "21/and-with"/imm32/subx-name
4141 1/imm32/rm32-is-first-inout
4142 2/imm32/r32-is-second-inout
4143 0/imm32/no-imm32
4144 0/imm32/output-is-write-only
4145 _Primitive-and-mem-with-reg/imm32/next
4146 _Primitive-and-mem-with-reg:
4147
4148 "and"/imm32/name
4149 Single-int-var-on-stack/imm32/inouts
4150 Single-int-var-in-some-register/imm32/outputs
4151 "23/and"/imm32/subx-name
4152 1/imm32/rm32-is-first-inout
4153 3/imm32/r32-is-first-output
4154 0/imm32/no-imm32
4155 0/imm32/output-is-write-only
4156 _Primitive-and-lit-with-reg/imm32/next
4157 _Primitive-and-lit-with-reg:
4158
4159 "and"/imm32/name
4160 Single-lit-var/imm32/inouts
4161 Single-int-var-in-some-register/imm32/outputs
4162 "81 4/subop/and"/imm32/subx-name
4163 3/imm32/rm32-is-first-output
4164 0/imm32/no-r32
4165 1/imm32/imm32-is-first-inout
4166 0/imm32/output-is-write-only
4167 _Primitive-and-lit-with-mem/imm32/next
4168 _Primitive-and-lit-with-mem:
4169
4170 "and-with"/imm32/name
4171 Int-var-and-literal/imm32/inouts
4172 0/imm32/outputs
4173 "81 4/subop/and"/imm32/subx-name
4174 1/imm32/rm32-is-first-inout
4175 0/imm32/no-r32
4176 2/imm32/imm32-is-first-inout
4177 0/imm32/output-is-write-only
4178 _Primitive-or-with-eax/imm32/next
4179
4180 _Primitive-or-with-eax:
4181
4182 "or"/imm32/name
4183 Single-lit-var/imm32/inouts
4184 Single-int-var-in-eax/imm32/outputs
4185 "0d/or-with-eax"/imm32/subx-name
4186 0/imm32/no-rm32
4187 0/imm32/no-r32
4188 1/imm32/imm32-is-first-inout
4189 0/imm32/output-is-write-only
4190 _Primitive-or-reg-with-reg/imm32/next
4191 _Primitive-or-reg-with-reg:
4192
4193 "or"/imm32/name
4194 Single-int-var-in-some-register/imm32/inouts
4195 Single-int-var-in-some-register/imm32/outputs
4196 "09/or-with"/imm32/subx-name
4197 3/imm32/rm32-is-first-output
4198 1/imm32/r32-is-first-inout
4199 0/imm32/no-imm32
4200 0/imm32/output-is-write-only
4201 _Primitive-or-reg-with-mem/imm32/next
4202 _Primitive-or-reg-with-mem:
4203
4204 "or-with"/imm32/name
4205 Int-var-and-second-int-var-in-some-register/imm32/inouts
4206 0/imm32/outputs
4207 "09/or-with"/imm32/subx-name
4208 1/imm32/rm32-is-first-inout
4209 2/imm32/r32-is-second-inout
4210 0/imm32/no-imm32
4211 0/imm32/output-is-write-only
4212 _Primitive-or-mem-with-reg/imm32/next
4213 _Primitive-or-mem-with-reg:
4214
4215 "or"/imm32/name
4216 Single-int-var-on-stack/imm32/inouts
4217 Single-int-var-in-some-register/imm32/outputs
4218 "0b/or"/imm32/subx-name
4219 1/imm32/rm32-is-first-inout
4220 3/imm32/r32-is-first-output
4221 0/imm32/no-imm32
4222 0/imm32/output-is-write-only
4223 _Primitive-or-lit-with-reg/imm32/next
4224 _Primitive-or-lit-with-reg:
4225
4226 "or"/imm32/name
4227 Single-lit-var/imm32/inouts
4228 Single-int-var-in-some-register/imm32/outputs
4229 "81 4/subop/or"/imm32/subx-name
4230 3/imm32/rm32-is-first-output
4231 0/imm32/no-r32
4232 1/imm32/imm32-is-first-inout
4233 0/imm32/output-is-write-only
4234 _Primitive-or-lit-with-mem/imm32/next
4235 _Primitive-or-lit-with-mem:
4236
4237 "or-with"/imm32/name
4238 Int-var-and-literal/imm32/inouts
4239 0/imm32/outputs
4240 "81 4/subop/or"/imm32/subx-name
4241 1/imm32/rm32-is-first-inout
4242 0/imm32/no-r32
4243 2/imm32/imm32-is-first-inout
4244 0/imm32/output-is-write-only
4245 _Primitive-xor-with-eax/imm32/next
4246
4247 _Primitive-xor-with-eax:
4248
4249 "xor"/imm32/name
4250 Single-lit-var/imm32/inouts
4251 Single-int-var-in-eax/imm32/outputs
4252 "35/xor-with-eax"/imm32/subx-name
4253 0/imm32/no-rm32
4254 0/imm32/no-r32
4255 1/imm32/imm32-is-first-inout
4256 0/imm32/output-is-write-only
4257 _Primitive-xor-reg-with-reg/imm32/next
4258 _Primitive-xor-reg-with-reg:
4259
4260 "xor"/imm32/name
4261 Single-int-var-in-some-register/imm32/inouts
4262 Single-int-var-in-some-register/imm32/outputs
4263 "31/xor-with"/imm32/subx-name
4264 3/imm32/rm32-is-first-output
4265 1/imm32/r32-is-first-inout
4266 0/imm32/no-imm32
4267 0/imm32/output-is-write-only
4268 _Primitive-xor-reg-with-mem/imm32/next
4269 _Primitive-xor-reg-with-mem:
4270
4271 "xor-with"/imm32/name
4272 Int-var-and-second-int-var-in-some-register/imm32/inouts
4273 0/imm32/outputs
4274 "31/xor-with"/imm32/subx-name
4275 1/imm32/rm32-is-first-inout
4276 2/imm32/r32-is-second-inout
4277 0/imm32/no-imm32
4278 0/imm32/output-is-write-only
4279 _Primitive-xor-mem-with-reg/imm32/next
4280 _Primitive-xor-mem-with-reg:
4281
4282 "xor"/imm32/name
4283 Single-int-var-on-stack/imm32/inouts
4284 Single-int-var-in-some-register/imm32/outputs
4285 "33/xor"/imm32/subx-name
4286 1/imm32/rm32-is-first-inout
4287 3/imm32/r32-is-first-output
4288 0/imm32/no-imm32
4289 0/imm32/output-is-write-only
4290 _Primitive-xor-lit-with-reg/imm32/next
4291 _Primitive-xor-lit-with-reg:
4292
4293 "xor"/imm32/name
4294 Single-lit-var/imm32/inouts
4295 Single-int-var-in-some-register/imm32/outputs
4296 "81 4/subop/xor"/imm32/subx-name
4297 3/imm32/rm32-is-first-output
4298 0/imm32/no-r32
4299 1/imm32/imm32-is-first-inout
4300 0/imm32/output-is-write-only
4301 _Primitive-xor-lit-with-mem/imm32/next
4302 _Primitive-xor-lit-with-mem:
4303
4304 "xor-with"/imm32/name
4305 Int-var-and-literal/imm32/inouts
4306 0/imm32/outputs
4307 "81 4/subop/xor"/imm32/subx-name
4308 1/imm32/rm32-is-first-inout
4309 0/imm32/no-r32
4310 2/imm32/imm32-is-first-inout
4311 0/imm32/output-is-write-only
4312 _Primitive-copy-to-eax/imm32/next
4313
4314 _Primitive-copy-to-eax:
4315
4316 "copy"/imm32/name
4317 Single-lit-var/imm32/inouts
4318 Single-int-var-in-eax/imm32/outputs
4319 "b8/copy-to-eax"/imm32/subx-name
4320 0/imm32/no-rm32
4321 0/imm32/no-r32
4322 1/imm32/imm32-is-first-inout
4323 1/imm32/output-is-write-only
4324 _Primitive-copy-to-ecx/imm32/next
4325 _Primitive-copy-to-ecx:
4326
4327 "copy"/imm32/name
4328 Single-lit-var/imm32/inouts
4329 Single-int-var-in-ecx/imm32/outputs
4330 "b9/copy-to-ecx"/imm32/subx-name
4331 0/imm32/no-rm32
4332 0/imm32/no-r32
4333 1/imm32/imm32-is-first-inout
4334 1/imm32/output-is-write-only
4335 _Primitive-copy-to-edx/imm32/next
4336 _Primitive-copy-to-edx:
4337
4338 "copy"/imm32/name
4339 Single-lit-var/imm32/inouts
4340 Single-int-var-in-edx/imm32/outputs
4341 "ba/copy-to-edx"/imm32/subx-name
4342 0/imm32/no-rm32
4343 0/imm32/no-r32
4344 1/imm32/imm32-is-first-inout
4345 1/imm32/output-is-write-only
4346 _Primitive-copy-to-ebx/imm32/next
4347 _Primitive-copy-to-ebx:
4348
4349 "copy"/imm32/name
4350 Single-lit-var/imm32/inouts
4351 Single-int-var-in-ebx/imm32/outputs
4352 "bb/copy-to-ebx"/imm32/subx-name
4353 0/imm32/no-rm32
4354 0/imm32/no-r32
4355 1/imm32/imm32-is-first-inout
4356 1/imm32/output-is-write-only
4357 _Primitive-copy-to-esi/imm32/next
4358 _Primitive-copy-to-esi:
4359
4360 "copy"/imm32/name
4361 Single-lit-var/imm32/inouts
4362 Single-int-var-in-esi/imm32/outputs
4363 "be/copy-to-esi"/imm32/subx-name
4364 0/imm32/no-rm32
4365 0/imm32/no-r32
4366 1/imm32/imm32-is-first-inout
4367 1/imm32/output-is-write-only
4368 _Primitive-copy-to-edi/imm32/next
4369 _Primitive-copy-to-edi:
4370
4371 "copy"/imm32/name
4372 Single-lit-var/imm32/inouts
4373 Single-int-var-in-edi/imm32/outputs
4374 "bf/copy-to-edi"/imm32/subx-name
4375 0/imm32/no-rm32
4376 0/imm32/no-r32
4377 1/imm32/imm32-is-first-inout
4378 1/imm32/output-is-write-only
4379 _Primitive-copy-reg-to-reg/imm32/next
4380 _Primitive-copy-reg-to-reg:
4381
4382 "copy"/imm32/name
4383 Single-int-var-in-some-register/imm32/inouts
4384 Single-int-var-in-some-register/imm32/outputs
4385 "89/copy-to"/imm32/subx-name
4386 3/imm32/rm32-is-first-output
4387 1/imm32/r32-is-first-inout
4388 0/imm32/no-imm32
4389 1/imm32/output-is-write-only
4390 _Primitive-copy-reg-to-mem/imm32/next
4391 _Primitive-copy-reg-to-mem:
4392
4393 "copy-to"/imm32/name
4394 Int-var-and-second-int-var-in-some-register/imm32/inouts
4395 0/imm32/outputs
4396 "89/copy-to"/imm32/subx-name
4397 1/imm32/rm32-is-first-inout
4398 2/imm32/r32-is-second-inout
4399 0/imm32/no-imm32
4400 1/imm32/output-is-write-only
4401 _Primitive-copy-mem-to-reg/imm32/next
4402 _Primitive-copy-mem-to-reg:
4403
4404 "copy"/imm32/name
4405 Single-int-var-on-stack/imm32/inouts
4406 Single-int-var-in-some-register/imm32/outputs
4407 "8b/copy-from"/imm32/subx-name
4408 1/imm32/rm32-is-first-inout
4409 3/imm32/r32-is-first-output
4410 0/imm32/no-imm32
4411 1/imm32/output-is-write-only
4412 _Primitive-copy-lit-to-reg/imm32/next
4413 _Primitive-copy-lit-to-reg:
4414
4415 "copy"/imm32/name
4416 Single-lit-var/imm32/inouts
4417 Single-int-var-in-some-register/imm32/outputs
4418 "c7 0/subop/copy"/imm32/subx-name
4419 3/imm32/rm32-is-first-output
4420 0/imm32/no-r32
4421 1/imm32/imm32-is-first-inout
4422 1/imm32/output-is-write-only
4423 _Primitive-copy-lit-to-mem/imm32/next
4424 _Primitive-copy-lit-to-mem:
4425
4426 "copy-to"/imm32/name
4427 Int-var-and-literal/imm32/inouts
4428 0/imm32/outputs
4429 "c7 0/subop/copy"/imm32/subx-name
4430 1/imm32/rm32-is-first-inout
4431 0/imm32/no-r32
4432 2/imm32/imm32-is-first-inout
4433 1/imm32/output-is-write-only
4434 0/imm32/next
4435
4436 Single-int-var-on-stack:
4437 Int-var-on-stack/imm32
4438 0/imm32/next
4439
4440 Int-var-on-stack:
4441 "arg1"/imm32/name
4442 Type-int/imm32
4443 1/imm32/some-block-depth
4444 1/imm32/some-stack-offset
4445 0/imm32/no-register
4446
4447 Int-var-and-second-int-var-in-some-register:
4448 Int-var-on-stack/imm32
4449 Single-int-var-in-some-register/imm32/next
4450
4451 Int-var-and-literal:
4452 Int-var-on-stack/imm32
4453 Single-lit-var/imm32/next
4454
4455 Single-int-var-in-some-register:
4456 Int-var-in-some-register/imm32
4457 0/imm32/next
4458
4459 Int-var-in-some-register:
4460 "arg1"/imm32/name
4461 Type-int/imm32
4462 1/imm32/some-block-depth
4463 0/imm32/no-stack-offset
4464 "*"/imm32/register
4465
4466 Single-int-var-in-eax:
4467 Int-var-in-eax/imm32
4468 0/imm32/next
4469
4470 Int-var-in-eax:
4471 "arg1"/imm32/name
4472 Type-int/imm32
4473 1/imm32/some-block-depth
4474 0/imm32/no-stack-offset
4475 "eax"/imm32/register
4476
4477 Single-int-var-in-ecx:
4478 Int-var-in-ecx/imm32
4479 0/imm32/next
4480
4481 Int-var-in-ecx:
4482 "arg1"/imm32/name
4483 Type-int/imm32
4484 1/imm32/some-block-depth
4485 0/imm32/no-stack-offset
4486 "ecx"/imm32/register
4487
4488 Single-int-var-in-edx:
4489 Int-var-in-edx/imm32
4490 0/imm32/next
4491
4492 Int-var-in-edx:
4493 "arg1"/imm32/name
4494 Type-int/imm32
4495 1/imm32/some-block-depth
4496 0/imm32/no-stack-offset
4497 "edx"/imm32/register
4498
4499 Single-int-var-in-ebx:
4500 Int-var-in-ebx/imm32
4501 0/imm32/next
4502
4503 Int-var-in-ebx:
4504 "arg1"/imm32/name
4505 Type-int/imm32
4506 1/imm32/some-block-depth
4507 0/imm32/no-stack-offset
4508 "ebx"/imm32/register
4509
4510 Single-int-var-in-esi:
4511 Int-var-in-esi/imm32
4512 0/imm32/next
4513
4514 Int-var-in-esi:
4515 "arg1"/imm32/name
4516 Type-int/imm32
4517 1/imm32/some-block-depth
4518 0/imm32/no-stack-offset
4519 "esi"/imm32/register
4520
4521 Single-int-var-in-edi:
4522 Int-var-in-edi/imm32
4523 0/imm32/next
4524
4525 Int-var-in-edi:
4526 "arg1"/imm32/name
4527 Type-int/imm32
4528 1/imm32/some-block-depth
4529 0/imm32/no-stack-offset
4530 "edi"/imm32/register
4531
4532 Single-lit-var:
4533 Lit-var/imm32
4534 0/imm32/next
4535
4536 Lit-var:
4537 "literal"/imm32/name
4538 Type-literal/imm32
4539 1/imm32/some-block-depth
4540 0/imm32/no-stack-offset
4541 0/imm32/no-register
4542
4543 Type-int:
4544 1/imm32/left/int
4545 0/imm32/right/null
4546
4547 Type-literal:
4548 0/imm32/left/literal
4549 0/imm32/right/null
4550
4551 == code
4552 emit-subx-primitive:
4553
4554 55/push-ebp
4555 89/<- %ebp 4/r32/esp
4556
4557 50/push-eax
4558 51/push-ecx
4559
4560 8b/-> *(ebp+0x10) 1/r32/ecx
4561
4562 (write-buffered *(ebp+8) *(ecx+0xc))
4563
4564 (emit-subx-rm32 *(ebp+8) *(ecx+0x10) *(ebp+0xc))
4565
4566 (emit-subx-r32 *(ebp+8) *(ecx+0x14) *(ebp+0xc))
4567
4568 (emit-subx-imm32 *(ebp+8) *(ecx+0x18) *(ebp+0xc))
4569 $emit-subx-primitive:end:
4570
4571 59/pop-to-ecx
4572 58/pop-to-eax
4573
4574 89/<- %esp 5/r32/ebp
4575 5d/pop-to-ebp
4576 c3/return
4577
4578 emit-subx-rm32:
4579
4580 55/push-ebp
4581 89/<- %ebp 4/r32/esp
4582
4583 50/push-eax
4584
4585 81 7/subop/compare *(ebp+0xc) 0/imm32
4586 74/jump-if-= $emit-subx-rm32:end/disp8
4587
4588 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc))
4589 (emit-subx-var-as-rm32 *(ebp+8) %eax)
4590 $emit-subx-rm32:end:
4591
4592 58/pop-to-eax
4593
4594 89/<- %esp 5/r32/ebp
4595 5d/pop-to-ebp
4596 c3/return
4597
4598 get-stmt-operand-from-arg-location:
4599
4600 55/push-ebp
4601 89/<- %ebp 4/r32/esp
4602
4603 51/push-ecx
4604
4605 8b/-> *(ebp+0xc) 0/r32/eax
4606
4607 8b/-> *(ebp+8) 1/r32/ecx
4608
4609 {
4610 3d/compare-eax-and 1/imm32
4611 75/jump-if-!= break/disp8
4612 $get-stmt-operand-from-arg-location:1:
4613 8b/-> *(ecx+8) 0/r32/eax
4614 8b/-> *eax 0/r32/eax
4615 eb/jump $get-stmt-operand-from-arg-location:end/disp8
4616 }
4617
4618 {
4619 3d/compare-eax-and 2/imm32
4620 75/jump-if-!= break/disp8
4621 $get-stmt-operand-from-arg-location:2:
4622 8b/-> *(ecx+8) 0/r32/eax
4623 8b/-> *(eax+4) 0/r32/eax
4624 8b/-> *eax 0/r32/eax
4625 eb/jump $get-stmt-operand-from-arg-location:end/disp8
4626 }
4627
4628 {
4629 3d/compare-eax-and 3/imm32
4630 75/jump-if-!= break/disp8
4631 $get-stmt-operand-from-arg-location:3:
4632 8b/-> *(ecx+0xc) 0/r32/eax
4633 8b/-> *eax 0/r32/eax
4634 eb/jump $get-stmt-operand-from-arg-location:end/disp8
4635 }
4636
4637 e9/jump $get-stmt-operand-from-arg-location:abort/disp32
4638 $get-stmt-operand-from-arg-location:end:
4639
4640 59/pop-to-ecx
4641
4642 89/<- %esp 5/r32/ebp
4643 5d/pop-to-ebp
4644 c3/return
4645
4646 $get-stmt-operand-from-arg-location:abort:
4647
4648 (write-buffered Stderr "invalid arg-location ")
4649 (print-int32-buffered Stderr %eax)
4650 (write-buffered Stderr "\n")
4651 (flush Stderr)
4652
4653 bb/copy-to-ebx 1/imm32
4654 b8/copy-to-eax 1/imm32/exit
4655 cd/syscall 0x80/imm8
4656
4657
4658 emit-subx-r32:
4659
4660 55/push-ebp
4661 89/<- %ebp 4/r32/esp
4662
4663 50/push-eax
4664 51/push-ecx
4665
4666 81 7/subop/compare *(ebp+0xc) 0/imm32
4667 0f 84/jump-if-= $emit-subx-r32:end/disp32
4668
4669 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc))
4670 (maybe-get Registers *(eax+0x10) 8)
4671 (write-buffered *(ebp+8) Space)
4672 (print-int32-buffered *(ebp+8) *eax)
4673 (write-buffered *(ebp+8) "/r32")
4674 $emit-subx-r32:end:
4675
4676 59/pop-to-ecx
4677 58/pop-to-eax
4678
4679 89/<- %esp 5/r32/ebp
4680 5d/pop-to-ebp
4681 c3/return
4682
4683 emit-subx-imm32:
4684
4685 55/push-ebp
4686 89/<- %ebp 4/r32/esp
4687
4688 50/push-eax
4689 51/push-ecx
4690
4691 81 7/subop/compare *(ebp+0xc) 0/imm32
4692 74/jump-if-= $emit-subx-imm32:end/disp8
4693
4694 (get-stmt-operand-from-arg-location *(ebp+0x10) *(ebp+0xc))
4695 (write-buffered *(ebp+8) Space)
4696 (write-buffered *(ebp+8) *eax)
4697 (write-buffered *(ebp+8) "/imm32")
4698 $emit-subx-imm32:end:
4699
4700 59/pop-to-ecx
4701 58/pop-to-eax
4702
4703 89/<- %esp 5/r32/ebp
4704 5d/pop-to-ebp
4705 c3/return
4706
4707 emit-subx-call:
4708
4709 55/push-ebp
4710 89/<- %ebp 4/r32/esp
4711
4712 50/push-eax
4713 51/push-ecx
4714
4715 (write-buffered *(ebp+8) "(")
4716
4717 8b/-> *(ebp+0x10) 1/r32/ecx
4718 (write-buffered *(ebp+8) *(ecx+4))
4719
4720
4721 8b/-> *(ebp+0xc) 1/r32/ecx
4722 8b/-> *(ecx+8) 1/r32/ecx
4723 {
4724
4725 81 7/subop/compare %ecx 0/imm32
4726 74/jump-if-= break/disp8
4727
4728 (emit-subx-call-operand *(ebp+8) *ecx)
4729
4730 8b/-> *(ecx+4) 1/r32/ecx
4731 eb/jump loop/disp8
4732 }
4733
4734 (write-buffered *(ebp+8) ")")
4735 $emit-subx-call:end:
4736
4737 59/pop-to-ecx
4738 58/pop-to-eax
4739
4740 89/<- %esp 5/r32/ebp
4741 5d/pop-to-ebp
4742 c3/return
4743
4744 emit-subx-call-operand:
4745
4746 55/push-ebp
4747 89/<- %ebp 4/r32/esp
4748
4749 50/push-eax
4750
4751 8b/-> *(ebp+0xc) 0/r32/eax
4752
4753 {
4754 81 7/subop/compare *(eax+0x10) 0/imm32
4755 74/jump-if-= break/disp8
4756 $emit-subx-call-operand:register:
4757 (write-buffered *(ebp+8) " %")
4758 (write-buffered *(ebp+8) *(eax+0x10))
4759 e9/jump $emit-subx-call-operand:end/disp32
4760 }
4761
4762 {
4763 81 7/subop/compare *(eax+0xc) 0/imm32
4764 74/jump-if-= break/disp8
4765 $emit-subx-call-operand:stack:
4766 (write-buffered *(ebp+8) Space)
4767 (write-buffered *(ebp+8) "*(ebp+")
4768 8b/-> *(ebp+0xc) 0/r32/eax
4769 (print-int32-buffered *(ebp+8) *(eax+0xc))
4770 (write-buffered *(ebp+8) ")")
4771 e9/jump $emit-subx-call-operand:end/disp32
4772 }
4773
4774 {
4775 50/push-eax
4776 8b/-> *(eax+4) 0/r32/eax
4777 81 7/subop/compare *eax 0/imm32
4778 58/pop-to-eax
4779 75/jump-if-!= break/disp8
4780 $emit-subx-call-operand:literal:
4781 (write-buffered *(ebp+8) Space)
4782 (write-buffered *(ebp+8) *eax)
4783 }
4784 $emit-subx-call-operand:end:
4785
4786 58/pop-to-eax
4787
4788 89/<- %esp 5/r32/ebp
4789 5d/pop-to-ebp
4790 c3/return
4791
4792 emit-subx-var-as-rm32:
4793
4794 55/push-ebp
4795 89/<- %ebp 4/r32/esp
4796
4797 50/push-eax
4798
4799 8b/-> *(ebp+0xc) 0/r32/eax
4800
4801 {
4802 81 7/subop/compare *(eax+0x10) 0/imm32
4803 74/jump-if-= break/disp8
4804 $emit-subx-var-as-rm32:register:
4805 (write-buffered *(ebp+8) " %")
4806 (write-buffered *(ebp+8) *(eax+0x10))
4807 }
4808
4809 {
4810 81 7/subop/compare *(eax+0xc) 0/imm32
4811 74/jump-if-= break/disp8
4812 $emit-subx-var-as-rm32:stack:
4813 (write-buffered *(ebp+8) Space)
4814 (write-buffered *(ebp+8) "*(ebp+")
4815 8b/-> *(ebp+0xc) 0/r32/eax
4816 (print-int32-buffered *(ebp+8) *(eax+0xc))
4817 (write-buffered *(ebp+8) ")")
4818 }
4819 $emit-subx-var-as-rm32:end:
4820
4821 58/pop-to-eax
4822
4823 89/<- %esp 5/r32/ebp
4824 5d/pop-to-ebp
4825 c3/return
4826
4827 find-matching-function:
4828
4829 55/push-ebp
4830 89/<- %ebp 4/r32/esp
4831
4832 51/push-ecx
4833
4834 8b/-> *(ebp+8) 1/r32/ecx
4835 {
4836
4837 81 7/subop/compare %ecx 0/imm32
4838 74/jump-if-= break/disp8
4839
4840 {
4841 (mu-stmt-matches-function? *(ebp+0xc) %ecx)
4842 3d/compare-eax-and 0/imm32
4843 74/jump-if-= break/disp8
4844 89/<- %eax 1/r32/ecx
4845 eb/jump $find-matching-function:end/disp8
4846 }
4847
4848 8b/-> *(ecx+0x14) 1/r32/ecx
4849 eb/jump loop/disp8
4850 }
4851
4852 b8/copy-to-eax 0/imm32
4853 $find-matching-function:end:
4854
4855 59/pop-to-ecx
4856
4857 89/<- %esp 5/r32/ebp
4858 5d/pop-to-ebp
4859 c3/return
4860
4861 find-matching-primitive:
4862
4863 55/push-ebp
4864 89/<- %ebp 4/r32/esp
4865
4866 51/push-ecx
4867
4868 8b/-> *(ebp+8) 1/r32/ecx
4869 {
4870 $find-matching-primitive:loop:
4871
4872 81 7/subop/compare %ecx 0/imm32
4873 0f 84/jump-if-= break/disp32
4874
4875
4876
4877
4878
4879
4880
4881 {
4882 (mu-stmt-matches-primitive? *(ebp+0xc) %ecx)
4883 3d/compare-eax-and 0/imm32
4884 74/jump-if-= break/disp8
4885 89/<- %eax 1/r32/ecx
4886 eb/jump $find-matching-primitive:end/disp8
4887 }
4888 $find-matching-primitive:next-primitive:
4889
4890 8b/-> *(ecx+0x20) 1/r32/ecx
4891 e9/jump loop/disp32
4892 }
4893
4894 b8/copy-to-eax 0/imm32
4895 $find-matching-primitive:end:
4896
4897 59/pop-to-ecx
4898
4899 89/<- %esp 5/r32/ebp
4900 5d/pop-to-ebp
4901 c3/return
4902
4903 mu-stmt-matches-function?:
4904
4905 55/push-ebp
4906 89/<- %ebp 4/r32/esp
4907
4908 51/push-ecx
4909
4910 8b/-> *(ebp+8) 1/r32/ecx
4911 8b/-> *(ebp+0xc) 0/r32/eax
4912 (string-equal? *(ecx+4) *eax)
4913 $mu-stmt-matches-function?:end:
4914
4915 59/pop-to-ecx
4916
4917 89/<- %esp 5/r32/ebp
4918 5d/pop-to-ebp
4919 c3/return
4920
4921 mu-stmt-matches-primitive?:
4922
4923
4924
4925
4926
4927
4928 55/push-ebp
4929 89/<- %ebp 4/r32/esp
4930
4931 51/push-ecx
4932 52/push-edx
4933 53/push-ebx
4934 56/push-esi
4935 57/push-edi
4936
4937 8b/-> *(ebp+8) 1/r32/ecx
4938
4939 8b/-> *(ebp+0xc) 2/r32/edx
4940 {
4941 $mu-stmt-matches-primitive?:check-name:
4942
4943 (string-equal? *(ecx+4) *edx)
4944 3d/compare-eax-and 0/imm32
4945 75/jump-if-!= break/disp8
4946 b8/copy-to-eax 0/imm32
4947 e9/jump $mu-stmt-matches-primitive?:end/disp32
4948 }
4949 $mu-stmt-matches-primitive?:check-inouts:
4950
4951 8b/-> *(ecx+8) 6/r32/esi
4952 8b/-> *(edx+4) 7/r32/edi
4953 {
4954
4955 {
4956 81 7/subop/compare %esi 0/imm32
4957 75/jump-if-!= break/disp8
4958 $mu-stmt-matches-primitive?:stmt-inout-is-null:
4959 {
4960 81 7/subop/compare %edi 0/imm32
4961 75/jump-if-!= break/disp8
4962
4963 e9/jump $mu-stmt-matches-primitive?:check-outputs/disp32
4964 }
4965
4966 b8/copy-to-eax 0/imm32/false
4967 e9/jump $mu-stmt-matches-primitive?:end/disp32
4968 }
4969
4970 {
4971 81 7/subop/compare %edi 0/imm32
4972 75/jump-if-!= break/disp8
4973 $mu-stmt-matches-primitive?:prim-inout-is-null:
4974 b8/copy-to-eax 0/imm32/false
4975 e9/jump $mu-stmt-matches-primitive?:end/disp32
4976 }
4977
4978 {
4979 (operand-matches-primitive? *esi *edi)
4980 3d/compare-eax-and 0/imm32
4981 75/jump-if-!= break/disp8
4982 b8/copy-to-eax 0/imm32/false
4983 e9/jump $mu-stmt-matches-primitive?:end/disp32
4984 }
4985
4986 8b/-> *(esi+4) 6/r32/esi
4987
4988 8b/-> *(edi+4) 7/r32/edi
4989 eb/jump loop/disp8
4990 }
4991 $mu-stmt-matches-primitive?:check-outputs:
4992
4993 8b/-> *(ecx+0xc) 6/r32/esi
4994 8b/-> *(edx+8) 7/r32/edi
4995 {
4996
4997 {
4998 $mu-stmt-matches-primitive?:check-output:
4999 81 7/subop/compare %esi 0/imm32
5000 75/jump-if-!= break/disp8
5001 {
5002 81 7/subop/compare %edi 0/imm32
5003 75/jump-if-!= break/disp8
5004
5005 b8/copy-to-eax 1/imm32
5006 e9/jump $mu-stmt-matches-primitive?:end/disp32
5007 }
5008
5009 b8/copy-to-eax 0/imm32
5010 e9/jump $mu-stmt-matches-primitive?:end/disp32
5011 }
5012
5013 {
5014 81 7/subop/compare %edi 0/imm32
5015 75/jump-if-!= break/disp8
5016 b8/copy-to-eax 0/imm32
5017 e9/jump $mu-stmt-matches-primitive?:end/disp32
5018 }
5019
5020 {
5021 (operand-matches-primitive? *esi *edi)
5022 3d/compare-eax-and 0/imm32
5023 75/jump-if-!= break/disp8
5024 b8/copy-to-eax 0/imm32
5025 e9/jump $mu-stmt-matches-primitive?:end/disp32
5026 }
5027
5028 8b/-> *(esi+4) 6/r32/esi
5029
5030 8b/-> *(edi+4) 7/r32/edi
5031 eb/jump loop/disp8
5032 }
5033 $mu-stmt-matches-primitive?:return-true:
5034 b8/copy-to-eax 1/imm32
5035 $mu-stmt-matches-primitive?:end:
5036
5037 5f/pop-to-edi
5038 5e/pop-to-esi
5039 5b/pop-to-ebx
5040 5a/pop-to-edx
5041 59/pop-to-ecx
5042
5043 89/<- %esp 5/r32/ebp
5044 5d/pop-to-ebp
5045 c3/return
5046
5047 operand-matches-primitive?:
5048
5049 55/push-ebp
5050 89/<- %ebp 4/r32/esp
5051
5052 56/push-esi
5053 57/push-edi
5054
5055 8b/-> *(ebp+8) 6/r32/esi
5056
5057 8b/-> *(ebp+0xc) 7/r32/edi
5058
5059 (type-equal? *(esi+4) *(edi+4))
5060 3d/compare-eax-and 0/imm32
5061 b8/copy-to-eax 0/imm32/false
5062 74/jump-if-= $operand-matches-primitive?:end/disp8
5063
5064 {
5065
5066 8b/-> *(esi+0x10) 0/r32/eax
5067 39/compare *(edi+0x10) 0/r32/eax
5068 74/jump-if-= break/disp8
5069
5070 3d/compare-eax-and 0/imm32
5071 74/jump-if-= $operand-matches-primitive?:end/disp8
5072 81 7/subop/compare *(edi+0x10) 0/imm32
5073 74/jump-if-= $operand-matches-primitive?:end/disp8
5074
5075 (string-equal? *(edi+0x10) "*")
5076 3d/compare-eax-and 0/imm32
5077 b8/copy-to-eax 1/imm32/true
5078 75/jump-if-!= $operand-matches-primitive?:end/disp8
5079
5080 (string-equal? *(esi+0x10) *(edi+0x10))
5081 3d/compare-eax-and 0/imm32
5082 b8/copy-to-eax 0/imm32/false
5083 74/jump-if-= $operand-matches-primitive?:end/disp8
5084 }
5085
5086 b8/copy-to-eax 1/imm32/true
5087 $operand-matches-primitive?:end:
5088
5089 5f/pop-to-edi
5090 5e/pop-to-esi
5091
5092 89/<- %esp 5/r32/ebp
5093 5d/pop-to-ebp
5094 c3/return
5095
5096 type-equal?:
5097
5098 55/push-ebp
5099 89/<- %ebp 4/r32/esp
5100
5101 51/push-ecx
5102 52/push-edx
5103
5104 8b/-> *(ebp+8) 1/r32/ecx
5105
5106 8b/-> *(ebp+0xc) 2/r32/edx
5107
5108 8b/-> %ecx 0/r32/eax
5109 39/compare %edx 0/r32/eax
5110 b8/copy-to-eax 1/imm32/true
5111 74/jump-if-= $type-equal?:end/disp8
5112
5113 81 7/subop/compare %ecx 0x10000/imm32
5114 b8/copy-to-eax 0/imm32/false
5115 72/jump-if-addr< $type-equal?:end/disp8
5116
5117 81 7/subop/compare %edx 0x10000/imm32
5118 b8/copy-to-eax 0/imm32/false
5119 72/jump-if-addr< $type-equal?:end/disp8
5120
5121 (type-equal? *ecx *edx)
5122 3d/compare-eax-and 0/imm32
5123 74/jump-if-= $type-equal?:end/disp8
5124
5125 (type-equal? *(ecx+4) *(edx+4))
5126 $type-equal?:end:
5127
5128 5a/pop-to-edx
5129 59/pop-to-ecx
5130
5131 89/<- %esp 5/r32/ebp
5132 5d/pop-to-ebp
5133 c3/return
5134
5135 test-emit-subx-statement-primitive:
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154 55/push-ebp
5155 89/<- %ebp 4/r32/esp
5156
5157 (clear-stream _test-output-stream)
5158 (clear-stream $_test-output-buffered-file->buffer)
5159
5160 68/push 0/imm32/right/null
5161 68/push 1/imm32/left/int
5162 89/<- %ecx 4/r32/esp
5163
5164 68/push 0/imm32/no-register
5165 68/push -8/imm32/stack-offset
5166 68/push 1/imm32/block-depth
5167 51/push-ecx
5168 68/push "foo"/imm32
5169 89/<- %ecx 4/r32/esp
5170
5171 68/push 0/imm32/next
5172 51/push-ecx/var-foo
5173 89/<- %ebx 4/r32/esp
5174
5175 68/push 0/imm32/next
5176 68/push 0/imm32/outputs
5177 53/push-ebx/operands
5178 68/push "increment"/imm32/operation
5179 68/push 1/imm32
5180 89/<- %esi 4/r32/esp
5181
5182 68/push 0/imm32/next
5183 68/push 0/imm32/output-is-write-only
5184 68/push 0/imm32/no-imm32
5185 68/push 0/imm32/no-r32
5186 68/push 1/imm32/rm32-is-first-inout
5187 68/push "ff 0/subop/increment"/imm32/subx-name
5188 68/push 0/imm32/outputs
5189 53/push-ebx/inouts
5190 68/push "increment"/imm32/name
5191 89/<- %ebx 4/r32/esp
5192
5193 (emit-subx-statement _test-output-buffered-file %esi %ebx 0)
5194 (flush _test-output-buffered-file)
5195 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5201
5202 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment *(ebp+0xfffffff8)" "F - test-emit-subx-statement-primitive")
5203
5204 89/<- %esp 5/r32/ebp
5205 5d/pop-to-ebp
5206 c3/return
5207
5208 test-emit-subx-statement-primitive-register:
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227 55/push-ebp
5228 89/<- %ebp 4/r32/esp
5229
5230 (clear-stream _test-output-stream)
5231 (clear-stream $_test-output-buffered-file->buffer)
5232
5233 68/push 0/imm32/right/null
5234 68/push 1/imm32/left/int
5235 89/<- %ecx 4/r32/esp
5236
5237 68/push "eax"/imm32/register
5238 68/push 0/imm32/no-stack-offset
5239 68/push 1/imm32/block-depth
5240 51/push-ecx
5241 68/push "foo"/imm32
5242 89/<- %ecx 4/r32/esp
5243
5244 68/push 0/imm32/next
5245 51/push-ecx/var-foo
5246 89/<- %ebx 4/r32/esp
5247
5248 68/push 0/imm32/next
5249 53/push-ebx/outputs
5250 68/push 0/imm32/inouts
5251 68/push "increment"/imm32/operation
5252 68/push 1/imm32
5253 89/<- %esi 4/r32/esp
5254
5255 68/push Any-register/imm32
5256 68/push 0/imm32/no-stack-offset
5257 68/push 1/imm32/block-depth
5258 ff 6/subop/push *(ecx+4)
5259 68/push "dummy"/imm32
5260 89/<- %ebx 4/r32/esp
5261
5262 68/push 0/imm32/next
5263 53/push-ebx/formal-var
5264 89/<- %ebx 4/r32/esp
5265
5266 68/push 0/imm32/next
5267 68/push 0/imm32/output-is-write-only
5268 68/push 0/imm32/no-imm32
5269 68/push 0/imm32/no-r32
5270 68/push 3/imm32/rm32-in-first-output
5271 68/push "ff 0/subop/increment"/imm32/subx-name
5272 53/push-ebx/outputs
5273 68/push 0/imm32/inouts
5274 68/push "increment"/imm32/name
5275 89/<- %ebx 4/r32/esp
5276
5277 (emit-subx-statement _test-output-buffered-file %esi %ebx 0)
5278 (flush _test-output-buffered-file)
5279 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5285
5286 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-statement-primitive-register")
5287
5288 89/<- %esp 5/r32/ebp
5289 5d/pop-to-ebp
5290 c3/return
5291
5292 test-emit-subx-statement-select-primitive:
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314 55/push-ebp
5315 89/<- %ebp 4/r32/esp
5316
5317 (clear-stream _test-output-stream)
5318 (clear-stream $_test-output-buffered-file->buffer)
5319
5320 68/push 0/imm32/right/null
5321 68/push 1/imm32/left/int
5322 89/<- %ecx 4/r32/esp
5323
5324 68/push "eax"/imm32/register
5325 68/push 0/imm32/no-stack-offset
5326 68/push 1/imm32/block-depth
5327 51/push-ecx
5328 68/push "foo"/imm32
5329 89/<- %ecx 4/r32/esp
5330
5331 68/push 0/imm32/next
5332 51/push-ecx/var-foo
5333 89/<- %edi 4/r32/esp
5334
5335 68/push 0/imm32/next
5336 57/push-edi/outputs
5337 68/push 0/imm32/inouts
5338 68/push "increment"/imm32/operation
5339 68/push 1/imm32
5340 89/<- %esi 4/r32/esp
5341
5342 68/push Any-register/imm32
5343 68/push 0/imm32/no-stack-offset
5344 68/push 1/imm32/block-depth
5345 ff 6/subop/push *(ecx+4)
5346 68/push "dummy"/imm32
5347 89/<- %ebx 4/r32/esp
5348
5349 68/push 0/imm32/next
5350 53/push-ebx/formal-var
5351 89/<- %ebx 4/r32/esp
5352
5353 68/push 0/imm32/next
5354 68/push 0/imm32/output-is-write-only
5355 68/push 0/imm32/no-imm32
5356 68/push 0/imm32/no-r32
5357 68/push 3/imm32/rm32-in-first-output
5358 68/push "ff 0/subop/increment"/imm32/subx-name
5359 53/push-ebx/outputs/formal-outputs
5360 68/push 0/imm32/inouts
5361 68/push "increment"/imm32/name
5362 89/<- %ebx 4/r32/esp
5363
5364 53/push-ebx/next
5365 68/push 0/imm32/output-is-write-only
5366 68/push 0/imm32/no-imm32
5367 68/push 0/imm32/no-r32
5368 68/push 1/imm32/rm32-is-first-inout
5369 68/push "ff 0/subop/increment"/imm32/subx-name
5370 68/push 0/imm32/outputs
5371 57/push-edi/inouts/real-outputs
5372 68/push "increment"/imm32/name
5373 89/<- %ebx 4/r32/esp
5374
5375 (emit-subx-statement _test-output-buffered-file %esi %ebx 0)
5376 (flush _test-output-buffered-file)
5377 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5383
5384 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-statement-select-primitive")
5385
5386 89/<- %esp 5/r32/ebp
5387 5d/pop-to-ebp
5388 c3/return
5389
5390 test-emit-subx-statement-select-primitive-2:
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412 55/push-ebp
5413 89/<- %ebp 4/r32/esp
5414
5415 (clear-stream _test-output-stream)
5416 (clear-stream $_test-output-buffered-file->buffer)
5417
5418 68/push 0/imm32/right/null
5419 68/push 1/imm32/left/int
5420 89/<- %ecx 4/r32/esp
5421
5422 68/push "eax"/imm32/register
5423 68/push 0/imm32/no-stack-offset
5424 68/push 1/imm32/block-depth
5425 51/push-ecx
5426 68/push "foo"/imm32
5427 89/<- %ecx 4/r32/esp
5428
5429 68/push 0/imm32/next
5430 51/push-ecx/var-foo
5431 89/<- %edi 4/r32/esp
5432
5433 68/push 0/imm32/next
5434 68/push 0/imm32/outputs
5435 57/push-edi/inouts
5436 68/push "increment"/imm32/operation
5437 68/push 1/imm32
5438 89/<- %esi 4/r32/esp
5439
5440 68/push Any-register/imm32
5441 68/push 0/imm32/no-stack-offset
5442 68/push 1/imm32/block-depth
5443 ff 6/subop/push *(ecx+4)
5444 68/push "dummy"/imm32
5445 89/<- %ebx 4/r32/esp
5446
5447 68/push 0/imm32/next
5448 53/push-ebx/formal-var
5449 89/<- %ebx 4/r32/esp
5450
5451 68/push 0/imm32/next
5452 68/push 0/imm32/output-is-write-only
5453 68/push 0/imm32/no-imm32
5454 68/push 0/imm32/no-r32
5455 68/push 3/imm32/rm32-in-first-output
5456 68/push "ff 0/subop/increment"/imm32/subx-name
5457 53/push-ebx/outputs/formal-outputs
5458 68/push 0/imm32/inouts
5459 68/push "increment"/imm32/name
5460 89/<- %ebx 4/r32/esp
5461
5462 53/push-ebx/next
5463 68/push 0/imm32/output-is-write-only
5464 68/push 0/imm32/no-imm32
5465 68/push 0/imm32/no-r32
5466 68/push 1/imm32/rm32-is-first-inout
5467 68/push "ff 0/subop/increment"/imm32/subx-name
5468 68/push 0/imm32/outputs
5469 57/push-edi/inouts/real-outputs
5470 68/push "increment"/imm32/name
5471 89/<- %ebx 4/r32/esp
5472
5473 (emit-subx-statement _test-output-buffered-file %esi %ebx 0)
5474 (flush _test-output-buffered-file)
5475 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5481
5482 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-emit-subx-statement-select-primitive-2")
5483
5484 89/<- %esp 5/r32/ebp
5485 5d/pop-to-ebp
5486 c3/return
5487
5488 test-increment-register:
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504 55/push-ebp
5505 89/<- %ebp 4/r32/esp
5506
5507 (clear-stream _test-output-stream)
5508 (clear-stream $_test-output-buffered-file->buffer)
5509
5510 68/push 0/imm32/right/null
5511 68/push 1/imm32/left/int
5512 89/<- %ecx 4/r32/esp
5513
5514 68/push "eax"/imm32/register
5515 68/push 0/imm32/no-stack-offset
5516 68/push 1/imm32/block-depth
5517 51/push-ecx
5518 68/push "foo"/imm32
5519 89/<- %ecx 4/r32/esp
5520
5521 68/push 0/imm32/next
5522 51/push-ecx/var-foo
5523 89/<- %edi 4/r32/esp
5524
5525 68/push 0/imm32/next
5526 57/push-edi/outputs
5527 68/push 0/imm32/inouts
5528 68/push "increment"/imm32/operation
5529 68/push 1/imm32/regular-statement
5530 89/<- %esi 4/r32/esp
5531
5532 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5533 (flush _test-output-buffered-file)
5534 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5540
5541 (check-next-stream-line-equal _test-output-stream "40/increment-eax" "F - test-increment-register")
5542
5543 89/<- %esp 5/r32/ebp
5544 5d/pop-to-ebp
5545 c3/return
5546
5547 test-increment-var:
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563 55/push-ebp
5564 89/<- %ebp 4/r32/esp
5565
5566 (clear-stream _test-output-stream)
5567 (clear-stream $_test-output-buffered-file->buffer)
5568
5569 68/push 0/imm32/right/null
5570 68/push 1/imm32/left/int
5571 89/<- %ecx 4/r32/esp
5572
5573 68/push "eax"/imm32/register
5574 68/push 0/imm32/no-stack-offset
5575 68/push 1/imm32/block-depth
5576 51/push-ecx
5577 68/push "foo"/imm32
5578 89/<- %ecx 4/r32/esp
5579
5580 68/push 0/imm32/next
5581 51/push-ecx/var-foo
5582 89/<- %edi 4/r32/esp
5583
5584 68/push 0/imm32/next
5585 68/push 0/imm32/outputs
5586 57/push-edi/inouts
5587 68/push "increment"/imm32/operation
5588 68/push 1/imm32
5589 89/<- %esi 4/r32/esp
5590
5591 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5592 (flush _test-output-buffered-file)
5593 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5599
5600 (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-increment-var")
5601
5602 89/<- %esp 5/r32/ebp
5603 5d/pop-to-ebp
5604 c3/return
5605
5606 test-add-reg-to-reg:
5607
5608
5609
5610
5611
5612 55/push-ebp
5613 89/<- %ebp 4/r32/esp
5614
5615 (clear-stream _test-output-stream)
5616 (clear-stream $_test-output-buffered-file->buffer)
5617
5618 68/push 0/imm32/right/null
5619 68/push 1/imm32/left/int
5620 89/<- %ecx 4/r32/esp
5621
5622 68/push "eax"/imm32/register
5623 68/push 0/imm32/no-stack-offset
5624 68/push 1/imm32/block-depth
5625 51/push-ecx
5626 68/push "var1"/imm32
5627 89/<- %ecx 4/r32/esp
5628
5629 68/push "ecx"/imm32/register
5630 68/push 0/imm32/no-stack-offset
5631 68/push 1/imm32/block-depth
5632 ff 6/subop/push *(ecx+4)
5633 68/push "var2"/imm32
5634 89/<- %edx 4/r32/esp
5635
5636 68/push 0/imm32/next
5637 52/push-edx/var-var2
5638 89/<- %esi 4/r32/esp
5639
5640 68/push 0/imm32/next
5641 51/push-ecx/var-var1
5642 89/<- %edi 4/r32/esp
5643
5644 68/push 0/imm32/next
5645 57/push-edi/outputs
5646 56/push-esi/inouts
5647 68/push "add"/imm32/operation
5648 68/push 1/imm32
5649 89/<- %esi 4/r32/esp
5650
5651 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5652 (flush _test-output-buffered-file)
5653 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5659
5660 (check-next-stream-line-equal _test-output-stream "01/add-to %eax 0x00000001/r32" "F - test-add-reg-to-reg")
5661
5662 89/<- %esp 5/r32/ebp
5663 5d/pop-to-ebp
5664 c3/return
5665
5666 test-add-reg-to-mem:
5667
5668
5669
5670
5671
5672 55/push-ebp
5673 89/<- %ebp 4/r32/esp
5674
5675 (clear-stream _test-output-stream)
5676 (clear-stream $_test-output-buffered-file->buffer)
5677
5678 68/push 0/imm32/right/null
5679 68/push 1/imm32/left/int
5680 89/<- %ecx 4/r32/esp
5681
5682 68/push 0/imm32/no-register
5683 68/push 8/imm32/stack-offset
5684 68/push 1/imm32/block-depth
5685 51/push-ecx
5686 68/push "var1"/imm32
5687 89/<- %ecx 4/r32/esp
5688
5689 68/push "ecx"/imm32/register
5690 68/push 0/imm32/no-stack-offset
5691 68/push 1/imm32/block-depth
5692 ff 6/subop/push *(ecx+4)
5693 68/push "var2"/imm32
5694 89/<- %edx 4/r32/esp
5695
5696 68/push 0/imm32/next
5697 52/push-edx/var-var2
5698 89/<- %esi 4/r32/esp
5699
5700 56/push-esi/next
5701 51/push-ecx/var-var1
5702 89/<- %esi 4/r32/esp
5703
5704 68/push 0/imm32/next
5705 68/push 0/imm32/outputs
5706 56/push-esi/inouts
5707 68/push "add-to"/imm32/operation
5708 68/push 1/imm32
5709 89/<- %esi 4/r32/esp
5710
5711 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5712 (flush _test-output-buffered-file)
5713 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5719
5720 (check-next-stream-line-equal _test-output-stream "01/add-to *(ebp+0x00000008) 0x00000001/r32" "F - test-add-reg-to-mem")
5721
5722 89/<- %esp 5/r32/ebp
5723 5d/pop-to-ebp
5724 c3/return
5725
5726 test-add-mem-to-reg:
5727
5728
5729
5730
5731
5732 55/push-ebp
5733 89/<- %ebp 4/r32/esp
5734
5735 (clear-stream _test-output-stream)
5736 (clear-stream $_test-output-buffered-file->buffer)
5737
5738 68/push 0/imm32/right/null
5739 68/push 1/imm32/left/int
5740 89/<- %ecx 4/r32/esp
5741
5742 68/push "eax"/imm32/register
5743 68/push 0/imm32/no-stack-offset
5744 68/push 1/imm32/block-depth
5745 51/push-ecx
5746 68/push "var1"/imm32
5747 89/<- %ecx 4/r32/esp
5748
5749 68/push 0/imm32/no-register
5750 68/push 8/imm32/stack-offset
5751 68/push 1/imm32/block-depth
5752 ff 6/subop/push *(ecx+4)
5753 68/push "var2"/imm32
5754 89/<- %edx 4/r32/esp
5755
5756 68/push 0/imm32/next
5757 52/push-edx/var-var2
5758 89/<- %esi 4/r32/esp
5759
5760 68/push 0/imm32/next
5761 51/push-ecx/var-var1
5762 89/<- %edi 4/r32/esp
5763
5764 68/push 0/imm32/next
5765 57/push-edi/outputs
5766 56/push-esi/inouts
5767 68/push "add"/imm32/operation
5768 68/push 1/imm32
5769 89/<- %esi 4/r32/esp
5770
5771 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5772 (flush _test-output-buffered-file)
5773 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5779
5780 (check-next-stream-line-equal _test-output-stream "03/add *(ebp+0x00000008) 0x00000000/r32" "F - test-add-mem-to-reg")
5781
5782 89/<- %esp 5/r32/ebp
5783 5d/pop-to-ebp
5784 c3/return
5785
5786 test-add-literal-to-eax:
5787
5788
5789
5790
5791
5792 55/push-ebp
5793 89/<- %ebp 4/r32/esp
5794
5795 (clear-stream _test-output-stream)
5796 (clear-stream $_test-output-buffered-file->buffer)
5797
5798 68/push 0/imm32/right/null
5799 68/push 1/imm32/left/int
5800 89/<- %ecx 4/r32/esp
5801
5802 68/push "eax"/imm32/register
5803 68/push 0/imm32/no-stack-offset
5804 68/push 1/imm32/block-depth
5805 51/push-ecx
5806 68/push "var1"/imm32
5807 89/<- %ecx 4/r32/esp
5808
5809 68/push 0/imm32/right/null
5810 68/push 0/imm32/left/literal
5811 89/<- %edx 4/r32/esp
5812
5813 68/push 0/imm32/no-register
5814 68/push 0/imm32/no-stack-offset
5815 68/push 1/imm32/block-depth
5816 52/push-edx
5817 68/push "0x34"/imm32
5818 89/<- %edx 4/r32/esp
5819
5820 68/push 0/imm32/next
5821 52/push-edx/var-var2
5822 89/<- %esi 4/r32/esp
5823
5824 68/push 0/imm32/next
5825 51/push-ecx/var-var1
5826 89/<- %edi 4/r32/esp
5827
5828 68/push 0/imm32/next
5829 57/push-edi/outputs
5830 56/push-esi/inouts
5831 68/push "add"/imm32/operation
5832 68/push 1/imm32
5833 89/<- %esi 4/r32/esp
5834
5835 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5836 (flush _test-output-buffered-file)
5837 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5843
5844 (check-next-stream-line-equal _test-output-stream "05/add-to-eax 0x34/imm32" "F - test-add-literal-to-eax")
5845
5846 89/<- %esp 5/r32/ebp
5847 5d/pop-to-ebp
5848 c3/return
5849
5850 test-add-literal-to-reg:
5851
5852
5853
5854
5855
5856 55/push-ebp
5857 89/<- %ebp 4/r32/esp
5858
5859 (clear-stream _test-output-stream)
5860 (clear-stream $_test-output-buffered-file->buffer)
5861
5862 68/push 0/imm32/right/null
5863 68/push 1/imm32/left/int
5864 89/<- %ecx 4/r32/esp
5865
5866 68/push "ecx"/imm32/register
5867 68/push 0/imm32/no-stack-offset
5868 68/push 1/imm32/block-depth
5869 51/push-ecx
5870 68/push "var1"/imm32
5871 89/<- %ecx 4/r32/esp
5872
5873 68/push 0/imm32/right/null
5874 68/push 0/imm32/left/literal
5875 89/<- %edx 4/r32/esp
5876
5877 68/push 0/imm32/no-register
5878 68/push 0/imm32/no-stack-offset
5879 68/push 1/imm32/block-depth
5880 52/push-edx
5881 68/push "0x34"/imm32
5882 89/<- %edx 4/r32/esp
5883
5884 68/push 0/imm32/next
5885 52/push-edx/var-var2
5886 89/<- %esi 4/r32/esp
5887
5888 68/push 0/imm32/next
5889 51/push-ecx/var-var1
5890 89/<- %edi 4/r32/esp
5891
5892 68/push 0/imm32/next
5893 57/push-edi/outputs
5894 56/push-esi/inouts
5895 68/push "add"/imm32/operation
5896 68/push 1/imm32
5897 89/<- %esi 4/r32/esp
5898
5899 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5900 (flush _test-output-buffered-file)
5901 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5907
5908 (check-next-stream-line-equal _test-output-stream "81 0/subop/add %ecx 0x34/imm32" "F - test-add-literal-to-reg")
5909
5910 89/<- %esp 5/r32/ebp
5911 5d/pop-to-ebp
5912 c3/return
5913
5914 test-add-literal-to-mem:
5915
5916
5917
5918
5919
5920 55/push-ebp
5921 89/<- %ebp 4/r32/esp
5922
5923 (clear-stream _test-output-stream)
5924 (clear-stream $_test-output-buffered-file->buffer)
5925
5926 68/push 0/imm32/right/null
5927 68/push 1/imm32/left/int
5928 89/<- %ecx 4/r32/esp
5929
5930 68/push 0/imm32/no-register
5931 68/push 8/imm32/stack-offset
5932 68/push 1/imm32/block-depth
5933 51/push-ecx
5934 68/push "var1"/imm32
5935 89/<- %ecx 4/r32/esp
5936
5937 68/push 0/imm32/right/null
5938 68/push 0/imm32/left/literal
5939 89/<- %edx 4/r32/esp
5940
5941 68/push 0/imm32/no-register
5942 68/push 0/imm32/no-stack-offset
5943 68/push 1/imm32/block-depth
5944 52/push-edx
5945 68/push "0x34"/imm32
5946 89/<- %edx 4/r32/esp
5947
5948 68/push 0/imm32/next
5949 52/push-edx/var-var2
5950 89/<- %esi 4/r32/esp
5951
5952 56/push-esi/next
5953 51/push-ecx/var-var1
5954 89/<- %esi 4/r32/esp
5955
5956 68/push 0/imm32/next
5957 68/push 0/imm32/outputs
5958 56/push-esi/inouts
5959 68/push "add-to"/imm32/operation
5960 68/push 1/imm32
5961 89/<- %esi 4/r32/esp
5962
5963 (emit-subx-statement _test-output-buffered-file %esi Primitives 0)
5964 (flush _test-output-buffered-file)
5965 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
5971
5972 (check-next-stream-line-equal _test-output-stream "81 0/subop/add *(ebp+0x00000008) 0x34/imm32" "F - test-add-literal-to-mem")
5973
5974 89/<- %esp 5/r32/ebp
5975 5d/pop-to-ebp
5976 c3/return
5977
5978 test-emit-subx-statement-function-call:
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999 55/push-ebp
6000 89/<- %ebp 4/r32/esp
6001
6002 (clear-stream _test-output-stream)
6003 (clear-stream $_test-output-buffered-file->buffer)
6004
6005 68/push 0/imm32/right/null
6006 68/push 1/imm32/left/int
6007 89/<- %ecx 4/r32/esp
6008
6009 68/push 0/imm32/no-register
6010 68/push -8/imm32/stack-offset
6011 68/push 0/imm32/block-depth
6012 51/push-ecx
6013 68/push "foo"/imm32
6014 89/<- %ecx 4/r32/esp
6015
6016 68/push 0/imm32/next
6017 51/push-ecx/var-foo
6018 89/<- %esi 4/r32/esp
6019
6020 68/push 0/imm32/next
6021 68/push 0/imm32/outputs
6022 56/push-esi/inouts
6023 68/push "f"/imm32/operation
6024 68/push 1/imm32
6025 89/<- %esi 4/r32/esp
6026
6027 68/push 0/imm32/next
6028 68/push 0/imm32/body
6029 68/push 0/imm32/outputs
6030 51/push-ecx/inouts
6031 68/push "f2"/imm32/subx-name
6032 68/push "f"/imm32/name
6033 89/<- %ebx 4/r32/esp
6034
6035 (emit-subx-statement _test-output-buffered-file %esi 0 %ebx)
6036 (flush _test-output-buffered-file)
6037 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
6043
6044 (check-next-stream-line-equal _test-output-stream "(f2 *(ebp+0xfffffff8))" "F - test-emit-subx-statement-function-call")
6045
6046 89/<- %esp 5/r32/ebp
6047 5d/pop-to-ebp
6048 c3/return
6049
6050 test-emit-subx-statement-function-call-with-literal-arg:
6051
6052
6053
6054
6055
6056
6057 55/push-ebp
6058 89/<- %ebp 4/r32/esp
6059
6060 (clear-stream _test-output-stream)
6061 (clear-stream $_test-output-buffered-file->buffer)
6062
6063 68/push 0/imm32/right/null
6064 68/push 0/imm32/left/literal
6065 89/<- %ecx 4/r32/esp
6066
6067 68/push 0/imm32/no-register
6068 68/push 0/imm32/no-stack-offset
6069 68/push 0/imm32/block-depth
6070 51/push-ecx
6071 68/push "34"/imm32
6072 89/<- %ecx 4/r32/esp
6073
6074 68/push 0/imm32/next
6075 51/push-ecx/var-foo
6076 89/<- %esi 4/r32/esp
6077
6078 68/push 0/imm32/next
6079 68/push 0/imm32/outputs
6080 56/push-esi/inouts
6081 68/push "f"/imm32/operation
6082 68/push 1/imm32
6083 89/<- %esi 4/r32/esp
6084
6085 68/push 0/imm32/next
6086 68/push 0/imm32/body
6087 68/push 0/imm32/outputs
6088 51/push-ecx/inouts
6089 68/push "f2"/imm32/subx-name
6090 68/push "f"/imm32/name
6091 89/<- %ebx 4/r32/esp
6092
6093 (emit-subx-statement _test-output-buffered-file %esi 0 %ebx)
6094 (flush _test-output-buffered-file)
6095 +-- 6 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
6101
6102 (check-next-stream-line-equal _test-output-stream "(f2 34)" "F - test-emit-subx-statement-function-call-with-literal-arg")
6103
6104 89/<- %esp 5/r32/ebp
6105 5d/pop-to-ebp
6106 c3/return
6107
6108 emit-subx-prologue:
6109
6110 55/push-ebp
6111 89/<- %ebp 4/r32/esp
6112
6113 (write-buffered *(ebp+8) "# . prologue\n")
6114 (write-buffered *(ebp+8) "55/push-ebp\n")
6115 (write-buffered *(ebp+8) "89/<- %ebp 4/r32/esp\n")
6116 $emit-subx-prologue:end:
6117
6118 89/<- %esp 5/r32/ebp
6119 5d/pop-to-ebp
6120 c3/return
6121
6122 emit-subx-epilogue:
6123
6124 55/push-ebp
6125 89/<- %ebp 4/r32/esp
6126
6127 (write-buffered *(ebp+8) "# . epilogue\n")
6128 (write-buffered *(ebp+8) "89/<- %esp 5/r32/ebp\n")
6129 (write-buffered *(ebp+8) "5d/pop-to-ebp\n")
6130 (write-buffered *(ebp+8) "c3/return\n")
6131 $emit-subx-epilogue:end:
6132
6133 89/<- %esp 5/r32/ebp
6134 5d/pop-to-ebp
6135 c3/return