The SASM IDE is a crosplatform IDE with NASM support. It provides debugging functions to observe the registers during the execution of the program. The following code compiles with NASM without any issue.
section .data
hello db "Hello World!",0xa
len equ $-hello
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, hello
mov edx, len
int 80h
mov eax, 1 ; exit(0)
mov ebx, 0
int 80h
But if you try to execute the same code in the SASM IDE it doesn't work. Here the complete error message.
[14:46:07] Warning! Errors have occurred in the build:
/tmp/SASM/program.o:/tmp/SASM/program.asm:9: multiple definition of _start'
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/crt1.o:(.text+0x0): first defined here
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/crt1.o: In function
_start':
(.text+0x20): undefined reference to `main'
collect2: Fehler: ld gab 1 als Ende-Status zurück
[14:46:07] Before debugging you need to build the program.
Because it doesn't work I guess there must be a difference between the SASM IDE and NASM (Usually I thought SASM is more or less just a GUI for NASM).
What must be fulfilled to compile the program in SASM ?
CMAIN
macro for entry point, not_start
. – Sami Kuhmonen