Dragon DOS Binary Format


#FILE: binformt.txt
#DESC: Format of Dragon Dos binary file
#REV: 1.0
#DATE: 27/01/94
#AUTHOR: Graham E.Kinns
#DISCLAIMER: All information provided as is etc.
#ARCHIVE: This file is part of the DRGNINFO collection of Dragon info files
#CONTACT: Comments, bugs, revisions, suggestions to Dragon@grempc.demon.co.uk
#HISTORY: 1.0 27/01/94 - Initial version
#XREF: basicfmt.txt - tokenised BASIC format 
#      bastoken.txt - BASIC tokens
#      dostoken.txt - Dragon DOS tokens
#TODO: check different filetypes

Three standard file types exist under Dragon Dos - these are
        .DAT - standard data file
        .BAS - BASIC tokenised file 
        .BIN - binary image file
Contents of DAT file are typically in Ascii style text format

BAS and BIN are essentially the same - both start with an 9 byte header of
the following format:
     
     Offset:  Type:   Value:
        0       byte    $55     Constant
        1       byte    FILETYPE
        2:3     word    LOAD
        4:5     word    LENGTH
        6:7     word    EXEC
        8       byte    $AA     Constant
        9-xxx   byte[]  DATA

NOTE: words are Motorola hi-order format

FILETYPE is
        $01     for BAS
        $02     for BIN
  Remainder are undefined under standard Dragon DOS.  The type $03 may have
  been used in DosPlus from Phil Scott for a gapped m/c binary. (?? check)

?? Result on 'RUN'ning a file of the wrong type is not known

LOAD is the data load address - typically $2401 for a .BAS file although
  uncertain whether this is actually used.

LENGTH is length if DATA block that follows i.e. complete file should be
  LENGTH+9 bytes long

EXEC is execute address stored in $9d:9e for default EXEC addr if the
  data/program is LOADed - if the BIN file is RUN this defines the entry point 
  that is jumped to.  For a BASIC program this is always $8B8D


Back to Index