Files
x86-bare-metal-examples/bios_sleep.S
2018-12-04 09:46:27 +00:00

23 lines
429 B
ArmAsm

/* https://github.com/cirosantilli/x86-bare-metal-examples#bios-sleep */
#include "common.h"
BEGIN
/* Must enable interrupts, since BIOS uses
* them to increment the timer.
*/
sti
mov $0, %dx
infinite:
mov $18, %cx
mov 0x046C, %bx
one_sec:
mov 0x046C, %ax
cmp %ax, %bx
je one_sec
mov %ax, %bx
loop one_sec
PRINT_WORD_HEX <%dx>
PRINT_NEWLINE
inc %dx
jmp infinite