https://github.com/akkartik/mu/blob/main/baremetal/102keyboard.subx
1
2
3
4
5
6
7 == code
8
9 read-key:
10
11 55/push-ebp
12 89/<- %ebp 4/r32/esp
13
14 51/push-ecx
15
16 b8/copy-to-eax 0/imm32
17
18 8b/-> *(ebp+8) 1/r32/ecx
19 81 7/subop/compare %ecx 0/imm32
20 {
21 75/jump-if-!= break/disp8
22
23 8b/-> *0x802c 1/r32/CL
24
25 8a/byte-> *(ecx+0x8030) 0/r32/AL
26
27 81 7/subop/compare %eax 0/imm32
28 {
29 74/jump-if-= break/disp8
30
31
32 fa/disable-interrupts
33 c6 0/subop/copy-byte *(ecx+0x8030) 0/imm8
34 ff 0/subop/increment *0x802c
35 81 4/subop/and *0x802c 0xf/imm32
36 fb/enable-interrupts
37 }
38
39 eb $read-key:end/disp8
40 }
41
42 $read-key:end:
43
44 59/pop-to-ecx
45
46 89/<- %esp 5/r32/ebp
47 5d/pop-to-ebp
48 c3/return