Use one assembly system calls for different OS's.
AASM use dialect FASM and translated into the FASM.
- [-i, --input] = input assembly file
- [-o, --output] = output assembly file
- Register: !ax
- System call: !syscall
- mov
- 10 = exit.
- 41 = write stdout.
section '.data' writeable
msg db "hello, world!", 0xA, 0
len = $-msg
section '.text' executable
_start:
mov !ax, 41
push msg
push len
!syscall
mov !ax, 10
!syscall
$ make compile
> gcc aasm.c -o aasm
$ make
> ./aasm -i main.asm
> fasm out.asm
> ld out.o -o out
> ./out
> hello, world!
format ELF64
public _start
section '.data' writeable
msg db "hello, world!", 0xA, 0
len = $-msg
section '.text' executable
_start:
push rax
push rbx
push rcx
push rdx
mov eax, 4
mov ebx, 1
push msg
push len
pop rdx
pop rcx
int 0x80
pop rdx
pop rcx
pop rbx
pop rax
push rax
push rbx
mov eax, 1
xor ebx, ebx
int 0x80
pop rbx
pop rax
[ AASM from #571 ]