-
Notifications
You must be signed in to change notification settings - Fork 0
/
bios.txt
21 lines (16 loc) · 1.01 KB
/
bios.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# refrence from os-dev
;
; A simple boot sector program that loops forever.
;
loop: ; Define a label , "loop", that will allow; us to jump back to it , forever.
; Use a simple CPU instruction that jumps
jmp loop ; to a new memory address to continue execution.
; In our case , jump to the address of the current
; instruction.
times 510-($-$$) db 0 ; When compiled , our program must fit into 512 bytes ,
; with the last two bytes being the magic number ,
; so here , tell our assembly compiler to pad out our
; program with enough zero bytes (db 0) to bring us to the
; 510th byte.
dw 0xaa55 ; Last two bytes (one word) form the magic number ,
; so BIOS knows we are a boot sector.