about summary refs log tree commit diff stats
path: root/boot.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-03-15 09:41:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-03-15 09:41:36 -0700
commite35259679211348d30b1607eb91f30f1fbf6829f (patch)
tree45ae07401c03bb2046f284ca122fd1a95eff4833 /boot.subx
parent4f73f09f1aa1b3db3abefdbbe202c0352a2c9abe (diff)
downloadmu-e35259679211348d30b1607eb91f30f1fbf6829f.tar.gz
.
Diffstat (limited to 'boot.subx')
-rw-r--r--boot.subx19
1 files changed, 11 insertions, 8 deletions
diff --git a/boot.subx b/boot.subx
index f73ea2ac..4f779112 100644
--- a/boot.subx
+++ b/boot.subx
@@ -274,28 +274,30 @@ initialize_32bit_mode:
 55 aa
 
 ## sector 2 onwards loaded by load_disk, not automatically on boot
+== code
 
 null-interrupt-handler:
   cf/return-from-interrupt
 
+== data
 # padding
 # 201:
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+== code
 
 keyboard-interrupt-handler:
   # prologue
   fa/disable-interrupts
   60/push-all-registers
-== data
   # acknowledge interrupt
-  b0 20  # al <- 0x20
-  e6 20  # port 0x20 <- al
-  31 c0  # eax <- xor eax;  11/direct 000/r32/eax 000/rm32/eax
+  b0/copy-to-al 0x20/imm8
+  e6/write-al-into-port 0x20/imm8
+  31/xor %eax 0/r32/eax
   # 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 64  # al <- port 0x64
-  a8 01  # set zf if bit 0 (least significant) is not set
-  74 bb  # jump to epilogue if 0 bit is not set [label]
-# 21e:
+  e4/read-port-into-al 0x64/imm8
+  a8/test-bits-in-al 0x01/imm8  # set zf if bit 0 (least significant) is not set
+  74/jump-if-not-set $keyboard-interrupt-handler:epilogue/disp8
+== data
   # - if keyboard buffer is full, return
   31 c9  # ecx <- xor ecx;  11/direct 001/r32/ecx 001/rm32/ecx
   # var index/ecx: byte
@@ -436,6 +438,7 @@ keyboard-interrupt-handler:
     28 80 00 00  # disp32 [label]
     0f  # imm8
 == code
+$keyboard-interrupt-handler:epilogue:
   # epilogue
   61/pop-all-registers
   fb/enable-interrupts