I'm just creating my own
.prg file using NCurses Hexeditor in Ubuntu which I load using
load"file.prg",8 in Vice. I followed the information in this link explaining how to create a
.prg file. It says basic starts at 2048 ($0800) but loads the
.prg code starting at $0801:
|$0801–$0802||2-byte pointer to the next line of BASIC code ($080C).|
|$0803–$0804||2-byte line number ($000A = 10).|
|$0805||Byte code for the SYS command.|
|$0806–$080A||The rest of the line, which is just the string " 2064".|
|$080B||Null byte, terminating the line.|
|$080C–$080D||2-byte pointer to the next line of BASIC code ($0000 = end of program).|
Is there any reason for this? I tried it at $0800 and all works fine (see below). I guess it wouldn't matter because the Assembly code starts at 2064 ($0810), but just thought I might be missing something as to why they chose $0801 and not $0800.
What I tried
First of all, according to the C64 Programmer's Reference Guide (C64PRM, p.59):
Programs will LOAD starting at memory location 2048 unless a secondary <address> of 1 is used. If you use the secondary address of 1 this will cause the program to LOAD to the memory location from which it was saved.
Tests show that no matter what PRG header I use my bytes are always loaded into 2048 when using
,8 as per C64PRM. But let's just suppose I use a header for $0800, then I have the following bytes in Hexeditor:
00000000 00 08 0B 08 0A 00 9E 20 32 30 36 34 00 00 00 00 ....... 2064.... 00000010 00 EE 20 D0 4C 10 08 .. .L..
and I don't get an error, e.g.: