我是初学者到ASM,我正在关注this tutorial。此示例中的代码无效。我正在使用Linux Mint,我的64位计算机和32位笔记本电脑都显示相同的错误:
rad.asm:1: error: attempt to define a local label before any non-local labels
rad.asm:1: error: parser: instruction expected
rad.asm:2: error: attempt to define a local label before any non-local labels
rad.asm:2: error: parser: instruction expected
rad.asm:4: error: attempt to define a local label before any non-local labels
rad.asm:13: error: comma, colon or end of line expected
rad.asm:19: error: parser: instruction expected
这是代码:
.model small
.stack 100h
.data
dexter db "Hello$"
.code
start:
mov ax, @data
mov ds, ax
mov ah, 09h
mov dx, offset dexter
int 21h
mov ah, 4ch
int 21h
end start
我已经成功安装了nasm,因为我可以使用以下方法成功编译其他“Hello World”示例:
nasm -f elf name.asm
ld name.o -o test
./test
NASM for Windows是否编译了与NASM for Linux不同的代码?