Commodore 64 binary executable
(add ref to CBMFS directory structure) |
|||
Line 4: | Line 4: | ||
}} | }} | ||
− | Binary files intended to be executed on a Commodore 64 (or emulator of it) are often stored with the extension .prg. (In the original Commodore environment, they generally didn't have an extension but had file type "PRG" in the directory structure.) | + | Binary files intended to be executed on a Commodore 64 (or emulator of it) are often stored with the extension .prg. (In the original Commodore environment, they generally didn't have an extension but had file type "PRG" in the [[CBMFS#CBM_DOS_Directory_Structure | directory structure]].) |
The first two bytes in a PRG file are the memory address that the file should be loaded into (in little-endian format). For a C64 [[Commodore BASIC tokenized file]] file, intended to be loaded into $801, these bytes are $01,$08. Note that these bytes will be ignored (i.e. a PRG file will be loaded into $801) UNLESS the LOAD command had a non-zero parameter after the device number. i.e. LOAD "*",8 will load a file from device 8 (the typical device number for a disk drive) into $801, while LOAD "*",8,1 will load a file into whatever memory address is specified by the first 2 bytes of the PRG. | The first two bytes in a PRG file are the memory address that the file should be loaded into (in little-endian format). For a C64 [[Commodore BASIC tokenized file]] file, intended to be loaded into $801, these bytes are $01,$08. Note that these bytes will be ignored (i.e. a PRG file will be loaded into $801) UNLESS the LOAD command had a non-zero parameter after the device number. i.e. LOAD "*",8 will load a file from device 8 (the typical device number for a disk drive) into $801, while LOAD "*",8,1 will load a file into whatever memory address is specified by the first 2 bytes of the PRG. |
Revision as of 23:27, 20 May 2013
Binary files intended to be executed on a Commodore 64 (or emulator of it) are often stored with the extension .prg. (In the original Commodore environment, they generally didn't have an extension but had file type "PRG" in the directory structure.)
The first two bytes in a PRG file are the memory address that the file should be loaded into (in little-endian format). For a C64 Commodore BASIC tokenized file file, intended to be loaded into $801, these bytes are $01,$08. Note that these bytes will be ignored (i.e. a PRG file will be loaded into $801) UNLESS the LOAD command had a non-zero parameter after the device number. i.e. LOAD "*",8 will load a file from device 8 (the typical device number for a disk drive) into $801, while LOAD "*",8,1 will load a file into whatever memory address is specified by the first 2 bytes of the PRG.