Skip to content

About

A universal assembly formatter

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

asm-format

A universal assembly formatter.

Supported assemblers

Assembler Dialect
GNU as for x86 gas-x86
GNU as for ARM gas-arm
GNU as for AArch64 gas-aarch64
GNU as for RISC-V gas-riscv
NASM, YASM nasm
MASM and compatible assemblers masm
flat assembler fasm
Go assembler go
SDCC sdas (sdasz80, sdasgb, ...) sdas
ASxxxx asxxxx
RGBDS rgbasm rgbds
cc65 ca65 ca65
z88dk z80asm z88dk

Other assemblers can be added with a dialect file.

Example

# .asm-format
Dialect: gas-x86
asm-format -i src/*.S

Input:

sum: xorl %eax,%eax # total = 0
loop: addl (%rdi),%eax
  addq $4,%rdi # next element
  decq %rsi
  jnz loop
  ret

Output:

sum:    xorl    %eax,   %eax    # total = 0
loop:   addl    (%rdi), %eax
        addq    $4,     %rdi    # next element
        decq    %rsi
        jnz     loop
        ret

Building

cargo build --release

Rust 1.89 or later is required.

Documentation

License

Licensed under either Apache-2.0 (LICENSE-APACHE) or MIT (LICENSE-MIT), at your option.

About

A universal assembly formatter

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages