将 ASM 文件组装成 EXE
我前几天刚开始学习汇编语言编程。现在,我在将 asm
文件组装成 exe
时遇到问题。我使用 NASM 作为我的汇编器。这是我用来组装它的命令:
nasm file.asm -o file.com or exe
这是我的代码:
.model small
.data
.code
start:
mov ax,@data
mov ds,ax
mov ax,00h
mov bx,33h
mov ah,4ch
int 21h
end start
...但是我收到这些错误:
boss.asm:1: error: attempt to define a local label before any non-local labels
boss.asm:1: error: parser: instruction expected
boss.asm:2: error: attempt to define a local label before any non-local labels
boss.asm:3: error: attempt to define a local label before any non-local labels
boss.asm:13: error: parser: instruction expected
我不明白这些错误的含义。我该如何修复这些错误?
I just started learning the assembly language programming few days ago. Now I have a problem assembling the asm
file into an exe
. I use NASM as my assembler. This is the command I use to assemble it:
nasm file.asm -o file.com or exe
Here is my code:
.model small
.data
.code
start:
mov ax,@data
mov ds,ax
mov ax,00h
mov bx,33h
mov ah,4ch
int 21h
end start
...but I get these errors:
boss.asm:1: error: attempt to define a local label before any non-local labels
boss.asm:1: error: parser: instruction expected
boss.asm:2: error: attempt to define a local label before any non-local labels
boss.asm:3: error: attempt to define a local label before any non-local labels
boss.asm:13: error: parser: instruction expected
I don't understand what these errors mean. How do I fix these errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已经很长时间了,但我认为这可能是由于缺乏正确的段定义造成的。
It's been a long time but I think this can be caused by a lack of proper segment definitions.