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