Technical Reference

Appendix J

FILE HEADER INFORMATION

J.1 Character Set Header

All files with the extension .CHR are Character Set table files. These files contain data corresponding to the actual dot matrix displayed for each character on the console. These files also contain information regarding the character set name, version number, origin, date of creation, and display class. The Character Set table file header is a 128 byte field, structured as follows:

Byte No.                 Function
Hex            Dec

00             00        Character Set type, ASCII 'C'=character

01             01        Character  Set  Version  No.   (ASCII  0 
                         through 9)
02-0D          02-13     Display Class

0E-15          14-21     Character Set Name

16             22        Filler (ASCII Space)

17-19          23-25     Banner Class

1A             26        Filler (ASCII Space)

1B-3D          27-61     Comment

3E-4D          62-77     Originator

4E-55          78-55     Creation Date - arranged as YY/MM/DD

56-59          86-89     Number of records in the file in  ASCII.  
                         A  character set file of 128  characters 
                         has 32 records;  a character set file of 
                         256  characters  has  64  records.   The 
                         record  count  for a 32 record  file  is 
                         stored as 30 30 33 32 (0032)

5A-5B          90-91     Reserved

5C             92        This   byte  is  used  to  house   three 
                         variables.   Bit  7 is used to show  the 
                         Horizontal/Vertical   alignment  of  the 
                         character  set  - bit  7  ON  infers   a 
                         Vertical character set.   Bits 6 through 
                         4  of  the high nibble is used to  store 
                         the binary Super/Subscript value  (which 
                         may be 1 through 7) offset from 1 - thus 
                         a  Super/Subscript value of two would be 
                         stored as binary 2.   The low nibble  is 
                         used   to  store  the  binary  Character 
                         Height offset from 0 - thus a  Character 
                         Height  value  of 16 would be stored  as 
                         binary  F.   The Character height  is  a 
                         function   of  the  number  of  vertical 
                         pixels the character will occupy in  the 
                         16x10  pixel  matrix available for  each 
                         character on the screen.
                         If  the  Horizontal/Vertical  bit,   the 
                         Super/Subscript value and the  Character 
                         Height  value was as stated above,  then 
                         this  byte  would  read  AF.   The  byte 
                         appears:

     Bit            [7]            [ 6 5 4 ]          [ 3 2 1 0 ]
     Function       Horiz/Vert     Super/Sub          Character
                                                      Height

5D             93        This  byte  contains  two  values;   the 
                         User/System character set toggle,  bit 0 
                         stores this value; and the Stock/Special 
                         character set toggle,  bit 1 stores this 
                         value.    Bit  0  ON  infers  that   the 
                         character  set  is a  special  character 
                         set.

5E             94        This  byte  contains information on  the 
                         character set width.  If the high nibble 
                         is 0,  then the low nibble contains  the 
                         binary  information,  offset from 0,  of 
                         all the characters in the character  set 
                         - thus a character set width value of 16 
                         would  be  stored  as F.   If  the  high 
                         nibble is F, then the character set is a 
                         proportional   one  - the   proportional 
                         character  set  has  a  trailing  record 
                         containing  information on the width  of 
                         each   individual   character   in   the 
                         character set.  A proportional character 
                         set  is  designed to be  used  in  high-
                         resolution  mode as it requires a  16x16 
                         screen cell.

5F-7F          95-127    Reserved.

80-            128-      The character set font information.
J.1.1 Sample Character Set Table File Header

Following is an actual header taken from the Character Set table file for the character set PROP.CHR. PROP contains 128 characters, and is a proportional character set:

Hex Offset                    Value in Hex

     0:        43 30 49 6E 74 27 6C 20   20 20 20 20 20 20 50 52    
    10:        4F 50 20 20 20 20 20 43   48 52 20 54 68 69 6E 20
    20:        70 72 6F 70 6F 72 74 69   6F 6E 61 6C 20 63 68 61
    30:        72 61 63 74 65 72 20 73   65 74 20 20 20 20 53 69
    40:        72 69 75 73 20 53 79 73   74 65 6D 73 20 20 38 32
    50:        2F 30 37 2F 31 36 30 30   33 30 00 00 7F 00 FF 00
    60:        00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00
    70:        00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00     
J.2 Proportional Character Set Trailer Information

In the case of a proportional character set, the trailing 128 bytes of the character set file contains information on the proportional width of each of the characters in the file. A proportional character set may not, therefore, contain more than 256 characters.

The following is a sample taken from the character set PROP.CHR; the hex figures represent the width for each proportional character starting with the space character. Note that each width value is offset from 0, with a value range of 1 through 16 decimal. Each byte is stored, and represented below, in low/high order; the two nibbles would be exchanged to give the value to the character(s) in high/low order. Each character is mapped from the proportional width as follows:

        29 95 98 49 77 88 84 93

The above figures are for the first 16 display characters including the space character - they correspond as follows:

          space = 10     (corresponding to 9)
          !     =  3     (corresponding to 2)
          "     =  6     (corresponding to 5)
          #     = 10     (corresponding to 9)
          $     =  9     (corresponding to 8)
          %     = 10     (corresponding to 9)
          &     = 10     (corresponding to 9)
          '     =  5     (corresponding to 4)
          (     =  8     (corresponding to 7)
          )     =  8     (corresponding to 7)
          *     =  9     (corresponding to 8)
          etc.
J.3 Keyboard Table Header

All files with the extension .KB are Keyboard Table files. these files contain information regarding keyboard code generated when a key on the keyboard is pressed. These files also contain information regarding the Keyboard Table name, version number, origin, date of creation, and display class. The Keyboard Table table file header is a 128 byte field, structured as follows:

Byte No.                 Function
Hex            Dec

00             00        Keyboard table type, ASCII 'K'=character

01             01        Keyboard table  Version  No.   (ASCII  0 
                         through 9)
02-0D          02-13     Display Class

0E-15          14-21     Keyboard Table Name

16             22        Filler (ASCII Space)

17-19          23-25     Banner Class

1A             26        Filler (ASCII Space)

1B-3D          27-61     Comment

3E-4D          62-77     Originator

4E-55          78-55     Creation Date - arranged as YY/MM/DD

56-59          86-89     Number of records in the file in  ASCII.  
                         A  character set file of 128  characters 
                         has 32 records;  a character set file of 
                         256  characters  has  64  records.   The 
                         record  count  for a 32 record  file  is 
                         stored as 30 30 33 32 (0032)

5A-7F          90-127    Reserved

80-            128-      Keyboard table information
J.4 Banner Skeleton Files

Files with the extension .BAN are banner skeleton files. The banner is information printed on the screen during system boot. The banner also prints the Logo (if selected) along with other information regarding configuration. The banner is a set of ASCII strings containing the escape sequences and characters necessary to print the logo and configuration information on the console.

The first 128 bytes of the Banner Skeleton has the following format. The first byte is zero followed by 0Dh, 0Ah. This is followed by the length of the file in ASCII decimal with a leading and trailing space, and followed by 0Dh, 0Ah.

The location of the keyboard name and character set name follow in the same format as the file name length. If the file length is 639 characters, the keyboard name is at byte 502, and the character set name is at 541, then the first 24 bytes of the banner file would be as follows:

        30 0D 0A 20 36 33 39 20 0D 0A 20 35 30 32 20 0D 0A 20
        35 34 31 20 0D 0A

J.5 Banner Customisation

Would you like your company name included on the Sirius banner? Syselect permits the selection to be made, but first you need to create a banner.

This may be achieved by using ED (under CP/M-86), EDLIN (under MS-DOS) or WordStar.

1. CP/M-86

     A>PIP YOUR.BAN=SIRIUS.BAN
     A>ED YOUR.BAN
     :*#a
     1:*2:0tt
     2: xxxxx SIRIUS I  MICROCOMPUTER xxxxx

        (must be exactly as shown)    (must be exactly 24 chrs)
     2:*sSIRIUS I MICROCOMPUTER^Z    PUT YOUR NAME HERE  ^Z0tt
     2:*e
     A>

2.   MS-DOS

     A>COPY SIRIUS.BAN YOUR.BAN
     A>EDLIN YOUR.BAN

     EDLIN version 1.01
     End of input file

     *alt clr                  (clear screen)

     rSIRIUS I  MICROCOMPUTER^Z    PUT YOUR NAME HERE  ^Z0tt
                                   PUT YOUR NAME HERE  (EDLIN 
                                                       repeats)
     *E
     A>

Syselect may now be used to include your banner file in an operating system.


J.6

This paragraph has been omitted

J.7 Normal File Control Block

The normal file control block is structured as follows - with offsets in decimal:

     Byte                     Contents

     0              The drive number.  The drives are numbered as 
                    follows:

                    Before opening file: 0 = default drive
                                         1 = drive A
                                         2 = drive B
                                         3 = drive C, etc.

                    After opening file:  1 = drive A
                                         2 = drive B, etc.

                    MS-DOS replaces the default drive prefix of 0 
                    with  the correct drive number after the open 
                    is processed.

     1-8            Filename,  left justified with trailing ASCII 
                    space(s).  If a device name is placed in this 
                    region, the trailing colon should be omitted.
     
     9-11           Extent,  left  justified with trailing  ASCII 
                    space(s).

     12-13          Current   block   number  relative   to   the 
                    beginning  of the file,  starting  with  zero 
                    (automatically   set  to  zero  by  the  open 
                    function request).   A block consists of  128 
                    records,   each  record  being  of  the  size 
                    specified  in the logical record size  field.  
                    The  current  block number is used  with  the 
                    current    record   field   for    sequential 
                    reads/writes.

     14-15          Logical record size in bytes.   Set to 80H by 
                    the open function request.

     16-19          File   size  in  bytes.    The   first   word 
                    represents  the  low-order part of  the  file 
                    size.

     20-21          Date  the  file was created or last  updated.  
                    The date is set by the open function request.  
                    The date is formatted as follows:

                    <         21        > <        20   >
                    15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
                     y  y  y  y  y  y y m m m m d d d d d

                    where m = month 1-12
                          d = day   1-31
                          y = year  0-119 (1980 - 2099)

     22-23          Time  the  file was created or last  updated.  
                    The time is set by the open function request.  
                    The time is formatted as follows:

                    <         23        > <        22   >
                    15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
                     h  h  h  h  h  m m m m m m s s s s s

                    where h = hours     0-23
                          m = minutes   0-59
                          s = seconds*2 0-59 

     24-31          Reserved for system use.

     32             Current relative record number (0-127) within 
                    the current block.   This must be set  before 
                    doing sequential read/write operations on the 
                    file.  The open function request does not set 
                    this field.

     33-36          Relative  record  number,   relative  to  the 
                    origin of the file,  starting at zero.   This 
                    field  must  be  set prior  to  doing  random 
                    read/write operations on the file.   The open 
                    function request does not set this field.

                    If  the  record size is less than  64  bytes, 
                    both  words are used.   If the record size is 
                    greater  than 64 bytes,  then only the  first 
                    three bytes are used.

Notes: The File Control Block at 5CH in the Base Page overlaps both the File Control Block at 6CH and the first byte of the command line area/disc transfer area at 80H.

Bytes 0 - 15 and 32 - 36 must be set by the user program. Bytes 16 - 31 are set by MS-DOS and may only be changed at the programmers own risk.

In the 8086/8088 all word fields are stored least significant byte first - this is true in setting the record length, etc.

J.8 Extended File Control Block

The extended FCB is used to create or search for files having special attributes. The extended FCB adds an additional 7 bytes preceeding the normal FCB. The extended FCB is structured as follows:

     Byte                     Contents

     FCB-7          Set  to FFH indicates that an extended FCB is 
                    being used.

     FCB-6 - FCB-2  Are reserved.

     FCB-1          Attribute byte to include hidden files  (02H) 
                    or system files (04H) in directory searches.

     FCB-0          Origin of normal FCB (drive byte).     


BACK


All contents of this website (including text, images, design, and presentation) are Copyright � 1999-2004,
ACT Sirius 1 User Group (UK) unless explicity stated otherwise. All Rights Reserved.
E-Mail: siriususer@eurobell.co.uk

Last revision 22/01/2003