I'm building a simple OS and am trying to just get some text on the screen, from the bootloader.
Whenever I compile it (nasm -fbin bootloader.asm), it gives this error:
print.asm:23: error: invalid combination of opcode and operands
I can't understand what's wrong, and print.asm doesn't even have that many lines, so it's not clear which line NASM doesn't like.
This is the bootloader.asm:
[org 0x7c00]
mov bp, 0x7c00
mov sp, bp
mov bx, TestString
call PrintString
jmp $
%include "print.asm"
times 510-($-$$) db 0
dw 0xaa55
Here is print.asm:
PrintString:
push ax
push bx
mov ah, 0x0e
.Loop:
cmp [bx], byte 0
je .Exit
mov al, [bx]
int 0x10
int bx
jmp .Loop
.Exit:
pop ax
pop bx
ret
TestString:
db 'Test String',0