Skip to content
Boisy Gene Pitre, PhD edited this page May 13, 2026 · 3 revisions

Author: Doug DeMartinis

dEd is a screen-oriented disk editor utility written in assembly language. It was originally conceived as a floppy disk editor, so the display is organized around individual sectors. It performs most of the functions of Patch from Computerware, but is faster, more compact, and screen-oriented rather than line-oriented.

Individual files or the disk itself (hard disk, floppy, or RAM disk) can be examined and changed. Sectors can be written to an output file, and executable modules can be located, linked to, and verified.

With simple changes, it will run on any CoCo Level 1 OS-9 system, and possibly others, including CoCo Level 2 OS-9.

Usage

dEd <pathlist>

<pathlist> may be:

  • filename
  • dirname
  • /path/filename
  • /D0@ to edit the entire disk

dEd reads and displays the first 256 bytes in the file or disk. This is Logical Sector Number (LSN) zero.

You move through the file sector by sector using the Up and Down arrow keys. The current LSN number is displayed in both hexadecimal and decimal in the upper-left corner of the screen.

If the disk itself was accessed by appending @ to its name when dEd was called, the LSN is the disk sector number. If an individual file is being edited, the displayed LSN refers to the file, not the disk.

All numbers requested by dEd must be in hexadecimal format. All commands are accessed by simply pressing the desired key.

Basic Navigation

Up/Down Arrows

Display the next or previous sector (LSN).

Each keypress moves the display by 256 bytes. Auto-repeat allows you to skim quickly through the file. To halt key repeat, type Control-W to pause the display, then press any key.

The displayed LSN represents the most significant byte of the offset of the bytes from the start of the file or module, so byte number $1457 would be found in LSN $14 on row 50, column 7.

Command Reference

A Command

Append the current LSN to the output file.

This command writes the currently displayed sector to the file opened with the O command. Append is inactive unless an output file has been created.

This mode is useful for recovering files with unreadable sectors, since the sectors before and after a damaged sector may still be accessed and saved to a new file. Append also increments the display to the next LSN automatically to speed that process.

At the end of a file, fewer than 256 bytes may be displayed because most file lengths are not exact multiples of 256. The Append command writes only the bytes that are displayed, and the display remains on the same LSN. Pressing A twice on the last LSN of a file writes that final fragment twice.

C Command

Close the output file.

This closes the file opened with the O command and removes the file name from the display, making Append inactive.

D Command

Diddle with the file length.

This command displays the current file length in hex and lets you change it. It is potentially dangerous, especially if used on loadable modules.

If you press Enter at the prompt, dEd returns to command mode. If you enter a valid length in bytes, not sectors, the file is expanded or contracted to that length.

This is useful for stripping trailing Control-Z bytes ($1A) from files downloaded with XModem. Remember that the length of a file is 1 greater than the offset of the last byte, because offsets begin at zero.

E Command

Edit the displayed sector.

This is the heart of dEd. The cursor appears over the first byte or character in the LSN.

  • If the cursor is over the byte area, type two hex nibbles such as 6c.
  • If the cursor is over the character area, type a new ASCII character.

In either case, the display updates and the cursor moves to the next position.

You can switch between byte mode and character mode at any time by pressing the Break key. Navigate within the sector using the four arrow keys. Left and Right wrap across rows; Up and Down wrap from top to bottom and back.

When you are done editing, press Enter to leave edit mode. The sector is not written back to disk until you use the W command, unless you are in Expert mode.

F Command

Find a byte or text string.

This searches the file for a given character or byte string.

You will be prompted with Find byte string $. Enter up to 16 hex bytes with no spaces, including leading zeroes for values from 00 to $0F, then press Enter.

The search begins at the start of the currently displayed LSN. If an exact match is found, the LSN containing the string is displayed and the first byte or character is highlighted.

Pressing Break at the prompt toggles between byte search and character search. In character mode, the prompt is Find char string:. Enter up to 16 ASCII characters and press Enter.

Character search ignores case, and characters with bit 7 set, such as directory entry names, are treated as if bit 7 were clear.

If no matching string is found, dEd returns to the command prompt. If you enter an invalid character or byte string, a beep sounds and the prompt is reissued. Press Enter on an empty prompt to return to command mode. Press Break during a search to abort it.

H or ? Command

Display the help screen.

L Command

Link to a module, or list modules.

If you are editing a file containing multiple executable modules merged together, such as OS9Boot, this command lets you link to one specific module. That module is then treated as if it were an individual file:

  • the start of the module is displayed as LSN 0
  • only that module is accessible for display or editing
  • the displayed LSN is relative to the module, not the parent file or disk

You will be prompted with Link to which Module?.

  • Enter a valid module name and press Enter to link to it.
  • Press Enter on an empty prompt to list all valid modules, along with their offsets from the beginning of the main file and their lengths in hex.

When a module is linked, the top row of the display shows the module name and its byte offset from the beginning of the main file.

This is useful when you want to change a given byte in a module using the same offset you would use with debug. For example, to permanently change the printer baud rate, you could:

  1. run dEd /D0/OS9Boot
  2. press L
  3. enter P
  4. edit byte number 27 in module P
  5. press W to write the sector
  6. press V to verify the modules

If a module is linked, the Find command searches only within that module.

N Command

Find the next occurrence of the current string.

This is used with the F command. After locating a hex byte or ASCII string with F, pressing N searches for the next occurrence.

If the displayed LSN has not changed since the last search, the new search continues from where the previous search left off. If the LSN has changed, the search starts at the beginning of the current LSN.

If a match is found, the string is highlighted. Otherwise, dEd returns to the command prompt with a beep.

O Command

Open an output file.

You will be prompted with OUTFILE:. Enter a file name or path that does not already exist, then press Enter.

A new file is created and opened, and its name is displayed on the second row of the screen. Individual sectors can then be written to that file using the Append command.

To abort the O command, press Enter on an empty prompt or press Break.

P Command

Push an LSN onto the sector stack.

This pushes the current LSN onto a Last-In, First-Out stack. The R command then removes sectors from the stack in reverse order.

Up to 16 LSNs can be saved. This is particularly useful when reconstructing a deleted file that was fragmented on disk, because it lets you retrace your path through the sectors.

Q Command

Quit dEd.

This exits dEd immediately. Be sure to write any edited or zapped sectors back to disk before quitting.

R Command

Remove an LSN from the sector stack and display it.

This removes the most recently pushed LSN from the stack and displays it.

S Command

Skip to a given LSN.

You will be prompted with LSN=$. Enter a sector number in hex and press Enter. That LSN is displayed if possible.

If the entered LSN is greater than the last LSN in the file, nothing happens.

U Command

Unlink a module.

This unlinks a module previously linked with the L command and returns the display to the first sector in the main file.

If no module is linked, the command has no effect.

V Command

Verify all modules.

This command calculates and writes a new CRC value for each module in a file. It must be used after editing executable modules or they may not be loadable.

Verification stops if an error is found in a module header, but each earlier module is verified individually and its CRC is rewritten before moving to the next one.

W Command

Write the displayed sector back to disk.

Warning: this command can be dangerous to your data.

It writes the currently displayed sector back to the disk at the same location from which it came, but not necessarily with the same contents. After zapping or editing a sector, use this command to commit the changes unless you are already in Expert mode.

Because it can easily damage the disk, dEd prompts:

Are you sure (Y/N)?

Pressing any key other than Y or y aborts the write. Otherwise the sector is written and the display shows Writing Sector....

On a hard disk or RAM disk this is usually very fast.

X Command

Toggle Expert mode.

This is potentially the most dangerous command in dEd. It should be used only by people who fully understand the consequences.

In Expert mode:

  • any sectors changed by Edit or Zap are automatically written to disk
  • the W command is no longer needed
  • mistakes go straight to disk

There is one escape route. After editing or zapping a sector, the changed sector is not actually written until you exit Edit or Zap and then issue the next command key. If you press Shift-BREAK before pressing any other command key, the automatic write does not occur.

This is only a one-time escape. Any later mistake requires pressing Shift-BREAK again at the right moment.

Unless you fully understand the OS-9 disk structure, or enjoy gambling with your data, avoid this mode.

Expert mode is entered only after you answer Y or y to the confirmation prompt. The display shows when you are in Expert mode. Press X again to turn it off.

Z Command

Zap the displayed sector.

You will be prompted with either Zap Byte: or Zap Char:. Enter either:

  • a hex byte such as 6c
  • an ASCII character such as $

Then press Enter. That byte or character is written to the entire sector buffer.

You can toggle between byte mode and character mode by pressing the Break key. In character mode, pressing ALT plus a character, then Enter, zaps the sector with that character and bit 7 set.

Unless you are in Expert mode, only the in-memory buffer is changed. To write the zapped sector to disk, you must use the W command.

If you decide not to zap the sector, press Enter on an empty prompt. You can redisplay a sector that has been zapped but not yet written to disk by moving to another LSN and back again, provided you are not in Expert mode.

$ Command

Fork a shell.

A new shell is forked so you can access OS-9 without terminating dEd. To return to dEd, press Ctrl-BREAK or Esc.

Enter at the CMD: Prompt

Clean up the screen display.

Pressing Enter at the CMD: prompt clears and redraws the screen if it has been trashed by an error. Current edits to the displayed sector are neither lost nor written. This command only refreshes the display.

Clone this wiki locally