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
25
26 68/push Heap/imm32
27 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
28
29 e8/call new-segment/disp32
30
31 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
32
33
34
35 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
36
37
38 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
39 7e/jump-if-lesser-or-equal $run-main/disp8
40
41
42 68/push "test"/imm32
43 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
44
45 e8/call kernel-string-equal?/disp32
46
47 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
48
49 3d/compare-EAX-and 1/imm32
50 75/jump-if-not-equal $run-main/disp8
51
52 e8/call run-tests/disp32
53 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
54 eb/jump $main:end/disp8
55 $run-main:
56
57
58 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
59 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
60
61
62 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
63
64
65 50/push-EAX/ed
66 68/push Stderr/imm32
67 68/push Stdout/imm32
68 68/push Stdin/imm32
69
70 e8/call convert/disp32
71
72 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/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
80
81
82
83 convert:
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 55/push-EBP
109 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
110
111 50/push-EAX
112 51/push-ECX
113 52/push-EDX
114 53/push-EBX
115 56/push-ESI
116 57/push-EDI
117
118 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
119 68/push 0x200/imm32/length
120 68/push 0/imm32/read
121 68/push 0/imm32/write
122 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
123
124 68/push 0/imm32/end
125 68/push 0/imm32/start
126 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
127
128
129
130 68/push 1/imm32
131 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32
132 68/push Heap/imm32
133
134 e8/call new-stream/disp32
135
136 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
137
138 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
139
140
141 68/push "== data\n"/imm32
142 57/push-EDI
143
144 e8/call write/disp32
145
146 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
147 $convert:line-loop:
148
149
150 51/push-ECX
151
152 e8/call clear-stream/disp32
153
154 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
155
156
157 51/push-ECX
158 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
159
160 e8/call read-line-buffered/disp32
161
162 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
163 $convert:check0:
164
165 81 7/subop/compare 0/mod/indirect 1/rm32/ECX . . . . . 0/imm32
166 0f 84/jump-if-equal $convert:break/disp32
167 $convert:word-loop:
168
169
170 52/push-EDX
171 51/push-ECX
172
173 e8/call next-word-or-string/disp32
174
175 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
176 $convert:check1:
177
178
179
180 52/push-EDX
181
182 e8/call slice-empty?/disp32
183
184 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
185
186 3d/compare-EAX-and 0/imm32
187 0f 85/jump-if-not-equal $convert:next-line/disp32
188 $convert:check-for-comment:
189
190
191 8b/copy 0/mod/indirect 2/rm32/EDX . . . 6/r32/ESI . .
192
193 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
194 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 0/r32/AL . .
195
196 3d/compare-EAX-and 0x23/imm32/hash
197 74/jump-if-equal $convert:word-loop/disp8
198 $convert:check-for-string-literal:
199 3d/compare-EAX-and 0x22/imm32/dquote
200 75/jump-if-not-equal $convert:regular-word/disp8
201 $convert:string-literal:
202
203
204 57/push-EDI
205 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
206 52/push-EDX
207
208 e8/call process-string-literal/disp32
209
210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
211
212 eb/jump $convert:next-word/disp8
213 $convert:regular-word:
214
215
216 52/push-EDX
217 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
218
219 e8/call write-slice-buffered/disp32
220
221 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
222
223 $convert:next-word:
224
225
226 68/push " "/imm32
227 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
228
229 e8/call write-buffered/disp32
230
231 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
232
233 eb/jump $convert:word-loop/disp8
234 $convert:next-line:
235
236
237 68/push Newline/imm32
238 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
239
240 e8/call write-buffered/disp32
241
242 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
243
244 e9/jump $convert:line-loop/disp32
245 $convert:break:
246
247
248 57/push-EDI
249 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
250
251 e8/call write-stream-data/disp32
252
253 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
254
255
256 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
257
258 e8/call flush/disp32
259
260 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
261 $convert:end:
262
263 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
264
265 5f/pop-to-EDI
266 5e/pop-to-ESI
267 5b/pop-to-EBX
268 5a/pop-to-EDX
269 59/pop-to-ECX
270 58/pop-to-EAX
271
272 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
273 5d/pop-to-EBP
274 c3/return
275
276
277
278 process-string-literal:
279
280
281
282
283
284
285
286
287 55/push-EBP
288 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
289
290 51/push-ECX
291
292 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0xa/imm32
293 68/push 0xa/imm32/decimal-digits-in-32bit-number
294 68/push 0/imm32/read
295 68/push 0/imm32/write
296 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
297
298
299
300 68/push "_string"/imm32
301 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
302
303 e8/call write/disp32
304
305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
306
307
308 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
309 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
310
311 e8/call print-int32-decimal/disp32
312
313 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
314
315
316 68/push ":\n"/imm32
317 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
318
319 e8/call write/disp32
320
321 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
322
323
324 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x8/disp8 .
325 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
326
327 e8/call emit-string-literal-data/disp32
328
329 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
330
331
332 68/push Newline/imm32
333 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
334
335 e8/call write/disp32
336
337 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
338
339
340
341 68/push "_string"/imm32
342 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
343
344 e8/call write-buffered/disp32
345
346 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
347
348
349 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
350 51/push-ECX
351
352 e8/call print-int32-decimal/disp32
353
354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
355
356
357 51/push-ECX
358 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
359
360 e8/call write-stream-data/disp32
361
362 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
363
364
365 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
366 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
367
368 e8/call emit-metadata/disp32
369
370 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
371
372 ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
373 $process-string-literal:end:
374
375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x16/imm32
376
377 59/pop-to-ECX
378
379 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
380 5d/pop-to-EBP
381 c3/return
382
383 test-convert-is-idempotent-by-default:
384
385 55/push-EBP
386 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
387
388
389
390 68/push _test-input-stream/imm32
391
392 e8/call clear-stream/disp32
393
394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
395
396
397 b8/copy-to-EAX _test-input-buffered-file/imm32
398 05/add-to-EAX 4/imm32
399 50/push-EAX
400
401 e8/call clear-stream/disp32
402
403 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
404
405
406 68/push _test-output-stream/imm32
407
408 e8/call clear-stream/disp32
409
410 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
411
412
413 b8/copy-to-EAX _test-output-buffered-file/imm32
414 05/add-to-EAX 4/imm32
415 50/push-EAX
416
417 e8/call clear-stream/disp32
418
419 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
420
421
422
423
424
425
426
427
428
429
430
431
432 68/push "# comment 1\n"/imm32
433 68/push _test-input-stream/imm32
434
435 e8/call write/disp32
436
437 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
438
439
440 68/push " # comment 2 indented\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 "== code 0x1\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 "# comment 3 inside a segment\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 "1\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 "\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 "2 3 # comment 4 inline with other contents\n"/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 "== data 0x2\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 "4 5/imm32\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 _test-output-buffered-file/imm32
505 68/push _test-input-buffered-file/imm32
506
507 e8/call convert/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
514 e8/call flush/disp32
515
516 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
517
518
519
520
521
522
523
524
525
526
527
528 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
554
555
556 68/push "F - test-convert-is-idempotent-by-default/0"/imm32
557 68/push ""/imm32
558 68/push _test-output-stream/imm32
559
560 e8/call check-next-stream-line-equal/disp32
561
562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
563
564
565 68/push "F - test-convert-is-idempotent-by-default/1"/imm32
566 68/push ""/imm32
567 68/push _test-output-stream/imm32
568
569 e8/call check-next-stream-line-equal/disp32
570
571 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
572
573
574 68/push "F - test-convert-is-idempotent-by-default/2"/imm32
575 68/push "== code 0x1 "/imm32
576 68/push _test-output-stream/imm32
577
578 e8/call check-next-stream-line-equal/disp32
579
580 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
581
582
583 68/push "F - test-convert-is-idempotent-by-default/3"/imm32
584 68/push ""/imm32
585 68/push _test-output-stream/imm32
586
587 e8/call check-next-stream-line-equal/disp32
588
589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
590
591
592 68/push "F - test-convert-is-idempotent-by-default/4"/imm32
593 68/push "1 "/imm32
594 68/push _test-output-stream/imm32
595
596 e8/call check-next-stream-line-equal/disp32
597
598 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
599
600
601 68/push "F - test-convert-is-idempotent-by-default/5"/imm32
602 68/push ""/imm32
603 68/push _test-output-stream/imm32
604
605 e8/call check-next-stream-line-equal/disp32
606
607 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
608
609
610 68/push "F - test-convert-is-idempotent-by-default/6"/imm32
611 68/push "2 3 "/imm32
612 68/push _test-output-stream/imm32
613
614 e8/call check-next-stream-line-equal/disp32
615
616 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
617
618
619 68/push "F - test-convert-is-idempotent-by-default/7"/imm32
620 68/push "== data 0x2 "/imm32
621 68/push _test-output-stream/imm32
622
623 e8/call check-next-stream-line-equal/disp32
624
625 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
626
627
628 68/push "F - test-convert-is-idempotent-by-default/8"/imm32
629 68/push "4 5/imm32 "/imm32
630 68/push _test-output-stream/imm32
631
632 e8/call check-next-stream-line-equal/disp32
633
634 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
635
636 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
637 5d/pop-to-EBP
638 c3/return
639
640 test-convert-processes-string-literals:
641
642 55/push-EBP
643 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
644
645
646
647 68/push _test-input-stream/imm32
648
649 e8/call clear-stream/disp32
650
651 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
652
653
654 b8/copy-to-EAX _test-input-buffered-file/imm32
655 05/add-to-EAX 4/imm32
656 50/push-EAX
657
658 e8/call clear-stream/disp32
659
660 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
661
662
663 68/push _test-output-stream/imm32
664
665 e8/call clear-stream/disp32
666
667 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
668
669
670 b8/copy-to-EAX _test-output-buffered-file/imm32
671 05/add-to-EAX 4/imm32
672 50/push-EAX
673
674 e8/call clear-stream/disp32
675
676 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
677
678
679
680
681 68/push "== code 0x1\n"/imm32
682 68/push _test-input-stream/imm32
683
684 e8/call write/disp32
685
686 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
687
688
689 68/push "1 \"a\"/x\n"/imm32
690 68/push _test-input-stream/imm32
691
692 e8/call write/disp32
693
694 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
695
696
697 68/push "2 \"bc\"/y\n"/imm32
698 68/push _test-input-stream/imm32
699
700 e8/call write/disp32
701
702 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
703
704
705 68/push _test-output-buffered-file/imm32
706 68/push _test-input-buffered-file/imm32
707
708 e8/call convert/disp32
709
710 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
711
712
713 68/push _test-output-buffered-file/imm32
714
715 e8/call flush/disp32
716
717 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734 +-- 33 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
767
768
769 68/push "F - test-convert-processes-string-literals/0"/imm32
770 68/push "== code 0x1 "/imm32
771 68/push _test-output-stream/imm32
772
773 e8/call check-next-stream-line-equal/disp32
774
775 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
776
777
778 68/push "F - test-convert-processes-string-literals/1"/imm32
779 68/push "1 _string1/x "/imm32
780 68/push _test-output-stream/imm32
781
782 e8/call check-next-stream-line-equal/disp32
783
784 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
785
786
787 68/push "F - test-convert-processes-string-literals/2"/imm32
788 68/push "2 _string2/y "/imm32
789 68/push _test-output-stream/imm32
790
791 e8/call check-next-stream-line-equal/disp32
792
793 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
794
795
796 68/push "F - test-convert-processes-string-literals/3"/imm32
797 68/push "== data"/imm32
798 68/push _test-output-stream/imm32
799
800 e8/call check-next-stream-line-equal/disp32
801
802 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
803
804
805 68/push "F - test-convert-processes-string-literals/4"/imm32
806 68/push "_string1:"/imm32
807 68/push _test-output-stream/imm32
808
809 e8/call check-next-stream-line-equal/disp32
810
811 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
812
813
814 68/push "F - test-convert-processes-string-literals/5"/imm32
815 68/push "0x00000001/imm32 61/a "/imm32
816 68/push _test-output-stream/imm32
817
818 e8/call check-next-stream-line-equal/disp32
819
820 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
821
822
823 68/push "F - test-convert-processes-string-literals/6"/imm32
824 68/push "_string2:"/imm32
825 68/push _test-output-stream/imm32
826
827 e8/call check-next-stream-line-equal/disp32
828
829 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
830
831
832 68/push "F - test-convert-processes-string-literals/7"/imm32
833 68/push "0x00000002/imm32 62/b 63/c "/imm32
834 68/push _test-output-stream/imm32
835
836 e8/call check-next-stream-line-equal/disp32
837
838 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
839
840 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
841 5d/pop-to-EBP
842 c3/return
843
844
845 emit-string-literal-data:
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 56/push-ESI
876
877 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
878
879 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
880
881 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 6/r32/ESI 4/disp8 .
882 $emit-string-literal-data:emit-length:
883
884
885 56/push-ESI
886 52/push-EDX
887
888 e8/call string-length-at-start-of-slice/disp32
889
890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
891
892
893
894 50/push-EAX
895 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
896
897 e8/call print-int32/disp32
898
899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
900
901
902 68/push "/imm32 "/imm32
903 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
904
905 e8/call write/disp32
906
907 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
908 $emit-string-literal-data:loop-init:
909
910 42/increment-EDX
911
912 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
913 $emit-string-literal-data:loop:
914
915 39/compare 3/mod/direct 2/rm32/EDX . . . 6/r32/ESI . .
916 0f 83/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp32
917
918 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 1/r32/CL . .
919
920 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x22/imm32/dquote
921 74/jump-if-equal $emit-string-literal-data:end/disp8
922
923 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x5c/imm32/backslash
924 75/jump-if-not-equal $emit-string-literal-data:emit/disp8
925
926 42/increment-EDX
927
928 39/compare 3/mod/direct 2/rm32/EDX . . . 6/r32/ESI . .
929 73/jump-if-greater-or-equal-unsigned $emit-string-literal-data:end/disp8
930
931 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 1/r32/CL . .
932
933 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x6e/imm32/n
934 75/jump-if-not-equal $emit-string-literal-data:emit/disp8
935 b9/copy-to-ECX 0x0a/imm32/newline
936 $emit-string-literal-data:emit:
937
938
939 51/push-ECX
940 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
941
942 e8/call append-byte-hex/disp32
943
944 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
945
946
947
948 51/push-ECX
949
950 e8/call is-alphanumeric?/disp32
951
952 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
953
954 3d/compare-EAX-and 0/imm32
955 74/jump-if-equal $emit-string-literal-data:char-done/disp8
956
957
958 68/push Slash/imm32
959 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
960
961 e8/call write/disp32
962
963 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
964
965
966 51/push-ECX
967 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
968
969 e8/call append-byte/disp32
970
971 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
972 $emit-string-literal-data:char-done:
973
974
975 68/push Space/imm32
976 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
977
978 e8/call write/disp32
979
980 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
981
982 42/increment-EDX
983 e9/jump $emit-string-literal-data:loop/disp32
984 $emit-string-literal-data:end:
985
986 5e/pop-to-ESI
987 5a/pop-to-EDX
988 59/pop-to-ECX
989 58/pop-to-EAX
990
991 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
992 5d/pop-to-EBP
993 c3/return
994
995 is-alphanumeric?:
996
997 55/push-EBP
998 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
999
1000 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 8/disp8 .
1001
1002 3d/compare-EAX-with 0x30/imm32/0
1003 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1004
1005 3d/compare-EAX-with 0x39/imm32/9
1006 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1007
1008 3d/compare-EAX-with 0x41/imm32/A
1009 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1010
1011 3d/compare-EAX-with 0x5a/imm32/Z
1012 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1013
1014 3d/compare-EAX-with 0x61/imm32/a
1015 7c/jump-if-lesser $is-alphanumeric?:false/disp8
1016
1017 3d/compare-EAX-with 0x7a/imm32/z
1018 7e/jump-if-lesser-or-equal $is-alphanumeric?:true/disp8
1019
1020 $is-alphanumeric?:false:
1021 b8/copy-to-EAX 0/imm32/false
1022 eb/jump $is-alphanumeric?:end/disp8
1023 $is-alphanumeric?:true:
1024 b8/copy-to-EAX 1/imm32/true
1025 $is-alphanumeric?:end:
1026
1027 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1028 5d/pop-to-EBP
1029 c3/return
1030
1031 test-emit-string-literal-data:
1032
1033 55/push-EBP
1034 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1035
1036
1037
1038 68/push _test-output-stream/imm32
1039
1040 e8/call clear-stream/disp32
1041
1042 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1043
1044 68/push _test-slice-abc-limit/imm32
1045 68/push _test-slice-abc/imm32
1046 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1047
1048
1049 51/push-ECX
1050 68/push _test-output-stream/imm32
1051
1052 e8/call emit-string-literal-data/disp32
1053
1054 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1055 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1081
1082
1083 68/push "F - test-emit-string-literal-data"/imm32
1084 68/push "0x00000003/imm32 61/a 62/b 63/c "/imm32
1085 68/push _test-output-stream/imm32
1086
1087 e8/call check-stream-equal/disp32
1088
1089 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1090
1091 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1092 5d/pop-to-EBP
1093 c3/return
1094
1095 test-emit-string-literal-data-empty:
1096
1097 55/push-EBP
1098 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1099
1100
1101
1102 68/push _test-output-stream/imm32
1103
1104 e8/call clear-stream/disp32
1105
1106 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1107
1108 68/push 0/imm32/end
1109 68/push 0/imm32/start
1110 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1111
1112
1113 51/push-ECX
1114 68/push _test-output-stream/imm32
1115
1116 e8/call emit-string-literal-data/disp32
1117
1118 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1119 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1145
1146
1147 68/push "F - test-emit-string-literal-data-empty"/imm32
1148 68/push "0x00000000/imm32 "/imm32
1149 68/push _test-output-stream/imm32
1150
1151 e8/call check-stream-equal/disp32
1152
1153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1154
1155 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1156 5d/pop-to-EBP
1157 c3/return
1158
1159
1160 test-emit-string-literal-data-no-metadata-for-non-alphanumerics:
1161
1162 55/push-EBP
1163 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1164
1165
1166
1167 68/push _test-output-stream/imm32
1168
1169 e8/call clear-stream/disp32
1170
1171 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1172
1173 68/push _test-slice-a-space-b-limit/imm32
1174 68/push _test-slice-a-space-b/imm32
1175 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1176
1177
1178 51/push-ECX
1179 68/push _test-output-stream/imm32
1180
1181 e8/call emit-string-literal-data/disp32
1182
1183 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1184 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1210
1211
1212 68/push "F - test-emit-string-literal-data-no-metadata-for-non-alphanumerics"/imm32
1213 68/push "0x00000003/imm32 61/a 20 62/b "/imm32
1214 68/push _test-output-stream/imm32
1215
1216 e8/call check-stream-equal/disp32
1217
1218 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1219
1220 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1221 5d/pop-to-EBP
1222 c3/return
1223
1224 test-emit-string-literal-data-handles-escape-sequences:
1225
1226 55/push-EBP
1227 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1228
1229
1230
1231 68/push _test-output-stream/imm32
1232
1233 e8/call clear-stream/disp32
1234
1235 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1236
1237 68/push _test-slice-a-dquote-b-limit/imm32
1238 68/push _test-slice-a-dquote-b/imm32
1239 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1240
1241
1242 51/push-ECX
1243 68/push _test-output-stream/imm32
1244
1245 e8/call emit-string-literal-data/disp32
1246
1247 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1248 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1274
1275
1276 68/push "F - test-emit-string-literal-data-handles-escape-sequences"/imm32
1277 68/push "0x00000003/imm32 61/a 22 62/b "/imm32
1278 68/push _test-output-stream/imm32
1279
1280 e8/call check-stream-equal/disp32
1281
1282 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1283
1284 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1285 5d/pop-to-EBP
1286 c3/return
1287
1288 test-emit-string-literal-data-handles-newline-escape:
1289
1290 55/push-EBP
1291 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1292
1293
1294
1295 68/push _test-output-stream/imm32
1296
1297 e8/call clear-stream/disp32
1298
1299 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1300
1301 68/push _test-slice-a-newline-b-limit/imm32
1302 68/push _test-slice-a-newline-b/imm32
1303 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1304
1305
1306 51/push-ECX
1307 68/push _test-output-stream/imm32
1308
1309 e8/call emit-string-literal-data/disp32
1310
1311 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1312 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1338
1339
1340 68/push "F - test-emit-string-literal-data-handles-newline-escape"/imm32
1341 68/push "0x00000003/imm32 61/a 0a 62/b "/imm32
1342 68/push _test-output-stream/imm32
1343
1344 e8/call check-stream-equal/disp32
1345
1346 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1347
1348 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1349 5d/pop-to-EBP
1350 c3/return
1351
1352
1353 emit-metadata:
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370 55/push-EBP
1371 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1372
1373 50/push-EAX
1374 51/push-ECX
1375 52/push-EDX
1376 53/push-EBX
1377 56/push-ESI
1378
1379 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
1380
1381 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
1382
1383 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
1384
1385 52/push-EDX
1386 68/push 0/imm32
1387 89/copy 3/mod/direct 3/rm32/EBX . . . 4/r32/ESP . .
1388
1389 b8/copy-to-EAX 0/imm32
1390 $emit-metadata:check-for-string-literal:
1391
1392 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
1393 3d/compare-EAX-and 0x22/imm32/dquote
1394 75/jump-if-not-equal $emit-metadata:skip-datum-loop/disp8
1395 $emit-metadata:skip-string-literal:
1396
1397
1398 52/push-EDX
1399 51/push-ECX
1400
1401 e8/call skip-string-in-slice/disp32
1402
1403 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1404
1405 89/copy 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
1406 eb/jump $emit-metadata:emit/disp8
1407 $emit-metadata:skip-datum-loop:
1408
1409
1410 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
1411 74/jump-if-equal $emit-metadata:end/disp8
1412
1413 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
1414 3d/compare-EAX-and 0x2f/imm32/slash
1415 74/jump-if-equal $emit-metadata:emit/disp8
1416
1417 41/increment-ECX
1418 eb/jump $emit-metadata:skip-datum-loop/disp8
1419 $emit-metadata:emit:
1420
1421 89/copy 0/mod/indirect 3/rm32/EBX . . . 1/r32/ECX . .
1422
1423
1424 53/push-EBX
1425 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1426
1427 e8/call write-slice-buffered/disp32
1428
1429 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . 8/imm32 .
1430 $emit-metadata:end:
1431
1432 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . 8/imm32 .
1433
1434 5e/pop-to-ESI
1435 5b/pop-to-EBX
1436 5a/pop-to-EDX
1437 59/pop-to-ECX
1438 58/pop-to-EAX
1439
1440 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1441 5d/pop-to-EBP
1442 c3/return
1443
1444 test-emit-metadata:
1445
1446 55/push-EBP
1447 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1448
1449
1450
1451 68/push _test-output-stream/imm32
1452
1453 e8/call clear-stream/disp32
1454
1455 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1456
1457
1458 b8/copy-to-EAX _test-output-buffered-file/imm32
1459 05/add-to-EAX 4/imm32
1460 50/push-EAX
1461
1462 e8/call clear-stream/disp32
1463
1464 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1465
1466 b8/copy-to-EAX "abc/def"/imm32
1467 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1468 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1469 05/add-to-EAX 4/imm32
1470
1471 51/push-ECX
1472 50/push-EAX
1473 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1474
1475
1476 51/push-ECX
1477 68/push _test-output-buffered-file/imm32
1478
1479 e8/call emit-metadata/disp32
1480
1481 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1482
1483
1484 68/push _test-output-buffered-file/imm32
1485
1486 e8/call flush/disp32
1487
1488 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1489
1490
1491 68/push "F - test-emit-metadata"/imm32
1492 68/push "/def"/imm32
1493 68/push _test-output-stream/imm32
1494
1495 e8/call check-stream-equal/disp32
1496
1497 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1498
1499 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1500 5d/pop-to-EBP
1501 c3/return
1502
1503 test-emit-metadata-none:
1504
1505 55/push-EBP
1506 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1507
1508
1509
1510 68/push _test-output-stream/imm32
1511
1512 e8/call clear-stream/disp32
1513
1514 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1515
1516
1517 b8/copy-to-EAX _test-output-buffered-file/imm32
1518 05/add-to-EAX 4/imm32
1519 50/push-EAX
1520
1521 e8/call clear-stream/disp32
1522
1523 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1524
1525 b8/copy-to-EAX "abc"/imm32
1526 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1527 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1528 05/add-to-EAX 4/imm32
1529
1530 51/push-ECX
1531 50/push-EAX
1532 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1533
1534
1535 51/push-ECX
1536 68/push _test-output-buffered-file/imm32
1537
1538 e8/call emit-metadata/disp32
1539
1540 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1541
1542
1543 68/push _test-output-buffered-file/imm32
1544
1545 e8/call flush/disp32
1546
1547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1548
1549
1550 68/push "F - test-emit-metadata-none"/imm32
1551 68/push ""/imm32
1552 68/push _test-output-stream/imm32
1553
1554 e8/call check-stream-equal/disp32
1555
1556 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1557
1558 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1559 5d/pop-to-EBP
1560 c3/return
1561
1562 test-emit-metadata-multiple:
1563
1564 55/push-EBP
1565 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1566
1567
1568
1569 68/push _test-output-stream/imm32
1570
1571 e8/call clear-stream/disp32
1572
1573 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1574
1575
1576 b8/copy-to-EAX _test-output-buffered-file/imm32
1577 05/add-to-EAX 4/imm32
1578 50/push-EAX
1579
1580 e8/call clear-stream/disp32
1581
1582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1583
1584 b8/copy-to-EAX "abc/def/ghi"/imm32
1585 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1586 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1587 05/add-to-EAX 4/imm32
1588
1589 51/push-ECX
1590 50/push-EAX
1591 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1592
1593
1594 51/push-ECX
1595 68/push _test-output-buffered-file/imm32
1596
1597 e8/call emit-metadata/disp32
1598
1599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1600
1601
1602 68/push _test-output-buffered-file/imm32
1603
1604 e8/call flush/disp32
1605
1606 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1607
1608
1609 68/push "F - test-emit-metadata-multiple"/imm32
1610 68/push "/def/ghi"/imm32
1611 68/push _test-output-stream/imm32
1612
1613 e8/call check-stream-equal/disp32
1614
1615 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1616
1617 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1618 5d/pop-to-EBP
1619 c3/return
1620
1621 test-emit-metadata-when-no-datum:
1622
1623 55/push-EBP
1624 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1625
1626
1627
1628 68/push _test-output-stream/imm32
1629
1630 e8/call clear-stream/disp32
1631
1632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1633
1634
1635 b8/copy-to-EAX _test-output-buffered-file/imm32
1636 05/add-to-EAX 4/imm32
1637 50/push-EAX
1638
1639 e8/call clear-stream/disp32
1640
1641 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1642
1643 b8/copy-to-EAX "/abc"/imm32
1644
1645 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1646 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1647 51/push-ECX
1648
1649 05/add-to-EAX 4/imm32
1650 50/push-EAX
1651
1652 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1653
1654
1655 51/push-ECX
1656 68/push _test-output-buffered-file/imm32
1657
1658 e8/call emit-metadata/disp32
1659
1660 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1661
1662
1663 68/push _test-output-buffered-file/imm32
1664
1665 e8/call flush/disp32
1666
1667 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1668
1669
1670 68/push "F - test-emit-metadata-when-no-datum"/imm32
1671 68/push "/abc"/imm32
1672 68/push _test-output-stream/imm32
1673
1674 e8/call check-stream-equal/disp32
1675
1676 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1677
1678 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1679 5d/pop-to-EBP
1680 c3/return
1681
1682 test-emit-metadata-in-string-literal:
1683
1684 55/push-EBP
1685 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1686
1687
1688
1689 68/push _test-output-stream/imm32
1690
1691 e8/call clear-stream/disp32
1692
1693 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1694
1695
1696 b8/copy-to-EAX _test-output-buffered-file/imm32
1697 05/add-to-EAX 4/imm32
1698 50/push-EAX
1699
1700 e8/call clear-stream/disp32
1701
1702 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1703
1704 68/push _test-slice-literal-string-with-limit/imm32
1705 68/push _test-slice-literal-string/imm32/start
1706 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1707
1708
1709 51/push-ECX
1710 68/push _test-output-buffered-file/imm32
1711
1712 e8/call emit-metadata/disp32
1713
1714 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1715
1716
1717 68/push _test-output-buffered-file/imm32
1718
1719 e8/call flush/disp32
1720
1721 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1722 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1748
1749
1750 68/push "F - test-emit-metadata-in-string-literal"/imm32
1751 68/push "/ghi"/imm32
1752 68/push _test-output-stream/imm32
1753
1754 e8/call check-stream-equal/disp32
1755
1756 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1757
1758 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1759 5d/pop-to-EBP
1760 c3/return
1761
1762
1763
1764 next-word-or-string:
1765
1766 55/push-EBP
1767 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1768
1769 50/push-EAX
1770 51/push-ECX
1771 56/push-ESI
1772 57/push-EDI
1773
1774 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
1775
1776 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
1777
1778
1779 68/push 0x20/imm32/space
1780 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1781
1782 e8/call skip-chars-matching/disp32
1783
1784 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1785 $next-word-or-string:check0:
1786
1787
1788 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
1789
1790 3b/compare 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1791 7c/jump-if-lesser $next-word-or-string:check-for-comment/disp8
1792
1793 c7 0/subop/copy 0/mod/direct 7/rm32/EDI . . . . . 0/imm32
1794 c7 0/subop/copy 1/mod/*+disp8 7/rm32/EDI . . . . 4/disp8 0/imm32
1795 eb/jump $next-word-or-string:end/disp8
1796 $next-word-or-string:check-for-comment:
1797
1798 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1799 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
1800 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
1801
1802
1803 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1804 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1805
1806 3d/compare-EAX-and 0x23/imm32/pound
1807 75/jump-if-not-equal $next-word-or-string:check-for-string-literal/disp8
1808 $next-word-or-string:comment:
1809
1810 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1811 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
1812 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
1813
1814 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1815 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
1816
1817 eb/jump $next-word-or-string:end/disp8
1818 $next-word-or-string:check-for-string-literal:
1819
1820
1821 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1822 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1823
1824 3d/compare-EAX-and 0x22/imm32/dquote
1825 75/jump-if-not-equal $next-word-or-string:regular-word/disp8
1826 $next-word-or-string:string-literal:
1827
1828
1829 56/push-ESI
1830
1831 e8/call skip-string/disp32
1832
1833 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1834
1835 $next-word-or-string:regular-word:
1836
1837
1838 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1839
1840 e8/call skip-chars-not-matching-whitespace/disp32
1841
1842 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1843
1844 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1845 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
1846 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
1847 $next-word-or-string:end:
1848
1849 5f/pop-to-EDI
1850 5e/pop-to-ESI
1851 59/pop-to-ECX
1852 58/pop-to-EAX
1853
1854 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1855 5d/pop-to-EBP
1856 c3/return
1857
1858 test-next-word-or-string:
1859
1860 55/push-EBP
1861 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1862
1863
1864
1865 68/push _test-input-stream/imm32
1866
1867 e8/call clear-stream/disp32
1868
1869 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1870
1871 68/push 0/imm32/end
1872 68/push 0/imm32/start
1873 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1874
1875
1876 68/push " ab"/imm32
1877 68/push _test-input-stream/imm32
1878
1879 e8/call write/disp32
1880
1881 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1882
1883
1884 51/push-ECX
1885 68/push _test-input-stream/imm32
1886
1887 e8/call next-word-or-string/disp32
1888
1889 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1890
1891
1892 68/push "F - test-next-word-or-string/updates-stream-read-correctly"/imm32
1893 68/push 4/imm32
1894 b8/copy-to-EAX _test-input-stream/imm32
1895 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
1896
1897 e8/call check-ints-equal/disp32
1898
1899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1900
1901
1902
1903 68/push "F - test-next-word-or-string: start"/imm32
1904 68/push 0xe/imm32
1905
1906 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1907 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1908 50/push-EAX
1909
1910 e8/call check-ints-equal/disp32
1911
1912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1913
1914
1915
1916 68/push "F - test-next-word-or-string: end"/imm32
1917 68/push 0x10/imm32
1918
1919 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1920 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1921 50/push-EAX
1922
1923 e8/call check-ints-equal/disp32
1924
1925 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1926
1927 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1928 5d/pop-to-EBP
1929 c3/return
1930
1931 test-next-word-or-string-returns-whole-comment:
1932
1933 55/push-EBP
1934 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1935
1936
1937
1938 68/push _test-input-stream/imm32
1939
1940 e8/call clear-stream/disp32
1941
1942 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1943
1944 68/push 0/imm32/end
1945 68/push 0/imm32/start
1946 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1947
1948
1949 68/push " # a"/imm32
1950 68/push _test-input-stream/imm32
1951
1952 e8/call write/disp32
1953
1954 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1955
1956
1957 51/push-ECX
1958 68/push _test-input-stream/imm32
1959
1960 e8/call next-word-or-string/disp32
1961
1962 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1963
1964
1965 68/push "F - test-next-word-or-string-returns-whole-comment/updates-stream-read-correctly"/imm32
1966 68/push 5/imm32
1967 b8/copy-to-EAX _test-input-stream/imm32
1968 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
1969
1970 e8/call check-ints-equal/disp32
1971
1972 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1973
1974
1975
1976 68/push "F - test-next-word-or-string-returns-whole-comment: start"/imm32
1977 68/push 0xe/imm32
1978
1979 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1980 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1981 50/push-EAX
1982
1983 e8/call check-ints-equal/disp32
1984
1985 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1986
1987
1988
1989 68/push "F - test-next-word-or-string-returns-whole-comment: end"/imm32
1990 68/push 0x11/imm32
1991
1992 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1993 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1994 50/push-EAX
1995
1996 e8/call check-ints-equal/disp32
1997
1998 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1999
2000 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2001 5d/pop-to-EBP
2002 c3/return
2003
2004 test-next-word-or-string-returns-empty-string-on-eof:
2005
2006 55/push-EBP
2007 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2008
2009
2010
2011 68/push _test-input-stream/imm32
2012
2013 e8/call clear-stream/disp32
2014
2015 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2016
2017 68/push 0/imm32/end
2018 68/push 0/imm32/start
2019 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2020
2021
2022
2023 51/push-ECX
2024 68/push _test-input-stream/imm32
2025
2026 e8/call next-word-or-string/disp32
2027
2028 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2029
2030
2031 68/push "F - test-next-word-or-string-returns-empty-string-on-eof"/imm32
2032 68/push 0/imm32
2033
2034 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
2035 2b/subtract 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
2036 50/push-EAX
2037
2038 e8/call check-ints-equal/disp32
2039
2040 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2041
2042 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2043 5d/pop-to-EBP
2044 c3/return
2045
2046 test-next-word-or-string-returns-whole-string:
2047
2048 55/push-EBP
2049 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2050
2051
2052
2053 68/push _test-input-stream/imm32
2054
2055 e8/call clear-stream/disp32
2056
2057 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2058
2059 68/push 0/imm32/end
2060 68/push 0/imm32/start
2061 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2062
2063
2064 68/push " \"a b\"/imm32 "/imm32
2065 68/push _test-input-stream/imm32
2066
2067 e8/call write/disp32
2068
2069 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2070
2071
2072 51/push-ECX
2073 68/push _test-input-stream/imm32
2074
2075 e8/call next-word-or-string/disp32
2076
2077 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2078
2079
2080
2081 68/push "F - test-next-word-or-string-returns-whole-string: start"/imm32
2082 68/push 0xd/imm32
2083
2084 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
2085 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
2086 50/push-EAX
2087
2088 e8/call check-ints-equal/disp32
2089
2090 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2091
2092
2093
2094 68/push "F - test-next-word-or-string-returns-whole-string: end"/imm32
2095 68/push 0x18/imm32
2096
2097 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
2098 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
2099 50/push-EAX
2100
2101 e8/call check-ints-equal/disp32
2102
2103 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2104
2105 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2106 5d/pop-to-EBP
2107 c3/return
2108
2109 test-next-word-or-string-returns-string-with-escapes:
2110
2111 55/push-EBP
2112 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2113
2114
2115
2116 68/push _test-input-stream/imm32
2117
2118 e8/call clear-stream/disp32
2119
2120 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2121
2122 68/push 0/imm32/end
2123 68/push 0/imm32/start
2124 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2125
2126
2127 68/push " \"a\\\"b\"/x"/imm32
2128 68/push _test-input-stream/imm32
2129
2130 e8/call write/disp32
2131
2132 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2133
2134
2135 51/push-ECX
2136 68/push _test-input-stream/imm32
2137
2138 e8/call next-word-or-string/disp32
2139
2140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2141
2142
2143
2144 68/push "F - test-next-word-or-string-returns-string-with-escapes: start"/imm32
2145 68/push 0xd/imm32
2146
2147 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
2148 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
2149 50/push-EAX
2150
2151 e8/call check-ints-equal/disp32
2152
2153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2154
2155
2156
2157 68/push "F - test-next-word-or-string-returns-string-with-escapes: end"/imm32
2158 68/push 0x15/imm32
2159
2160 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
2161 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
2162 50/push-EAX
2163
2164 e8/call check-ints-equal/disp32
2165
2166 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2167
2168 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2169 5d/pop-to-EBP
2170 c3/return
2171
2172
2173
2174 skip-string:
2175
2176 55/push-EBP
2177 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2178
2179 50/push-EAX
2180 51/push-ECX
2181 52/push-EDX
2182
2183 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 1/r32/ECX 8/disp8 .
2184
2185
2186 8b/copy 1/mod/*+disp8 1/rm32/ECX . . 2/r32/EDX 8/disp8 .
2187 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX 0xc/disp8 .
2188 52/push-EDX
2189
2190 8b/copy 1/mod/*+disp8 1/rm32/ECX . . 2/r32/EDX 4/disp8 .
2191 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX 0xc/disp8 .
2192 52/push-EDX
2193
2194 e8/call skip-string-in-slice/disp32
2195
2196 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2197
2198 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
2199 2d/subtract-from-EAX 0xc/imm32
2200 89/copy 1/mod/*+disp8 1/rm32/ECX . . 0/r32/EAX 4/disp8 .
2201 $skip-string:end:
2202
2203 5a/pop-to-EDX
2204 59/pop-to-ECX
2205 58/pop-to-EAX
2206
2207 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2208 5d/pop-to-EBP
2209 c3/return
2210
2211 test-skip-string:
2212
2213 55/push-EBP
2214 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2215
2216
2217
2218 68/push _test-input-stream/imm32
2219
2220 e8/call clear-stream/disp32
2221
2222 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2223
2224
2225
2226 68/push "\"abc\" def"/imm32
2227 68/push _test-input-stream/imm32
2228
2229 e8/call write/disp32
2230
2231 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2232
2233
2234 68/push "F - test-skip-string/precondition"/imm32
2235 68/push 0/imm32
2236 b8/copy-to-EAX _test-input-stream/imm32
2237 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2238
2239 e8/call check-ints-equal/disp32
2240
2241 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2242
2243
2244 68/push _test-input-stream/imm32
2245
2246 e8/call skip-string/disp32
2247
2248 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2249
2250
2251 68/push "F - test-skip-string"/imm32
2252 68/push 5/imm32
2253 b8/copy-to-EAX _test-input-stream/imm32
2254 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2255
2256 e8/call check-ints-equal/disp32
2257
2258 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2259
2260 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2261 5d/pop-to-EBP
2262 c3/return
2263
2264 test-skip-string-ignores-spaces:
2265
2266 55/push-EBP
2267 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2268
2269
2270
2271 68/push _test-input-stream/imm32
2272
2273 e8/call clear-stream/disp32
2274
2275 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2276
2277
2278
2279 68/push "\"a b\"/yz"/imm32
2280 68/push _test-input-stream/imm32
2281
2282 e8/call write/disp32
2283
2284 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2285
2286
2287 68/push "F - test-skip-string-ignores-spaces/precondition"/imm32
2288 68/push 0/imm32
2289 b8/copy-to-EAX _test-input-stream/imm32
2290 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2291
2292 e8/call check-ints-equal/disp32
2293
2294 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2295
2296
2297 68/push _test-input-stream/imm32
2298
2299 e8/call skip-string/disp32
2300
2301 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2302
2303
2304 68/push "F - test-skip-string-ignores-spaces"/imm32
2305 68/push 5/imm32
2306 b8/copy-to-EAX _test-input-stream/imm32
2307 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2308
2309 e8/call check-ints-equal/disp32
2310
2311 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2312
2313 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2314 5d/pop-to-EBP
2315 c3/return
2316
2317 test-skip-string-ignores-escapes:
2318
2319 55/push-EBP
2320 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2321
2322
2323
2324 68/push _test-input-stream/imm32
2325
2326 e8/call clear-stream/disp32
2327
2328 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2329
2330
2331
2332 68/push "\"a\\\"b\"/yz"/imm32
2333 68/push _test-input-stream/imm32
2334
2335 e8/call write/disp32
2336
2337 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2338
2339
2340 68/push "F - test-skip-string-ignores-escapes/precondition"/imm32
2341 68/push 0/imm32
2342 b8/copy-to-EAX _test-input-stream/imm32
2343 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2344
2345 e8/call check-ints-equal/disp32
2346
2347 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2348
2349
2350 68/push _test-input-stream/imm32
2351
2352 e8/call skip-string/disp32
2353
2354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2355
2356
2357 68/push "F - test-skip-string-ignores-escapes"/imm32
2358 68/push 6/imm32
2359 b8/copy-to-EAX _test-input-stream/imm32
2360 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2361
2362 e8/call check-ints-equal/disp32
2363
2364 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2365
2366 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2367 5d/pop-to-EBP
2368 c3/return
2369
2370 test-skip-string-works-from-mid-stream:
2371
2372 55/push-EBP
2373 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2374
2375
2376
2377 68/push _test-input-stream/imm32
2378
2379 e8/call clear-stream/disp32
2380
2381 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2382
2383
2384
2385 68/push "0 \"a\\\"b\"/yz"/imm32
2386 68/push _test-input-stream/imm32
2387
2388 e8/call write/disp32
2389
2390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2391
2392 c7 0/subop/copy 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 2/imm32
2393
2394
2395 68/push _test-input-stream/imm32
2396
2397 e8/call skip-string/disp32
2398
2399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2400
2401
2402 68/push "F - test-skip-string-works-from-mid-stream"/imm32
2403 68/push 8/imm32
2404 b8/copy-to-EAX _test-input-stream/imm32
2405 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
2406
2407 e8/call check-ints-equal/disp32
2408
2409 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2410
2411 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2412 5d/pop-to-EBP
2413 c3/return
2414
2415 skip-string-in-slice:
2416
2417 55/push-EBP
2418 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2419
2420 51/push-ECX
2421 52/push-EDX
2422 53/push-EBX
2423
2424 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 1/r32/ECX 8/disp8 .
2425
2426 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 2/r32/EDX 0xc/disp8 .
2427
2428 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2429
2430 41/increment-ECX
2431 $skip-string-in-slice:loop:
2432
2433 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
2434 73/jump-if-greater-unsigned-or-equal $skip-string-in-slice:return-curr/disp8
2435
2436 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
2437 $skip-string-in-slice:dquote:
2438
2439 3d/compare-EAX-and 0x22/imm32/double-quote
2440 74/jump-if-equal $skip-string-in-slice:break/disp8
2441 $skip-string-in-slice:check-for-escape:
2442
2443 3d/compare-EAX-and 0x5c/imm32/backslash
2444 75/jump-if-not-equal $skip-string-in-slice:continue/disp8
2445 $skip-string-in-slice:escape:
2446 41/increment-ECX
2447 $skip-string-in-slice:continue:
2448
2449 41/increment-ECX
2450 eb/jump $skip-string-in-slice:loop/disp8
2451 $skip-string-in-slice:break:
2452
2453 41/increment-ECX
2454 $skip-string-in-slice:return-curr:
2455
2456 89/copy 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
2457 $skip-string-in-slice:end:
2458
2459 5b/pop-to-EBX
2460 5a/pop-to-EDX
2461 59/pop-to-ECX
2462
2463 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2464 5d/pop-to-EBP
2465 c3/return
2466
2467 test-skip-string-in-slice:
2468
2469 55/push-EBP
2470 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2471
2472 b8/copy-to-EAX "\"abc\" def"/imm32
2473 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2474 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2475 05/add-to-EAX 4/imm32
2476
2477
2478 51/push-ECX
2479 50/push-EAX
2480
2481 e8/call skip-string-in-slice/disp32
2482
2483 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2484
2485
2486 68/push "F - test-skip-string-in-slice"/imm32
2487 68/push 4/imm32
2488
2489 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2490 51/push-ECX
2491
2492 e8/call check-ints-equal/disp32
2493
2494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2495
2496 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2497 5d/pop-to-EBP
2498 c3/return
2499
2500 test-skip-string-in-slice-ignores-spaces:
2501
2502 55/push-EBP
2503 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2504
2505 b8/copy-to-EAX "\"a b\"/yz"/imm32
2506 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2507 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2508 05/add-to-EAX 4/imm32
2509
2510
2511 51/push-ECX
2512 50/push-EAX
2513
2514 e8/call skip-string-in-slice/disp32
2515
2516 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2517
2518
2519 68/push "F - test-skip-string-in-slice-ignores-spaces"/imm32
2520 68/push 3/imm32
2521
2522 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2523 51/push-ECX
2524
2525 e8/call check-ints-equal/disp32
2526
2527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2528
2529 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2530 5d/pop-to-EBP
2531 c3/return
2532
2533 test-skip-string-in-slice-ignores-escapes:
2534
2535 55/push-EBP
2536 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2537
2538 b8/copy-to-EAX "\"a\\\"b\"/yz"/imm32
2539 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2540 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2541 05/add-to-EAX 4/imm32
2542
2543
2544 51/push-ECX
2545 50/push-EAX
2546
2547 e8/call skip-string-in-slice/disp32
2548
2549 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2550
2551
2552 68/push "F - test-skip-string-in-slice-ignores-escapes"/imm32
2553 68/push 3/imm32
2554
2555 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2556 51/push-ECX
2557
2558 e8/call check-ints-equal/disp32
2559
2560 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2561
2562 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2563 5d/pop-to-EBP
2564 c3/return
2565
2566 test-skip-string-in-slice-stops-at-end:
2567
2568 55/push-EBP
2569 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2570
2571 b8/copy-to-EAX "\"abc"/imm32
2572 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2573 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2574 05/add-to-EAX 4/imm32
2575
2576
2577 51/push-ECX
2578 50/push-EAX
2579
2580 e8/call skip-string-in-slice/disp32
2581
2582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2583
2584
2585 68/push "F - test-skip-string-in-slice-stops-at-end"/imm32
2586 68/push 0/imm32
2587
2588 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2589 51/push-ECX
2590
2591 e8/call check-ints-equal/disp32
2592
2593 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2594
2595 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2596 5d/pop-to-EBP
2597 c3/return
2598
2599 string-length-at-start-of-slice:
2600
2601 55/push-EBP
2602 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2603
2604 51/push-ECX
2605 52/push-EDX
2606 53/push-EBX
2607
2608 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 1/r32/ECX 8/disp8 .
2609
2610 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 2/r32/EDX 0xc/disp8 .
2611
2612 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
2613
2614 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
2615
2616 41/increment-ECX
2617 $string-length-at-start-of-slice:loop:
2618
2619 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
2620 73/jump-if-greater-unsigned-or-equal $string-length-at-start-of-slice:end/disp8
2621
2622 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 3/r32/BL . .
2623 $string-length-at-start-of-slice:dquote:
2624
2625 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0x22/imm32/dquote
2626 74/jump-if-equal $string-length-at-start-of-slice:end/disp8
2627 $string-length-at-start-of-slice:check-for-escape:
2628
2629 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0x5c/imm32/backslash
2630 75/jump-if-not-equal $string-length-at-start-of-slice:continue/disp8
2631 $string-length-at-start-of-slice:escape:
2632
2633 41/increment-ECX
2634 $string-length-at-start-of-slice:continue:
2635
2636 40/increment-EAX
2637
2638 41/increment-ECX
2639 eb/jump $string-length-at-start-of-slice:loop/disp8
2640 $string-length-at-start-of-slice:end:
2641
2642 5b/pop-to-EBX
2643 5a/pop-to-EDX
2644 59/pop-to-ECX
2645
2646 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2647 5d/pop-to-EBP
2648 c3/return
2649
2650 test-string-length-at-start-of-slice:
2651
2652 55/push-EBP
2653 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2654
2655 b8/copy-to-EAX "\"abc\" def"/imm32
2656 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2657 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2658 05/add-to-EAX 4/imm32
2659
2660
2661 51/push-ECX
2662 50/push-EAX
2663
2664 e8/call string-length-at-start-of-slice/disp32
2665
2666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2667
2668
2669 68/push "F - test-string-length-at-start-of-slice"/imm32
2670 68/push 3/imm32
2671 50/push-EAX
2672
2673 e8/call check-ints-equal/disp32
2674
2675 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2676
2677 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2678 5d/pop-to-EBP
2679 c3/return
2680
2681 test-string-length-at-start-of-slice-escaped:
2682
2683 55/push-EBP
2684 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2685
2686 b8/copy-to-EAX "\"ab\\c\" def"/imm32
2687 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2688 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2689 05/add-to-EAX 4/imm32
2690
2691
2692 51/push-ECX
2693 50/push-EAX
2694
2695 e8/call string-length-at-start-of-slice/disp32
2696
2697 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2698
2699
2700 68/push "F - test-string-length-at-start-of-slice-escaped"/imm32
2701 68/push 3/imm32
2702 50/push-EAX
2703
2704 e8/call check-ints-equal/disp32
2705
2706 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2707
2708 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2709 5d/pop-to-EBP
2710 c3/return
2711
2712 == data
2713
2714 Next-string-literal:
2715 1/imm32
2716
2717
2718 Space:
2719
2720 1/imm32
2721
2722 20/space
2723
2724
2725 Slash:
2726
2727 1/imm32
2728
2729 2f/slash
2730
2731 _test-slice-abc:
2732 22/dquote 61/a 62/b 63/c 22/dquote
2733 2f/slash 64/d
2734 _test-slice-abc-limit:
2735
2736 _test-slice-a-space-b:
2737 22/dquote 61/a 20/space 62/b 22/dquote
2738 _test-slice-a-space-b-limit:
2739
2740 _test-slice-a-dquote-b:
2741 22/dquote 61/a 5c/backslash 22/dquote 62/b 22/dquote
2742 _test-slice-a-dquote-b-limit:
2743
2744 _test-slice-a-newline-b:
2745 22/dquote 61/a 5c/backslash 6e/n 62/b 22/dquote
2746 _test-slice-a-newline-b-limit:
2747
2748
2749 _test-slice-literal-string:
2750 22/dquote
2751 61/a 62/b 63/c
2752 2f/slash 64/d 65/e 66/f
2753 22/dquote
2754 2f/slash 67/g 68/h 69/i
2755 _test-slice-literal-string-with-limit:
2756
2757