https://github.com/akkartik/mu/blob/master/apps/calls.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 == code
27
28 Entry:
29
30 89/<- %ebp 4/r32/esp
31
32
33
34
35 68/push Heap/imm32
36 ff 6/subop/push *Heap-size
37
38 e8/call new-segment/disp32
39
40 81 0/subop/add %esp 8/imm32
41
42
43
44 81 7/subop/compare *ebp 1/imm32
45 7e/jump-if-lesser-or-equal $run-main/disp8
46
47
48
49 68/push "test"/imm32
50 ff 6/subop/push *(ebp+8)
51
52 e8/call kernel-string-equal?/disp32
53
54 81 0/subop/add %esp 8/imm32
55
56 3d/compare-eax-and 0/imm32
57 74/jump-if-equal $run-main/disp8
58
59 e8/call run-tests/disp32
60
61 8b/-> *Num-test-failures 3/r32/ebx
62 eb/jump $main:end/disp8
63 $run-main:
64
65
66
67 68/push Stdout/imm32
68 68/push Stdin/imm32
69
70 e8/call convert/disp32
71
72 81 0/subop/add %esp 8/imm32
73
74 bb/copy-to-ebx 0/imm32
75 $main:end:
76 b8/copy-to-eax 1/imm32/exit
77 cd/syscall 0x80/imm8
78
79 convert:
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 55/push-ebp
103 89/<- %ebp 4/r32/esp
104
105
106 81 5/subop/subtract %esp 0x200/imm32
107 68/push 0x200/imm32/length
108 68/push 0/imm32/read
109 68/push 0/imm32/write
110 89/<- %ecx 4/r32/esp
111
112 81 5/subop/subtract %esp 0x80/imm32
113 68/push 0x80/imm32/length
114 68/push 0/imm32/read
115 68/push 0/imm32/write
116 89/<- %edx 4/r32/esp
117 $convert:loop:
118
119
120 51/push-ecx
121
122 e8/call clear-stream/disp32
123
124 81 0/subop/add %esp 4/imm32
125
126
127 51/push-ecx
128 ff 6/subop/push *(ebp+8)
129
130 e8/call read-line-buffered/disp32
131
132 81 0/subop/add %esp 8/imm32
133 $convert:check0:
134
135 81 7/subop/compare *ecx 0/imm32
136 0f 84/jump-if-equal $convert:break/disp32
137
138 e9/jump $convert:loop/disp32
139 $convert:break:
140
141
142 ff 6/subop/push *(ebp+0xc)
143
144 e8/call flush/disp32
145
146 81 0/subop/add %esp 4/imm32
147 $convert:end:
148
149 81 0/subop/add %esp 0x298/imm32
150
151
152 89/<- %esp 5/r32/ebp
153 5d/pop-to-ebp
154 c3/return
155
156 parse-line:
157
158
159
160
161
162
163
164
165
166
167 55/push-ebp
168 89/<- %ebp 4/r32/esp
169
170 $parse-line:end:
171
172
173
174 89/<- %esp 5/r32/ebp
175 5d/pop-to-ebp
176 c3/return
177
178 emit-call:
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 55/push-ebp
206 89/<- %ebp 4/r32/esp
207
208 $emit-call:end:
209
210
211
212 89/<- %esp 5/r32/ebp
213 5d/pop-to-ebp
214 c3/return
215
216 next-word-string-or-expression-without-metadata:
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274 55/push-ebp
275 89/<- %ebp 4/r32/esp
276
277 50/push-eax
278 51/push-ecx
279 56/push-esi
280 57/push-edi
281
282 8b/-> *(ebp+8) 6/r32/esi
283
284 8b/-> *(ebp+0xc) 7/r32/edi
285
286
287 68/push 0x20/imm32/space
288 ff 6/subop/push *(ebp+8)
289
290 e8/call skip-chars-matching/disp32
291
292 81 0/subop/add %esp 8/imm32
293 $next-word-string-or-expression-without-metadata:check0:
294
295
296 8b/-> *(esi+4) 1/r32/ecx
297
298 3b/compare *esi 1/r32/ecx
299 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32
300 $next-word-string-or-expression-without-metadata:check-for-comment:
301
302 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
303 89/<- *edi 0/r32/eax
304
305
306 31/xor %eax 0/r32/eax
307 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
308
309 3d/compare-eax-and 0x23/imm32/pound
310 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-string-literal/disp8
311 $next-word-string-or-expression-without-metadata:comment:
312
313 8b/-> *esi 0/r32/eax
314 8d/copy-address *(esi+eax+0xc) 0/r32/eax
315 89/<- *(edi+4) 0/r32/eax
316
317 8b/-> *esi 0/r32/eax
318 89/<- *(esi+4) 0/r32/eax
319
320 e9/jump $next-word-string-or-expression-without-metadata:end/disp32
321 $next-word-string-or-expression-without-metadata:check-for-string-literal:
322
323 3d/compare-eax-and 0x22/imm32/dquote
324 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-expression/disp8
325 $next-word-string-or-expression-without-metadata:string-literal:
326
327
328 56/push-esi
329
330 e8/call skip-string/disp32
331
332 81 0/subop/add %esp 4/imm32
333
334 8b/-> *(esi+4) 1/r32/ecx
335 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
336 89/<- *(edi+4) 0/r32/eax
337
338 e9/jump $next-word-string-or-expression-without-metadata:end/disp32
339 $next-word-string-or-expression-without-metadata:check-for-expression:
340
341 3d/compare-eax-and 0x2a/imm32/asterisk
342 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:check-for-end-of-call/disp8
343
344 8a/copy-byte *(esi+ecx+0xd) 0/r32/AL
345 3d/compare-eax-and 0x20/imm32/space
346 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error1/disp32
347
348 3d/compare-eax-and 0x28/imm32/open-paren
349 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32
350 $next-word-string-or-expression-without-metadata:paren:
351
352
353 56/push-esi
354
355 e8/call skip-until-close-paren/disp32
356
357 81 0/subop/add %esp 4/imm32
358
359
360 8b/-> *(esi+4) 1/r32/ecx
361 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
362
363 3d/compare-eax-and 0x29/imm32/close-paren
364 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:error2/disp32
365
366 ff 0/subop/increment *(esi+4)
367
368 8b/-> *(esi+4) 1/r32/ecx
369 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
370 89/<- *(edi+4) 0/r32/eax
371
372 e9/jump $next-word-string-or-expression-without-metadata:end/disp32
373 $next-word-string-or-expression-without-metadata:check-for-end-of-call:
374
375 3d/compare-eax-and 0x29/imm32/close-paren
376 75/jump-if-not-equal $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp8
377
378 ff 0/subop/increment *(esi+4)
379
380
381
382 8b/-> *(esi+4) 1/r32/ecx
383
384 3b/compare *esi 1/r32/ecx
385 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32
386
387
388 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
389
390 3d/compare-eax-and 0x2f/imm32/slash
391 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error3/disp32
392
393 3d/compare-eax-and 0x20/imm32/space
394 0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:error4/disp32
395
396
397 56/push-esi
398
399 e8/call skip-chars-matching-whitespace/disp32
400
401 81 0/subop/add %esp 4/imm32
402
403
404 8b/-> *(esi+4) 1/r32/ecx
405
406 3b/compare *esi 1/r32/ecx
407 0f 8d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:return-eol/disp32
408
409
410 8b/-> *(esi+4) 1/r32/ecx
411 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
412
413 3d/compare-eax-and 0x23/imm32/pound
414 74/jump-if-equal $next-word-string-or-expression-without-metadata:return-eol/disp8
415
416 e9/jump $next-word-string-or-expression-without-metadata:error4/disp32
417 $next-word-string-or-expression-without-metadata:regular-word-without-metadata:
418
419
420 8b/-> *(esi+4) 1/r32/ecx
421
422 3b/compare *esi 1/r32/ecx
423 7d/jump-if-greater-or-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8
424
425
426 8b/-> *(esi+4) 1/r32/ecx
427 8a/copy-byte *(esi+ecx+0xc) 0/r32/AL
428
429 3d/compare-eax-and 0x20/imm32/space
430 74/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp8
431
432 3d/compare-eax-and 0x29/imm32/close-paren
433 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:regular-word-break/disp32
434
435 3d/compare-eax-and 0x2f/imm32/slash
436 0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error5/disp32
437
438 ff 0/subop/increment *(esi+4)
439
440 e9/jump $next-word-string-or-expression-without-metadata:regular-word-without-metadata/disp32
441 $next-word-string-or-expression-without-metadata:regular-word-break:
442
443 8b/-> *(esi+4) 1/r32/ecx
444 8d/copy-address *(esi+ecx+0xc) 0/r32/eax
445 89/<- *(edi+4) 0/r32/eax
446 eb/jump $next-word-string-or-expression-without-metadata:end/disp8
447 $next-word-string-or-expression-without-metadata:return-eol:
448
449 c7 0/subop/copy *edi 0/imm32
450 c7 0/subop/copy *(edi+4) 0/imm32
451 $next-word-string-or-expression-without-metadata:end:
452
453 5f/pop-to-edi
454 5e/pop-to-esi
455 59/pop-to-ecx
456 58/pop-to-eax
457
458 89/<- %esp 5/r32/ebp
459 5d/pop-to-ebp
460 c3/return
461
462 $next-word-string-or-expression-without-metadata:error1:
463
464
465
466 68/push "error: no space allowed after '*' in '"/imm32
467 68/push Stderr/imm32
468
469 e8/call write-buffered/disp32
470
471 81 0/subop/add %esp 8/imm32
472
473
474 56/push-esi
475 68/push Stderr/imm32
476
477 e8/call write-stream-data/disp32
478
479 81 0/subop/add %esp 8/imm32
480
481
482 68/push "'"/imm32
483 68/push Stderr/imm32
484
485 e8/call write-buffered/disp32
486
487 81 0/subop/add %esp 8/imm32
488
489
490 68/push Stderr/imm32
491
492 e8/call flush/disp32
493
494 81 0/subop/add %esp 4/imm32
495
496 bb/copy-to-ebx 1/imm32
497 b8/copy-to-eax 1/imm32/exit
498 cd/syscall 0x80/imm8
499
500
501 $next-word-string-or-expression-without-metadata:error2:
502
503
504
505 68/push "error: *(...) expression must be all on a single line in '"/imm32
506 68/push Stderr/imm32
507
508 e8/call write-buffered/disp32
509
510 81 0/subop/add %esp 8/imm32
511
512
513 56/push-esi
514 68/push Stderr/imm32
515
516 e8/call write-stream-data/disp32
517
518 81 0/subop/add %esp 8/imm32
519
520
521 68/push "'"/imm32
522 68/push Stderr/imm32
523
524 e8/call write-buffered/disp32
525
526 81 0/subop/add %esp 8/imm32
527
528
529 68/push Stderr/imm32
530
531 e8/call flush/disp32
532
533 81 0/subop/add %esp 4/imm32
534
535 bb/copy-to-ebx 1/imm32
536 b8/copy-to-eax 1/imm32/exit
537 cd/syscall 0x80/imm8
538
539
540 $next-word-string-or-expression-without-metadata:error3:
541
542
543
544 68/push "error: no metadata after calls; just use a comment (in '"/imm32
545 68/push Stderr/imm32
546
547 e8/call write-buffered/disp32
548
549 81 0/subop/add %esp 8/imm32
550
551
552 56/push-esi
553 68/push Stderr/imm32
554
555 e8/call write-stream-data/disp32
556
557 81 0/subop/add %esp 8/imm32
558
559
560 68/push "')"/imm32
561 68/push Stderr/imm32
562
563 e8/call write-buffered/disp32
564
565 81 0/subop/add %esp 8/imm32
566
567
568 68/push Stderr/imm32
569
570 e8/call flush/disp32
571
572 81 0/subop/add %esp 4/imm32
573
574 bb/copy-to-ebx 1/imm32
575 b8/copy-to-eax 1/imm32/exit
576 cd/syscall 0x80/imm8
577
578
579 $next-word-string-or-expression-without-metadata:error4:
580
581
582
583 68/push "error: unexpected text after end of call in '"/imm32
584 68/push Stderr/imm32
585
586 e8/call write-buffered/disp32
587
588 81 0/subop/add %esp 8/imm32
589
590
591 56/push-esi
592 68/push Stderr/imm32
593
594 e8/call write-stream-data/disp32
595
596 81 0/subop/add %esp 8/imm32
597
598
599 68/push "'"/imm32
600 68/push Stderr/imm32
601
602 e8/call write-buffered/disp32
603
604 81 0/subop/add %esp 8/imm32
605
606
607 68/push Stderr/imm32
608
609 e8/call flush/disp32
610
611 81 0/subop/add %esp 4/imm32
612
613 bb/copy-to-ebx 1/imm32
614 b8/copy-to-eax 1/imm32/exit
615 cd/syscall 0x80/imm8
616
617
618 $next-word-string-or-expression-without-metadata:error5:
619
620
621
622 68/push "error: no metadata anywhere in calls (in '"/imm32
623 68/push Stderr/imm32
624
625 e8/call write-buffered/disp32
626
627 81 0/subop/add %esp 8/imm32
628
629
630 56/push-esi
631 68/push Stderr/imm32
632
633 e8/call write-stream-data/disp32
634
635 81 0/subop/add %esp 8/imm32
636
637
638 68/push "')"/imm32
639 68/push Stderr/imm32
640
641 e8/call write-buffered/disp32
642
643 81 0/subop/add %esp 8/imm32
644
645
646 68/push Stderr/imm32
647
648 e8/call flush/disp32
649
650 81 0/subop/add %esp 4/imm32
651
652 bb/copy-to-ebx 1/imm32
653 b8/copy-to-eax 1/imm32/exit
654 cd/syscall 0x80/imm8
655
656
657 test-next-word-string-or-expression-without-metadata:
658
659 55/push-ebp
660 89/<- %ebp 4/r32/esp
661
662
663
664 68/push _test-input-stream/imm32
665
666 e8/call clear-stream/disp32
667
668 81 0/subop/add %esp 4/imm32
669
670 68/push 0/imm32/end
671 68/push 0/imm32/start
672 89/<- %ecx 4/r32/esp
673
674
675 68/push " ab"/imm32
676 68/push _test-input-stream/imm32
677
678 e8/call write/disp32
679
680 81 0/subop/add %esp 8/imm32
681
682
683 51/push-ecx
684 68/push _test-input-stream/imm32
685
686 e8/call next-word-string-or-expression-without-metadata/disp32
687
688 81 0/subop/add %esp 8/imm32
689
690
691 68/push "F - test-next-word-string-or-expression-without-metadata/updates-stream-read-correctly"/imm32
692 68/push 4/imm32
693 b8/copy-to-eax _test-input-stream/imm32
694 ff 6/subop/push *(eax+4)
695
696 e8/call check-ints-equal/disp32
697
698 81 0/subop/add %esp 0xc/imm32
699
700
701
702 68/push "F - test-next-word-string-or-expression-without-metadata: start"/imm32
703 68/push 0xe/imm32
704
705 8b/-> *ecx 0/r32/eax
706 81 5/subop/subtract %eax _test-input-stream/imm32
707 50/push-eax
708
709 e8/call check-ints-equal/disp32
710
711 81 0/subop/add %esp 0xc/imm32
712
713
714
715 68/push "F - test-next-word-string-or-expression-without-metadata: end"/imm32
716 68/push 0x10/imm32
717
718 8b/-> *(ecx+4) 0/r32/eax
719 81 5/subop/subtract %eax _test-input-stream/imm32
720 50/push-eax
721
722 e8/call check-ints-equal/disp32
723
724 81 0/subop/add %esp 0xc/imm32
725
726 89/<- %esp 5/r32/ebp
727 5d/pop-to-ebp
728 c3/return
729
730 test-next-word-string-or-expression-without-metadata-returns-whole-comment:
731
732 55/push-ebp
733 89/<- %ebp 4/r32/esp
734
735
736
737 68/push _test-input-stream/imm32
738
739 e8/call clear-stream/disp32
740
741 81 0/subop/add %esp 4/imm32
742
743 68/push 0/imm32/end
744 68/push 0/imm32/start
745 89/<- %ecx 4/r32/esp
746
747
748 68/push " # a"/imm32
749 68/push _test-input-stream/imm32
750
751 e8/call write/disp32
752
753 81 0/subop/add %esp 8/imm32
754
755
756 51/push-ecx
757 68/push _test-input-stream/imm32
758
759 e8/call next-word-string-or-expression-without-metadata/disp32
760
761 81 0/subop/add %esp 8/imm32
762
763
764 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-comment/updates-stream-read-correctly"/imm32
765 68/push 5/imm32
766 b8/copy-to-eax _test-input-stream/imm32
767 ff 6/subop/push *(eax+4)
768
769 e8/call check-ints-equal/disp32
770
771 81 0/subop/add %esp 0xc/imm32
772
773
774
775 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-comment: start"/imm32
776 68/push 0xe/imm32
777
778 8b/-> *ecx 0/r32/eax
779 81 5/subop/subtract %eax _test-input-stream/imm32
780 50/push-eax
781
782 e8/call check-ints-equal/disp32
783
784 81 0/subop/add %esp 0xc/imm32
785
786
787
788 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-comment: end"/imm32
789 68/push 0x11/imm32
790
791 8b/-> *(ecx+4) 0/r32/eax
792 81 5/subop/subtract %eax _test-input-stream/imm32
793 50/push-eax
794
795 e8/call check-ints-equal/disp32
796
797 81 0/subop/add %esp 0xc/imm32
798
799 89/<- %esp 5/r32/ebp
800 5d/pop-to-ebp
801 c3/return
802
803 test-next-word-string-or-expression-without-metadata-returns-empty-slice-on-eof:
804
805 55/push-ebp
806 89/<- %ebp 4/r32/esp
807
808
809
810 68/push _test-input-stream/imm32
811
812 e8/call clear-stream/disp32
813
814 81 0/subop/add %esp 4/imm32
815
816 68/push 0/imm32/end
817 68/push 0/imm32/start
818 89/<- %ecx 4/r32/esp
819
820
821
822 51/push-ecx
823 68/push _test-input-stream/imm32
824
825 e8/call next-word-string-or-expression-without-metadata/disp32
826
827 81 0/subop/add %esp 8/imm32
828
829
830 68/push "F - test-next-word-string-or-expression-without-metadata-returns-empty-expression-on-eof"/imm32
831 68/push 0/imm32
832
833 8b/-> *(ecx+4) 0/r32/eax
834 2b/subtract-> *ecx 0/r32/eax
835 50/push-eax
836
837 e8/call check-ints-equal/disp32
838
839 81 0/subop/add %esp 0xc/imm32
840
841 89/<- %esp 5/r32/ebp
842 5d/pop-to-ebp
843 c3/return
844
845 test-next-word-string-or-expression-without-metadata-returns-string-literal:
846
847 55/push-ebp
848 89/<- %ebp 4/r32/esp
849
850
851
852 68/push _test-input-stream/imm32
853
854 e8/call clear-stream/disp32
855
856 81 0/subop/add %esp 4/imm32
857
858 68/push 0/imm32/end
859 68/push 0/imm32/start
860 89/<- %ecx 4/r32/esp
861
862
863 68/push " \"a b\" "/imm32
864 68/push _test-input-stream/imm32
865
866 e8/call write/disp32
867
868 81 0/subop/add %esp 8/imm32
869
870
871 51/push-ecx
872 68/push _test-input-stream/imm32
873
874 e8/call next-word-string-or-expression-without-metadata/disp32
875
876 81 0/subop/add %esp 8/imm32
877
878
879
880 68/push "F - test-next-word-string-or-expression-without-metadata-returns-string-literal: start"/imm32
881 68/push 0xd/imm32
882
883 8b/-> *ecx 0/r32/eax
884 81 5/subop/subtract %eax _test-input-stream/imm32
885 50/push-eax
886
887 e8/call check-ints-equal/disp32
888
889 81 0/subop/add %esp 0xc/imm32
890
891
892
893 68/push "F - test-next-word-string-or-expression-without-metadata-returns-string-literal: end"/imm32
894 68/push 0x12/imm32
895
896 8b/-> *(ecx+4) 0/r32/eax
897 81 5/subop/subtract %eax _test-input-stream/imm32
898 50/push-eax
899
900 e8/call check-ints-equal/disp32
901
902 81 0/subop/add %esp 0xc/imm32
903
904 89/<- %esp 5/r32/ebp
905 5d/pop-to-ebp
906 c3/return
907
908 test-next-word-string-or-expression-without-metadata-returns-string-with-escapes:
909
910 55/push-ebp
911 89/<- %ebp 4/r32/esp
912
913
914
915 68/push _test-input-stream/imm32
916
917 e8/call clear-stream/disp32
918
919 81 0/subop/add %esp 4/imm32
920
921 68/push 0/imm32/end
922 68/push 0/imm32/start
923 89/<- %ecx 4/r32/esp
924
925
926 68/push " \"a\\\"b\""/imm32
927 68/push _test-input-stream/imm32
928
929 e8/call write/disp32
930
931 81 0/subop/add %esp 8/imm32
932
933
934 51/push-ecx
935 68/push _test-input-stream/imm32
936
937 e8/call next-word-string-or-expression-without-metadata/disp32
938
939 81 0/subop/add %esp 8/imm32
940
941
942
943 68/push "F - test-next-word-string-or-expression-without-metadata-returns-string-with-escapes: start"/imm32
944 68/push 0xd/imm32
945
946 8b/-> *ecx 0/r32/eax
947 81 5/subop/subtract %eax _test-input-stream/imm32
948 50/push-eax
949
950 e8/call check-ints-equal/disp32
951
952 81 0/subop/add %esp 0xc/imm32
953
954
955
956 68/push "F - test-next-word-string-or-expression-without-metadata-returns-string-with-escapes: end"/imm32
957 68/push 0x13/imm32
958
959 8b/-> *(ecx+4) 0/r32/eax
960 81 5/subop/subtract %eax _test-input-stream/imm32
961 50/push-eax
962
963 e8/call check-ints-equal/disp32
964
965 81 0/subop/add %esp 0xc/imm32
966
967 89/<- %esp 5/r32/ebp
968 5d/pop-to-ebp
969 c3/return
970
971 test-next-word-string-or-expression-without-metadata-returns-whole-expression:
972
973 55/push-ebp
974 89/<- %ebp 4/r32/esp
975
976
977
978 68/push _test-input-stream/imm32
979
980 e8/call clear-stream/disp32
981
982 81 0/subop/add %esp 4/imm32
983
984 68/push 0/imm32/end
985 68/push 0/imm32/start
986 89/<- %ecx 4/r32/esp
987
988
989 68/push " *(a b) "/imm32
990 68/push _test-input-stream/imm32
991
992 e8/call write/disp32
993
994 81 0/subop/add %esp 8/imm32
995
996
997 51/push-ecx
998 68/push _test-input-stream/imm32
999
1000 e8/call next-word-string-or-expression-without-metadata/disp32
1001
1002 81 0/subop/add %esp 8/imm32
1003
1004
1005
1006 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-expression: start"/imm32
1007 68/push 0xd/imm32
1008
1009 8b/-> *ecx 0/r32/eax
1010 81 5/subop/subtract %eax _test-input-stream/imm32
1011 50/push-eax
1012
1013 e8/call check-ints-equal/disp32
1014
1015 81 0/subop/add %esp 0xc/imm32
1016
1017
1018
1019 68/push "F - test-next-word-string-or-expression-without-metadata-returns-whole-expression: end"/imm32
1020 68/push 0x13/imm32
1021
1022 8b/-> *(ecx+4) 0/r32/eax
1023 81 5/subop/subtract %eax _test-input-stream/imm32
1024 50/push-eax
1025
1026 e8/call check-ints-equal/disp32
1027
1028 81 0/subop/add %esp 0xc/imm32
1029
1030 89/<- %esp 5/r32/ebp
1031 5d/pop-to-ebp
1032 c3/return
1033
1034 test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren:
1035
1036 55/push-ebp
1037 89/<- %ebp 4/r32/esp
1038
1039
1040
1041 68/push _test-input-stream/imm32
1042
1043 e8/call clear-stream/disp32
1044
1045 81 0/subop/add %esp 4/imm32
1046
1047 68/push 0/imm32/end
1048 68/push 0/imm32/start
1049 89/<- %ecx 4/r32/esp
1050
1051
1052 68/push " ) "/imm32
1053 68/push _test-input-stream/imm32
1054
1055 e8/call write/disp32
1056
1057 81 0/subop/add %esp 8/imm32
1058
1059
1060 51/push-ecx
1061 68/push _test-input-stream/imm32
1062
1063 e8/call next-word-string-or-expression-without-metadata/disp32
1064
1065 81 0/subop/add %esp 8/imm32
1066
1067
1068 68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: start"/imm32
1069 68/push 0/imm32
1070 ff 6/subop/push *ecx
1071
1072 e8/call check-ints-equal/disp32
1073
1074 81 0/subop/add %esp 0xc/imm32
1075
1076
1077 68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: end"/imm32
1078 68/push 0/imm32
1079 ff 6/subop/push *(ecx+4)
1080
1081 e8/call check-ints-equal/disp32
1082
1083 81 0/subop/add %esp 0xc/imm32
1084
1085 89/<- %esp 5/r32/ebp
1086 5d/pop-to-ebp
1087 c3/return
1088
1089 test-next-word-string-or-expression-without-metadata-handles-comment-after-trailing-close-paren:
1090
1091 55/push-ebp
1092 89/<- %ebp 4/r32/esp
1093
1094
1095
1096 68/push _test-input-stream/imm32
1097
1098 e8/call clear-stream/disp32
1099
1100 81 0/subop/add %esp 4/imm32
1101
1102 68/push 0/imm32/end
1103 68/push 0/imm32/start
1104 89/<- %ecx 4/r32/esp
1105
1106
1107 68/push " ) # abc "/imm32
1108 68/push _test-input-stream/imm32
1109
1110 e8/call write/disp32
1111
1112 81 0/subop/add %esp 8/imm32
1113
1114
1115 51/push-ecx
1116 68/push _test-input-stream/imm32
1117
1118 e8/call next-word-string-or-expression-without-metadata/disp32
1119
1120 81 0/subop/add %esp 8/imm32
1121
1122
1123 68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: start"/imm32
1124 68/push 0/imm32
1125 ff 6/subop/push *ecx
1126
1127 e8/call check-ints-equal/disp32
1128
1129 81 0/subop/add %esp 0xc/imm32
1130
1131
1132 68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: end"/imm32
1133 68/push 0/imm32
1134 ff 6/subop/push *(ecx+4)
1135
1136 e8/call check-ints-equal/disp32
1137
1138 81 0/subop/add %esp 0xc/imm32
1139
1140 89/<- %esp 5/r32/ebp
1141 5d/pop-to-ebp
1142 c3/return
1143
1144 test-next-word-string-or-expression-without-metadata-stops-at-close-paren:
1145
1146 55/push-ebp
1147 89/<- %ebp 4/r32/esp
1148
1149
1150
1151 68/push _test-input-stream/imm32
1152
1153 e8/call clear-stream/disp32
1154
1155 81 0/subop/add %esp 4/imm32
1156
1157 68/push 0/imm32/end
1158 68/push 0/imm32/start
1159 89/<- %ecx 4/r32/esp
1160
1161
1162 68/push " abc) # def"/imm32
1163 68/push _test-input-stream/imm32
1164
1165 e8/call write/disp32
1166
1167 81 0/subop/add %esp 8/imm32
1168
1169
1170 51/push-ecx
1171 68/push _test-input-stream/imm32
1172
1173 e8/call next-word-string-or-expression-without-metadata/disp32
1174
1175 81 0/subop/add %esp 8/imm32
1176
1177
1178
1179 68/push "F - test-next-word-string-or-expression-without-metadata-stops-at-close-paren: start"/imm32
1180 68/push 0xd/imm32
1181
1182 8b/-> *ecx 0/r32/eax
1183 81 5/subop/subtract %eax _test-input-stream/imm32
1184 50/push-eax
1185
1186 e8/call check-ints-equal/disp32
1187
1188 81 0/subop/add %esp 0xc/imm32
1189
1190
1191
1192 68/push "F - test-next-word-string-or-expression-without-metadata-stops-at-close-paren: end"/imm32
1193 68/push 0x10/imm32
1194
1195 8b/-> *(ecx+4) 0/r32/eax
1196 81 5/subop/subtract %eax _test-input-stream/imm32
1197 50/push-eax
1198
1199 e8/call check-ints-equal/disp32
1200
1201 81 0/subop/add %esp 0xc/imm32
1202
1203 89/<- %esp 5/r32/ebp
1204 5d/pop-to-ebp
1205 c3/return
1206
1207