For reasons I can not put my finger on, using a variable inside my bootloader causes it to be marked as an undefined symbol.
.386
option segment:use16
.model tiny, stdcall
;------------------------------
; CODE
;------------------------------
.code
org 07c00h
Print PROTO lpStr:WORD
_start:
INVOKE Print, OFFSET bootInfo
cli
hlt
error:
cli
hlt
Print PROC USES ax si lpStr:WORD
mov si, lpStr
mov ah, 0Eh
@@loop:
lodsb
cmp al, 0
je @@done
int 10h
jmp @@loop
@@done:
ret
Print ENDP
;------------------------------
; DATA
;------------------------------
bootInfo db "Booting CompatOS...", 0
;------------------------------
; PADDING
;------------------------------
byte 510-($-_start) dup (0)
dw 0AA55h
END _start
I've searched and looked if there is something wrong with the way I declare my variable, but apparently, it should work like this. For context, I oriented myself on this.
Any help is much appreciated. Thanks.
Edit:
MASM and linker used to compile the sources. Makefile:
.PHONY: clear
clear:
rm -f -r -d ./tmp/
rm -f -r -d ./bin/
.PHONY: build_debug
build_debug:
mkdir -p tmp
mkdir -p bin
masm_615/bin/ml /nologo /AT /c /Febin\\CompatOS.img /Fotmp\\boot.obj src\\boot\\boot.asm
masm_615/bin/link /nologo /TINY /NOD tmp\\boot.obj, bin\\CompatOS.img, NUL, NUL, NUL
Errors:
1>src\boot\boot.asm(14): error A2006: undefined symbol : bootInfo
1>src\boot\boot.asm(14): error A2114: INVOKE argument type mismatch : argument : 1