This commit is contained in:
parent
d418bc0c97
commit
db5f7c26a5
18
boot.subx
18
boot.subx
|
@ -344,8 +344,6 @@ idt_start:
|
|||
|
||||
null-interrupt-handler:
|
||||
# prologue
|
||||
# Don't disable interrupts; the timer has the highest priority anyway,
|
||||
# and this interrupt triggers extremely frequently.
|
||||
fa/disable-interrupts
|
||||
60/push-all-registers
|
||||
9c/push-flags
|
||||
|
@ -353,7 +351,7 @@ null-interrupt-handler:
|
|||
b0/copy-to-al 0x20/imm8
|
||||
e6/write-al-into-port 0x20/imm8
|
||||
31/xor %eax 0/r32/eax
|
||||
$null-interrupt-handler:epilogue:
|
||||
$null-interrupt-handler:end:
|
||||
# epilogue
|
||||
9d/pop-flags
|
||||
61/pop-all-registers
|
||||
|
@ -372,7 +370,7 @@ keyboard-interrupt-handler:
|
|||
# check output buffer of 8042 keyboard controller (https://web.archive.org/web/20040604041507/http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html)
|
||||
e4/read-port-into-al 0x64/imm8
|
||||
a8/test-bits-in-al 0x01/imm8 # set zf if bit 0 (least significant) is not set
|
||||
0f 84/jump-if-not-set $keyboard-interrupt-handler:epilogue/disp32
|
||||
0f 84/jump-if-not-set $keyboard-interrupt-handler:end/disp32
|
||||
# - if keyboard buffer is full, return
|
||||
# var dest-addr/ecx: (addr byte) = (keyboard-buffer + *keyboard-buffer:write)
|
||||
31/xor %ecx 1/r32/ecx
|
||||
|
@ -382,7 +380,7 @@ keyboard-interrupt-handler:
|
|||
8a/byte-> *ecx 0/r32/al
|
||||
# if (al != 0) return
|
||||
3c/compare-al-and 0/imm8
|
||||
0f 85/jump-if-!= $keyboard-interrupt-handler:epilogue/disp32
|
||||
0f 85/jump-if-!= $keyboard-interrupt-handler:end/disp32
|
||||
# - read keycode
|
||||
e4/read-port-into-al 0x60/imm8
|
||||
# - key released
|
||||
|
@ -412,7 +410,7 @@ keyboard-interrupt-handler:
|
|||
24/and-al-with 0x80/imm8
|
||||
3c/compare-al-and 0/imm8
|
||||
58/pop-to-eax
|
||||
75/jump-if-!= $keyboard-interrupt-handler:epilogue/disp8
|
||||
75/jump-if-!= $keyboard-interrupt-handler:end/disp8
|
||||
# - key pressed
|
||||
# if (al == 0x2a) shift = true, return # left shift pressed
|
||||
{
|
||||
|
@ -421,7 +419,7 @@ keyboard-interrupt-handler:
|
|||
# *shift = 1
|
||||
c7 0/subop/copy *Keyboard-shift-pressed? 1/imm32
|
||||
# return
|
||||
eb/jump $keyboard-interrupt-handler:epilogue/disp8
|
||||
eb/jump $keyboard-interrupt-handler:end/disp8
|
||||
}
|
||||
# if (al == 0x36) shift = true, return # right shift pressed
|
||||
{
|
||||
|
@ -430,7 +428,7 @@ keyboard-interrupt-handler:
|
|||
# *shift = 1
|
||||
c7 0/subop/copy *Keyboard-shift-pressed? 1/imm32
|
||||
# return
|
||||
eb/jump $keyboard-interrupt-handler:epilogue/disp8
|
||||
eb/jump $keyboard-interrupt-handler:end/disp8
|
||||
}
|
||||
# if (al == 0x1d) ctrl = true, return
|
||||
{
|
||||
|
@ -439,7 +437,7 @@ keyboard-interrupt-handler:
|
|||
# *ctrl = 1
|
||||
c7 0/subop/copy *Keyboard-ctrl-pressed? 1/imm32
|
||||
# return
|
||||
eb/jump $keyboard-interrupt-handler:epilogue/disp8
|
||||
eb/jump $keyboard-interrupt-handler:end/disp8
|
||||
}
|
||||
# - convert key to character
|
||||
# if (shift) use keyboard shift map
|
||||
|
@ -474,7 +472,7 @@ $keyboard-interrupt-handler:select-map-done:
|
|||
# clear top nibble of index (keyboard buffer is circular)
|
||||
80 4/subop/and-byte *Keyboard-buffer:write 0x0f/imm8
|
||||
}
|
||||
$keyboard-interrupt-handler:epilogue:
|
||||
$keyboard-interrupt-handler:end:
|
||||
# epilogue
|
||||
9d/pop-flags
|
||||
61/pop-all-registers
|
||||
|
|
Loading…
Reference in New Issue