|  | 
  | 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: 
      6502 family (including 65C02, 65CE02, DTV, 45GS02, HU6280,
          65802, 65816)6800 family (6800, 6801, 6803, 68HC11)6809 family (6809, 6309, Turbo9, Konami-2 and 68HC12)80x86 family (IA32 8/16/32 bit, using AT&T-syntax)ARM (architecture ARMv1 to ARMv4, including THUMB mode)C16x/ST10ColdFire family (all models of V2, V3, V4, V4e)HANS project (32-bit FPGA CPU)Jaguar RISC (GPU and DSP instruction sets)M680x0 family (including M6888x, M68851, CPU32 and Apollo 68080)PDP-11 architecture (includes EIS, FIS)PowerPC family (POWER, 40x, 440, 460, 6xx, 7xx, 7xxx, 860,
          Book-E, e300 and e500)QNICE (elegant 16-bit FPGA CPU)Raspberry-Pi VideoCore IVSony SPC700SunPlus μnSP CPU (ISA V1.0 and V1.1)TR3200 (virtual CPU from 0x10c)Z80 family (Z80, 8080, 8085, GBZ80, 64180, RCM2/3/4k) |  | These syntax flavours are supported: 
      Standard (GNU-as style) syntaxMotorola/Freescale 68k syntax (Devpac compatible)Atari MadMac syntax (6502, 68k, Jaguar)Old 8-bit style syntax |  | Supported output file formats: 
      a.out (M68k, i386 and JRISC)Amiga hunk format (M68k)Apple DOS, Atari COM, Commodore PRG, Oric TAP binary formats (6502)Atari TOS executable format (M68k)Atari DRI object file format (M68k)C #define output format (all)C256 Foenix PGX and PGZ binary formats (65816)EHF extended hunk format (PowerPC)ELF (M68k, PowerPC, i386, ARM and JRISC)GST object file formatHANS project output formatIntel-Hex format (all)MOS Paper Tape format (all)Motorola Srecord format (all)o65 relocatable format (6502, 65816)Raw, binary output (all)Sharp X68000 Xfile (and Zfile) format (M68k)Tandy Color Computer and Dragon DOS binaries (6809)Test, debugging output (all, default)VOBJ proprietary versatile object format (all)Wozmon monitor format (6502) |  
 
 
| 14-Jul-2025: vasm 2.0c. 
 
Fixed output of the last byte in a CPU's address space for multiple  output formats allowing absolute addressing: gst, ihex, pap, srec, woz.Try to convert 128-bit expressions to the backend's native address size  when  possible, while parsing it.Support left and right shift operations using a shift-count larger than  the backend's native address size.Defining symbols which were declared as externally defined is no longer  an error but a warning, as this is usually harmless.Fixed possible internal error when defining a label on the same line as  a section directive.m68k: Reverted change from V2.0: out of range warnings have become errors  again. These checks can be disabled by multiple options and directives.m68k: Improved error messages for quick-immediate and shift-values.m68k: Huge (128-bit) expressions are allowed in immediate 8/16/32-bit  addressing modes when the final value fits or when range-checking was  disabled.m68k: Apollo: Disabled illegal optimization of ADDI.B #n,An into ADDQ.m68k: New option -warnunaligned to warn about accesses to odd addresses.6809: -konami2 option now enables the original instruction set (rev. 052001),  while the extended instruction set for later revisions is available via  -konami2ext (e.g. rev. 052526, 053248).jagrisc: New option -opt-jr=<n> automatically translates out-of-range JR  branches into MOVEI plus JUMP, using Rn as a temporary register.jagrisc: New option -no-opt disables all standard optimizations.jagrisc: Optimize MOVEI to MOVEQ when possible (constant from 0 to 31).jagrisc: Fixed JR/JUMP with externally defined CC.jagrisc: Allow relocations for LOAD/STORE (Rn+x), but note that there are  still errors when x becomes 32.mot-syntax: -devpac compatility automatically disables warnings for xref  on defined symbols and xdef on undefined symbols.oldstyle-syntax: Fixed data directives with comment characters (for example:  db 1,';',2).vobj-output: Fix handling of section sizes which have the MSB set.bin-output: New option -join implements a mini-linker for multiple sections. |  
 
 
| 21-Apr-2025: vasm 2.0b. 
 
New CPU backend for the SPC700, as used in the SuperFamicom and SNES for  sound processing.New option -no-msrcdebug to disable source level debugging within a macro  context (MSOURCE directive in mot-syntax).Fixed potential crash with NOLIST directives, when listing file is  enabled (new bug since V2.0).Assign a relocated org address to labels already in the parser pass to  make conditional assembly (sort of) work.Fixed DWARF output for advancing the state machine by 15 * instruction size.m68k: Allow Apollo immediate FPU instructions with a third operand again  (broken since V2.0).6502: Fixed external branch label references.6502: Fixed Mega65 32-bit indirect instructions (broken since V1.9a).6809: Added Konami-6809 support, used on arcade boards (patch submitted  by Jim Westfall).6809: Fixed two-byte opcodes with the MSB in the first byte set (for example  HC12 TAP).mot-syntax: The rept directive allows for an optional counter symbol name.oldstyle-syntax: The label field allows preceding whitespace now, provided  it is followed by a ':', an '=', or an assignment directive (EQU, SET).oldstyle-syntax: Allow anonymous labels together with multiple statements  per line (Z80).oldstyle-syntax: ascii does not null-terminate strings. asc is not the  same as byte.oldstyle-syntax: The size of multi-byte data and space directives depends  on the target CPU now. For example long is 24 bits for 6502/65816.oldstyle-syntax: defp uses the target's address size, like da and addr.oldstyle-syntax: fdb doesn't define words but double-bytes (whenever that  matters).oldstyle-syntax: New directive dl (long word).oldstyle-syntax: New directives with fixed bit-size for forming constant  data and space: di8, di16, di24, di32, di64, ds8, ds16, ds24, ds32, ds64.oldstyle-syntax: The rept and repeat directives allow an optional second  argument to specify the name of an iteration symbol to use.hunk-output: -kick1hunks ignores section memory flags except CHIP and FAST  with a warning. |  
 
 
| 30-Dec-2024: vasm 2.0a. 
 
Fixed bad path in source level debugging information, when the initial  source file and an include file were based on the same "compile directory".Get rid of C99-round() dependency.Fixed empty strings, which were broken in V2.0. They should not generate  any data.When position-independant code is requested (-pic option) the assembler  defaults to relocatable mode (to be able to detect violations).Allow 64-bit (or more) expressions with absolute label addresses.6502: Additionally allow BRK with an immediate 8-bit operand.6502: Operand prefix character '?' can be used to select the Memory/Bank-ID  where the referenced symbol resides. Requires the use of VOBJ and vlink.mot-syntax: A double colon after the label also exports RS symbols now.madmac-syntax: New directives: ifdef and ifndef (just for convenience,  they are no official MadMac directives!).madmac-syntax: Fix problem with print-directive when string is empty.oldstyle-syntax: Fixed usage of '$' as current-PC symbol for Z80, which  was broken since V2.0.oldstyle-syntax: Fixed definition of structure offset labels, which  should be referenceable by structname.offsetname. Broken since V2.0.hunk-output: Fixed output generated by Databss directives (like DX in  mot-syntax). Broken in V2.0.hunk-output: -linedebug: do not generate multiple entries per line. |  
 
 
| 13-Oct-2024: vasm 2.0. 
 
Support for architectures which have bytes with more than 8 bits.Output formats bin, ihex, srec, test and vobj currently support >8-bit bytes.New options -obe and -ole to define the endianess of target-bytes in  binary output.New options -ibe and -ile to define the endianess of target-bytes in  binary includes (incbin).New option -underscore adds a leading underscore to all imported and  exported symbol names.New option -relpath to treat all include paths as relative first,  even when starting with '/' or '\'.Reworked relocations and added the option to define their signedness.New CPU backend for unSP (micro-nSP), having 16-bit bytes. Contributed  by Adrien Destugues.New CPU backend for the FPGA-CPU HANS, using 32-bit bytes. Contributed  by Yannick Stamm.New output module "pap", which outputs MOS Paper Tape files, as  documented in the KIM-1 User's Manual. Contributed by Dimitri Theulings.When printing error messages in macros, also print the source text line  calling the macro.A macro redefinition prints a warning with the previous definition.  The old macro is correctly replaced.Also warn about initialized space atoms (.space, etc.) in BSS sections.Workaround for a Windows bug, when reading a source text from stdin  directly via the terminal.Fixed output of 64-bit symbol values in vobjdump.Directives to suppress listing file output (like NOLIST) will no longer  appear in the listing file.Fixed string constants (in immediate addressing modes) with non-ASCII  characters.Fixed potential buffer overflow when generating a section name for  ORG directives (since V1.9f).Output modules now show the source line for unknown relocation errors.m68k: Most out of range errors have now become warnings.m68k: Out of range 8-bit immediate constants write to all 16 bits of  the extension word, with a warning (to be able to simulate the behaviour  of some old, faulty assemblers).m68k: Improved -opt-size optimization for move.l->moveq/lsl, which now  optimizes all values below 0x8000 where the highest and lowest bit set  does not span more than 7 bits (suggested by Erik Hemming).m68k: Float-constant optimization (OPT of, enabled by default) now also  supports integer constant optimization to 16-bit.m68k: Command line options of the form -opt-<option> execute a  Devpac-style option in the same way as an OPT directive at the top  of the source text.m68k: New options -warnabs16 and -warnabs32 to show a warning when  accessing absolute 16- oder 32-bit addresses.m68k: Fixed assigning another register list symbol with REG/EQURL, which  was broken since V1.9a.m68k: REG/EQURL directives optionally allow to specify register lists as a  register mask constant (BAsm compatibility).m68k: Add Apollo E-register banking for negx, swap, movex, sCC,  addiw.l, cmpiw.l, rol, ror, roxl, roxr, and perm.m68k: Apollo instructions pabsb, pabsw are gone (opcode space will be  reused in future).m68k: Apollo fmove.{b/w/l/s/d} En,Em is replaced by floadi and fstorei to  make clear whether the Em target is an integer or floating point register.m68k: New Apollo instructions: fmoverz, fmoveurz, moveiw, mov3q, movs,  movz, move2 (updated), clr.q.m68k: Do not allow Bcc.B with branch distance -130 for Apollo, as it  would encode as $6xff (opcode for 32-bit branch).6502: Added al/as/xl/xs as aliases for a16/a8/x16/x8 directives.  Added longa/longi as WDC-style aliases for theses directives (65816).6502: Absolute 16-bit addressing modes ignore the bank by default for 65816.6502: Optionally allow alternative syntax with immediate operands for MVN,  MVP and PEA (65816).6502: Out of range errors turned into warnings.6502: CPU directive, to define the cpu model.6502: Byte-selector operators are gone and turned into operand prefixes,  according to the official WDC syntax.6502: New option -am to mask all immediate and data values to their  specified size.6502: Hu6280 uses SETDP $2000 to move the zero page for automatic code  optimizations.6502: New option -dpo to generate offset-relocs for zero- or direct-page  accesses.x86: Default to 16-bit addressing when -m selects a CPU below 386.  Default to 64-bit addressing with -m64.x86: Let the mnemonic's suffix always decide about the operation size,  even when the operand is a label (gas seems to do the same).x86: Mask all immediate operand relocations according to their size  (to allow something like movb $label,dest or movw $label,dest).x86: Fix macros with size-suffixes (b,w,l,s,q,x). Size qualifiers are  no longer allowed in x86-macros.x86: Allow multiple alternating .codeNN directives in the source.x86: Add missing prefix when using 32-bit registers in 16-bit mode.x86: Fixed relative calls with size suffix (callw, calll) in 16/32-bit mode.mot-syntax: Fixed non-zero offset in CNOP, which was broken since V1.7c.mot-syntax: TTL sets the listing file page title and not the unit name.oldstyle-syntax: MACRO (written in upper case) didn't work with arguments.oldstyle-syntax: New ifblank and ifnblank directives may be used to  check whether a macro argument was given.oldstyle-syntax: New directive exitmacro to exit recursive macro  invocations.oldstyle-syntax: New directive da as an alias for addr.oldstyle-syntax: New directive bss to reserve space, like ds or reserve.oldstyle-syntax: New directives blkl and dsl for defining space with a  32-bit pattern.oldstyle-syntax: Section attributes 'f' and 'z' may be used to designate  a section for far- or near-addressing (e.g. direct/zero-page).oldstyle-syntax: Fixed FCC for single characters (no expressions allowed).oldstyle-syntax: The closing quote-character (' or ") in single-character  expressions is now optional (compatibility with old Motorola sources).oldstyle-syntax: Broken hex-constants with the minus-operator following  the '$' are supported for compatibility reasons.oldstyle-syntax: Allow optional colon after a label for macro, equ  and set directives.std-syntax: The "true" result of logical operations should be 1 not -1.std-syntax: Allow XY' (alternate) registers with Z80.std-syntax: The .org directive always defines the absolute address for  subsequent code, as long as no relocatable section was defined (or -gas).std-syntax: .ifc and .ifnc directives for comparing strings.hunk-output: New option -noabspath to refrain from creating absolute  paths for source line debugging (LINE debug format).hunk-output: Automatic source line debugging output (-linedebug) also  includes BSS sections now, unless Devpac-compatibility was specified  (-devpac).hunk-output: New options -dbg-local and -dbg-globloc to include local  labels into the debug symbol hunk (HUNK_SYMBOL).hunk-output: Warn about odd relocation offsets, which might crash the  AmigaOS loader on 68000 and 68010 systems (suggested by Erik Hemming).o65-output: Support low-word relocs in 65816 mode.bin-output: Fixed overlapping misdetection with empty org-sections.bin-output: Foenix PGX format supports 65C02 and PGZ format supports 32-bit.bin-output: New option -coalesced to output org-blocks without padding.cdef-output: Do not output internal symbols.elf-output: Fixed advancing by more than 63 lines in the DWARF output  (patch by arcanist/EAB).tos-output: Fixed alignment problem with DRI object file relocs.tos-output: New option -zfile to output Sharp X68000 Z-file executables.xfile-output: New option -exec to define the execution label.xfile-output: New option -loadhigh to load the executable into high memory. |  
 
 
| 10-Nov-2023: vasm 1.9f. 
 
Fix relative section offset directives, which must be unsigned to work  correctly over the whole target's address space.Fixed a few issues with named macro arguments.Do not warn about missing references to Common or Weak symbols.Binary output modules allow addresses outside of the backend's  address space.m68k: MOVEM (An),An/Am must not be optimized into two MOVE instructions.  This was a new bug in V1.9e.std-syntax: Fixed binary constant 0b...., which was erroneously mistaken  for a one-digit temporary label destination since V1.9a. |  
 
 
| 30-Sep-2023: vasm 1.9e. 
 
Exit before reading the source (from stdin) when there were errors already.Make sure the relocated blocks within all sections are closed after  parsing. Otherwise the first pass may find the section in a wrong state.Output modules may define the default section, when no SECTION or ORG  directive was given. "bin", "ihex" and "srec" now default to "ORG 0".New output module "woz", which outputs sections as "wozmon" monitor  commands, suitable for ASCII transfer via a serial connection.  Contributed by anomie-p.m68k: Improved -opt-movem (OPT om+) optimizations, for MOVEM with two  registers.m68k: Fixed Apollo ADD/SUB->ADDQ/SUBQ optimization with AMMX registers.m68k: Enabled Apollo FPU instructions using 64-bit data registers:  Fxxx.D Dn,ea, FMOVE.D Fn,Dm, etc.m68k: Added missing PC-relative destination addressing modes for Apollo  shift instructions and FMOVE, FMOVEM.m68k: Apollo bchg/bclr/bset/btst Dn,An must not be allowed (conflicts  with MOVEP).m68k: New Apollo instructions FDBcc.L, DBcc En,lab; EXTUB.L and EXTUW.L.6809: Fixed typo in the opcode for the 6309 LDMD instruction.mot-syntax: Allow multiple consecutive relocated blocks within a section.mot-syntax: New directives LOCAL and RSEVEN for compatibility.mot-syntax: Allow any type of expression for RSSET, SETSO, SETFO.madmac-syntax: Allow multiple consecutive relocated blocks within a section.oldstyle-syntax: The label defining the size of a STRUCT block may have  been moved into the previous section, or caused a segfault at ENDSTRUCT,  since V1.9b.tos-output: Also write absolute symbols (equates) into executables.tos-output: New option -szbx to enable unlimited symbol names using the  SozobonX extension.bin-output: New option -start to define the start address for the  default org-section. |  |