Hi -
As I'm sure you've guessed, the "define" is just a macro (exactly like C/C++ "#define"), and "sys_write" is the actual call.
I confess, however, I'm not at all familiar with "%define" per se. And I vastly prefer "as" syntax to Intel/Masm syntax (for many, many reasons; I won't bore you with them here
).
In ANY case: here's an example that should completely answer your question:
Code:
http://stackoverflow.com/questions/2...-explain-the-a
/hello.S
#include <asm/unistd.h>
#include <syscall.h>
#define STDOUT 1
.data
hellostr:
.ascii "hello world\n";
helloend:
.text
.globl _start
_start:
movl $(SYS_write) , %eax //ssize_t write(int fd, const void *buf, size_t count);
movl $(STDOUT) , %ebx
movl $hellostr , %ecx
movl $(helloend-hellostr) , %edx
int $0x80
movl $(SYS_exit), %eax //void _exit(int status);
xorl %ebx, %ebx
int $0x80
ret
Note the explicit call to "SYS_write" (whose prototype is defined in "syscall.h"), and the macro definition ("#define") for STDOUT (file #1).
'Hope that helps!