halt until exception when waiting for keyboard
This reduces CPU consumption from 180% to 2% when running Qemu. Many thanks to Fabian of https://copy.sh for this suggestion.
This commit is contained in:
parent
204589b2ff
commit
ae4058add3
|
@ -24,6 +24,8 @@ read-key: # kbd: (addr keyboard) -> result/eax: byte
|
|||
89/<- %ebp 4/r32/esp
|
||||
# . save registers
|
||||
51/push-ecx
|
||||
# wait for an interrupt to save power on Qemu
|
||||
f4/hlt
|
||||
# result = 0
|
||||
b8/copy-to-eax 0/imm32
|
||||
# ecx = keyboard
|
||||
|
|
Loading…
Reference in New Issue