I am making a bootloader which prints 3 strings. I can successfully print those strings separated by lines in bochs but cannot do so when I use Rawrite to write the 512 byte bootloader to usb and boot it. It only prints the new lines. I even initialized the registers.
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
I am just a beginner. This question does not help me- Code works on bochs but does not on real computer, x86 real mode