https://github.com/akkartik/mu/blob/main/101screen.subx
1
2
3
4
5
6 == code
7
8 pixel-on-real-screen:
9
10 55/push-ebp
11 89/<- %ebp 4/r32/esp
12
13 (pixel-on-screen-buffer *Video-memory-addr *(ebp+8) *(ebp+0xc) *(ebp+0x10) 0x400 0x300)
14 $pixel-on-real-screen:end:
15
16 89/<- %esp 5/r32/ebp
17 5d/pop-to-ebp
18 c3/return
19
20
21 pixel-on-screen-buffer:
22
23 55/push-ebp
24 89/<- %ebp 4/r32/esp
25
26 50/push-eax
27 51/push-ecx
28
29 8b/-> *(ebp+0xc) 0/r32/eax
30 3d/compare-eax-and 0/imm32
31 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
32 3b/compare 0/r32/eax *(ebp+0x18)
33 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
34 8b/-> *(ebp+0x10) 0/r32/eax
35 3d/compare-eax-and 0/imm32
36 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
37 3b/compare 0/r32/eax *(ebp+0x1c)
38 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
39
40 8b/-> *(ebp+0x10) 0/r32/eax
41 0f af/multiply-> *(ebp+0x18) 0/r32/eax
42 03/add-> *(ebp+0xc) 0/r32/eax
43
44 03/add-> *(ebp+8) 0/r32/eax
45
46 8b/-> *(ebp+0x14) 1/r32/ecx
47 88/byte<- *eax 1/r32/CL
48 $pixel-on-screen-buffer:end:
49
50 59/pop-to-ecx
51 58/pop-to-eax
52
53 89/<- %esp 5/r32/ebp
54 5d/pop-to-ebp
55 c3/return