谁能告诉我为什么会发生这些错误?我对程序集很新,我在编译文件时遇到了一些问题。
我尝试在NASM中编译它,在Debian中使用以下代码:
nasm -f elf codeasm.asm -o codeasm.o
我收到以下错误:
codeasm.asm:2: error: parser: instruction expected
codeasm.asm:3: error: parser: instruction expected
codeasm.asm:5: error: label or instruction expected at start of line
codeasm.asm:6: warning: Unknown section attribute 'public' ignored on declaration of section `para'
codeasm.asm:6: warning: Unknown section attribute ''data'' ignored on declaration of section `para'
codeasm.asm:10: error: parser: instruction expected
codeasm.asm:11: error: parser: instruction expected
codeasm.asm:12: error: parser: instruction expected
codeasm.asm:13: error: parser: instruction expected
codeasm.asm:14: error: parser: instruction expected
codeasm.asm:15: error: parser: instruction expected
codeasm.asm:16: error: parser: instruction expected
codeasm.asm:20: error: parser: instruction expected
codeasm.asm:21: error: parser: instruction expected
codeasm.asm:23: error: symbol `dseg' redefined
codeasm.asm:23: error: parser: instruction expected
codeasm.asm:28: warning: Unknown section attribute 'public' ignored on declaration of section `para'
codeasm.asm:28: warning: Unknown section attribute ''indata'' ignored on declaration of section `para'
对于汇编Intel语法中的以下代码(仅限前几行):
xlist
include stdlib.a
includelib stdlib.lib
list
286
dseg segment para public 'data'
h word ?
i word ?
j word ?
k word ?
l word ?
sum word ?
iterations word ?
InName byte "file1.raw",0
OutName byte "file2.raw",0
dseg ends
InSeg segment para public 'indata'
DataIn byte 251 dup (256 dup (?))
InSeg ends
OutSeg segment para public 'outdata'
DataOut byte 251 dup (256 dup (?))
OutSeg ends
有人告诉我这段代码工作正常。