https://github.com/akkartik/mu/blob/master/subx/apps/crenshaw2-1b.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 == code
29
30
31
32
33
34
35
36
37
38
39 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
40
41
42 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0/disp8 1/imm32
43 7e/jump-if-lesser-or-equal $run-main/disp8
44
45
46 68/push "test"/imm32
47 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x8/disp8
48
49 e8/call kernel-string-equal/disp32
50
51 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
52
53 3d/compare-EAX 1/imm32
54 75/jump-if-not-equal $run-main/disp8
55
56 e8/call run-tests/disp32
57 8b/copy 0/mod/indirect 5/rm32/.disp32 3/r32/EBX Num-test-failures/disp32
58 eb/jump $main:end/disp8
59 $run-main:
60
61
62 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 8/imm32
63 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX
64
65
66 c7/copy 0/mod/direct 0/rm32/EAX 0/imm32
67
68
69 50/push-EAX/ed
70 68/push 2/imm32/stderr
71 68/push 1/imm32/stdout
72 68/push Stdin/imm32
73
74 e8/call compile/disp32
75
76 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
77
78 bb/copy-to-EBX 0/imm32
79 $main:end:
80 b8/copy-to-EAX 1/imm32/exit
81 cd/syscall 0x80/imm8
82
83
84 compile:
85
86 55/push-EBP
87 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
88
89 50/push-EAX
90 51/push-ECX
91
92
93
94 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
95
96 e8/call get-char/disp32
97
98 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
99
100
101
102
103
104 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 0x13/imm32
105 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 1/r32/ECX
106
107
108 c7/copy 1/mod/*+disp8 1/rm32/ECX 8/disp8 7/imm32
109
110
111 51/push-ECX
112
113 e8/call clear-stream/disp32
114
115 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
116
117
118
119 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x14/disp8
120 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x10/disp8
121 51/push-ECX/num
122 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
123
124 e8/call get-num/disp32
125
126 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
127
128
129
130
131
132
133
134 68/push "bb/copy-to-EBX "/imm32
135 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
136
137 e8/call write/disp32
138
139 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
140
141
142 51/push-ECX/num
143 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
144
145 e8/call write-stream/disp32
146
147 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
148
149
150 68/push Newline/imm32
151 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
152
153 e8/call write/disp32
154
155 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
156
157
158 68/push "b8/copy-to-EAX 1/imm32/exit"/imm32
159 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
160
161 e8/call write/disp32
162
163 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
164
165
166 68/push Newline/imm32
167 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
168
169 e8/call write/disp32
170
171 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
172
173
174 68/push "cd/syscall 0x80/imm8"/imm32
175 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
176
177 e8/call write/disp32
178
179 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
180
181
182 68/push Newline/imm32
183 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
184
185 e8/call write/disp32
186
187 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
188
189 59/pop-to-ECX
190 58/pop-to-EAX
191
192 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
193 5d/pop-to-EBP
194 c3/return
195
196
197
198
199
200 get-num:
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226 55/push-EBP
227 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
228
229
230
231 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 Look/disp32
232
233 e8/call is-digit?/disp32
234
235 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
236
237 3d/compare-EAX 0/imm32
238 75/jump-if-not-equal $get-num:main/disp8
239
240
241 68/push "integer"/imm32
242 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x10/disp8
243 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x14/disp8
244
245 e8/call expected/disp32
246
247 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
248 $get-num:main:
249
250
251 50/push-EAX
252 51/push-ECX
253 52/push-EDX
254 53/push-EBX
255 56/push-ESI
256 57/push-EDI
257
258
259 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 6/r32/ESI 8/disp8
260
261 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 7/r32/EDI 0xc/disp8
262
263 8b/copy 0/mod/indirect 7/rm32/EDI 1/r32/ECX
264
265 8b/copy 1/mod/*+disp8 7/rm32/EDI 2/r32/EDX 8/disp8
266 $get-num:loop:
267
268 3b/compare 3/mod/direct 1/rm32/ECX 2/r32/EDX
269 7d/jump-if-lesser $get-num:loop-stage2/disp8
270
271
272 68/push "get-num: too many digits in number"/imm32
273 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x10/disp8
274 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x14/disp8
275
276 e8/call error/disp32
277
278 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
279 $get-num:loop-stage2:
280
281 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/EDI 1/index/ECX 3/r32/EBX 0xc/disp8
282 8b/copy 0/mod/indirect 5/rm32/.disp32 0/r32/EAX Look/disp32
283 88/copy-byte 0/mod/indirect 3/rm32/EBX 0/r32/AL
284
285 41/increment-ECX
286
287
288 56/push-ESI
289
290 e8/call get-char/disp32
291
292 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
293
294
295
296 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 Look/disp32
297
298 e8/call is-digit?/disp32
299
300 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
301
302 3d/compare-EAX 0/imm32
303 0f 85/jump-if-not-equal $get-num:loop/disp32
304 $get-num:loop-end:
305
306 89/copy 0/mod/indirect 7/rm32/EDI 1/r32/ECX
307
308 5f/pop-to-EDI
309 5e/pop-to-ESI
310 5b/pop-to-EBX
311 5a/pop-to-EDX
312 59/pop-to-ECX
313 58/pop-to-EAX
314
315 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
316 5d/pop-to-EBP
317 c3/return
318
319 test-get-num-reads-single-digit:
320
321
322 55/push-EBP
323 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
324
325
326
327 68/push _test-stream/imm32
328
329 e8/call clear-stream/disp32
330
331 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
332
333
334 b8/copy-to-EAX _test-buffered-file/imm32
335 05/add-to-EAX 4/imm32
336 50/push-EAX
337
338 e8/call clear-stream/disp32
339
340 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
341
342
343 68/push _test-output-stream/imm32
344
345 e8/call clear-stream/disp32
346
347 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
348
349
350 68/push _test-error-stream/imm32
351
352 e8/call clear-stream/disp32
353
354 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
355
356
357
358 68/push "3"/imm32
359 68/push _test-stream/imm32
360
361 e8/call write/disp32
362
363 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
364
365
366 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 8/imm32
367 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX
368
369
370 68/push 0x10/imm32/nbytes-of-args-for-get-num
371 50/push-EAX/ed
372
373 e8/call tailor-exit-descriptor/disp32
374
375 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
376
377
378
379 68/push _test-buffered-file/imm32
380
381 e8/call get-char/disp32
382
383 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
384
385
386 50/push-EAX/ed
387 68/push _test-error-stream/imm32
388 68/push _test-output-stream/imm32
389 68/push _test-buffered-file/imm32
390
391 e8/call get-num/disp32
392
393
394 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
395
396
397 68/push "F - test-get-num-reads-single-digit"/imm32
398 68/push 0x33/imm32
399 b8/copy-to-EAX _test-output-stream/imm32
400 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX 0xc/disp8
401
402 e8/call check-ints-equal/disp32
403
404 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
405
406 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
407 5d/pop-to-EBP
408 c3/return
409
410 test-get-num-aborts-on-non-digit-in-Look:
411
412
413 55/push-EBP
414 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
415
416
417
418 68/push _test-stream/imm32
419
420 e8/call clear-stream/disp32
421
422 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
423
424
425 b8/copy-to-EAX _test-buffered-file/imm32
426 05/add-to-EAX 4/imm32
427 50/push-EAX
428
429 e8/call clear-stream/disp32
430
431 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
432
433
434 68/push _test-output-stream/imm32
435
436 e8/call clear-stream/disp32
437
438 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
439
440
441 68/push _test-error-stream/imm32
442
443 e8/call clear-stream/disp32
444
445 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
446
447
448
449 68/push "3"/imm32
450 68/push _test-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 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 8/imm32
458 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX
459
460
461 68/push 0x10/imm32/nbytes-of-args-for-get-num
462 50/push-EAX/ed
463
464 e8/call tailor-exit-descriptor/disp32
465
466 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
467
468
469
470 50/push-EAX/ed
471 68/push _test-error-stream/imm32
472 68/push _test-output-stream/imm32
473 68/push _test-buffered-file/imm32
474
475 e8/call get-num/disp32
476
477
478 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
479
480
481
482 68/push "F - test-get-num-aborts-on-non-digit-in-Look"/imm32
483 68/push 2/imm32
484
485 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX 4/disp8
486
487 e8/call check-ints-equal/disp32
488
489 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
490
491 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
492 5d/pop-to-EBP
493 c3/return
494
495 test-get-num-reads-multiple-digits:
496
497
498 55/push-EBP
499 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
500
501
502
503 68/push _test-stream/imm32
504
505 e8/call clear-stream/disp32
506
507 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
508
509
510 b8/copy-to-EAX _test-buffered-file/imm32
511 05/add-to-EAX 4/imm32
512 50/push-EAX
513
514 e8/call clear-stream/disp32
515
516 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
517
518
519 68/push _test-output-stream/imm32
520
521 e8/call clear-stream/disp32
522
523 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
524
525
526 68/push _test-error-stream/imm32
527
528 e8/call clear-stream/disp32
529
530 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
531
532
533
534 68/push "3456"/imm32
535 68/push _test-stream/imm32
536
537 e8/call write/disp32
538
539 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
540
541
542 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 8/imm32
543 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX
544
545
546 68/push 0x10/imm32/nbytes-of-args-for-get-num
547 50/push-EAX/ed
548
549 e8/call tailor-exit-descriptor/disp32
550
551 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
552
553
554
555 68/push _test-buffered-file/imm32
556
557 e8/call get-char/disp32
558
559 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
560
561
562 50/push-EAX/ed
563 68/push _test-error-stream/imm32
564 68/push _test-output-stream/imm32
565 68/push _test-buffered-file/imm32
566
567 e8/call get-num/disp32
568
569
570 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
571
572
573 68/push "F - test-get-num-reads-multiple-digits"/imm32
574 68/push 0x36353433/imm32
575 b8/copy-to-EAX _test-output-stream/imm32
576 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX 0xc/disp8
577
578 e8/call check-ints-equal/disp32
579
580 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
581
582 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
583 5d/pop-to-EBP
584 c3/return
585
586 test-get-num-reads-multiple-digits-followed-by-nondigit:
587
588
589 55/push-EBP
590 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
591
592
593
594 68/push _test-stream/imm32
595
596 e8/call clear-stream/disp32
597
598 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
599
600
601 b8/copy-to-EAX _test-buffered-file/imm32
602 05/add-to-EAX 4/imm32
603 50/push-EAX
604
605 e8/call clear-stream/disp32
606
607 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
608
609
610 68/push _test-output-stream/imm32
611
612 e8/call clear-stream/disp32
613
614 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
615
616
617 68/push _test-error-stream/imm32
618
619 e8/call clear-stream/disp32
620
621 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
622
623
624
625 68/push "3456 x"/imm32
626 68/push _test-stream/imm32
627
628 e8/call write/disp32
629
630 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
631
632
633 81 5/subop/subtract 3/mod/direct 4/rm32/ESP 8/imm32
634 8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none 0/r32/EAX
635
636
637 68/push 0x10/imm32/nbytes-of-args-for-get-num
638 50/push-EAX/ed
639
640 e8/call tailor-exit-descriptor/disp32
641
642 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
643
644
645
646 68/push _test-buffered-file/imm32
647
648 e8/call get-char/disp32
649
650 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
651
652
653 50/push-EAX/ed
654 68/push _test-error-stream/imm32
655 68/push _test-output-stream/imm32
656 68/push _test-buffered-file/imm32
657
658 e8/call get-num/disp32
659
660
661 81 0/subop/add 3/mod/direct 4/rm32/ESP 0x10/imm32
662
663
664 68/push "F - test-get-num-reads-multiple-digits-followed-by-nondigit"/imm32
665 68/push 0x36353433/imm32
666 b8/copy-to-EAX _test-output-stream/imm32
667 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX 0xc/disp8
668
669 e8/call check-ints-equal/disp32
670
671 81 0/subop/add 3/mod/direct 4/rm32/ESP 0xc/imm32
672
673 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
674 5d/pop-to-EBP
675 c3/return
676
677
678
679
680 expected:
681
682 55/push-EBP
683 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
684
685
686 68/push "Error: "/imm32
687 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
688
689 e8/call write/disp32
690
691 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
692
693
694 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x10/disp8
695 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
696
697 e8/call write/disp32
698
699 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
700
701
702 68/push " expected"/imm32
703 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
704
705 e8/call write/disp32
706
707 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
708
709
710 68/push Newline/imm32
711 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
712
713 e8/call write/disp32
714
715 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
716
717
718 68/push 1/imm32
719 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
720
721 e8/call stop/disp32
722
723
724 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
725 5d/pop-to-EBP
726 c3/return
727
728
729 error:
730
731 55/push-EBP
732 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
733
734
735 68/push "Error: "/imm32
736 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
737
738 e8/call write/disp32
739
740 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
741
742
743 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x10/disp8
744 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
745
746 e8/call write/disp32
747
748 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
749
750
751 68/push Newline/imm32
752 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0xc/disp8
753
754 e8/call write/disp32
755
756 81 0/subop/add 3/mod/direct 4/rm32/ESP 8/imm32
757
758
759 68/push 1/imm32
760 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8
761
762 e8/call stop/disp32
763
764
765 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
766 5d/pop-to-EBP
767 c3/return
768
769
770 get-char:
771
772 55/push-EBP
773 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
774
775 50/push-EAX
776
777
778 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x8/disp8
779
780 e8/call read-byte/disp32
781
782 81 0/subop/add 3/mod/direct 4/rm32/ESP 4/imm32
783
784 89/copy 0/mod/indirect 5/rm32/.disp32 0/r32/EAX Look/disp32
785
786 58/pop-to-EAX
787
788 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
789 5d/pop-to-EBP
790 c3/return
791
792 is-digit?:
793
794 55/push-EBP
795 89/copy 3/mod/direct 5/rm32/EBP 4/r32/ESP
796
797 b8/copy-to-EAX 0/imm32
798
799 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x8/disp8 0x30/imm32
800 7c/jump-if-lesser $is-digit?:end/disp8
801
802 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 0x8/disp8 0x39/imm32
803 7f/jump-if-greater $is-digit?:end/disp8
804
805 b8/copy-to-EAX 1/imm32
806 $is-digit?:end:
807
808 89/copy 3/mod/direct 4/rm32/ESP 5/r32/EBP
809 5d/pop-to-EBP
810 c3/return
811
812 == data
813
814 Look:
815 00 00 00 00
816
817 _test-output-stream:
818
819 00 00 00 00
820
821 00 00 00 00
822
823 08 00 00 00
824
825 00 00 00 00 00 00 00 00
826
827 _test-error-stream:
828
829 00 00 00 00
830
831 00 00 00 00
832
833 08 00 00 00
834
835 00 00 00 00 00 00 00 00
836
837