https://github.com/akkartik/mu/blob/master/apps/dquotes.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 == code
18
19
20
21
22 Entry:
23
24 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
25
26
27
28
29 68/push Heap/imm32
30 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
31
32 e8/call new-segment/disp32
33
34 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
35
36
37
38 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
39 7e/jump-if-lesser-or-equal $subx-dquotes-main:interactive/disp8
40
41
42
43 68/push "test"/imm32
44 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
45
46 e8/call kernel-string-equal?/disp32
47
48 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
49
50 3d/compare-eax-and 0/imm32
51 74/jump-if-equal $subx-dquotes-main:interactive/disp8
52
53 e8/call run-tests/disp32
54
55 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
56 eb/jump $subx-dquotes-main:end/disp8
57 $subx-dquotes-main:interactive:
58
59
60 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32
61 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . .
62
63
64 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32
65
66
67 50/push-eax/ed
68 68/push Stderr/imm32
69 68/push Stdout/imm32
70 68/push Stdin/imm32
71
72 e8/call subx-dquotes/disp32
73
74 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
75
76 bb/copy-to-ebx 0/imm32
77 $subx-dquotes-main:end:
78 b8/copy-to-eax 1/imm32/exit
79 cd/syscall 0x80/imm8
80
81
82
83
84
85 subx-dquotes:
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 55/push-ebp
111 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
112
113 50/push-eax
114 51/push-ecx
115 52/push-edx
116 53/push-ebx
117 56/push-esi
118 57/push-edi
119
120 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
121 68/push 0x200/imm32/length
122 68/push 0/imm32/read
123 68/push 0/imm32/write
124 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
125
126 68/push 0/imm32/end
127 68/push 0/imm32/start
128 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
129
130
131
132 68/push 1/imm32
133 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32
134 68/push Heap/imm32
135
136 e8/call new-stream/disp32
137
138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
139
140 89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
141
142
143 68/push "== data\n"/imm32
144 57/push-edi
145
146 e8/call write/disp32
147
148 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
149 $subx-dquotes:line-loop:
150
151
152 51/push-ecx
153
154 e8/call clear-stream/disp32
155
156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
157
158
159 51/push-ecx
160 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
161
162 e8/call read-line-buffered/disp32
163
164 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
165 $subx-dquotes:check0:
166
167 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
168 0f 84/jump-if-equal $subx-dquotes:break/disp32
169 $subx-dquotes:word-loop:
170
171
172 52/push-edx
173 51/push-ecx
174
175 e8/call next-word-or-string/disp32
176
177 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
178 $subx-dquotes:check1:
179
180
181
182 52/push-edx
183
184 e8/call slice-empty?/disp32
185
186 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
187
188 3d/compare-eax-and 0/imm32
189 0f 85/jump-if-not-equal $subx-dquotes:next-line/disp32
190 $subx-dquotes:check-for-comment:
191
192
193 8b/copy 0/mod/indirect 2/rm32/edx . . . 6/r32/esi . .
194
195 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
196 8a/copy-byte 0/mod/indirect 6/rm32/esi . . . 0/r32/AL . .
197
198 3d/compare-eax-and 0x23/imm32/hash
199 74/jump-if-equal $subx-dquotes:word-loop/disp8
200 $subx-dquotes:check-for-string-literal:
201
202 3d/compare-eax-and 0x22/imm32/dquote
203 75/jump-if-not-equal $subx-dquotes:regular-word/disp8
204 $subx-dquotes:string-literal:
205
206
207 57/push-edi
208 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
209 52/push-edx
210
211 e8/call process-string-literal/disp32
212
213 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
214
215 eb/jump $subx-dquotes:next-word/disp8
216 $subx-dquotes:regular-word:
217
218
219 52/push-edx
220 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
221
222 e8/call write-slice-buffered/disp32
223
224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
225
226 $subx-dquotes:next-word:
227
228
229 68/push Space/imm32
230 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
231
232 e8/call write-buffered/disp32
233
234 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
235
236 eb/jump $subx-dquotes:word-loop/disp8
237 $subx-dquotes:next-line:
238
239
240 68/push Newline/imm32
241 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
242
243 e8/call write-buffered/disp32
244
245 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
246
247 e9/jump $subx-dquotes:line-loop/disp32
248 $subx-dquotes:break:
249
250
251 57/push-edi
252 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
253
254 e8/call write-stream-data/disp32
255
256 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
257
258
259 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
260
261 e8/call flush/disp32
262
263 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
264 $subx-dquotes:end:
265
266 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
267
268 5f/pop-to-edi
269 5e/pop-to-esi
270 5b/pop-to-ebx
271 5a/pop-to-edx
272 59/pop-to-ecx
273 58/pop-to-eax
274
275 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
276 5d/pop-to-ebp
277 c3/return
278
279
280
281 process-string-literal:
282
283
284
285
286
287
288
289
290 55/push-ebp
291 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
292
293 51/push-ecx
294
295 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0xa/imm32
296 68/push 0xa/imm32/decimal-digits-in-32bit-number
297 68/push 0/imm32/read
298 68/push 0/imm32/write
299 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
300
301
302
303 68/push "_string"/imm32
304 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
305
306 e8/call write/disp32
307
308 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
309
310
311 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
312 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
313
314 e8/call print-int32-decimal/disp32
315
316 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
317
318
319 68/push ":\n"/imm32
320 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
321
322 e8/call write/disp32
323
324 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
325
326
327 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
328 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
329
330 e8/call emit-string-literal-data/disp32
331
332 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
333
334
335 68/push Newline/imm32
336 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
337
338 e8/call write/disp32
339
340 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
341
342
343
344 68/push "_string"/imm32
345 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
346
347 e8/call write-buffered/disp32
348
349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
350
351
352 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
353 51/push-ecx
354
355 e8/call print-int32-decimal/disp32
356
357 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
358
359
360 51/push-ecx
361 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
362
363 e8/call write-stream-data/disp32
364
365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
366
367
368 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
369 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
370
371 e8/call emit-metadata/disp32
372
373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
374
375 ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
376 $process-string-literal:end:
377
378 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x16/imm32
379
380 59/pop-to-ecx
381
382 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
383 5d/pop-to-ebp
384 c3/return
385
386 test-subx-dquotes-is-idempotent-by-default:
387
388 55/push-ebp
389 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
390
391
392
393 68/push _test-input-stream/imm32
394
395 e8/call clear-stream/disp32
396
397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
398
399
400 68/push _test-input-buffered-file->buffer/imm32
401
402 e8/call clear-stream/disp32
403
404 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
405
406
407 68/push _test-output-stream/imm32
408
409 e8/call clear-stream/disp32
410
411 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
412
413
414 68/push _test-output-buffered-file->buffer/imm32
415
416 e8/call clear-stream/disp32
417
418 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
419
420
421
422
423
424
425
426
427
428
429
430
431 68/push "# comment 1\n"/imm32
432 68/push _test-input-stream/imm32
433
434 e8/call write/disp32
435
436 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
437
438
439 68/push " # comment 2 indented\n"/imm32
440 68/push _test-input-stream/imm32
441
442 e8/call write/disp32
443
444 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
445
446
447 68/push "== code 0x1\n"/imm32
448 68/push _test-input-stream/imm32
449
450 e8/call write/disp32
451
452 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
453
454
455 68/push "# comment 3 inside a segment\n"/imm32
456 68/push _test-input-stream/imm32
457
458 e8/call write/disp32
459
460 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
461
462
463 68/push "1\n"/imm32
464 68/push _test-input-stream/imm32
465
466 e8/call write/disp32
467
468 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
469
470
471 68/push Newline/imm32
472 68/push _test-input-stream/imm32
473
474 e8/call write/disp32
475
476 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
477
478
479 68/push "2 3 # comment 4 inline with other contents\n"/imm32
480 68/push _test-input-stream/imm32
481
482 e8/call write/disp32
483
484 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
485
486
487 68/push "== data 0x2\n"/imm32
488 68/push _test-input-stream/imm32
489
490 e8/call write/disp32
491
492 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
493
494
495 68/push "4 5/imm32\n"/imm32
496 68/push _test-input-stream/imm32
497
498 e8/call write/disp32
499
500 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
501
502
503 68/push _test-output-buffered-file/imm32
504 68/push _test-input-buffered-file/imm32
505
506 e8/call subx-dquotes/disp32
507
508 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
509
510
511 68/push _test-output-buffered-file/imm32
512
513 e8/call flush/disp32
514
515 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
516
517
518
519
520
521
522
523
524
525
526
527 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
553
554
555 68/push "F - test-subx-dquotes-is-idempotent-by-default/0"/imm32
556 68/push ""/imm32
557 68/push _test-output-stream/imm32
558
559 e8/call check-next-stream-line-equal/disp32
560
561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
562
563
564 68/push "F - test-subx-dquotes-is-idempotent-by-default/1"/imm32
565 68/push ""/imm32
566 68/push _test-output-stream/imm32
567
568 e8/call check-next-stream-line-equal/disp32
569
570 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
571
572
573 68/push "F - test-subx-dquotes-is-idempotent-by-default/2"/imm32
574 68/push "== code 0x1 "/imm32
575 68/push _test-output-stream/imm32
576
577 e8/call check-next-stream-line-equal/disp32
578
579 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
580
581
582 68/push "F - test-subx-dquotes-is-idempotent-by-default/3"/imm32
583 68/push ""/imm32
584 68/push _test-output-stream/imm32
585
586 e8/call check-next-stream-line-equal/disp32
587
588 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
589
590
591 68/push "F - test-subx-dquotes-is-idempotent-by-default/4"/imm32
592 68/push "1 "/imm32
593 68/push _test-output-stream/imm32
594
595 e8/call check-next-stream-line-equal/disp32
596
597 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
598
599
600 68/push "F - test-subx-dquotes-is-idempotent-by-default/5"/imm32
601 68/push ""/imm32
602 68/push _test-output-stream/imm32
603
604 e8/call check-next-stream-line-equal/disp32
605
606 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
607
608
609 68/push "F - test-subx-dquotes-is-idempotent-by-default/6"/imm32
610 68/push "2 3 "/imm32
611 68/push _test-output-stream/imm32
612
613 e8/call check-next-stream-line-equal/disp32
614
615 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
616
617
618 68/push "F - test-subx-dquotes-is-idempotent-by-default/7"/imm32
619 68/push "== data 0x2 "/imm32
620 68/push _test-output-stream/imm32
621
622 e8/call check-next-stream-line-equal/disp32
623
624 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
625
626
627 68/push "F - test-subx-dquotes-is-idempotent-by-default/8"/imm32
628 68/push "4 5/imm32 "/imm32
629 68/push _test-output-stream/imm32
630
631 e8/call check-next-stream-line-equal/disp32
632
633 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
634
635 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
636 5d/pop-to-ebp
637 c3/return
638
639 test-subx-dquotes-processes-string-literals:
640
641 55/push-ebp
642 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
643
644
645
646 68/push _test-input-stream/imm32
647
648 e8/call clear-stream/disp32
649
650 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
651
652
653 68/push _test-input-buffered-file->buffer/imm32
654
655 e8/call clear-stream/disp32
656
657 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
658
659
660 68/push _test-output-stream/imm32
661
662 e8/call clear-stream/disp32
663
664 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
665
666
667 68/push _test-output-buffered-file->buffer/imm32
668
669 e8/call clear-stream/disp32
670
671 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
672
673
674
675
676 68/push "== code 0x1\n"/imm32
677 68/push _test-input-stream/imm32
678
679 e8/call write/disp32
680
681 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
682
683
684 68/push "1 \"a\"/x\n"/imm32
685 68/push _test-input-stream/imm32
686
687 e8/call write/disp32
688
689 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
690
691
692 68/push "2 \"bc\"/y\n"/imm32
693 68/push _test-input-stream/imm32
694
695 e8/call write/disp32
696
697 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
698
699
700 68/push _test-output-buffered-file/imm32
701 68/push _test-input-buffered-file/imm32
702
703 e8/call subx-dquotes/disp32
704
705 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
706
707
708 68/push _test-output-buffered-file/imm32
709
710 e8/call flush/disp32
711
712 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729 +-- 33 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
762
763
764 68/push "F - test-subx-dquotes-processes-string-literals/0"/imm32
765 68/push "== code 0x1 "/imm32
766 68/push _test-output-stream/imm32
767
768 e8/call check-next-stream-line-equal/disp32
769
770 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
771
772
773 68/push "F - test-subx-dquotes-processes-string-literals/1"/imm32
774 68/push "1 _string1/x "/imm32
775 68/push _test-output-stream/imm32
776
777 e8/call check-next-stream-line-equal/disp32
778
779 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
780
781
782 68/push "F - test-subx-dquotes-processes-string-literals/2"/imm32
783 68/push "2 _string2/y "/imm32
784 68/push _test-output-stream/imm32
785
786 e8/call check-next-stream-line-equal/disp32
787
788 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
789
790
791 68/push "F - test-subx-dquotes-processes-string-literals/3"/imm32
792 68/push "== data"/imm32
793 68/push _test-output-stream/imm32
794
795 e8/call check-next-stream-line-equal/disp32
796
797 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
798
799
800 68/push "F - test-subx-dquotes-processes-string-literals/4"/imm32
801 68/push "_string1:"/imm32
802 68/push _test-output-stream/imm32
803
804 e8/call check-next-stream-line-equal/disp32
805
806 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
807
808
809 68/push "F - test-subx-dquotes-processes-string-literals/5"/imm32
810 68/push "0x00000001/imm32 61/a "/imm32
811 68/push _test-output-stream/imm32
812
813 e8/call check-next-stream-line-equal/disp32
814
815 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
816
817
818 68/push "F - test-subx-dquotes-processes-string-literals/6"/imm32
819 68/push "_string2:"/imm32
820 68/push _test-output-stream/imm32
821
822 e8/call check-next-stream-line-equal/disp32
823
824 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
825
826
827 68/push "F - test-subx-dquotes-processes-string-literals/7"/imm32
828 68/push "0x00000002/imm32 62/b 63/c "/imm32
829 68/push _test-output-stream/imm32
830
831 e8/call check-next-stream-line-equal/disp32
832
833 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
834
835 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
836 5d/pop-to-ebp
837 c3/return
838
839
840 emit-string-literal-data:
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869 55/push-ebp
870 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
871
872 50/push-eax
873 51/push-ecx
874 52/push-edx
875 53/push-ebx
876 56/push-esi
877
878 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 .
879
880 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
881
882 8b/copy 0/mod/indirect 6/rm32/esi . . . 2/r32/edx . .
883
884 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 6/r32/esi 4/disp8 .
885 $emit-string-literal-data:emit-length:
886
887
888 56/push-esi
889 52/push-edx
890
891 e8/call string-length-at-start-of-slice/disp32
892
893 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
894
895
896
897 50/push-eax
898 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
899
900 e8/call print-int32/disp32
901
902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
903
904
905 68/push "/imm32 "/imm32
906 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
907
908 e8/call write/disp32
909
910 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
911 $emit-string-literal-data:loop-init:
912
913 42/increment-edx
914
915 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . .
916 $emit-string-literal-data:loop:
917
918 39/compare 3/mod/direct 2/rm32/edx . . . 6/r32/esi . .
919 0f 83/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp32
920
921 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 1/r32/CL . .
922
923 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x22/imm32/dquote
924 0f 84/jump-if-equal $emit-string-literal-data:end/disp32
925
926 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x5c/imm32/backslash
927 75/jump-if-not-equal $emit-string-literal-data:emit/disp8
928
929 42/increment-edx
930
931 39/compare 3/mod/direct 2/rm32/edx . . . 6/r32/esi . .
932 0f 83/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp32
933
934 8a/copy-byte 0/mod/indirect 2/rm32/edx . . . 1/r32/CL . .
935
936 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x6e/imm32/n
937 75/jump-if-not-equal $emit-string-literal-data:emit/disp8
938 b9/copy-to-ecx 0x0a/imm32/newline
939 $emit-string-literal-data:emit:
940
941
942 51/push-ecx
943 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
944
945 e8/call append-byte-hex/disp32
946
947 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
948
949
950
951 51/push-ecx
952
953 e8/call is-alphanumeric?/disp32
954
955 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
956
957 3d/compare-eax-and 0/imm32
958 74/jump-if-equal $emit-string-literal-data:char-done/disp8
959
960
961 68/push Slash/imm32
962 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
963
964 e8/call write/disp32
965
966 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
967
968
969 51/push-ecx
970 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
971
972 e8/call append-byte/disp32
973
974 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
975 $emit-string-literal-data:char-done:
976
977
978 68/push Space/imm32
979 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
980
981 e8/call write/disp32
982
983 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
984
985 42/increment-edx
986
987 43/increment-ebx
988
989 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x40/imm32
990 7c/jump-if-lesser $emit-string-literal-data:next-char/disp8
991
992 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
993
994
995 68/push Newline/imm32
996 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
997
998 e8/call write/disp32
999
1000 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1001 $emit-string-literal-data:next-char:
1002 e9/jump $emit-string-literal-data:loop/disp32
1003 $emit-string-literal-data:end:
1004
1005 5e/pop-to-esi
1006 5b/pop-to-ebx
1007 5a/pop-to-edx
1008 59/pop-to-ecx
1009 58/pop-to-eax
1010
1011 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1012 5d/pop-to-ebp
1013 c3/return
1014
1015 is-alphanumeric?:
1016
1017 55/push-ebp
1018 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1019
1020 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 .
1021
1022 3d/compare-eax-with 0x30/imm32/0
1023 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1024
1025 3d/compare-eax-with 0x39/imm32/9
1026 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1027
1028 3d/compare-eax-with 0x41/imm32/A
1029 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1030
1031 3d/compare-eax-with 0x5a/imm32/Z
1032 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1033
1034 3d/compare-eax-with 0x61/imm32/a
1035 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1036
1037 3d/compare-eax-with 0x7a/imm32/z
1038 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1039
1040 $is-alphanumeric?:false:
1041 b8/copy-to-eax 0/imm32/false
1042 eb/jump $is-alphanumeric?:end/disp8
1043 $is-alphanumeric?:true:
1044 b8/copy-to-eax 1/imm32/true
1045 $is-alphanumeric?:end:
1046
1047 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1048 5d/pop-to-ebp
1049 c3/return
1050
1051 test-emit-string-literal-data:
1052
1053 55/push-ebp
1054 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1055
1056
1057
1058 68/push _test-output-stream/imm32
1059
1060 e8/call clear-stream/disp32
1061
1062 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1063
1064 68/push _test-slice-abc-limit/imm32
1065 68/push _test-slice-abc/imm32
1066 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1067
1068
1069 51/push-ecx
1070 68/push _test-output-stream/imm32
1071
1072 e8/call emit-string-literal-data/disp32
1073
1074 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1075 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1101
1102
1103 68/push "F - test-emit-string-literal-data"/imm32
1104 68/push "0x00000003/imm32 61/a 62/b 63/c "/imm32
1105 68/push _test-output-stream/imm32
1106
1107 e8/call check-stream-equal/disp32
1108
1109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1110
1111 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1112 5d/pop-to-ebp
1113 c3/return
1114
1115 test-emit-string-literal-data-empty:
1116
1117 55/push-ebp
1118 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1119
1120
1121
1122 68/push _test-output-stream/imm32
1123
1124 e8/call clear-stream/disp32
1125
1126 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1127
1128 68/push 0/imm32/end
1129 68/push 0/imm32/start
1130 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1131
1132
1133 51/push-ecx
1134 68/push _test-output-stream/imm32
1135
1136 e8/call emit-string-literal-data/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1139 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1165
1166
1167 68/push "F - test-emit-string-literal-data-empty"/imm32
1168 68/push "0x00000000/imm32 "/imm32
1169 68/push _test-output-stream/imm32
1170
1171 e8/call check-stream-equal/disp32
1172
1173 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1174
1175 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1176 5d/pop-to-ebp
1177 c3/return
1178
1179
1180 test-emit-string-literal-data-no-metadata-for-non-alphanumerics:
1181
1182 55/push-ebp
1183 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1184
1185
1186
1187 68/push _test-output-stream/imm32
1188
1189 e8/call clear-stream/disp32
1190
1191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1192
1193 68/push _test-slice-a-space-b-limit/imm32
1194 68/push _test-slice-a-space-b/imm32
1195 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1196
1197
1198 51/push-ecx
1199 68/push _test-output-stream/imm32
1200
1201 e8/call emit-string-literal-data/disp32
1202
1203 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1204 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1230
1231
1232 68/push "F - test-emit-string-literal-data-no-metadata-for-non-alphanumerics"/imm32
1233 68/push "0x00000003/imm32 61/a 20 62/b "/imm32
1234 68/push _test-output-stream/imm32
1235
1236 e8/call check-stream-equal/disp32
1237
1238 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1239
1240 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1241 5d/pop-to-ebp
1242 c3/return
1243
1244 test-emit-string-literal-data-handles-escape-sequences:
1245
1246 55/push-ebp
1247 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1248
1249
1250
1251 68/push _test-output-stream/imm32
1252
1253 e8/call clear-stream/disp32
1254
1255 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1256
1257 68/push _test-slice-a-dquote-b-limit/imm32
1258 68/push _test-slice-a-dquote-b/imm32
1259 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1260
1261
1262 51/push-ecx
1263 68/push _test-output-stream/imm32
1264
1265 e8/call emit-string-literal-data/disp32
1266
1267 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1268 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1294
1295
1296 68/push "F - test-emit-string-literal-data-handles-escape-sequences"/imm32
1297 68/push "0x00000003/imm32 61/a 22 62/b "/imm32
1298 68/push _test-output-stream/imm32
1299
1300 e8/call check-stream-equal/disp32
1301
1302 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1303
1304 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1305 5d/pop-to-ebp
1306 c3/return
1307
1308 test-emit-string-literal-data-handles-newline-escape:
1309
1310 55/push-ebp
1311 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1312
1313
1314
1315 68/push _test-output-stream/imm32
1316
1317 e8/call clear-stream/disp32
1318
1319 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1320
1321 68/push _test-slice-a-newline-b-limit/imm32
1322 68/push _test-slice-a-newline-b/imm32
1323 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1324
1325
1326 51/push-ecx
1327 68/push _test-output-stream/imm32
1328
1329 e8/call emit-string-literal-data/disp32
1330
1331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1332 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1358
1359
1360 68/push "F - test-emit-string-literal-data-handles-newline-escape"/imm32
1361 68/push "0x00000003/imm32 61/a 0a 62/b "/imm32
1362 68/push _test-output-stream/imm32
1363
1364 e8/call check-stream-equal/disp32
1365
1366 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1367
1368 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1369 5d/pop-to-ebp
1370 c3/return
1371
1372
1373 emit-metadata:
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390 55/push-ebp
1391 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1392
1393 50/push-eax
1394 51/push-ecx
1395 52/push-edx
1396 53/push-ebx
1397 56/push-esi
1398
1399 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 .
1400
1401 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
1402
1403 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 .
1404
1405 52/push-edx
1406 68/push 0/imm32
1407 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . .
1408
1409 b8/copy-to-eax 0/imm32
1410 $emit-metadata:check-for-string-literal:
1411
1412 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
1413 3d/compare-eax-and 0x22/imm32/dquote
1414 75/jump-if-not-equal $emit-metadata:skip-datum-loop/disp8
1415 $emit-metadata:skip-string-literal:
1416
1417
1418 52/push-edx
1419 51/push-ecx
1420
1421 e8/call skip-string-in-slice/disp32
1422
1423 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1424
1425 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
1426 eb/jump $emit-metadata:emit/disp8
1427 $emit-metadata:skip-datum-loop:
1428
1429
1430 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
1431 74/jump-if-equal $emit-metadata:end/disp8
1432
1433 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
1434 3d/compare-eax-and 0x2f/imm32/slash
1435 74/jump-if-equal $emit-metadata:emit/disp8
1436
1437 41/increment-ecx
1438 eb/jump $emit-metadata:skip-datum-loop/disp8
1439 $emit-metadata:emit:
1440
1441 89/copy 0/mod/indirect 3/rm32/ebx . . . 1/r32/ecx . .
1442
1443
1444 53/push-ebx
1445 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1446
1447 e8/call write-slice-buffered/disp32
1448
1449 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . 8/imm32 .
1450 $emit-metadata:end:
1451
1452 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . 8/imm32 .
1453
1454 5e/pop-to-esi
1455 5b/pop-to-ebx
1456 5a/pop-to-edx
1457 59/pop-to-ecx
1458 58/pop-to-eax
1459
1460 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1461 5d/pop-to-ebp
1462 c3/return
1463
1464 test-emit-metadata:
1465
1466 55/push-ebp
1467 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1468
1469
1470
1471 68/push _test-output-stream/imm32
1472
1473 e8/call clear-stream/disp32
1474
1475 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1476
1477
1478 68/push _test-output-buffered-file->buffer/imm32
1479
1480 e8/call clear-stream/disp32
1481
1482 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1483
1484 b8/copy-to-eax "abc/def"/imm32
1485 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1486 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1487 05/add-to-eax 4/imm32
1488
1489 51/push-ecx
1490 50/push-eax
1491 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1492
1493
1494 51/push-ecx
1495 68/push _test-output-buffered-file/imm32
1496
1497 e8/call emit-metadata/disp32
1498
1499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1500
1501
1502 68/push _test-output-buffered-file/imm32
1503
1504 e8/call flush/disp32
1505
1506 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1507
1508
1509 68/push "F - test-emit-metadata"/imm32
1510 68/push "/def"/imm32
1511 68/push _test-output-stream/imm32
1512
1513 e8/call check-stream-equal/disp32
1514
1515 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1516
1517 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1518 5d/pop-to-ebp
1519 c3/return
1520
1521 test-emit-metadata-none:
1522
1523 55/push-ebp
1524 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1525
1526
1527
1528 68/push _test-output-stream/imm32
1529
1530 e8/call clear-stream/disp32
1531
1532 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1533
1534
1535 68/push _test-output-buffered-file->buffer/imm32
1536
1537 e8/call clear-stream/disp32
1538
1539 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1540
1541 b8/copy-to-eax "abc"/imm32
1542 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1543 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1544 05/add-to-eax 4/imm32
1545
1546 51/push-ecx
1547 50/push-eax
1548 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1549
1550
1551 51/push-ecx
1552 68/push _test-output-buffered-file/imm32
1553
1554 e8/call emit-metadata/disp32
1555
1556 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1557
1558
1559 68/push _test-output-buffered-file/imm32
1560
1561 e8/call flush/disp32
1562
1563 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1564
1565
1566 68/push "F - test-emit-metadata-none"/imm32
1567 68/push ""/imm32
1568 68/push _test-output-stream/imm32
1569
1570 e8/call check-stream-equal/disp32
1571
1572 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1573
1574 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1575 5d/pop-to-ebp
1576 c3/return
1577
1578 test-emit-metadata-multiple:
1579
1580 55/push-ebp
1581 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1582
1583
1584
1585 68/push _test-output-stream/imm32
1586
1587 e8/call clear-stream/disp32
1588
1589 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1590
1591
1592 68/push _test-output-buffered-file->buffer/imm32
1593
1594 e8/call clear-stream/disp32
1595
1596 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1597
1598 b8/copy-to-eax "abc/def/ghi"/imm32
1599 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1600 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1601 05/add-to-eax 4/imm32
1602
1603 51/push-ecx
1604 50/push-eax
1605 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1606
1607
1608 51/push-ecx
1609 68/push _test-output-buffered-file/imm32
1610
1611 e8/call emit-metadata/disp32
1612
1613 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1614
1615
1616 68/push _test-output-buffered-file/imm32
1617
1618 e8/call flush/disp32
1619
1620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1621
1622
1623 68/push "F - test-emit-metadata-multiple"/imm32
1624 68/push "/def/ghi"/imm32
1625 68/push _test-output-stream/imm32
1626
1627 e8/call check-stream-equal/disp32
1628
1629 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1630
1631 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1632 5d/pop-to-ebp
1633 c3/return
1634
1635 test-emit-metadata-when-no-datum:
1636
1637 55/push-ebp
1638 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1639
1640
1641
1642 68/push _test-output-stream/imm32
1643
1644 e8/call clear-stream/disp32
1645
1646 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1647
1648
1649 68/push _test-output-buffered-file->buffer/imm32
1650
1651 e8/call clear-stream/disp32
1652
1653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1654
1655 b8/copy-to-eax "/abc"/imm32
1656
1657 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1658 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1659 51/push-ecx
1660
1661 05/add-to-eax 4/imm32
1662 50/push-eax
1663
1664 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1665
1666
1667 51/push-ecx
1668 68/push _test-output-buffered-file/imm32
1669
1670 e8/call emit-metadata/disp32
1671
1672 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1673
1674
1675 68/push _test-output-buffered-file/imm32
1676
1677 e8/call flush/disp32
1678
1679 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1680
1681
1682 68/push "F - test-emit-metadata-when-no-datum"/imm32
1683 68/push "/abc"/imm32
1684 68/push _test-output-stream/imm32
1685
1686 e8/call check-stream-equal/disp32
1687
1688 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1689
1690 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1691 5d/pop-to-ebp
1692 c3/return
1693
1694 test-emit-metadata-in-string-literal:
1695
1696 55/push-ebp
1697 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1698
1699
1700
1701 68/push _test-output-stream/imm32
1702
1703 e8/call clear-stream/disp32
1704
1705 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1706
1707
1708 68/push _test-output-buffered-file->buffer/imm32
1709
1710 e8/call clear-stream/disp32
1711
1712 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1713
1714 68/push _test-slice-literal-string-with-limit/imm32
1715 68/push _test-slice-literal-string/imm32/start
1716 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1717
1718
1719 51/push-ecx
1720 68/push _test-output-buffered-file/imm32
1721
1722 e8/call emit-metadata/disp32
1723
1724 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1725
1726
1727 68/push _test-output-buffered-file/imm32
1728
1729 e8/call flush/disp32
1730
1731 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1732 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1758
1759
1760 68/push "F - test-emit-metadata-in-string-literal"/imm32
1761 68/push "/ghi"/imm32
1762 68/push _test-output-stream/imm32
1763
1764 e8/call check-stream-equal/disp32
1765
1766 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1767
1768 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1769 5d/pop-to-ebp
1770 c3/return
1771
1772 string-length-at-start-of-slice:
1773
1774 55/push-ebp
1775 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1776
1777 51/push-ecx
1778 52/push-edx
1779 53/push-ebx
1780
1781 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 8/disp8 .
1782
1783 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 2/r32/edx 0xc/disp8 .
1784
1785 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1786
1787 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
1788
1789 41/increment-ecx
1790 $string-length-at-start-of-slice:loop:
1791
1792 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
1793 73/jump-if-greater-unsigned-or-equal $string-length-at-start-of-slice:end/disp8
1794
1795 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 3/r32/BL . .
1796 $string-length-at-start-of-slice:dquote:
1797
1798 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x22/imm32/dquote
1799 74/jump-if-equal $string-length-at-start-of-slice:end/disp8
1800 $string-length-at-start-of-slice:check-for-escape:
1801
1802 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x5c/imm32/backslash
1803 75/jump-if-not-equal $string-length-at-start-of-slice:continue/disp8
1804 $string-length-at-start-of-slice:escape:
1805
1806 41/increment-ecx
1807 $string-length-at-start-of-slice:continue:
1808
1809 40/increment-eax
1810
1811 41/increment-ecx
1812 eb/jump $string-length-at-start-of-slice:loop/disp8
1813 $string-length-at-start-of-slice:end:
1814
1815 5b/pop-to-ebx
1816 5a/pop-to-edx
1817 59/pop-to-ecx
1818
1819 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1820 5d/pop-to-ebp
1821 c3/return
1822
1823 test-string-length-at-start-of-slice:
1824
1825 55/push-ebp
1826 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1827
1828 b8/copy-to-eax "\"abc\" def"/imm32
1829 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1830 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1831 05/add-to-eax 4/imm32
1832
1833
1834 51/push-ecx
1835 50/push-eax
1836
1837 e8/call string-length-at-start-of-slice/disp32
1838
1839 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1840
1841
1842 68/push "F - test-string-length-at-start-of-slice"/imm32
1843 68/push 3/imm32
1844 50/push-eax
1845
1846 e8/call check-ints-equal/disp32
1847
1848 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1849
1850 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1851 5d/pop-to-ebp
1852 c3/return
1853
1854 test-string-length-at-start-of-slice-escaped:
1855
1856 55/push-ebp
1857 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1858
1859 b8/copy-to-eax "\"ab\\c\" def"/imm32
1860 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1861 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1862 05/add-to-eax 4/imm32
1863
1864
1865 51/push-ecx
1866 50/push-eax
1867
1868 e8/call string-length-at-start-of-slice/disp32
1869
1870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1871
1872
1873 68/push "F - test-string-length-at-start-of-slice-escaped"/imm32
1874 68/push 3/imm32
1875 50/push-eax
1876
1877 e8/call check-ints-equal/disp32
1878
1879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1880
1881 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1882 5d/pop-to-ebp
1883 c3/return
1884
1885 == data
1886
1887 Next-string-literal:
1888 1/imm32
1889
1890 _test-slice-abc:
1891 22/dquote 61/a 62/b 63/c 22/dquote
1892 2f/slash 64/d
1893 _test-slice-abc-limit:
1894
1895 _test-slice-a-space-b:
1896 22/dquote 61/a 20/space 62/b 22/dquote
1897 _test-slice-a-space-b-limit:
1898
1899 _test-slice-a-dquote-b:
1900 22/dquote 61/a 5c/backslash 22/dquote 62/b 22/dquote
1901 _test-slice-a-dquote-b-limit:
1902
1903 _test-slice-a-newline-b:
1904 22/dquote 61/a 5c/backslash 6e/n 62/b 22/dquote
1905 _test-slice-a-newline-b-limit:
1906
1907
1908 _test-slice-literal-string:
1909 22/dquote
1910 61/a 62/b 63/c
1911 2f/slash 64/d 65/e 66/f
1912 22/dquote
1913 2f/slash 67/g 68/h 69/i
1914 _test-slice-literal-string-with-limit:
1915
1916