Edit 6502

Medium
Cartridge
Year
1981
Publisher
LJK Enterprises, Inc. (St. Louis, Missouri)
Type
Development tool
Category
Cartridge assembler, editor, symbolic disassembler and monitor
Developer
Ken Leonhardi
Language
6502 machine language
Requirements
Atari 400 or 800 with the Edit 6502 cartridge; disk drive for the disassembler (loaded from the supplied disk), linked assemblies and file storage
Magazine advertisement headed Letter Perfect, Data Perfect, Edit 6502 over jigsaw-puzzle artwork, with a column describing Edit 6502 at $99.95 as a co-resident two-pass assembler, disassembler, text editor and machine language monitor

Overview

Edit 6502 was one of the first serious third-party assembly-language systems for the Atari 400 and 800. It came on cartridge from LJK Enterprises of St. Louis, the company best known for the word processor Letter Perfect. The manual's title page lists the parts: assembler, editor, symbolic disassembler and machine-language monitor, all co-resident, copyright 1980–81, version 1.0. The author was Ken Leonhardi, who also wrote the manual's preface on good 6502 programming. One of his points: if you know the instruction set, you know that LDA already sets the zero flag, so CMP #0 after it is wasted.

LJK sold it for $99.95. Its advertising called it the favourite assembler/editor of Gebelli Software and listed lower-case support as an option with a lower-case character generator (LCG).

Features

The manual promises that you can disassemble a program, edit it, assemble it, run it, debug it and edit it again without ever reloading anything. Everything happens at a command prompt modelled on BASIC's immediate mode, with a C prompt for commands. The manual counts 32 editor commands plus 22 monitor commands, in four groups:

  • Input/output: LOAD, SAVE, MERGE, BLOAD, BRUN, BSAVE, DIR and DOS.
  • System management: NEW, LEN, HIM/LOM, TABS, SYMB, DATE and HELP. The program asks for the date when it starts and stamps your work with it.
  • Editing: ADD, INS, EDIT, DEL, LIST, PLIST (print), COPY ... TO, FIND, CHNG and SRCH (search and replace), and TABLE to show the symbol table.
  • Mode changers: ASM to assemble, DIS to disassemble and MON for the monitor.

The line editor has its own keys, beyond the normal Atari screen editor. CTRL+A and CTRL+E jump to the start or end of the input line, CTRL+F finds a character, the right arrow copies characters from the screen into the input buffer, and the Atari logo key toggles inverse (high-bit) input.

The monitor has single-character commands: memory display in hex and ASCII, disassembly listing, hex and ASCII search and store, fill, move, verify, go, step and trace, register display, user calls, printer on/off, and sector read and write.

The assembler and disassembler

The assembler makes two passes and has about twenty pseudo-ops. They follow Apple-style naming rather than Atari's .BYTE/.WORD: ORG, EQU, DFB, DFW, ASC, DCI, RES and LST. Several are unusual:

  • LNK "D:FILE" chains source files, so programs too large for memory can be assembled in one run.
  • IBP "prompt" asks the user for a value during pass 1. It is meant for setting conditional-assembly parameters at assembly time.
  • DSS and DPS build tables of addresses minus one for software stacking, the push-and-RTS trick that stands in for the 6502's missing indexed indirect jump. An appendix explains the technique.

Numbers default to decimal, with $ for hex and % for binary. Expressions may use + - * /, evaluated strictly left to right with no precedence. > takes the high byte, and the accumulator form of the shift instructions takes a blank operand, not A. In strings, double quotes set the high bit and single quotes clear it. Mark Chasin's Assembly Language Programming for the Atari Computers adds that source does not need line numbers.

The symbolic disassembler loads from the supplied disk into memory from $2100. Because of that address, it cannot be in memory at the same time as the serial (R:) driver. You tell it which address ranges are code (L), ASCII text (T), hex bytes (H), words (W) or software-stack tables (S). It then produces editable source with generated labels, which you can reassemble. It never clears the symbol table, so you can assemble a file of equates first to get meaningful names, and work through a large program in sections.

Technical notes

The cartridge occupies $A000–$BFFF and uses zero page $80–$B6. The input buffer is at $480–$57F. Source text lives between the application low-memory pointer and the screen. The manual says it was written for experienced users who would find menus a hindrance, unlike other LJK products.

Using it today

A cartridge dump and a scan of the manual both survive. In an emulator, run it as an 8K left-slot cartridge on 400/800 settings. Boot the supplied disk first if you want the disassembler. Edit 6502's pseudo-ops differ from Atari's Assembler Editor and MAC/65, so 1980s magazine listings written for those need translating before they will assemble.

Credits