bootloader.asm

BITS 16

ORG 0x7C00


init:

MOV AX,CS

MOV DS,AX

start:

MOV SI,s_hello

CALL writes

JMP $


write:

MOV AH,0x0E

MOV BL,7

MOV BH,0

INT 0x10

RET


writes:

MOV AL,[SI]

OR AL,AL

JZ exit_writes

CALL write

INC SI

JMP writes

exit_writes:

RET


s_hello:

DB "Hello, world.",0


TIMES 510-($-$$) DB 0

DW 0xAA55

 © Andrew Brehm 2016