https://github.com/akkartik/mu/blob/main/baremetal/108write.subx
1
2
3
4
5 write:
6
7 55/push-ebp
8 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
9
10 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 0/imm32
11 74/jump-if-= $write:end/disp8
12
13
14
15 50/push-eax
16 51/push-ecx
17 52/push-edx
18 53/push-ebx
19
20 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 8/disp8 .
21
22 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . .
23
24 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 3/r32/ebx 8/disp8 .
25
26
27 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
28
29 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ecx 3/index/ebx . 3/r32/ebx 0xc/disp8 .
30 53/push-ebx
31
32 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ecx 2/index/edx . 3/r32/ebx 0xc/disp8 .
33 53/push-ebx
34
35 e8/call _append-3/disp32
36
37 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
38
39 01/add 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
40
41 5b/pop-to-ebx
42 5a/pop-to-edx
43 59/pop-to-ecx
44 58/pop-to-eax
45 $write:end:
46
47 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
48 5d/pop-to-ebp
49 c3/return
50
51
52
53