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