This article was written by Tom Price on February 17, 1984 and explains the structure of SuperSCRIPSIT document files, which may be of assistance in repairing damaged files with the aid of a ‘zap’ program or a file editor.

Basic Structure of a SuperScripsit File
Each SuperScripsit file has four distinct areas:
      Record 0  Document header and other vital information
      Records 1 thru 4  Disk block index
      Record 5  List of new page markers
      Record 6-END  Disk blocks containing the text.
Before getting into the details, it is necessary to define the meaning of a ‘disk block’. It is 1K in size, consisting of 4 256 byte records. Each block contains a 7 byte header (explained later), up to 985 bytes of text, paragraph and control information, and 32 bytes of overflow space to accomodate minor changes without starting a new block. Each of the four possible header/footer pages will occupy its own block, if present. A document may not contain more than 174 blocks. Blocks are numbered from 0 to 173, with Block 0 starting at document record 6.

Structure of Document Record 0 – Header
      Byte Description
      —————- ——————————————————–
      00 ID – Always E0, identifies a SS document
      01 – 18 24 bytes for the document name
      19 Maximum lines per page in half-line increments
      1A Pitch – PS=00
      1B Line spacing in half-line increments
      1C – 23 8 bytes for printer driver filename
      24 – 25 Page number to start footers
      26 – 27 Page number to start headers
      28 Odd footer length in half-lines
      29 Odd header length in half-lines
      2A Even footer length in half-lines
      2B Even footer length in half-lines
      2C Horizontal posit of cursor on video display at document close
      2D Vertical posit of cursor on video display at document close
      2E Column position of cursor at document close time
      2F – 30 Document line number of cursor at document close time
      31 – 45 Tab line 0 (21 bytes)
      46 – 5A Tab line 1 (21 bytes)
      [NOTE] – The 21 byte tab line contains 168 bits, each bit representing a column position. If a bit is set, there is a tab stop at that position.
      5B – 71 Bit map of disk block allocation (23 bytes)
      [NOTE] – The first 174 bits of this map represent disk blocks 0-173. If a bit is set, that block is allocated. If the bit is reset, the block is available.
      72 Disk block number of odd footer (if any)
      73 Disk block number of odd header (if any)
      74 Disk block number of even footer (if any)
      75 Disk block number of even header (if any)
      76 Disk block number of tab line table (FF = none)
      [NOTE] – This block has space for 48, 21 byte tab lines, which added to the two available in this record, make up the maximum of 50 tab lines per document.
      77 Number of tab lines currently assigned to the document.
      78 – 97 Name of Author (32 bytes)
      98 – B7 Name of Operator (32 bytes)
      B8 – D7 Comments (32 bytes)
      D8 – FF   Not currently used

Structure of Document Records 1-4 – Disk Block Index
Byte 00 of the index contains the number of active text blocks in the entire document, not including any blocks assigned to headers, footers or tab lines. Starting with Byte 01 of Record 1, there is room for 174, 5 byte groups, each group representing a disk block containing text. The groups are arranged in the actual order of the document’s text as printed. The meaning of each byte in a group is as follows:
      Byte Description
      ———- ——————————————————–
      00 Disk block number (range 00 to AD). If the value is FF, it denotes the end of the index and all following bytes have no meaning. The actual record number in the file can be found by multiplying the block number by 4 and adding 6.
      01 – 02 Actual length of valid text in the block
      03 – 04 Number of lines of text in the block. The upper nybble of byte 04 is used to contain block control information as follows:
      Bit 7 – set if the first line of the block is a whole line, not part of a line from a previous block.
      Bit 6 – set if the block contains an open marker ‘[‘
      Bit 5 – set if the block contains a close marker ‘]’
      Bit 4 – set if the block has been changed (edited)

Structure of a Disk Block
Each disk block starts with a 7 byte header. Bytes 00-01 contain the number of text bytes following the header. This value must be identical to bytes 01-02 of the index group for this block. Bytes 02-06 of the header comprise the default paragraph format for the block as follows:
      Byte Description
      ———- ——————————————————–
      02 Column containing the left margin
      03 Column containing the right margin
      04 Column containing the indent tab
      05 Number of the tab line in use.
      06 Control byte – following bits are used:
      Bit 4 – Set if the paragraph is frozen
      Bit 3 – Set if the paragraph is centered
      Bits 2 thru 0 – used to indicate line spacing in half-lines.
After the header comes the actual text. If the block starts with a complete paragraph (line), there will be a 5 byte paragraph group identical in format to the default group in the block header followed by an EF control byte indicating the end of the paragraph info. Then comes the actual text of the paragraph, terminated by an FD, denoting a hard carriage return. This will be followed by a 5 byte paragraph info group for the next paragraph, followed by an EF, and so forth until the number of bytes shown in Bytes 00-01 of the block has been reached. Everything after this point is MEANINGLESS; the text continues on the next block shown in the disk block index. In the text, the following control codes may be encountered:
      Code Meaning
      ———- ——————————————————–
      E5 Null – deleted text
      EC Soft page marker
      ED Hard page marker
      EF End of paragraph control info
      F0 Start block marker (shows as ‘[‘ on screen)
      F1 End block marker (shows as ‘]’ on screen)
      F2 Normal tab
      F3 Align tab
      F5 ‘Code’ for printer control (underline, bold, etc)
      F6 Filler bytes for insert mode
      F7 Space compression for two succeeding spaces (delta)
      F8 Soft carriage return replacing a space
      F9 Soft carriage return replacing a double space
      FA Hard hyphen
      FB Hard space (for hyhenation)
      FC Hard carriage return during inserting
      FD Hard carriage return
      FF End of file/text

Structure of Document Record 5 – List of New Page Markers
This record contains the location of any hard page breaks (^) in the document. Byte 00 is the number of markers in the document, followed by 127 pairs of bytes (byte FF is not used). Each non-zero byte pair contains the line number, relative to the start of the document (line 0), where a page break is located.
Armed with the above information, a user with a clobbered file may be able to zap it to the point where it will load properly and allow final repair with the normal SuperSCRIPSIT editing functions. The information in the disk block index MUST agree with what is actually contained in the disk blocks themselves. For example, when the FF byte is encountered in the index, it is a sign that the previous block should contain the FF end of text code some where among the valid bytes of that block.

Leave a Comment.