https://github.com/akkartik/mu/blob/master/subx/066print-byte.subx
1
2
3 == code
4
5
6
7
8 print-byte:
9
10 55/push-EBP
11 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
12
13 50/push-EAX
14
15 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0xc/disp8 .
16 c1/shift 5/subop/logic-right 3/mod/direct 0/rm32/EAX . . . . . 4/imm8
17 25/and-EAX 0xf/imm32
18
19 e8/call to-hex-char/disp32
20
21
22 50/push-EAX
23 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
24
25 e8/call write-byte/disp32
26
27 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
28
29 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 0xc/disp8 .
30 25/and-EAX 0xf/imm32
31
32 e8/call to-hex-char/disp32
33
34
35 50/push-EAX
36 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
37
38 e8/call write-byte/disp32
39
40 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
41 $print-byte:end:
42
43 58/pop-to-EAX
44
45 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
46 5d/pop-to-EBP
47 c3/return
48
49 test-print-byte:
50
51
52
53
54 68/push _test-stream/imm32
55
56 e8/call clear-stream/disp32
57
58 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
59
60
61 b8/copy-to-EAX _test-buffered-file/imm32
62 05/add-to-EAX 4/imm32
63 50/push-EAX
64
65 e8/call clear-stream/disp32
66
67 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
68
69
70 68/push 0xa/imm32
71 68/push _test-buffered-file/imm32
72
73 e8/call print-byte/disp32
74
75 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
76
77
78 68/push _test-buffered-file/imm32
79
80 e8/call flush/disp32
81
82 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
83
84
85 68/push "F - test-print-byte"/imm32
86 68/push "0a"/imm32
87 68/push _test-stream/imm32
88
89 e8/call check-stream-equal/disp32
90
91 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
92
93 c3/return
94
95