根据于渊老师给的bootbin源码,wiki以后小改了一下。参考BIOS的10H系统中断和BIOS颜色模式。
org 7c00h ;
call DispStr ;
jmp $ ;
DispStr:
mov ax, BootMessage ;
mov bp, ax ;
mov cx, LenOfMsg ;
mov ax, 1301h ; Write String Mode; Assign all chars the attribute in BL and update cursor
mov bx, 000ah ; Set Page Number; Set Color
mov dx, 0000h ; Set Row 0; Set Colum 0
int 10h ; Call int 10h
ret
BootMessage: db "[>>>>>>>>>>>>>>>>>>WE ARE ANOYMOUS<<<<<<<<<<<<<<<<<<]"
LenOfMsg equ $ - BootMessage
times 510-($-$$) db 0 ;
dw 0xaa55 ;
类似int13基本输入输出中断,整个配置涉及BP字符串存储,以及[A-D]X配置寄存器,最后呼叫中断函数。