I am trying to make a simple OS in x86 assembly, but when I try to assemble it I get a lot of errors along the lines of:
../inc/screen.asm:1: error: label `print' inconsistently redefined
../inc/screen.asm:1: note: label `print' originally defined here
The source for screen.asm:
print:
pusha
print_loop:
mov al, [si]
cmp al, 0
jne disp_char
popa
ret
disp_char:
mov ah, 0x0E
int 0x10
add si, 1
jmp print_loop
This is in a separate file that is used in the bootloader. bootloader source:
[org 0x7c00]
%include "../inc/screen.asm"
%include "../inc/disk.asm"
%include "../inc/err.asm"
mov si, mbr_boot_info
call print
mov si, mbr_legal
call print
call read_kern
jmp $
mbr_boot_info: db "CCLOS ALPHA BOOTLOADER", 10, 13, 0
mbr_legal: db "Copyright 2021", 10, 13, 0
times 510-($-$$) db 0
dw 0xAA55
This error appears for all labels in screen.asm and also in err.asm:
%include "../inc/screen.asm"
err:
mov si, errtxt
call print
jmp $
errtxt: db "ERROR", 0
Why is this happening?