UCSD Pascal (p-System)

The UCSD Pascal volume format was used by the p-System and Apple Pascal (late 1970s to 1980s) with a simple contiguous directory. It appears on old Apple II Pascal disks and in preservation work.

Overview

A Pascal volume has a directory in blocks 2 to 5 with a header entry and up to 77 file entries. Files are contiguous extents with start and end blocks, file type and modification date. There is no allocation map; free space is whatever is not covered by an entry.

History

  • Developed at the University of California San Diego under Kenneth Bowles in the late 1970s.
  • Apple Pascal appeared in 1979.

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Probe

OffsetSizeTypeFieldNotes
0x61u8Description
0xE2u16 LEBlocks

Probe

OffsetSizeTypeFieldNotes
0x41u8Description
0x292u16 LEBlocks

Is Directory

OffsetSizeTypeFieldNotes
0x02u16 LEFirst
0x22u16 LENext
0x42u16 LEKind
0x61u8Name Length
0xE2u16 LEBlocks
0x102u16 LEFiles

Is Directory

OffsetSizeTypeFieldNotes
0x02u16 LEStart
0x22u16 LEEnd
0x61u8–

Live Entries

OffsetSizeTypeFieldNotes
0x02u16 LE–
0x22u16 LE–

Make Entry

OffsetSizeTypeFieldNotes
0x42u16 LEKind
0x162u16 LELast Bytes

Pascal File System

OffsetSizeTypeFieldNotes
0xE2u16 LETotal Blocks
0x102u16 LEFile Count

Other fields read

Read inOffsetSizeTypeFieldNotes
Read Block0x0256bytes–
Date0x02u16 LEWord

Constants

Apple2 Layout

NameValueTypeNotes
DosLogicalToPhysical[0, 13, 11, 9, 7, 5, 3, 1, 14, 12, 10, 8, 6, 4, 2, 15]int[]
ProDosLogicalToPhysical[0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15]int[]
DosPhysicalToLogicalInvert(DosLogicalToPhysical)int[]
ProDosPhysicalToLogicalInvert(ProDosLogicalToPhysical)int[]

Pascal File System

NameValueTypeNotes
EntrySize26int
DirectoryBlocks4int

Implementation limits

ClassNameValueNotes
Apple2 LayoutFloppyBytes143360
Apple2 LayoutThirteenSectorBytes116480

Apple2 Order

NameValue
Dos(next)
ProDos(next)
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.