Commodore 64 binary executable

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(add ref to CBMFS directory structure)
Line 6: Line 6:
 
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]].)  
 
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]], 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.  
  
 
== Programs and utilities ==
 
== Programs and utilities ==

Revision as of 17:11, 21 May 2013

File Format
Name Commodore 64 binary executable
Ontology
Extension(s) .prg

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, 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.

Programs and utilities

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox