vasm

A portable and retargetable assembler.
Valid HTML 4.01!
About vasm
Last release source
Daily source snapshot
Tagged source archives
Last release binaries
Daily snapshot binaries
Compilation notes
A small tutorial
vasm docs (html)
vasm docs (pdf)
Volker's vasm page
vbcc/Amiga home page

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 extensions.

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)
  • C16x/ST10
  • 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)
  • Atari TOS executable format (M68k)
  • Sharp X68000 Xfile 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)


28-Dec-2018: vasm 1.8e.
  • New option -dwarf automatically generates line debug information for source level debugging in DWARF V2 or DWARF V3 format.
  • New output module for Sharp X68000 Xfile executables. Can be selected with the -Fxfile option.
  • Repeatedly included files are only loaded once into memory.
  • m68k: Avoid wrong branch-optimization info messages with -opt-allbra.
  • 6502: Fixed LDA (zp,X) in 65C02 mode (-c02).
  • 6502: -wdc02 enables the WDC65C02 extensions, like RMB, SMB, BBR, BBS.
  • 6502: Support for Hudson Soft HuC6280 (new option -6280).
  • 6502: New directive SETDP to set the current zero/direct-page address for optimizations from abs to zp addressing modes.
  • x86: Fixed crash with SWAPGS, when not supported by current cpu.
  • std-syntax: Fixed potential buffer overflow when parsing macro arguments.
  • output-hunk: Always try to include the full absolute source-path when writing LINE debug hunks (-linedebug option).


20-Aug-2018: vasm 1.8d.
  • Repeat-loops with a single line generated a malformatted listing file.
  • m68k: Recognize (PC) addressing mode and transform it into (0,PC).
  • m68k: Only "fpu 1..7" may enable FPU code generation.
  • m68k: -kick1hunks also prevents optimizing from absolute to 32-bit PC-relative.
  • arm: Fixed instruction alignment in Thumb mode, which was broken since 1.8b (introduction of -noialign option).
  • arm: Fix for immediate operands like cmp r0,#'A' not working properly in thumb mode (provided by Peter Petterson).
  • PPC: tlbld is available as general PPC instruction again.
  • z80: SBC addressing modes IX,ss and SBC IY,ss do not exist.
  • z80: EX (SP),HL is not supported by GBZ80, but SRL is.
  • mot-syntax: Report garbage at end of line for DC directives.
  • mot-syntax: Labels with a double colon are automatically exported (xdef).
  • mot-syntax: Allow '?' within identifiers, in Devpac-compatibility mode.
  • madmac-syntax: Report garbage at end of line for DC directives.
  • std-syntax: Fixed \@ (unique id) in macros, which was broken since 1.7h.
  • vobj-output: Prevent crash when referencing undefined local symbols.


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).
Aktion UBERWACH!

$Id: index.php,v 1.13 2017/06/27 21:59:33 frank Exp $