pawnasm is a small x86 64 assembler written in component pascal. it uses intel syntax, keeps the nasm style forms it supports, and adds a few short readable forms of its own
chess piece little brother of rookcc. part of the rookcc project, but split off into a separate one. was meant to be invoked by rookcc until we made one in house for rookcc. i inherited source code of both after partners bailed, so i bug fix and me release under release candidates
it now lives as a separate project because it is useful on its own. the goal is a light assembler with a simple command line, clear errors, a reusable core, and source code that is not miserable to read
pawnasm writes elf64 relocatable objects and flat binaries. it handles parsing, preprocessing, instruction encoding, layout, relocations, object writing, and object checks itself. it does not start gcc, clang, gas, nasm, or a linker while assembling. it only assembles, doesnt link.
this is release candidate 8. it will become plain 1.0.0 only after i figure out some bullshit that it cant do and whatnot.
ofront plus is the normal build route (click the link and compile and install ofrontplus)
make ofrontthis creates the assembler under the build directory
build/ofront/bin/pawnasm
run the assembler like this
build/ofront/bin/pawnasm hello.asminstall for the whole system
sudo ./install.shinstall only for the current user
./install.sh userremove an installation
sudo ./install.sh uninstallglobal _start
default rel
section .text, progbits, alloc, exec
_start:
mov rax, 60
xor rdi, rdi
syscallassemble it into an elf64 object
pawnasm hello.asmpawnasm creates an object file. linking is a separate job
normal intel syntax uses the destination first and puts memory inside brackets
pawnasm also accepts a few shorter names
text
export _start
_start:
mov byte [rsi], 10
ret
rodata
message:
asciz "hello"
data
values:
qwords 10, 20, 30
bss
scratch:
zero 256these are additions. supported nasm style source does not need to be rewritten
run the manual after installing
man pawnasmterminal errors are short and readable. compact and json output are available for editors and build systems. nearby instruction and option spellings can be suggested when a typo is obvious
pawnasm targets x86 64 long mode. it does not claim every nasm instruction. vector and floating point families are not complete. it does not contain a linker. flat binaries cannot keep unresolved external symbols
bsd 2 clause. see the license file
thanks to Kokonico for the logo!