Problems with a simple bootsector
Posted: Thu Nov 07, 2002 4:32 pm
Hi all,
i wrote a simple bootsector in NASM . It should just print a message to the screen and then enter a infinite loop. But it doesn?t print anything. Could you please check my code and tell me what i am doing wrong?
Thank you very much !
i wrote a simple bootsector in NASM . It should just print a message to the screen and then enter a infinite loop. But it doesn?t print anything. Could you please check my code and tell me what i am doing wrong?
Thank you very much !
Code: Select all
ORG 0x7c00
mov ax,0x1301 ; function to write a string on screen
; al = 01 => update cursor
mov bx,0x0007 ; page 0, white on black
mov cx,message_length
mov dx,0 ; row 0 , col 0
mov es,dx ;
mov bp,message ; es:bp is pointing at the string to output
int 0x10 ; finally invoke the interrupt to output the message
forever: jmp forever
message: db "Hello , i am a bootsector"
message_length equ $-message
times 510-($$-$) db 0xFF ; fill space with 0xFF , so that we fit exactly 512 bytes
dw 0xAA55 ; this is the magic signature for the boot-sector