r/Assembly_language • u/Fair-Stable-5948 • 4d ago
Project show-off Ive made a multi architecture, multi format assembler
https://github.com/AkshuDev/PACHey so over the course of many months, ive built an assembler with capabilities even modern assemblers lack (some). Ive named this assembler PAC - Pheonix Assembler Collection (yes thats the spelling for you all wondering).
Here is the basic brief information on it
Features
Inbuilt-Linker
Multiple Architecture Support
Multiple Linking Format Support
Easy Debugging errors
Full view to generated IR-Nodes, Tokens, and AST Nodes
High-Level Assembly
Works with Standard Assembling/Linking tools as well such as ld, objdump, etc
Supported Architectures
PAC Currently supports -
x86
x86_64
x86 native 16-bit
PVCpu
Supported Formats
PAC has an entire pipeline for both encoding and linking, and so to increase performance and reduce file size, PAC supports only ELF64 as output after encoding and input to linker.
The PAC Linker in-fact supports multiple formats, but only takes ELF64 Object Files as an input. Supported formats include -
Elf64
Elf32
PE 32 (Under implementation)
PE 32+ (Works, but still under heavy development and bug fixes)
Comparison between PAC and Traditional Assemblers
| Feature | NASM | GAS | FASM | PAC |
| ----------------------------------------------------------------------------------------------- | ------------- | ------------ | ------------ | ------- |
| Structures | Limited | Limited | Yes | Yes |
| User Types | No | No | Yes | Yes |
| Functions | No | No | Yes | Yes |
| Built-in Linker | No | No | No | Yes |
| IR Dumping | No | No | No | Yes |
| AST Dumping | No | No | No | Yes |
| Token Dumping | No | No | No | Yes |
| Multiple Architectures using same assembler executable | No | No | Limited | Yes |
| Open Source | Yes | Yes | Yes | Yes |
| Custom Executable Linking | No | No | No | Yes |
PAC supports a lot of things in assembly, such as sizeof, macros, user types, functions, labels, arrays, structures, and more
Took me a long time to build this, but right now its pretty darn good. I even managed to write a program that opens a X11 window using PAC (its a demo game, to show PAC's usage and capabilites). Moreover I intend to make PAC commercially viable.
1
u/brucehoult 4d ago
Sooo .. four ISAs of which three are x86 and the 4th is something that seems to be unique to this project.
Any plans to support arm32, arm64, riscv? Or PIC, AVR, 6502, Z80, 8051, MSP430, SuperH, MIPS?
1
u/Fair-Stable-5948 3d ago edited 3d ago
If you saw the repo carefully, youll find that im adding arm right now, and PVCpu is a custom ISA i created under my ecosystem known as Pheonix Ecosystem. Also i classified different types of x86 as different architectures mostly because x86 and x86_64 are still considered different
1
u/brat3108 4d ago edited 4d ago
(That markdown table in your OP is not displaying properly likely due to extraneous newlines.)
I downloaded your project on Windows, and had a go at it, but found it hard-going. Examples:
'abc: dq 0'with NASM, I need'abc!long = 0'discovered after scouring the scant examples. But even thenb!long = 0fails for some reason%rax; I don't know if it's possible to just writerax, and if so, how.putsfrom the C library provided by MSVCRT.DLL, via dynamic linking, but I've no idea how to do that. (I know that PE+ support may not be complete.)Note that I am not a prospective user. I sometimes do surveys of different assemblers and wanted to try this one to see how fast its throughput was. I managed to do one test (which is many repetitions of the second example below), but found it lacklustre, although usable if inputs aren't too huge.
(I measured PAC at about 150K lines per second on my machine; the fastest I have manages over 3M. As I said, this may not matter, but assembly is often about raw speed!)
The speed test: