Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
at the very least, set up a stack before using it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
;----------------------------------------------------------------------
; Simple boot program that prints the letter 'H'
; and then hangs
;----------------------------------------------------------------------
org 0x7c00 ; This is where BIOS loads the bootloader
; Execution begins here
entry:
jmp short begin ; jump over the DOS boot record data
; --------------------------------------------
; Boot program code begins here
; --------------------------------------------
; boot code begins at 0x003E
begin:
mov ah, 0x0 ; Function to print a character to the screen
mov al, 'H' ; Which character to print
mov bl, 7 ; color/style to use for the character
int 0x10 ; print the character
hang:
jmp hang ; just loop forever.
;---------------------------------------------
size equ $ - entry
%if size+2 > 512
%error "code is too large for boot sector"
%endif
times (512 - size - 2) db 0
db 0x55, 0xAA ;2 byte boot signature
becareful this will destroy all data on your floppy disk.
Thanx.
The man who follows the crowd will usually get no further than the crowd.
The man who walks alone is likely to find himself in places
no one has ever been before.