Fast Assembler

Year
1995
Publisher
MMMG Soft (1995); public domain since 2021
Type
Development tool
Category
Native 6502 assembler for SpartaDOS X and BW-DOS
Developer
Marek Goderski (MMMG Soft); version 1.8 maintained by Holger Janz
Language
6502 machine language
Requirements
Atari XL/XE or 400/800 running SpartaDOS X (any version for FA 1.8) or BW-DOS 1.4+; ATASCII source files
Title page of the Fast Assembler 1.8 manual: a grey dolphin above the words Fast Assembler, 1.8 31-08-2024, for SpartaDOS X and BW-DOS

Overview

Fast Assembler (FA) is a 6502 assembler that runs on the Atari itself, under SpartaDOS X or BW-DOS. It is a true file-to-file assembler. Source is read from disk and object code written back, so program size is limited only by the file system, not by RAM. It understands SpartaDOS X's relocatable executable format and symbol system, which makes it the natural tool for writing SDX commands, drivers and memory-resident utilities on real hardware. MADS, the popular PC cross-assembler, took its SpartaDOS X syntax from FA.

History

Marek Goderski of the Polish group MMMG Soft (Free MG) wrote Fast Assembler and documented it in 1995 as shareware. Version 1.7 became the assembler supplied on the SpartaDOS X Toolkit disk, already registered, with the author's permission. An FA 2.0 was announced as in development in 1995 but was never finished. Goderski later released FA to the public domain.

FA 1.7 had a time bomb in it. It relied on undocumented SpartaDOS X behaviour for parsing parameters. SDX 4.47 removed that behaviour and 4.49e restored it, so FA 1.7 fails on SDX 4.47 through 4.49d. In 2024 Holger Janz released version 1.8 (24 August 2024). It works with every SpartaDOS X version and also with BW-DOS 1.4 or later, and it is now part of the official SpartaDOS X add-ons. Among the 1.8 changes:

  • removal of the undocumented parameter tricks
  • fixes for multiplication and division (which always raised "Too big number") and for END handling
  • new INS pseudo-op for including binary data, and a padding block type for building ROM images
  • ; accepted as a comment character (as well as *), for MADS compatibility
  • new switches: /S summary, /Y symbol dump, /E DOS error codes for batch files, /Q quiet mode; /A renamed /L, /B dropped
  • better memory management and a faster pass 1, with at most 8 passes
  • a tutorial with extended examples, and FJC's XEDIT editor bundled to make a complete package

Using it

FA [/L|S|E|Y|Q] src[.ext] [dst[.ext]]

FA MY_SOURCE assembles MY_SOURCE.ASM into MY_SOURCE.OBJ, showing progress per pass. Errors report the file, line number and program counter (for example Error at D1:MY_SOURCE.ASM:13:3E40 / Undeclared label). /L lists every line as it is read, with includes resolved. The package contains BIN>FA.COM for SpartaDOS X, DOS>FA.COM for BW-DOS, a MAN page, examples, the SDX Lib for writing code that builds for both systems, the full source (FA assembles itself) and a test suite.

Syntax in brief

Lines are [label] opcode [operand] [comment]. Comment lines start with * or ;, and anything after an instruction is treated as a comment. < and > take the low and high byte. Instructions that can work on either the accumulator or memory use @ for the accumulator. Code is organized into blocks instead of using ORG:

* Rainbow colours - press START to end
RTCLK  equ $14
RUNAD  equ $02e0
COLPF2 equ $d018
CONSOL equ $d01f
WSYNC  equ $d40a
VCOUNT equ $d40b
       blk DOS $3000      same as *=$3000 elsewhere
start  lda #$08
       sta CONSOL
loop   clc
       lda VCOUNT
       adc RTCLK
       sta WSYNC
       sta COLPF2
       lda CONSOL
       and #$01
       bne loop
       rts
       blk DOS RUNAD      run-address block
       dta a(start)
       end

Assemble with FA RAINBOW.ASM RAINBOW.COM and run it by typing RAINBOW. This is the first example from the FA 1.8 manual, lightly condensed.

For SpartaDOS X programs you use blk reloc main for relocatable code, blk empty for uninitialised buffers, and smb 'PRINTF' to import SDX system symbols resolved at load time. Finish with blk update addresses and blk update symbols. The bundled examples go on to a memory-resident command defined with blk update new (names starting with @ become shell commands), program-to-program calls through U_LOAD, and an external file-compare command that sets STATUS for IF ERROR in batch files. There are also hardware demos (fine scrolling, DLIs and VBIs, GTIA, POKEY music) and an 8K cartridge build.

Compatibility

FA's syntax is fully compatible with Quick Assembler but not with MAC/65 or the Atari Assembler Editor, so older sources need converting. Projects built with it include BW-DOS itself, Janz's FujiNet command-line tools for SpartaDOS-compatible DOSes, a buildable source of the XL operating system, and small games and demos. FA source can also be assembled on a PC with MADS.

Credits