Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; COMPILE: nasm bootloader.asm -f bin -o bootloader.bin
- ; RUN: qemu-system-i386 bootloader.bin
- [BITS 16]
- [ORG 0x7C00]
- Bootloader_Entry_Point:
- mov si, info_text
- call Print_String
- jmp $ ; Loop forever
- Print_Character:
- mov ah, 0x0e
- mov bh, 0x00
- mov bl, 0x07
- int 0x10
- ret
- Print_String:
- mov al, [si]
- inc si
- cmp al, 0
- je exit_function
- call Print_Character
- jmp Print_String
- exit_function:
- ret
- info_text db 'My very own bootloader', 13, 10, 0
- TIMES 510 - ($ - $$) db 0 ; Fill unused part of the 512 byte boot block with zeroes
- magic_id dw 0xAA55 ; This ID has to be the last two bytes of the 512 byte boot block
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement