Atari Assembler Editor
|Original author(s)||Kathleen O'Brien|
|Platform||Atari 8-bit family|
Atari Assembler Editor (sometimes written as Atari Assembler/Editor) is a cartridge-based development system used to edit, assemble, and debug 6502 programs for the Atari 8-bit family of home computers. It was programmed by Kathleen O'Brien of Shepardson Microsystems; O'Brien later helped with Atari BASIC, and Assembler Editor shares many design concepts with that language.
Assembler Editor lacked many features, notably the ability to define macros to organize code, and the inability to link multiple modules together into a larger program. The later was especially limiting, as the amount of free memory available to hold source code on early machines was limited. The assembly/compiling times were also slow for anything but the smallest programs.
In the manual, Atari recommends the Assembler Editor as a tool for writing subroutines to speed up Atari BASIC. The Atari Macro Assembler was offered by Atari to provide better performance and more powerful features, such as macros, but it was disk-based, copy-protected, and did not include an editor or debugger. Despite the recommendation, commercial software was written using the Assembler Editor, such as the game Eastern Front (1941).
The source code to the original Assembler Editor was licensed to Optimized Systems Software, who introduced EASMD based on this code, and later introduced the greatly updated MAC/65. Problems with Assembler Editor also led to a thriving market for other 3rd party assemblers.
Assembler Editor was written by Kathleen O'Brien of Shepardson Microsystems. The company had been hired by Atari to help fit Microsoft 6502 BASIC onto an 8KB ROM, something the programmers at Atari were struggling with. Instead, Bill Wilkenson suggested designing an entirely new version of basic, which became Atari BASIC.
While Atari BASIC was being written, primarily by Paul Laughton, O'Brien's husband, O'Brien worked on Assembler Editor. Assembler Editor was written "by hand" by punching codes into a punch tape machine, running the tape through an EPROM burner, and then testing the resulting ROM in an Atari 800. The cartridge was completed before Atari BASIC, and O'Brien spent some time working on portions of that project as well.
As part of Shepardson's work on the Atari, a number of common routines were copied into the Atari's operating system. These included the floating point routines, which O'Brien was tasked with writing, although she had not worked on such code before. These routines were considered to be notoriously slow, a topic that Wilkenson often wrote about.
Shortly after Shepardson delivered Assembler Editor and Atari BASIC to Atari, Bob Shepardson, the owner, decided to return to being a one-person company. O'Brien, Laughton and Wilkinson formed their own company, Optimized Systems Software (OSS), to continue development of the Atari products. They licensed the original source code for BASIC, Assembler Editor and Atari DOS, which they had collectively written.
In 1981, OSS released an improved version of Assembler Editor known as EASMD, which was released on floppy disk. EASMD was later replaced by a further improved version, MAC/65, in 1982. In contrast to Assembler Editor, MAC/65 was one of the fastest assemblers on the platform. Much of the improved performance of MAC/65 was due to it tokenizing the code as lines were entered; in Assembler Editor an instruction like
LDA had to be read from memory and converted to the internal opcode every time it was encountered, in MAC/65 this occurred only once when the user pressed ↵ Enter.
3rd party assemblers
Problems with Assembler Editor and Macro Assembler led to a number of 3rd party assemblers for the platform, in addition to EASMD and MAC/65. Among these, SynAssembler from Synapse Software was the fastest, using the same tokenizing concept as MAC/65 to garner slightly more speed. SynAssembler was a port of S-C Assembler II from the Apple II.
The Assembler Editor is two-pass 6502 assembler in an 8KB cartridge. Both source and object code can be in memory simultaneously, allowing repeated editing, assembly, and running of the resulting code without accessing a disk or tape drive.
The cartridge starts in EDIT mode. The programmer enters lines of assembly source into the Atari BASIC-like editor. Source text must be prefixed with a line number, or it is interpreted as a command. Like Atari BASIC, Assembler Editor included an
ENTER command that could be used to combine files together into a single larger program listing. Unlike Atari BASIC, Assembler Editor included a number of commands for automatically creating spaced-out line numbers, as well as renumbering lines and deleting them en masse. The editor also had a
FIND command, which was very useful when working with labels.
Instructions are listed in the order they will be placed in memory. The starting point for the instructions is specified with the
*= instruction, so, for instance, code intended to be placed in the special "page six" would be prefixed with the line
*= $0600. Variable names could be assigned to point to specific locations, and this was often combined with an increment
*= *+1 to directly encode offsets into tables.
Values following instructions were normally interpreted as "the value at this memory address", but an actual numeric value could be provided as an "immediate operand" by appending it with a hash, like
LDA #12, which loads the accumulator with the decimal value 12. Hexadecimal was indicated with a dollar sign,
LDA #$12 would load the accumulator with 12 hex, or 18 decimal. Indirect addressing was supported using parentheses;
LDA ($600) would use the values in location $600,$601 to produce a 16-bit address, and then load the accumulator with the value found at that location.
Errors are reported with numeric error codes, with about 50 such codes in total.
Code can be assembled at any time by typing the
ASM command into the editor.
Assembler Editor was widely derided as the slowest assembler on the platform. Much of this was due to it sharing much of the editor code with Atari BASIC, which had also been written by Shepardson Microsystems. Atari BASIC was notorious for the very slow routines used to convert numerical constants in code into an internal representation, which used binary coded decimal (BCD) routines in the Atari's operating system. This meant that all numbers, even line numbers, had to be converted to BCD. Oddly, it also meant that
1E2 was a legal line number.
The debugger, really a monitor, is entered with the
BUG command. The
X command returns to EDIT mode. The debugger allows the viewing and changing of registers and memory locations, code tracing, single-step and disassembly.
The following is example code for Hello World! written in Atari assembly language:
10 ; HELLO.ASM 20 ; --------- 30 ; 40 ; THIS ATARI ASSEMBLY PROGRAM 50 ; WILL PRINT THE "HELLO WORLD" 60 ; MESSAGE TO THE SCREEN 70 ; 0100 ; CIO EQUATES 0110 ; =========== 0120 *= $0340 ;START OF IOCB 0130 IOCB 0140 ; 0150 ICHID *= *+1 ;DEVICE HANDLER 0160 ICDNO *= *+1 ;DEVICE NUMBER 0170 ICCOM *= *+1 ;I/O COMMAND 0180 ICSTA *= *+1 ;I/O STATUS 0190 ICBAL *= *+1 ;LSB BUFFER ADDR 0200 ICBAH *= *+1 ;MSB BUFFER ADDR 0210 ICPTL *= *+1 ;LSB PUT ROUTINE 0220 ICPTH *= *+1 ;MSB PUT ROUTINE 0230 ICBLL *= *+1 ;LSB BUFFER LEN 0240 ICBLH *= *+1 ;MSB BUFFER LEN 0250 ICAX1 *= *+1 ;AUX BYTE 1 0260 ICAX2 *= *+1 ;AUX BYTE 1 0270 ; 0280 GETREC = 5 ;GET TEXT RECORD 0290 PUTREC = 9 ;PUT TEXT RECORD 0300 ; 0310 CIOV = $E456 ;CIO ENTRY VECTOR 0320 RUNAD = $02E0 ;RUN ADDRESS 0330 EOL = $9B ;END OF LINE 0340 ; 0350 ; SETUP FOR CIO 0360 ; ------------- 0370 *= $0600 0380 START LDX #0 ;IOCB 0 0390 LDA #PUTREC ;WANT OUTPUT 0400 STA ICCOM,X ;ISSUE CMD 0410 LDA #MSG&255 ;LOW BYTE OF MSG 0420 STA ICBAL,X ; INTO ICBAL 0430 LDA #MSG/256 ;HIGH BYTE 0440 STA ICBAH,X ; INTO ICBAH 0450 LDA #0 ;LENGTH OF MSG 0460 STA ICBLH,X ; HIGH BYTE 0470 LDA #$FF ;255 CHAR LENGTH 0480 STA ICBLL,X ; LOW BYTE 0490 ; 0500 ; CALL CIO TO PRINT 0510 ; ----------------- 0520 JSR CIOV ;CALL CIO 0530 RTS ;EXIT TO DOS 0540 ; 0550 ; OUR MESSAGE 0560 ; ----------- 0570 MSG .BYTE "HELLO WORLD!",EOL 0580 ; 0590 ; INIT RUN ADDRESS 0600 ; ---------------- 0610 *= RUNAD 0620 .WORD START 0630 .END ASM BUG G600 X
- Manual 1981, p. 63.
- Crawford, Chris (1982). Source Code for Eastern Front (1941). The ATARI Program Exchange.
- Interview 2015.
- Wilkinson, Bill (February 1985). "INSIGHT: Atari". Compute!. p. 139.
- Wilkinson 1982, p. vi.
- Wilkinson 1982, pp. vi-vii.
- Wetmore 1983, p. 29.
- Hague 2009.
- Ratcliff, Matthew (20 November 1989). "Atari Assembler Editor Reference".
- Dery, Adrian (9 September 2017). "Synapse Assembler 'SynAssembler' by Steve Hales". Missing or empty
- Manual 1981, p. 15.
- Manual 1981, p. 7,31.
- Manual 1981, p. 31.
- Manual 1981, pp. 10-12.
- Manual 1981, pp. 43-44.
- Manual 1981, p. 25.
- Manual 1981, p. 35.
- Manual 1981, p. 41.
- Manual 1981, pp. 35-41.
- Atari Assembler Editor User Manual (PDF). Atari. 1981.
- Hague, James (2 August 2009). "A Personal History of Compilation Speed, Part 1". Programming in the 21st Century.
- Kathleen O'Brien, Kevin Savetz (13 March 2015). Kathleen O'Brien, OSS (Podcast).
- Wetmore, Russ (November 1983). "Atari 8-bit assemblers reviewed". Hi-Res. Vol. 1 no. 1.
- Wilkinson, Bill (1982). Inside Atari DOS. Optimized Systems Software,Inc. ISBN 0-942386-02-7. Retrieved 2009-04-04.