flat assembler
Message board for the users of flat assembler.
Index
> Unix > openbsd i386 minimal working executable |
Author |
|
sylware 27 Dec 2022, 16:38
BTW, does openbsd require gcc or clang to be compiled or have the decency to allow a clean iso c89/c99 compiler (with probably the gas assembler) to do so?
For instance, linux requires nearly the latest gcc extensions in order to be compiled. Yes, this is sad. |
|||
27 Dec 2022, 16:38 |
|
Ali.Z 31 Dec 2022, 14:12
Im not sure about OpenBSD, I use FreeBSD. (also your program is missing a RET)
Code: ; cc -m32 asm.o -o asm ; cc is a link to clang, FreeBSD use llvm toolchain. format elf public main extrn printf section '.text' executable main: push _freebsd call printf add esp,4 ret section '.data' writeable _freebsd db 'FreeBSD', 0Ah, 0 edit: here is a version without C functions: Code: ; cc -m32 asm.o -o asm format elf public main section '.text' executable main: mov eax,4 push 9 push _freebsd push 1 push eax int 80h add esp,10h ret section '.data' writeable _freebsd db 'FreeBSD', 0Ah, 0 _________________ Asm For Wise Humans |
|||
31 Dec 2022, 14:12 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.