MAC/65

From Wikipedia, the free encyclopedia

MAC/65
MAC/65 screen shot
Developer: Optimized Systems Software
Latest Release: 4.20 / 1994
Release date: 1982
Platform: Atari 400/800/XL/XE
Genre: Assembler
Media: floppy disk, cartridge
License: Copyright © 1994 Fine Tooned Engineering

MAC/65 was a assembly language compiler produced by Optimized Systems Software for the Atari 8-bit family of microcomputers. A direct descendant of the Atari Assembler Editor and successor to OSS's EASMD, this 6502 macro editor/assembler featured built-in editing and debugging.

MAC/65 was written by Stephen D. Lawrow. First release on disk in 1982.

Contents

[edit] Features

Screenshot of DDT
Screenshot of DDT

MAC/65 featured two-pass compiling, with a third-pass for macros. Object code was generated in memory only when explicitly declared, unlike the Atari Assembler Editor cartridge. Source was either MAC/65 token format or text files. Editing source required line numbers otherwise MAC/65 would treat lines as commands. MAC/65 also did syntax checking in EDIT mode. MAC/65 converted all strings to uppercase unless they were embedded with double quotes.

Unlike the Atari Assembler Editor, MAC/65 provided true macro processing and conditional assembly.

The cartridge version added 65C02 op-code support as well as Dunion's Debugging Tool (DDT) by Jim Dunion, of APX fame. Dunion later wrote EXDDT (EXtended DDT) for ANTIC Software.

[edit] Example Code

The following is example code for Hello World! written in MAC/65:

10 ; HELLO.ASM
20 ;
30 ; THIS SIMPLE MAC/65 DEMO WILL
40 ; PRINT THE "HELLO WORLD"
50 ; MESSAGE TO THE SCREEN
60 ;
0100 ; === CIO EQUATES ===
0110     *=  $0340   ;START OF IOCB
0120 IOCB
0130 ;
0140 ICHID *= *+1    ;DEVICE HANDLER
0150 ICDNO *= *+1    ;DEVICE NUMBER
0160 ICCOM *= *+1    ;I/O COMMAND
0170 ICSTA *= *+1    ;I/O STATUS
0180 ICBAL *= *+1    ;LSB BUFFER ADDR
0190 ICBAH *= *+1    ;MSB BUFFER ADDR
0200 ICPTL *= *+1    ;LSB PUT ROUTINE
0210 ICPTH *= *+1    ;MSB PUT ROUTINE
0220 ICBLL *= *+1    ;LSB BUFFER LEN
0230 ICBLH *= *+1    ;MSB BUFFER LEN
0240 ICAX1 *= *+1    ;AUX BYTE 1
0250 ICAX2 *= *+1    ;AUX BYTE 1
0260 ;
0270 GETREC = 5
0280 PUTREC = 9
0290 ;
0300 CIOV =  $E456
0310 ;
0320 RUNAD = $02E0   ;RUN ADDRESS
0330 ;
0340 ; === SETUP FOR CIO ===
0350 ;
0360     *= $0600
0370 START LDX #0    ;IOCB 0
0380     LDA #PUTREC ;WANT OUTPUT
0390     STA ICCOM,X ;ISSUE CMD
0400     LDA #MSG&255 ;LOW BYTE OF MSG
0410     STA ICBAL,X ; INTO ICBAL
0420     LDA #MSG/256 ;HIGH BYTE
0430     STA ICBAH,X ; INTO ICBAH
0440     LDA #0      ;LENGTH OF MSG
0450     STA ICBLH,X ; HIGH BYTE
0460     LDA #$FF    ;255 CHAR LENGTH
0470     STA ICBLL,X ; LOW BYTE
0480 ;
0490 ; === CALL CIO TO PRINT ===
0500 ;
0510     JSR CIOV    ;CALL CIO
0520     RTS         ;EXIT
0530 ;
0540 ; === OUR MESSAGE ===
0550 ;
0560 MSG .BYTE "HELLO WORLD!",$9B
0570 ;
0580 ; === INIT RUN ADDRESS ===
0590     *=  RUNAD
0600     .WORD START

[edit] Bugs

There is a bug in the MAC/65 cartridge which gives an error on a JSR or JMP to a zero page address. A temporary fix would be to use macros in the source code. As examples, try these:

  1000  .MACRO @JSR
  1010  .BYTE $20
  1020  .WORD %1
  1030  .ENDM
  1040  .MACRO @JMP
  1050  .BYTE $4C
  1060  .WORD %1
  1070  .ENDM

To invoke the macro, type @JSR (or @JMP) in place of the JSR or JMP instruction, and the proper hex code will be generated.

[edit] Add-ons

[edit] MAC/65 Toolkit

This was a disk filled with source code and examples for use with the MAC/65 assembler. Available on disk, required 40K of memory.

[edit] DDT

Dunion's Debugging Tool (DDT) was built into the cartridge version of MAC/65. Based on the original Atari Program Exchange software, DDT provided monitoring of program code while keeping as much of the display screen intact. The version that was supplied with MAC/65 was a condensed version of the APX original.

[edit] Trivia

  • According to Matthew J. Ratcliff of ANALOG Computing, MAC/65 was used by C64 programmers to assemble C64 projects on Atari computers.
  • According to Stephen D. Lawrow, MAC/65 was used to compile not only itself, but BASIC XL and BASIC XE.

[edit] Aftermath

MAC/65 along with other OSS products became part of ICD's catalog of Atari products in January 1988. In 1994, Fine Tooned Engineering obtained the rights to ICD's 8-bit products, including MAC/65.

[edit] References

  • A reference manual for MAC/65 by OSS, Rev. 1.2. 1983
  • Atari Home Computer System - Technical Reference Notes. Atari, Inc. C016555 REV A.
  • Andrews, Mark (1984). Atari Roots: A Guide to Atari Assembly Language. DATAMOST, Inc. ISBN 0-88190-171-7. [1]
  • Chasin, Mark (1984). Assembly Language Programming for the Atari Computers. Byte Books, McGraw-Hill Paperbacks. ISBN 0-07-010679-7. [2]
  • Chadwick, Ian (1985). Mapping the Atari Revised Edition. COMPUTE! Publications, Inc. ISBN 0-87455-004-1. [3]
  • Leventhal, Lance A. (1986). 6502 Assembly Language Programming 2nd Edition. Osborne/McGraw-Hill. ISBN 0-07-881216-X.
  • Leventhal, Lance A. (1982). 6502 Assembly Language Subroutines. Osborne/McGraw-Hill. ISBN 0-931988-59-4.
  • Mansfield, Richard (1983). Machine Language for Beginners. COMPUTE! Publications, Inc. ISBN 0-942386-11-6. [4]
  • Mansfield, Richard (1984). The Second Book of Machine Language. COMPUTE! Publications, Inc. ISBN 0-942386-53-1. [5]
  • Zaks, Rodnay (1983). Programming the 6502 (Fourth Edition). Sybex, Inc. ISBN 0-89588-135-7.
  • Zaks, Rodnay (1982). Advanced 6502 Programming. Sybex, Inc. ISBN 0-89588-089-X.
  • OSS Newsletter - Spring 1984
  • OSS Newsletter - October 1984

[edit] External links