vasm is a portable and retargetable assembler to create
linkable objects in various formats or absolute code.
Multiple CPU-, syntax and output-modules can be selected.
Many common directives/pseudo-opcodes are supported
(depending on the syntax module) as well as CPU-specific
The assembler supports optimizations
(e.g. choosing the shortest possible branch instruction or
addressing mode) and relaxations (e.g. converting a branch to an
absolute jump when necessary).
Most syntax modules support macros, include directives,
repetitions, conditional assembly and local symbols.
Currently the following CPUs are officially supported by vasm
(loosely ordered by maturity):
- M680x0 family (including M6888x, M68851 and CPU32)
- ColdFire family (all models of V2, V3, V4, V4e)
- PowerPC family (POWER, 40x, 440, 460, 6xx, 7xx, 7xxx, 860,
Book-E, e300 and e500)
- Z80 family (Z80, 8080, GBZ80, 64180, RCM2/3/4k)
- 6502 family
- Jaguar RISC (GPU and DSP instruction sets)
- ARM (architecture ARMv1 to ARMv4, including THUMB mode)
- 80x86 family (IA32 8/16/32 bit, using MIT-syntax)
- 6800 family (6800, 6801, 6803, 68HC11)
- QNICE (elegant 16-bit FPGA CPU)
- TR3200 (virtual CPU from 0x10c)
- Raspberry-Pi VideoCore IV
These syntax flavours are supported:
- Standard MIT (GNU-as style) syntax
- Motorola/Freescale 68k syntax (Devpac compatible)
- Atari MadMac syntax (6502, 68k, Jaguar)
- Old 8-bit style syntax
Supported output file formats:
- ELF (M68k, PowerPC, i386, ARM and JRISC)
- a.out (M68k, i386 and JRISC)
- Amiga hunk format (M68k)
- TOS executable format (M68k)
- EHF extended hunk format (PowerPC)
- Raw, binary output (all)
- Motorola Srecord format (all)
- VOBJ proprietary versatile object format (all)
- Test, debugging output (all, default)
15-Mar-2018: vasm 1.8c.|
- Relocated ORG blocks within a section were not recognized, when their start address was 0.
- The count in repeat-directives is always unsigned, even when given as a negative value.
- Check for target address space overflows.
- Fixed crash when undefining non-existing register symbols.
- A redefined label is no longer a warning, but an error.
- arm: Fixed compile-error from last release.
- vobj-output: Fixed uninitialized symbol index for internal/local symbols.
- oldstyle-syntax: New directive ROFFS to set the program counter relative to the start of the current section.
30-Dec-2017: vasm 1.8b.|
- Option -noialign disables the automatic instruction alignment.
- m68k: New Apollo Core instructions (core >=4035.jic), provided by Henryk Richter.
- m68k: Referencing absolute-short labels and optimizing labels into absolute short addressing mode is allowed, when the label resides in an absolute ORG section.
- jagrisc: Fixed MOVE PC,Rn instruction.
- oldstyle-syntax: Internal symbol __RPTCNT can be used as iteration counter in the inner repeat loop.
- oldstyle-syntax: Numeric absolute symbol expansion is supported for macro parameters of the form \<symbol>.
- vobj-output: Ignoring internal/local symbols does not work. Now we create and use section symbols as a relocation reference.
13-Aug-2017: vasm 1.8a.|
- Increased number of fast-optimization passes from 50 to 200, as very large sources (> 60000 lines), with lots of branches to optimize, may still have optimization possibilities left after 50 passes.
- Repeat loops with an iterator symbol over an arbitrary sequence of values.
- m68k: New option -sd and directive OPT ON to enable optimizations of absolute references to the small data section into a base register relative addressing mode.
- m68k: New option -opt-jbra and directive OPT OB to convert all absolute jumps to external labels into 32-bit PC-relative branches (68020 and up).
- m68k: OPT O+ in Devpac compatibilty mode does not enable PC-relative optimizations (an explicit OPT A+ is needed).
- m68k: New Apollo Core instructions: PMULA, PMULH, STOREC, UNPACK1632.
- m68k: -m68020up option no longer includes Apollo Core.
- m68k: Devpac OPT Ln (with n=0,1,2,etc. for Atari) is recognized, although it has no effect at the moment.
- m68k: Suppressed index registers ZRn, which are explicitely written in the source, are no longer optimized away.
- PPC: -m option to select the CPU model starts working. By default the instruction set of a 32-bit PPC (G2, G3, G4) with AltiVec is supported.
- x86: Floating point constants (.float, .double) are supported.
- mot-syntax: Optional offset and length arguments for INCBIN (contributed by Andreas Larsson).
- std-syntax: New directives for gas compatibility: .irp and .irpc.
- bin-output: Fixed another sign-problem while padding between sections.
- hunk-output: Print source line for undefined symbols, when generating an executable.
- vobj-output: Ignore all internal/local symbols, except "*tmpNNNNNNNN*", which is required for certain relocations.
16-May-2017: vasm 1.8.|
- External references in ORG or RORG sections are allowed.
- Option -depend only prints relative include file names, while the new option -dependall prints all included file names, also with absolute paths.
- m68k: Support for Apollo Core 68080 and AMMX ISA.
- m68k: MSP, ISP and MMUSR are no valid 68060 control registers.
- 6502: Fixed potential segfault during zero-page optimization (new since last version).
- jagrisc: Fixed SHLQ instruction.
- mot-syntax: Make NREF directive work for PhxAss compatibility. Allows optimization of absolute references to base-relative.
- std-syntax: Labels ending on '$' are only local when all preceding characters are digits.
- madmac-syntax: Fixed .long directive (which only aligned to even bytes).
- oldstyle-syntax: New options -i (ignore everything in the operand after a blank), -noc (no C-style constant prefixes) and -noi (no intel-style constant suffixes).
- oldstyle-syntax: Z80 supports multiple directives or instructions per line, separated by a ':' character.
- oldstyle-syntax: Fixed parser problem with nested repeat/endrepeat blocks.
- output-hunk: -kick1hunks must not forbid base relative relocs and references. It was supported by some 1.3 linkers (blink for example).
14-Feb-2017: vasm 1.7h.|
- Implemented a dynamic line buffer. No limitations on line lengths anymore.
- Octal escape sequences are limited to a maximum of three digits.
- Allow assembler text output (echo, printv) in offset sections.
- Print a warning for initialized data in a bss-type section. This already worked in the past (1.2c and later), but has been lost somewhere.
- Some single-character labels and symbols will be rejected (depending on the syntax module).
- -maxerrors=0 should print all errors in the source.
- Print expressions in the listing file and the test output in decimal and hexadecimal form.
- m68k: Immediate- and PC-relative destination addressing modes for 68851 PMOVE are not allowed. PMOVE ea,PCSR doesn't exist.
- 6502: Perform zero-page optimization with a known label from an absolute section.
- std-syntax: Fixed problem with parentheses in character constants.
- oldstyle-syntax: New option -org=<address> to set the absolute base address of the program from the command line.
- oldstyle-syntax: Implemented some listing file directives, but without any function yet: nam, subttl, page, space.
- bin-output: Fixed output section sorting, which didn't work with some implementations of qsort().
- elf-output: Fixed external references in stabs.
- elf-output: Use a hash table for ELF symbols to speed up the output.
- hunk-output: Optimization to make it faster with many sections.
- test-output: Fixed crash when printing stabs without a value.
02-Nov-2016: vasm 1.7g.|
- Avoid a crash or internal error in some output modules, when an equate refers to an undefined (imported) symbol.
- m68k: Optimizing/translating to 68020+ addressing modes for MOVEM didn't work. For example MOVEM (40000,A0) was not automatically translated into a bd32 addressing mode, but had to be explicitely written as (40000.l,A0).
- m68k: Optimizing MOVEM was not attempted, when using a register list symbol in one operand and a label in the other.
- m68k: Fixed -opt-movem & -opt-speed optimization of MOVEM with two registers, which saw a wrong instruction size and moved following labels.
- aout-output: Instructions with more than one relocation were no longer supported since V1.7f.