A single-pass x86_64 assembler that emits relocatable ELF64 objects
Go to file
mappu 01a8281bc9 doc: README.md 2023-12-11 19:33:22 +13:00
.gitignore gitignore 2023-12-11 13:14:24 +13:00
README.md doc: README.md 2023-12-11 19:33:22 +13:00
compile.go instr: support nop 2023-12-11 19:31:47 +13:00
elf.go elf: declare alignment, move global symbols to end of symtab 2023-12-11 18:06:35 +13:00
go.mod initial commit 2023-12-09 16:12:45 +13:00
lexer.go lexer: parse fields with a state machine 2023-12-11 19:32:40 +13:00
main.go assemble: clean up error handling, add src/dest args to main function 2023-12-11 19:32:29 +13:00
main_test.go assemble: clean up error handling, add src/dest args to main function 2023-12-11 19:32:29 +13:00
test_assemble.sh support shstrtab, symtab, elf output, ret instr, use rodata, more mov types 2023-12-11 13:14:13 +13:00
token.go instr: support nop 2023-12-11 19:31:47 +13:00

README.md

pxasme

A single-pass x86_64 assembler that emits relocatable ELF64 objects.

Usage

pxasme -Src myapp.asm -Dest myapp.o
ld -s -o myapp myapp.o
./myapp

Status

  • Lexer
    • "Variables" in data/rodata (u8, u16, u32, u64, sz)
      • C-style addressing (bare or &)
    • Unified public/private, import/export syntax
    • State machine parser for opcode arguments
  • Parser
    • mov, ret, syscall, sections, variables
    • strlen($var) compile-time function
    • more isa ops
  • Code generation
    • Generate ELF64 binaries
      • Relocations
        • R_X86_64_32S (n.b. not PIC)
        • R_X86_64_64
    • Freestanding mode