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
27
28
29
30 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
31
32
33 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
34 7e/jump-if-lesser-or-equal $run-main/disp8
35
36
37 68/push "test"/imm32
38 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
39
40 e8/call kernel-string-equal?/disp32
41
42 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
43
44 3d/compare-EAX-and 1/imm32
45 75/jump-if-not-equal $run-main/disp8
46
47 e8/call run-tests/disp32
48 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
49 eb/jump $main:end/disp8
50 $run-main:
51
52
53 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
54 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
55
56
57 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
58
59
60 50/push-EAX/ed
61 68/push Stderr/imm32
62 68/push Stdout/imm32
63 68/push Stdin/imm32
64
65 e8/call convert/disp32
66
67 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
68
69 bb/copy-to-EBX 0/imm32
70 $main:end:
71 b8/copy-to-EAX 1/imm32/exit
72 cd/syscall 0x80/imm8
73
74 convert:
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 55/push-EBP
98 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
99
100 50/push-EAX
101 51/push-ECX
102 52/push-EDX
103 53/push-EBX
104 56/push-ESI
105 57/push-EDI
106
107 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
108 68/push 0x200/imm32/length
109 68/push 0/imm32/read
110 68/push 0/imm32/write
111 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
112
113 68/push 0/imm32/end
114 68/push 0/imm32/curr
115 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
116
117
118
119 68/push 1/imm32
120 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32
121 68/push Heap/imm32
122
123 e8/call new-stream/disp32
124
125 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
126
127 89/copy 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
128
129
130 68/push "== data\n"/imm32
131 57/push-EDI
132
133 e8/call write/disp32
134
135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
136 $convert:line-loop:
137
138
139 51/push-ECX
140
141 e8/call clear-stream/disp32
142
143 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
144
145
146 51/push-ECX
147 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
148
149 e8/call read-line/disp32
150
151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
152 $convert:check0:
153
154 81 7/subop/compare 0/mod/indirect 1/rm32/ECX . . . . . 0/imm32
155 0f 84/jump-if-equal $convert:break/disp32
156 $convert:word-loop:
157
158
159 52/push-EDX
160 51/push-ECX
161
162 e8/call next-word/disp32
163
164 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
165 $convert:check1:
166
167
168
169 52/push-EDX
170
171 e8/call slice-empty?/disp32
172
173 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
174
175 3d/compare-EAX-and 0/imm32
176 0f 85/jump-if-not-equal $convert:next-line/disp32
177 $convert:check-for-comment:
178
179
180 8b/copy 0/mod/indirect 2/rm32/EDX . . . 6/r32/ESI . .
181
182 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
183 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 0/r32/AL . .
184
185 3d/compare-EAX-and 0x23/imm32/hash
186 74/jump-if-equal $convert:word-loop/disp8
187 $convert:check-for-string-literal:
188 3d/compare-EAX-and 0x22/imm32/hash
189 75/jump-if-not-equal $convert:regular-word/disp8
190 $convert:string-literal:
191
192
193 57/push-EDI
194 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
195 52/push-EDX
196
197 e8/call process-string-literal/disp32
198
199 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
200
201 eb/jump $convert:next-word/disp8
202 $convert:regular-word:
203
204
205 52/push-EDX
206 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
207
208 e8/call write-slice/disp32
209
210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
211
212 $convert:next-word:
213
214
215 68/push " "/imm32
216 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
217
218 e8/call write-buffered/disp32
219
220 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
221
222 eb/jump $convert:word-loop/disp8
223 $convert:next-line:
224
225
226 68/push Newline/imm32
227 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
228
229 e8/call write-buffered/disp32
230
231 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
232
233 e9/jump $convert:line-loop/disp32
234 $convert:break:
235 $convert:end:
236
237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
238
239 5f/pop-to-EDI
240 5e/pop-to-ESI
241 5b/pop-to-EBX
242 5a/pop-to-EDX
243 59/pop-to-ECX
244 58/pop-to-EAX
245
246 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
247 5d/pop-to-EBP
248 c3/return
249
250
251
252 process-string-literal:
253
254
255
256
257
258
259
260
261 55/push-EBP
262 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
263
264 51/push-ECX
265
266 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0xa/imm32
267 68/push 0xa/imm32/decimal-digits-in-32bit-number
268 68/push 0/imm32/read
269 68/push 0/imm32/write
270 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
271
272
273
274 68/push "_string"/imm32
275 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
276
277 e8/call write/disp32
278
279 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
280
281
282
283 68/push ":\n"/imm32
284 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
285
286 e8/call write/disp32
287
288 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
289
290
291
292 68/push Newline/imm32
293 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
294
295 e8/call write/disp32
296
297 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
298
299
300
301 68/push "_string"/imm32
302 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
303
304 e8/call write-buffered/disp32
305
306 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
307
308
309
310 ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32
311 $process-string-literal:end:
312
313 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x16/imm32
314
315 59/pop-to-ECX
316
317 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
318 5d/pop-to-EBP
319 c3/return
320
321 test-convert-is-idempotent-by-default:
322
323 55/push-EBP
324 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
325
326
327
328 68/push _test-input-stream/imm32
329
330 e8/call clear-stream/disp32
331
332 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
333
334
335 b8/copy-to-EAX _test-input-buffered-file/imm32
336 05/add-to-EAX 4/imm32
337 50/push-EAX
338
339 e8/call clear-stream/disp32
340
341 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
342
343
344 68/push _test-output-stream/imm32
345
346 e8/call clear-stream/disp32
347
348 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
349
350
351 b8/copy-to-EAX _test-output-buffered-file/imm32
352 05/add-to-EAX 4/imm32
353 50/push-EAX
354
355 e8/call clear-stream/disp32
356
357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
358
359
360
361
362
363
364
365
366
367
368
369
370 68/push "# comment 1\n"/imm32
371 68/push _test-input-stream/imm32
372
373 e8/call write/disp32
374
375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
376
377
378 68/push " # comment 2 indented\n"/imm32
379 68/push _test-input-stream/imm32
380
381 e8/call write/disp32
382
383 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
384
385
386 68/push "== code\n"/imm32
387 68/push _test-input-stream/imm32
388
389 e8/call write/disp32
390
391 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
392
393
394 68/push "# comment 3 inside a segment\n"/imm32
395 68/push _test-input-stream/imm32
396
397 e8/call write/disp32
398
399 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
400
401
402 68/push "1\n"/imm32
403 68/push _test-input-stream/imm32
404
405 e8/call write/disp32
406
407 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
408
409
410 68/push "\n"/imm32
411 68/push _test-input-stream/imm32
412
413 e8/call write/disp32
414
415 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
416
417
418 68/push "2 3 # comment 4 inline with other contents\n"/imm32
419 68/push _test-input-stream/imm32
420
421 e8/call write/disp32
422
423 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
424
425
426 68/push "== data\n"/imm32
427 68/push _test-input-stream/imm32
428
429 e8/call write/disp32
430
431 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
432
433
434 68/push "4 5/imm32\n"/imm32
435 68/push _test-input-stream/imm32
436
437 e8/call write/disp32
438
439 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
440
441
442 68/push _test-output-buffered-file/imm32
443 68/push _test-input-buffered-file/imm32
444
445 e8/call convert/disp32
446
447 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
448
449
450 68/push _test-output-buffered-file/imm32
451
452 e8/call flush/disp32
453
454 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
455
456
457
458
459
460
461
462
463
464
465
466 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
492
493
494 68/push "F - test-convert/0"/imm32
495 68/push ""/imm32
496 68/push _test-output-stream/imm32
497
498 e8/call check-next-stream-line-equal/disp32
499
500 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
501
502
503 68/push "F - test-convert/1"/imm32
504 68/push ""/imm32
505 68/push _test-output-stream/imm32
506
507 e8/call check-next-stream-line-equal/disp32
508
509 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
510
511
512 68/push "F - test-convert/2"/imm32
513 68/push "== code "/imm32
514 68/push _test-output-stream/imm32
515
516 e8/call check-next-stream-line-equal/disp32
517
518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
519
520
521 68/push "F - test-convert/3"/imm32
522 68/push ""/imm32
523 68/push _test-output-stream/imm32
524
525 e8/call check-next-stream-line-equal/disp32
526
527 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
528
529
530 68/push "F - test-convert/4"/imm32
531 68/push "1 "/imm32
532 68/push _test-output-stream/imm32
533
534 e8/call check-next-stream-line-equal/disp32
535
536 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
537
538
539 68/push "F - test-convert/5"/imm32
540 68/push ""/imm32
541 68/push _test-output-stream/imm32
542
543 e8/call check-next-stream-line-equal/disp32
544
545 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
546
547
548 68/push "F - test-convert/6"/imm32
549 68/push "2 3 "/imm32
550 68/push _test-output-stream/imm32
551
552 e8/call check-next-stream-line-equal/disp32
553
554 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
555
556
557 68/push "F - test-convert/7"/imm32
558 68/push "== data "/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/8"/imm32
567 68/push "4 5/imm32 "/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 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
575 5d/pop-to-EBP
576 c3/return
577
578
579
580 next-word:
581
582 55/push-EBP
583 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
584
585 50/push-EAX
586 51/push-ECX
587 56/push-ESI
588 57/push-EDI
589
590 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
591
592 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
593
594
595 68/push 0x20/imm32/space
596 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
597
598 e8/call skip-chars-matching/disp32
599
600 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
601 $next-word:check0:
602
603
604 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
605
606 3b/compare 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
607 7c/jump-if-lesser $next-word:check-for-comment/disp8
608
609 c7 0/subop/copy 0/mod/direct 7/rm32/EDI . . . . . 0/imm32
610 c7 0/subop/copy 1/mod/*+disp8 7/rm32/EDI . . . . 4/disp8 0/imm32
611 eb/jump $next-word:end/disp8
612 $next-word:check-for-comment:
613
614 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
615 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
616 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
617
618
619 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
620 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
621
622 3d/compare-EAX-and 0x23/imm32/pound
623 75/jump-if-not-equal $next-word:check-for-string-literal/disp8
624 $next-word:comment:
625
626 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
627 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
628 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
629
630 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
631
632 eb/jump $next-word:end/disp8
633 $next-word:check-for-string-literal:
634
635
636 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
637 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
638
639 3d/compare-EAX-and 0x22/imm32/dquote
640 75/jump-if-not-equal $next-word:regular-word/disp8
641 $next-word:string-literal:
642
643
644 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
645
646 ff 0/subop/increment 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
647
648
649 57/push-EDI
650 56/push-ESI
651
652 e8/call parse-string/disp32
653
654 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
655
656 $next-word:regular-word:
657
658
659 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
660
661 e8/call skip-chars-not-matching-whitespace/disp32
662
663 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
664
665 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
666 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
667 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
668 $next-word:end:
669
670 5f/pop-to-EDI
671 5e/pop-to-ESI
672 59/pop-to-ECX
673 58/pop-to-EAX
674
675 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
676 5d/pop-to-EBP
677 c3/return
678
679 parse-string:
680
681
682
683
684
685
686
687
688
689
690
691
692 55/push-EBP
693 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
694
695 50/push-EAX
696 51/push-ECX
697 52/push-EDX
698 56/push-ESI
699
700 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
701
702
703 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
704
705 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 1/r32/ECX 0xc/disp8 .
706
707
708 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
709
710 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 2/index/EDX . 2/r32/EDX 0xc/disp8 .
711
712 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
713 $parse-string:loop:
714
715 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
716 7d/jump-if-greater-or-equal $parse-string:break/disp8
717
718 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
719 $parse-string:check1:
720
721 3d/compare-EAX-and 0x22/imm32/dquote
722 74/jump-if-equal $parse-string:break/disp8
723 $parse-string:check2:
724
725 3d/compare-EAX-and 0x5c/imm32/backslash
726 75/jump-if-not-equal $parse-string:continue/disp8
727
728 41/increment-ECX
729 $parse-string:continue:
730
731 41/increment-ECX
732
733 eb/jump $parse-string:loop/disp8
734 $parse-string:break:
735
736 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0xc/disp8 .
737 89/copy 1/mod/*+disp8 0/rm32/EAX . . . 1/r32/ECX 4/disp8 .
738
739 29/subtract 3/mod/direct 1/rm32/ECX . . . 6/r32/ESI . .
740 81 5/subop/subtract 3/mod/direct 1/rm32/ECX . . . . . 0xc/imm32
741 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
742 $parse-string:end:
743
744 5e/pop-to-ESI
745 5a/pop-to-EDX
746 59/pop-to-ECX
747 58/pop-to-EAX
748
749 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
750 5d/pop-to-EBP
751 c3/return
752
753 test-next-word:
754
755 55/push-EBP
756 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
757
758
759
760 68/push _test-input-stream/imm32
761
762 e8/call clear-stream/disp32
763
764 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
765
766 68/push 0/imm32/end
767 68/push 0/imm32/start
768 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
769
770
771 68/push " ab"/imm32
772 68/push _test-input-stream/imm32
773
774 e8/call write/disp32
775
776 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
777
778
779 51/push-ECX
780 68/push _test-input-stream/imm32
781
782 e8/call next-word/disp32
783
784 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
785
786
787
788 68/push "F - test-next-word: start"/imm32
789 68/push 0xe/imm32
790
791 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
792 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
793 50/push-EAX
794
795 e8/call check-ints-equal/disp32
796
797 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
798
799
800
801 68/push "F - test-next-word: end"/imm32
802 68/push 0x10/imm32
803
804 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
805 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
806 50/push-EAX
807
808 e8/call check-ints-equal/disp32
809
810 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
811
812 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
813 5d/pop-to-EBP
814 c3/return
815
816 test-next-word-returns-whole-comment:
817
818 55/push-EBP
819 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
820
821
822
823 68/push _test-input-stream/imm32
824
825 e8/call clear-stream/disp32
826
827 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
828
829 68/push 0/imm32/end
830 68/push 0/imm32/start
831 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
832
833
834 68/push " # a"/imm32
835 68/push _test-input-stream/imm32
836
837 e8/call write/disp32
838
839 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
840
841
842 51/push-ECX
843 68/push _test-input-stream/imm32
844
845 e8/call next-word/disp32
846
847 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
848
849
850
851 68/push "F - test-next-word-returns-whole-comment: start"/imm32
852 68/push 0xe/imm32
853
854 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
855 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
856 50/push-EAX
857
858 e8/call check-ints-equal/disp32
859
860 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
861
862
863
864 68/push "F - test-next-word-returns-whole-comment: end"/imm32
865 68/push 0x11/imm32
866
867 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
868 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
869 50/push-EAX
870
871 e8/call check-ints-equal/disp32
872
873 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
874
875 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
876 5d/pop-to-EBP
877 c3/return
878
879 test-next-word-returns-empty-string-on-eof:
880
881 55/push-EBP
882 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
883
884
885
886 68/push _test-input-stream/imm32
887
888 e8/call clear-stream/disp32
889
890 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
891
892 68/push 0/imm32/end
893 68/push 0/imm32/start
894 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
895
896
897
898 51/push-ECX
899 68/push _test-input-stream/imm32
900
901 e8/call next-word/disp32
902
903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
904
905
906 68/push "F - test-next-word-returns-empty-string-on-eof"/imm32
907 68/push 0/imm32
908
909 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
910 2b/subtract 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
911 50/push-EAX
912
913 e8/call check-ints-equal/disp32
914
915 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
916
917 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
918 5d/pop-to-EBP
919 c3/return
920
921 test-next-word-returns-whole-string:
922
923 55/push-EBP
924 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
925
926
927
928 68/push _test-input-stream/imm32
929
930 e8/call clear-stream/disp32
931
932 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
933
934 68/push 0/imm32/end
935 68/push 0/imm32/start
936 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
937
938
939 68/push " \"a b\"/imm32 "/imm32
940 68/push _test-input-stream/imm32
941
942 e8/call write/disp32
943
944 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
945
946
947 51/push-ECX
948 68/push _test-input-stream/imm32
949
950 e8/call next-word/disp32
951
952 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
953
954
955
956 68/push "F - test-next-word-returns-whole-string: start"/imm32
957 68/push 0xd/imm32
958
959 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
960 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
961 50/push-EAX
962
963 e8/call check-ints-equal/disp32
964
965 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
966
967
968
969 68/push "F - test-next-word-returns-whole-string: end"/imm32
970 68/push 0x18/imm32
971
972 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
973 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
974 50/push-EAX
975
976 e8/call check-ints-equal/disp32
977
978 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
979
980 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
981 5d/pop-to-EBP
982 c3/return
983
984 test-next-word-returns-string-with-escapes:
985
986 55/push-EBP
987 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
988
989
990
991 68/push _test-input-stream/imm32
992
993 e8/call clear-stream/disp32
994
995 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
996
997 68/push 0/imm32/end
998 68/push 0/imm32/start
999 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1000
1001
1002 68/push " \"a\\\"b\"/x"/imm32
1003 68/push _test-input-stream/imm32
1004
1005 e8/call write/disp32
1006
1007 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1008
1009
1010 51/push-ECX
1011 68/push _test-input-stream/imm32
1012
1013 e8/call next-word/disp32
1014
1015 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1016
1017
1018
1019 68/push "F - test-next-word-returns-string-with-escapes: start"/imm32
1020 68/push 0xd/imm32
1021
1022 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1023 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1024 50/push-EAX
1025
1026 e8/call check-ints-equal/disp32
1027
1028 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1029
1030
1031
1032 68/push "F - test-next-word-returns-string-with-escapes: end"/imm32
1033 68/push 0x15/imm32
1034
1035 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1036 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1037 50/push-EAX
1038
1039 e8/call check-ints-equal/disp32
1040
1041 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1042
1043 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1044 5d/pop-to-EBP
1045 c3/return
1046
1047 == data
1048
1049 Segment-size:
1050
1051 0x100/imm32
1052
1053
1054 Next-string-literal:
1055 1/imm32
1056
1057