Commodore 64 binary executable

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Sample files)
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
|extensions={{ext|prg}}
 
|extensions={{ext|prg}}
 
}}
 
}}
 +
A '''Commodore 64 binary executable''' is intended to be run on a Commodore 64 or on another machine that is emulating one. These files are often stored with the extension .prg when kept in filesystems that distinguish types by extension. (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]].) Files of this type might be binary executables, tokenized BASIC, or other sorts of data files; even text files are sometimes stored in PRG format instead of TXT, so the file type doesn't give much information about what sort of data it is.
  
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 [[Endianness|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.  
 
+
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.  
+
  
 
== Programs and utilities ==
 
== Programs and utilities ==
 
* [http://search.cpan.org/~pawelkrol/D64-File-PRG-0.02/lib/D64/File/PRG.pm D64::File::PRG library for Perl to handle PRG files.]
 
* [http://search.cpan.org/~pawelkrol/D64-File-PRG-0.02/lib/D64/File/PRG.pm D64::File::PRG library for Perl to handle PRG files.]
 +
 +
== Sample files ==
 +
* http://www.zimmers.net/anonftp/pub/cbm/c64/index.html ...
 +
* [http://sos.gd/flappy64/ Flappy Bird implementation for C64]
 +
* [http://www.vintageisthenewold.com/battery-powered-portable-commodore-64-12v-dc/ Battery powered Portable Commodore 64 (12V DC)]
  
 
[[Category:Commodore computers]]
 
[[Category:Commodore computers]]

Latest revision as of 13:11, 2 June 2015

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

A Commodore 64 binary executable is intended to be run on a Commodore 64 or on another machine that is emulating one. These files are often stored with the extension .prg when kept in filesystems that distinguish types by extension. (In the original Commodore environment, they generally didn't have an extension but had file type "PRG" in the directory structure.) Files of this type might be binary executables, tokenized BASIC, or other sorts of data files; even text files are sometimes stored in PRG format instead of TXT, so the file type doesn't give much information about what sort of data it is.

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.

[edit] Programs and utilities

[edit] Sample files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox