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)

Commodore PRG and Atari COM format (6502)

Motorola Srecord format (all)

VOBJ proprietary versatile object format (all)

Test, debugging output (all, default)



18-Apr-2020: vasm 1.8h.

Reworked absolute ORG sections.

-pic no longer reports references to undefined symbols.

New option -pad=<value> can be used to define a different padding value than zero for alignments and for filling gaps between absolute sections.

Fixed alignment directives. Now also alignments which are not a power of two are allowed (but probably not supported by all object file formats).

m68k: New optimizations for BAsm compatibility: MOVE.L #n,Dn is transformed into a combination of MOVEQ and SWAP, ADD.W or NEG.W.

m68k: New optimization flag for size, even when speed suffers. It will optimize for example MOVE.L #x,Dn to MOVEQ #x>>n,Dn + LSL.W #n,Dn.

m68k: Fix some situations where an absolute label from an ORG section should be treated as a simple absolute value (e.g. MOVEQ).

m68k: New option -nodpc to disallow direct encoding of absolute PC displacements (also set automatically with -devpac compatibility).

m68k: Added internal symbols _MOVEMBYTES and _MOVEMREGS for BAsm compatibility.

6502: New directive ZPAGE, to declare a relocatable symbol as being located in the zero-page, so vasm will use ZP-addressing, even on external symbols.

6502: Allow 32-bit data directives.

6502: New option -bbcade for compatibility with the BBC ADE assembler, contributed by Garry Marshall.

z80: New option -intel-syntax switches to the old Intel 8080 syntax. Contributed by Mark Jones.

std-syntax: .org within a section allows an optional argument to define a fill-value.

mot-syntax: A SECTION directive with a single argument is interpreted as section type when the selected output format does not support section names (e.g. aout, tos, xfile). Otherwise the type defaults to code, using the given argument as section name.

mot-syntax: register list directives (REG, EQURL) also accept a previously defined register list symbol.

mot-syntax: Fix segfault/out-of-memory when a macro-argument enclosed in < ... > is missing the '>'.

mot-syntax: Allow comment-character directly attached to a macro directive.

mot-syntax: RORG allows an optional argument to define a fill-value.

mot-syntax: Only allow valid identifiers for macro names.

mot-syntax: Fixed string expressions as macro arguments.

mot-syntax: New directives db, dw and dl for ArgAsm, BAsm, HX68, Macro68, MaxonAsm, OMA, ProAsm, Cape compatibility. They do not exist in PhxAss- or Devpac-compatibility mode.

oldstyle-syntax: The addend in the abyte directive is now a modifier, where the special symbol ._ works as a placeholder for each expression from the line.

oldstyle-syntax: macro definitions and repetitions with -dotdir were not correctly recognized.

oldstyle-syntax: Fixed string expressions as macro arguments.

oldstyle-syntax: New directives fi and str, contributed by Garry Marshall.

oldstyle-syntax: New directives dsect and dend to implement offset-sections.

madmac-syntax: Fixed string expressions as macro arguments.

bin-output: option -atari-com may be used to output Atari 6502 COM files.

output-hunk: Alignment directives behind DX are allowed.



04-Oct-2019: vasm 1.8g.

Do not print informational messages when generating dependencies.

New option -depfile to specify a file name for the dependency output. Code generation may happen in parallel in this case.

Include the compile directory in the path, when printing error messages.

Treat a subtraction of a label from a constant as constant, when the label is from an absolute ORG section.

m68k: -opt-allbra makes sure that branch-optimization is enabled.

z80: "ld (BC/DE/HL),abs" is an illegal addressing mode.

mot-syntax: SECTION directive with a single argument is interpreted as section-type when the output format is "tos". Otherwise the type defaults to CODE.

mot-syntax: In devpac-compatibility mode allow '@' in the middle of labels.

mot-syntax: -phxass compatibility mode allows dots ('.') in labels (-ldots).

mot-syntax: Added support for Devpac IIF directive.

output-hunk: Fixed LINE debug hunk output (-linedebug). Now it can deal with code from multiple sources and the line numbers for executing macros and repetitions are correct.

output-hunk: New option -hunkpad=<code> selects the padding code for code sections to achieve 32-bit alignment. Default to 0x4e71 (NOP) for M68k.



10-Jun-2019: vasm 1.8f.

New option -wfail makes vasm return with an error code not only for errors but also for warnings.

6502: Added missing WDC65C02 instructions (-wdc02): STP and WAI.

m68k: Warn about DIVxL.L with identical quotient and remainder registers.

m68k: Do not optimize or translate PC-relative addressing modes when the referenced symbol is in a different section.

m68k: RTD operand should be signed.

m68k: Automatic optimization of absolute to base-relative addressing (-sd option) must only be done when the target address is between offset 0 and 65535 in the small data section.

z80: Forbid ixh/ixl operands on one side with h/l on the other.

mot-syntax: Structure directives (RS, SO, FO) without an offset-expression are not allowed in Devpac-compatibility mode (-devpac).

mot-syntax: __LINE__ represents the correct line number again, after it had been broken in the last version.

mot-syntax: New directive DX for ProAsm/Barfly compatibility. Used to create DataBss space in an executable file. Otherwise identical to DS.

mot-syntax: New option -cnop=<code> sets a two-byte code for padding CNOP-alignments. Defaults to 0x4e71 for M68k.

output-hunk: Make sure all unsupported relocations in hunk-executables are reported. Do not generate an executable with missing relocs.

output-hunk: Do not pad a code section with 0x4e71 when skipping DataBss contents at this point (-databss with -Fhunkexe).



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.