如何使用JWASM为NASM编写的库?
这个库是使用NASM语法编写的: http://sourceforge.net/projects/along32/
我想以二进制形式使用它来为我为JWASM编写的程序。我想我只需要重写包含原型的.inc文件,对吧?
我正在尝试将原型包含在源代码中,但没有成功。
.386
.model flat, C
stdout equ 1
SYS_EXIT equ 1
SYS_WRITE equ 4
WriteString proto
.data
string db 10,"Hello, world!",10
.code
_start:
mov eax, offset string
call WriteString
end _start
然后我遇到了链接问题:
jwasm -elf -Fo=Linux1.o Linux1.asm
JWasm v2.10, Apr 20 2013, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
Linux1.asm: 32 lines, 2 passes, 0 ms, 0 warnings, 0 errors
ld -lAlong32 --dynamic-linker /lib/ld-linux.so.2 -m elf_i386 -o Linux1 Linux1.o
ld: warning: can not find entry symbol _start; defaulting to 0000000008048174
Linux1.o: In function `__start ':
Linux1.asm: (. Text +0 x6): undefined reference to `_WriteString '
make: ** [all] Error 1
有人能给我一个语法示例吗?