# MAC/65

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/MAC/65
> Markdown URL: https://mediated.wiki/source/MAC/65.md
> Source: https://en.wikipedia.org/wiki/MAC%2F65
> Source revision: 1354228644
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

**MAC/65** is a [6502](/source/6502) [assembler](/source/Assembly_language) written by Stephen D. Lawrow for [Atari 8-bit computers](/source/Atari_8-bit_computers). MAC/65 was first released on [floppy disk](/source/Floppy_disk) by [Optimized Systems Software](/source/Optimized_Systems_Software) in 1982, with the program requiring 16 KB RAM. A [bank switched](/source/Bank_switching) "SuperCartridge" from OSS followed in January 1984 for US$99,[1] occupying only 8 KB.

MAC/65 is structured similarly to the [Atari Assembler Editor](/source/Atari_Assembler_Editor) cartridge, combining a line editor, assembler, and debugger into a single package. Its reputation was based on being much faster than either the Assembler Editor or the standalone Atari Macro Assembler. [Brian Moriarty](/source/Brian_Moriarty) of [Infocom](/source/Infocom) wrote, "No assembler [at the time] on the C64 even comes CLOSE to MAC/65. Take it from someone who looked for one."[2] It was used to write numerous commercial games and applications, and the majority of assembly language listings in *[ANALOG Computing](/source/ANALOG_Computing)* were written with MAC/65.

According to Lawrow, MAC/65 was used to [compile not only itself](/source/Self-hosting_(compilers)), but [BASIC XL](/source/BASIC_XL) and [BASIC XE](/source/BASIC_XE).

## Overview

Like [Atari BASIC](/source/Atari_BASIC), source code in MAC/65 uses line numbers and is tokenized as it is entered. The line number is converted to a 16-bit integer, the assembly mnemonic to an 8-bit code, and a constant or variable to a reference to its entry in the [symbol table](/source/Symbol_table). This allows syntax errors to be immediately reported, reduces the size of the source code in memory, and "compiling" the preprocessed form is dramatically faster.

Source files can be saved and loaded in either tokenized format or as text files.

Unlike the Atari Assembler Editor, MAC/65 provides macro processing and [conditional assembly](/source/Conditional_assembly_language).

The cartridge version added [65C02](/source/65C02) [opcode](/source/Opcode) support as well as a condensed version of [Dunion's Debugging Tool](/source/Dunion's_Debugging_Tool) (DDT) by [Jim Dunion](/source/Jim_Dunion), the full version of which was originally sold through the [Atari Program Exchange](/source/Atari_Program_Exchange).[3] DDT replaced the BUG/65 debugger which shipped with the disk version of MAC/65.

## MAC/65 ToolKit

The ToolKit was a floppy diskette filled with [source code](/source/Source_code) and examples for use with the *MAC/65* assembler. The ToolKit required an Atari 8-bit with 48K of memory, a disk drive and the MAC/65 cartridge.

The following is example code for [Hello World!](/source/Hello_world_program) using the MAC/65 ToolKit:

0100     .OPT NO LIST
0110 ;
0120 ; HELLO.M65
0130 ; ---------
0140 ;
0150 ; THE HELLO WORLD TEST USING
0160 ; THE MAC/65 TOOLKIT
0170 ;
0180 RUNAD = $02E0   ; RUN ADDRESS
0190 EOL =   $9B     ; END-OF-LINE
0200     *=  $4000
0210 ;
0220 MSG .BYTE "HELLO WORLD!",EOL
0230 ;
0240     .INCLUDE #D:KERNEL.M65
0250 ;
0260 START
0270     PRINT  0,MSG ; CHANNEL 0
0280    RTS         ; RETURN TO DOS
0290 ;
0300    *=  RUNAD
0310    .WORD START
0320    .END

ASM ,,#D:HELLO.COM
DOS
HELLO.COM

## Legacy

MAC/65 along with other OSS products became part of ICD's catalog of Atari products in January 1988. In 1994, [Fine Tooned Engineering](/source/Fine_Tooned_Engineering) obtained limited rights to ICD's 8-bit products, including MAC/65.[4]

The [open source](/source/Open_source) ATasm project was written as a MAC/65-compatible [cross assembler](/source/Cross_assembler).[5]

## References

1. ["OSS Newsletter"](https://archive.org/stream/OSSNewsletterJanuary1984/OSS%20Newsletter%20-%20January%201984#page/n9/mode/2up). *archive.org*. January 1984.

1. ["INFOCOM On Line: Transcript with Brian Moriarty"](http://www.ifarchive.org/if-archive/infocom/info/moriarty-online.txt)

1. ["Dunion's Debugging Tool"](http://www.atarimania.com/utility-atari-400-800-xl-xe-ddt-dunion-s-debugging-tool_29075.html). *Atari Mania*

1. ["Fine Tooned Engineering"](http://atariage.com/forums/topic/104214-fine-tooned-engineering/). 24 March 2007.

1. ["ATasm: 6502 cross-assembler"](https://sourceforge.net/projects/atasm/). 21 March 2021.

## External links

- [retrobits.net](http://retrobits.net) Dan's OSS Supercart Page
- [MAC/65 Online](http://www.mixinc.net/atari/mac65.htm#topofpage) - MAC/65 Assembler Cartridge (manual)
- [Compute! Magazine](http://www.atarimagazines.com/compute/issue43/177_1_REVIEWS_MAC_65.php) - Review: MAC/65, Issue 43, Dec 1983
- [Antic Vol. 2, No. 7 - Oct 1983](http://www.atarimagazines.com/v2n7/nightmare.html) Nightmare Mission - MAC's the one for the job (Atari assemblers review)
- [Antic Vol. 4, No. 1 - May 1985](http://www.atarimagazines.com/v4n1/product_reviews.html) Product Review - MAC/65 Toolkit

---
Adapted from the Wikipedia article [MAC/65](https://en.wikipedia.org/wiki/MAC%2F65) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/MAC%2F65?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
