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