https://github.com/akkartik/mu/blob/master/apps/random.subx
1
2
3
4
5
6
7 == code 0x09000000
8
9
10
11
12 Entry:
13
14 bb/copy-to-ebx Filename/imm32
15 b9/copy-to-ecx 0/imm32/rdonly
16 ba/copy-to-edx 0x180/imm32/fixed-perms
17 b8/copy-to-eax 5/imm32/open
18 cd/syscall 0x80/imm8
19
20 89/copy 3/mod/direct 6/rm32/esi . . . 0/r32/eax . .
21
22 $loop:
23
24
25 89/copy 3/mod/direct 3/rm32/ebx . . . 6/r32/esi . .
26 b9/copy-to-ecx N/imm32
27 ba/copy-to-edx 4/imm32/size
28 b8/copy-to-eax 3/imm32/read
29 cd/syscall 0x80/imm8
30
31
32
33 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . N/disp32
34 68/push Stdout/imm32
35
36 e8/call print-int32-buffered/disp32
37
38
39
40 68/push Newline/imm32
41 68/push Stdout/imm32
42
43 e8/call write-buffered/disp32
44
45 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
46
47 eb/jump $loop/disp8
48
49
50 bb/copy-to-ebx 0/imm32
51 b8/copy-to-eax 1/imm32/exit
52 cd/syscall 0x80/imm8
53
54 == data 0x0a000000
55
56 N:
57 0/imm32
58 Filename:
59 2f 64 65 76 2f 72 61 6e 64 6f 6d 00
60
61
62