我正在制作一个打印3个字符串的bootloader。我可以成功打印bochs中由行分隔的字符串,但是当我使用Rawrite将512字节引导加载程序写入USB并启动它时,不能这样做。它只打印新行。我甚至初始化了寄存器。
org 0x7c00
bits 16
cld
mov ax, 0
mov bx, 0
mov cx, 0
mov dx, 0
mov ds, ax
mov cs, ax
mov es, ax
mov ss, ax
mov sp, ax
jmp main
Print:
mov al, [bx]
cmp al, 0
je PrintD
mov ah, 0x0e
int 0x10
inc bx
jmp Print
PrintD:
ret
Println:
call Print
mov al, 10
int 0x10
mov al, 13
int 0x10
ret
main:
mov bx, HELLO_MSG
call Println
mov bx, GOODBYE
call Println
mov bx, THANKS
call Println
jmp $
HELLO_MSG: db "Hello World!",0
GOODBYE: db "Goodbye!",0
THANKS: db "Thank you for choosing Garg OS!",0
times 510 - ($-$$) db 0
dw 0xaa55
我只是个初学者。这个问题对我没有帮助 - Code works on bochs but does not on real computer, x86 real mode