[comp.sys.tandy] WANTED: executable file format under TRSDOS

lennox@minilove.diag.stratus.com (Craig Scott Lennox) (12/18/90)

I need to know the format for an executable binary file under TRSDOS.
I've been hacking zmac (public domain Z80 assembler) to work under
TRSDOS, but the programs that are produced don't seem to run...  any
help would be appreciated.

Unless someone wants to sell me their copy of CP/M for the TRS-80
model IV...


                                        Craig.

--
|    flame me at: lennox@minilove.diag.stratus.com, (Craig Scott Lennox)    |
|"Oh boy, virtual memory! Now I'm gonna make myself a REALLY BIG ram disk!" |
|   Disclaimer:  My opinions are covered by section 2b of the Gnu Public    |
|                License and thus do not belong to Stratus Computer.        |

les@chinet.chi.il.us (Leslie Mikesell) (12/19/90)

In article <LENNOX.90Dec18104039@minilove.diag.stratus.com> lennox@stratus.com writes:
>

>I need to know the format for an executable binary file under TRSDOS.
>I've been hacking zmac (public domain Z80 assembler) to work under
>TRSDOS, but the programs that are produced don't seem to run...  any
>help would be appreciated.

The loadable files look like:
 05 <length> comment text (not loaded)
 01 <length> <address> code  (loaded) 
 02 02 <address>  (execution entry point)

The <length> byte of the optional comment field is exact - on the loaded
portion, the length includes the 2 byte address field, but that is subtracted
off before considering the value.  Thus, the longest possible segment will
have a length byte of 02 - subtracting the two address bytes leaves 0,
indicating 256 bytes to be loaded.  The load and execution addresses are
in the usual low-byte first z80 format. If you are starting from an
intel hex format you can do the obvious thing with a loader code every
16 bytes (and a lot of Tandy's programs look like that) but you can save
disk space by collapsing them into 256 byte chunks.

There is another code used as a comment by the patch utility and maybe another
in the system library overlays, but I've forgotten what they are.
If you can get the code loaded into memory some other way, DUMP will generate
a loadable copy for you.

Les Mikesell
  les@chinet.chi.il.us