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 (including 65C02, 65CE02, DTV, HU6280)
- 6809 family (6309, 6309 and 68HC12)
- 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)
- PDP-11 architecture (includes EIS, FIS)
- 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)
- o65 relocatable format (6502)
- Raw, binary output (all)
- Commodore PRG, Atari COM, Apple DOS binary formats (6502)
- Tandy Color Computer and Dragon DOS binaries (6809)
- Motorola Srecord format (all)
- Intel-Hex format (all)
- VOBJ proprietary versatile object format (all)
- Test, debugging output (all, default)
31-Dec-2020: vasm 1.8j.|
- New CPU backend for the PDP-11 architecture.
- Fixed alignments in relocated-org blocks within a section.
- 6809: 16-bit branch with a negative distance of 127 bytes (-130 encoded) was erroneously optimized to 8-bit branch (-129 encoded). Fixed.
- 6809: .dpage directive conflicts with .dpage section in std-syntax and was renamed to .direct.
- 6809: Support label differences in immediate addressing modes, which generate a pc-relative relocation.
- m68k: Fixed inappropriate cpu-type errors, when using directives or macros starting with "mc", "mcf" or "ac".
- m68k: Illegal opcode extensions should also be reported in Devpac- compatibility mode. Illegal opcode extensions for unsized instructions are still ignored with -devpac.
- mot-syntax: pushsection and popsection directives.
- mot-syntax: msource directive to control source level debugging within a macro (submitted by Soren Hannibal).
- mot-syntax: if1, if2, ifp1 directives for compatibility with a warning.
- oldstyle-syntax: org $addr works again for Z80.
28-Sep-2020: vasm 1.8i.|
- New CPU backend for 6809, 6309 and 68HC12.
- New output module "cdef" to write all absolute symbols as a series of #define directives for inclusion in a C source.
- Do not read a source file with the same name from the CWD, when the real source is actually located in a sub directory!
- Show an error when no numerical term follows a base-prefix.
- Do not show expression-evalulation errors before the final pass (e.g. division by zero).
- New option -nomsg= to disable specific informational messages.
- Define an internal symbol depending on the host file system in use (__UNIXFS, __AMIGAFS, __MSDOSFS).
- Fixed crash when printing errors from files with an absolute path.
- m68k: New option -extsd to allow small data with 020 extended addressing modes.
- m68k: Disabled most of the new MOVE.L #x,Dn optimization from V1.8h for ColdFire, which doesn't support .W and .B operations.
- m68k: Fixed encoding of ([...],ZRn,...).
- m68k: Fixed PFLUSHR immediate addressing mode.
- m68k: Some PMOVE reg,<ea> erroneously allowed immediate and PC-relative addressing modes as destination.
- m68k: Allow A0 and A1 as small data base registers (near, -sdreg).
- m68k: External small-data symbol references may have a signed addend.
- jagrisc: Add more predefined condition codes. Now vasm supports the same condition codes as the SMAC assembler.
- 6502: Fixed branches to external labels.
- 6502: New directive EZP. Like EQU, but use advises zero page addressing.
- 6502: -opt-branch can now also translate/optimize between BRA and JMP.
- ARM: Fixed a problems with auto-rotated immediate values. Now all possible solutions should be found.
- ARM: Fixed oscillating optimization for ADR/ADRL (-opt-adr).
- ARM: Fixed handling of string/data directives with a single character.
- ARM: Fixed MSR status register bit mask (patch by Luna).
- mot-syntax: -devpac compatibility mode allows dots ('.') in labels (-ldots).
- mot-syntax: Fixed crash when reading a label field including '\' and followed by a non-identifier character.
- oldstyle-syntax: -ast allows * to start comments in the first column.
- oldstyle-syntax: -i now also works for instructions with no operand.
- oldstyle-syntax: -ldots allows '.' within identifiers.
- oldstyle-syntax: added inline and einline directives from mot-syntax.
- oldstyle-syntax: added FCS directive, which is like FCC but sets the MSB of the last character.
- madmac-syntax: Added missing .offset and .abs directives to start an offset-section.
- std-syntax: Added .pushsection and .popsection directives.
- bin-output: Added support for Apple DOS binaries, Dragon DOS binaries and Tandy Color Computer machine language files.
- vobj-output: Make some backends support larger sections sizes than their target address allows.
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).