EXE and HEX files cannot be written

This error normally occurs when you load a .HEX or .EXE file, modify
it, and then attempt to write the file back to a disk.

You should understand that .EXE and .HEX files contain loading infor-
mation that is used to load the file. When DEBUG is executed, it loads
the .EXE file while at the same time discarding the information. During
direct execution of an .EXE file, the same thing happens. When you use
DEBUG to write an .EXE file, the information is gone; therefore, a cor-
rect .EXE file cannot be generated. That is why you get this error mes-
sage.


This error might also be caused by the fact that data consists of a
.COM file loaded in with DEBUG and you are now trying to write it to an
.EXE or .HEX file. This is not possible. The data requires a backward
conversion that DEBUG doesn't support.

Rename the file using a different extension, then execute DEBUG. DEBUG
then reads the file instead of loading it, and the file can now be
written out. Reading the file in does not alter the records or data in
the file.