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