I sent a message to the OpenBSD mailing list, but since it's the weekend, I am still waiting a reply.
I haven't used NASM for a while, too busy.
So this is a newer version of both NASM and OpenBSD.
nasm-2.10.04
Just running a quick test and I get these errors
Any thoughts?
I am getting errors with NASM. ( I also tried many other combinations. )
# nasm -f aoutb hello.asm
# ld -e _start -o hello hello.o
ld: warning: cannot find entry symbol _start; defaulting to 1c000114
# ./hello
./hello[1]: syntax error: `(' unexpected
or
# nasm -f aout hello.asm
# ld -s -o hello hello.o
hello.o: file not recognized: File format not recognized
or
# nasm -f elf hello.asm
# ld -s -o hello hello.o
ld: warning: cannot find entry symbol _start; defaulting to 1c000120
# ./hello
./hello[1]: syntax error: `(' unexpected
I have never had a problem previously.
I am running:
OpenBSD 5.2-current (GENERIC) #22: Mon Sep 24 18:31:52 MDT 2012
hello.asm:
%include 'system.inc'
section .data
hello db 'Hello, World!', 0Ah
hbytes equ $-hello
section .text
global _start
_start:
push dword hbytes
push dword hello
push dword stdout
sys.write
push dword 0
sys.exit
system.inc:
%define stdin 0
%define stdout 1
%define stderr 2
%define SYS_nosys 0
%define SYS_exit 1
%define SYS_fork 2
%define SYS_read 3
%define SYS_write 4
%define SYS_open 5
%define SYS_close 6
section .text
align 4
access.the.bsd.kernel:
int 80h
ret
%macro system 1
mov eax, %1
call access.the.bsd.kernel
%endmacro
%macro sys.exit 0
system SYS_exit
%endmacro
%macro sys.fork 0
system SYS_fork
%endmacro
%macro sys.read 0
system SYS_read
%endmacro
%macro sys.write 0
system SYS_write
%endmacro
%macro sys.open 0
system SYS_open
%endmacro
%macro sys.close 0
system SYS_close
%endmacro