I am trying to develop a simple boot sector. Including another assembly file is producing an error.Here is my code:
boot_sect.asm
mov ah,0x0e
org 0x7c00
mov bx,HELLO
call print_bx
call print_bx
jmp $
print_bx:
pusha
call printing_loop
mov al,0xa
int 0x10
mov al,0xd
int 0x10
popa
ret
printing_loop:
mov al,[bx]
int 0x10
add bx,0x01
cmp byte [bx],0x00
jne printing_loop
ret
HELLO:
db 'Hello World',0
times 510-($-$$) db 0
dw 0xaa55
This works perfectly and produces the output:
Hello World
Hello World
But when I add the line %include "print_al.asm"
in the beginning,the output produced is
U
No errors are shown. I run the code using
nasm boot_sect.asm -f bin -o boot_sect.bin
qemu-system-x86_64 boot_sect.bin
What am I doing wrong?