Format:Commodore PRG file
| Platforms | Platform:Commodore 64 |
|---|---|
| Magic | none (first 2 bytes are the load address) |
| Extensions | .prg |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
A C64 PRG file is a program file as stored on a 1541 disk: two bytes of little-endian load address followed by the data (Unverified for the raw file; see below).
Layout
Unverified: a PRG is the 2-byte little-endian load address followed by the memory image (the KERNAL LOAD convention). No source for the raw .prg file itself was read for this page; related readings: the T64 container stores the start address in the directory record instead (Format:Commodore T64 tape archive), and libsidplayfp treats a SID file whose header load address is 0 as having the same 2-byte prefix at the start of its data (Format:PSID and RSID (SID music)).
Where PRG files come from
File type 2 (PRG) in the 1541 directory entry (Format:Commodore D64, D71 and D81 disk images), or extracted from T64 records. Since there is no header, identify by context: a BASIC program starts with a link pointer then a line number, typically after a $01 $08 prefix (Unverified).
Code & repositories
- https://github.com/libsidplayfp/libsidplayfp @
c855551959b74651a800bdc16df1665de21f4e21· license: GPL-2.0-or-later (declared by the contributor for the files used; GitHub reports GPL-2.0 for the repository)
libsidplayfp C64 SID player library: src/sidtune/PSID.cpp and SidTuneBase.cpp parse the PSID/RSID header
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-18