Atari Macro Assembler (AMAC)
- Medium
- Disk
- Year
- 1981
- Publisher
- Atari, Inc.
- Type
- Development tool
- Category
- Disk-based 6502 macro assembler
- Developer
- Sorcim (with Mike Lorenzen)
- Language
- 6502 machine language
- Requirements
- Atari 400/800/XL/XE with disk drive; separate text editor (Atari Program-Text Editor or any ATASCII editor)
- Tags
- assembler, 6502, macro-assembler, atari-inc, sorcim, disk, programming, amac
Overview
The Atari Macro Assembler, usually called AMAC, was Atari's professional-grade assembler for the 400/800. It works quite differently from the Assembler Editor cartridge. It lives on disk, has no editor of its own, and uses ordinary unnumbered text files. It reads source from disk and writes object code back to disk, so it can assemble one program "many times larger than the entire memory space of the ATARI", as Mark Chasin put it in 1984. Atari sold it as Macro Assembler and Program-Text Editor (CX8121), paired with a full-screen editor that was also released on its own through APX.
History
Atari previewed the "Sorcim Macro Assembler" in 1981 together with the Program-Text Editor, and shipped the combined package in early 1982. The assembler was developed for Atari by Sorcim. Mike Lorenzen is among the credited programmers. Three versions are known: V1.0A, a re-mastered V1.0A with different sector interleave, and a "Company Confidential" V1.0E without the editor, which may be a prototype or an internal edition. AMAC was also "mostly" supported on the Bit 3 80-column board at launch.
Reviewers who used it for big projects were enthusiastic. The Creative Atari languages column called it "a very, very powerful disk-based assembler, which is a joy to work with", and reported it assembling 100 pages of code in six minutes, "light years beyond" the cartridge. Chasin grouped it with MEDIT (an editor) and DDT (a debugger) as Atari's complete development set. Commercially, though, it lost out to OSS's cheaper, all-in-one MAC/65 cartridge. Later notes by user Nick Kennedy (AMAC.TXT) give the usual reasons: it was slow on big files from floppy, it switched back and forth with a separate editor, and its copy protection made the drive grind and reset on every load.
Features
- No line numbers. Labels start in column 1 and opcodes are indented by a tab.
- SYSTEXT files. You build a file of OS and hardware equates once and load it automatically on every assembly. The default is
D:SYSTEXT.AST. - INCLUDE chains many source files into one assembly.
- Macros with numbered parameters (
%1,%2),IF/ENDIFconditionals, andPROC/EPROCblocks whose labels starting with:are local to the block. - Rich expressions:
HIGHandLOW,AND OR XOR NOT SHL SHR, comparisons (EQ NE LT GT LE GE) and octal constants (@). Square brackets, not parentheses, set precedence. - Pseudo-ops in the CP/M-assembler style (
ORG,EQU,DB,DW,DS,END start), with.BYTE,.WORDand.ENDalso accepted for Atari-cartridge habits. - Cross-reference maps (full or short) and listings to screen, printer or disk.
Only the first six characters of a label are significant. Strings go in single quotes.
Running an assembly
Load AMAC and it prompts for a source file followed by options:
D:KEYER.SOR S=D2:SYSTEXT L=S:
This assembles KEYER.SOR, reads equates from a SYSTEXT file on drive 2 and lists to the screen. The object file defaults to KEYER.OBJ on D1:. Other switches: H=Dn or H=filespec (object destination; H=0 for none), L=P: or L=Dn: (listing to printer or a .PRN file), O=n (run address), R=F/R=S (reference map), S=0 (no systext). BREAK stops the assembly.
A short AMAC-style macro that prints a record through CIO:
PUTREC: MACRO I, A
LDX #%1*$10
LDA #0
STA ICBLH,X
LDA #$80
STA ICBLL,X
LDA #9
STA ICCOM,X
LDA #LOW %2
STA ICBAL,X
LDA #HIGH %2
STA ICBAH,X
JSR CIOV
ENDM
START: PUTREC 0, TEXT
RTS
TEXT: DB 'HELLO FROM AMAC',$9B
END START
Gotchas
ENDMmust be preceded by a real ATASCII tab character. If your editor turns tabs into spaces, type ESC-TAB on the Atari to insert one.- Very long macros can crash the assembler. Short ones are fine.
- Original disks are copy-protected. Kennedy's notes explain how to remove the protection for practical use.
Using it today
Kennedy argued that AMAC's old weaknesses have turned into strengths. Plain text source means you can write code in any PC editor. RAM disks, SIO2PC-style drive emulation and emulators make the disk-bound design fast. AMAC "doesn't flinch at large files". Convert PC line endings to ATASCII EOLs ($9B) before assembling. AtariMania hosts the known disk images and the manual. Source written for AMAC moves to MAC/65 fairly easily: Chasin notes that MAC/65's ENTER command can number unnumbered AMAC files automatically, leaving only minor syntax changes.
Credits
- Picture: Manual cover for the Atari Macro Assembler (AMAC). — Manual cover from the Internet Archive item 'Atari Macro Assembler' (Fair use (manual cover))
- AtariMania — Macro Assembler and Program-Text Editor (Atari, CX8121) — AtariMania
- Assembly Language Programming for the Atari Computers (Mark Chasin, 1984), ch. 6 — AtariArchives.org, 1984
- The Creative Atari — Atari Languages — AtariArchives.org
- comp.sys.atari.8bit FAQ (Michael Current) — Michael Current (comp.sys.atari.8bit FAQ)
