Previous Next Contents Index
Appendix 3: The DISCiPLE Disk Layout

The DISCiPLE numbers its tracks beginning with 0 for side 0 and 128 for side 1. Sectors
are 512 (Double Density) or 256 (Single Density) bytes long and are numbered 1 to 10.
The DISCiPLE catalogue starts at track 0 sector 1 and ends at track 3 sector 10. Each
catalogue sector holds the information of two (DD) or one (SD) file(s). Each catalogue
entry holds the following data:

Offset  Lenght  Name        Contents
                            The following 11 bytes form the file descriptor.
0       1       NSTR1       Directory description (0-11).
1       10      NSTR2       Filename.
11      2                   Number of sectors used high byte first.
13      2                   Start track (1st) and sector (2nd) number of file.
15      195     BITMAP      Bitmap of file (occupied sectors).
210     1                   Most significant byte of file length (64K blocks).
                            The following 9 bytes form the file header (only used with BASIC,
                            ARRAYs and CODE files; HD0B is also used with OPENTYPE files).
211     1       HD00        File type (0-3).
212     2       HD0B        Length of file.
214     2       HD0D        Start address of file.
216     2       HD0F        BASIC program length without variables.
218     2       HD11        Autostart line number (BASIC, >=#4000 if none), or
                            execute address (CODE, =#0000 or #FFFF if none).
220     22                  In case of a snapshot file:
                            registers IY, IX, DE', BC', HL', IR, DE, BC, HL, IR
                            again and SP are stored here (AF is stored on the
                            stack, AF' is "forgotten").
242     14                  Not used.

DIRECTORY DESCRIPTION           FILE TYPE

0       ERASED                  0       BASIC
1       BASIC                   1       NUM. ARRAY
2       NUMERIC ARRAY           2       STR. ARRAY
3       STRING ARRAY            3       CODE
4       CODE
5       SNAP 48K
6       MICRODRIVE FILE
7       SCREEN$
8       SPECIAL FILE
9       SNAP 128K
10      OPENTYPE FILE
11      EXECUTE FILE

In case of file-types 0-3 the 9 byte file header is also found in the first sector,
preceeding the actual file itself.
The last two bytes of each sector contain the next track and sector number of the file
being handled. In the last sector these bytes contain 0.
SNAP 48K files contain always 49152 bytes, SNAP 128K files contain always 8*16384
bytes, EXECUTE files occupy always one sector. SCREEN$ files are in fact CODE files
with start 16384 and length 6912.
Previous Next Contents Index