diff options
Diffstat (limited to '102keyboard.subx')
-rw-r--r-- | 102keyboard.subx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/102keyboard.subx b/102keyboard.subx index df74c8e7..e8d23962 100644 --- a/102keyboard.subx +++ b/102keyboard.subx @@ -19,20 +19,19 @@ read-key: # kbd: (addr keyboard) -> result/eax: byte 81 7/subop/compare %ecx 0/imm32 { 75/jump-if-!= break/disp8 - # var read/ecx: byte = keyboard buffer's read index - 8b/-> *0x802c 1/r32/CL # keyboard-buffer-read - # var next-key/eax: byte = *(keyboard buffer + ecx) - 8a/byte-> *(ecx+0x8030) 0/r32/AL # keyboard-buffer-data + # var buffer-byte-addr/ecx: (addr byte) + 8b/-> *Keyboard-buffer:read 1/r32/CL + 81 0/subop/add %ecx Keyboard-buffer:data/imm32 + # var next-key/eax: byte = *buffer-byte-addr + 8a/byte-> *ecx 0/r32/AL # if (next-key != 0) lock and remove from keyboard buffer 81 7/subop/compare %eax 0/imm32 { 74/jump-if-= break/disp8 - # TODO: add some instructions in this block to SubX if we ever want to - # use bootstrap on baremetal programs fa/disable-interrupts - c6 0/subop/copy-byte *(ecx+0x8030) 0/imm8 # keyboard-buffer-data - ff 0/subop/increment *0x802c # keyboard-buffer-read - 81 4/subop/and *0x802c 0xf/imm32 # keyboard-buffer-read + c6 0/subop/copy-byte *ecx 0/imm8 + ff 0/subop/increment *Keyboard-buffer:read + 81 4/subop/and *Keyboard-buffer:read 0x0f/imm32 fb/enable-interrupts } # return |