SectorZap: A 1980s Sector Editor Returns with Full Assembly Source

On 22 June 2021 the AtariAge member glurk posted SectorZap 1.2, a single-density sector editor for Atari disks, together with its complete 6502 assembly source. He wrote the original around 1983–84, because none of the editors available then suited him. He had offered it to ANALOG and Antic at the time, but both magazines said they already had something similar in the works, so it was never published.

What it is

SectorZap reads, displays, edits and writes disk sectors. It is almost entirely built on CIO calls and shows a whole 128-byte single-density sector on screen at once. It was written before the XL/XE models existed but runs on them. glurk had cleaned up the original MAC/65 source so that it assembles without errors with the ATASM cross-assembler on a PC. Testers liked that common actions don't require going back to the menu each time, and one called it easier to load than Disk Wizard while doing most of what you need.

Rapid development

Releasing the source started a burst of community activity:

  • TGB1718 found that printing a second sector gave ERROR 81 and suggested closing the printer IOCB before reopening it. glurk fixed it within a day.
  • 1.3 (early July 2021) added no new features but was heavily optimised, and glurk estimated it at two to three times faster.
  • Another member ported the source to MADS and posted a MADS-built executable. TGB1718 produced a MAC/65-loadable version by replacing CR/LF line ends with ATASCII EOLs, stripping tab characters and adding line numbers.
  • 1.5 (work in progress, late July 2021) was largely rewritten and split into several ATASM source files. It added a VTOC display, a boot-sector analyser and a viewer for a drive's Percom configuration block, in about 5 KB of code.

glurk said he still uses SectorZap with real floppies. He had recently used it with his Percom drive to partially read some 5¼-inch TRS-80 disks; another member noted that early Atari duplicators often used TRS-80 machines and odd formats as copy protection. He decided against double-density support, because the program assumes a whole sector fits on one screen and too much is hard-coded around 128-byte sectors. His plan was to fill an 8 KB cartridge image, since SectorZap doesn't need DOS. The maker of the 576NUC+ board asked to put that cartridge in a "programmer's" ROM slot alongside the Assembler/Editor.

Why it matters

Fully commented source for a classic-style disk utility is rare, and SectorZap is small enough to learn from. It shows CIO-based disk and printer I/O, screen handling and VTOC parsing in tight 6502 code. glurk called it free for anyone to use.

Getting it

Search the AtariAge Atari 8-bit programming forum for the "SectorZap 1.2" thread. It has the original SECTZAP.M65, the faster 1.3, MADS and MAC/65 conversions, and the 1.5 SECTZAP.xex with its ATASM source zip. The program runs from any DOS on a single-density disk, on real hardware or under an emulator.

Credits