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