Introduction
The header is always $800 bytes: the BIOS reads the first $800 bytes of the file, takes what it needs from the first
$4C, and loads the rest. Every number is a 32-bit little-endian value. The layout follows the Nocash PSX-SPX page on
PSX.EXE.
Fields
| Offset | Size | Field | Meaning |
|---|---|---|---|
$000 | 8 | Signature | The ASCII text PS-X EXE, followed by eight zero bytes ($008–$00F). |
$010 | 4 | Initial PC | The address the program starts at. Usually $80010000 or higher. |
$014 | 4 | Initial GP (R28) | The global pointer’s starting value; usually 0. |
$018 | 4 | Destination address | Where in RAM the program is loaded; usually $80010000 or higher, because the first 64 KiB of RAM belong to the BIOS. |
$01C | 4 | Size | The size of the program after the header, which must be a multiple of $800. The whole file is therefore $800 plus this. |
$020 | 4 | Unused address | Unknown, usually 0; the page suggests an optional overlay that is not loaded automatically. |
$024 | 4 | Unused size | Unknown, usually 0. |
$028 | 4 | Memory fill start address | The start of a RAM area to fill before the program starts; usually 0. |
$02C | 4 | Memory fill size | The number of bytes to fill; 0 for none. |
$030 | 4 | Initial SP and FP base | The stack pointer (R29) and frame pointer (R30) start at this address plus the offset below. Usually $801FFFF0; 0 for none. |
$034 | 4 | Initial SP and FP offset | Added to the base; usually 0. |
$038 | 20 | Reserved | Reserved for the BIOS function A(43h), Exec; should be zero in the file. |
$04C | to $7FF | Region text | One of the three texts below, then zeros up to $7FF. The BIOS does not check it and boots without it; it is often all zeros in homebrew. |
$800 | size | Program | The code and data, loaded to the destination address and up. |
| Region text | Region |
|---|---|
Sony Computer Entertainment Inc. for Japan area | Japan (NTSC) |
Sony Computer Entertainment Inc. for Europe area | Europe (PAL) |
Sony Computer Entertainment Inc. for North America area | North America (NTSC) |
The header carries no relocation information: the program must run at the destination address.
What the viewer checks
- The size is a multiple of
$800, and the file is exactly$800plus the size; a longer file has bytes the BIOS does not load, a shorter one is truncated. - The initial PC is inside the loaded program and word aligned.
- The destination is not in the first 64 KiB of RAM and the program ends within the 2 MiB of RAM.
- The bytes the format says are zero (
$008–$00F, the end of the header) are.
Not described
Known, not yet covered
- Reference: what the unused address and size at
$020and$024are for (the source calls them unknown), how the BIOS fills the reserved words at$038when it executes a file, and the layout of the “PS-X EXR” relocatable variant. - Viewer: the viewer only reports problems; whether the BIOS refuses a file for any of them is not described (the source says only that the region text is not verified).
Links
Reference
- Nocash PSX-SPX – “CDROM File Playstation EXE and SYSTEM.CNF”: the PSX.EXE header