【发布时间】:2018-03-09 20:16:37
【问题描述】:
我正在汇编中制作引导加载程序,在 NASM 中编译我的文件时出现编译器错误。 输出是:
bootloader.asm:1: error: label or instruction expected at start of line
bootloader.asm:16: warning: label alone on a line without a colon might be in error [-w+orphan-labels]
bootloader.asm:23: warning: label alone on a line without a colon might be in error [-w+orphan-labels]
有人可以帮忙吗?这是我的代码:
[BITS 16]
[ORG 0x7C00]
MOV SI, BOOTLOADERSTR
CALL PrintString
JMP $
PrintCharacter:
MOV AH, 0x0E
MOV BH, 0x00
MOV BL, 0x07
INT 0x10
RET
PrintString
next_character:
MOV AL, [SI]
INC SI
OR AL, AL
JZ exit_function
CALL PrintCharacter
exit_function
RET
;DATA
BOOTLOADERSTR db 'it-is-OK Bootloader for OpenKasrix' , 0
TIMES 510 - ($ - $$) db 0
DW 0xAA55
【问题讨论】:
-
可能您的编辑器(我猜您是在 Windows 上?)正在保存为带有字节顺序标记的 UTF-8。你用的是什么编辑器?您的编辑器可以选择保存纯文本 (ANSI) 而不是 UTF-8
标签: assembly operating-system nasm bootloader