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