Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Untitled(1)

pawnasm

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.

build

ofront plus is the normal build route (click the link and compile and install ofrontplus)

make ofront

this creates the assembler under the build directory

build/ofront/bin/pawnasm

run the assembler like this

build/ofront/bin/pawnasm hello.asm

install

install for the whole system

sudo ./install.sh

install only for the current user

./install.sh user

remove an installation

sudo ./install.sh uninstall

a small program

global _start

default rel

section .text, progbits, alloc, exec
_start:
    mov rax, 60
    xor rdi, rdi
    syscall

assemble it into an elf64 object

pawnasm hello.asm

pawnasm creates an object file. linking is a separate job

pawnasm forms

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 256

these are additions. supported nasm style source does not need to be rewritten

command line

run the manual after installing

man pawnasm

terminal 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

limits

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

license

bsd 2 clause. see the license file

Credits

thanks to Kokonico for the logo!

more

https://kokonico.me

About

pawn assembler, also know as 'pawnasm', is a simplistic intel syntax assembler that supports common NASM intel syntax conventional standards, yet a standalone project. built to be lean, and simple codebase, and an educational basis.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages