Using the standard loader (slow speed) you can load a file in 2 different way's.
Using LOAD
load the program to the BASIC start address.
Using LOAD””,1,1
load the program to the start address as specified in the file.
When you program a BASIC program on a +3K expanded VIC-20 and want to load that on an
unexpanded VIC-20 then you will get into trouble if you load with LOAD””,1,1. Because then you
will load your program into $1001 (the BASIC start address of an unexpanded VIC-20). The +3K
epanded VIC-20 has BASIC start $0401, so this will not work, because when loading is ready you
see nothing when you type list. This is because the BASIC program is not loaded into the proper
basic area for the unexpanded machine. Fortunately the good people of Commodore have made an
option to compensate for this. Simply load your file using LOAD and it will relocate automatically.
This means that during loading all the addresses are correct for the current BASIC start value.
Relocating a BASIC program is possible, as long as it fits into the machine. Relocating a machine
language program (not intended to be relocated) is not good. Because the address would change
and the program would crash on execution, unless the program has it's own relocation routines.
When loading a file with the Cassiopei's fastloader, you cannot choose how to load the file. But this
is not required. The Cassiopei will detect if the file will start at $0401, $1001 or $1201 and if so, it
must be a BASIC program and so it will be relocated to the current basic start address. If the
program is a machine language program it will not start at one of these 3 locations. If the program
is a hybrid program (a machine language program that begins with a BASIC stub then it will be
relocated. But for these programs you must be aware if these programs are capable of running on
your machine's configuration. Because not all programs will function. This is due to system
constraints (or bad programming) and not because of the Cassiopei. However for most of these kind
of games it is noted in a readme file or manual on what kind of memory configuration it should be
played.
8.1.3
Writing a program that works on all VIC-20 configurations
Technically it is possible to write a small program that has a BASIC stub and a self relocating
machine language part. The Cassiopei menu program is such a program and below is shown how it
works.
Example of a self relocating machine language program and a basic stub to start it:
The program below is written to work on memory address $12XX and further, because this location is
available in all possible memory configurations. When compiled using the address below, it can be
loaded and started with a simple run. No more SYS commands to remember, just RUN. The relocating
routine will copy itself from the current location the correct location, but because these areas
might overlap, the copying routine copies the last byte first. In other words, it copies backwards,
so the loop ends by copying the first byte last.
;zero page variables
;===================
SOURCE_ADR = $F7 ;pointer for relocation
;SOU1 = $F8 ;
DEST_ADR = $F9 ;pointer for relocation
;D1 = $FA ;
;BASIC stub
;==========
*=$1201
;20 SYS32+256*peek(44)
;Start address $1201, end address $1214
BYTE $13,$10,$14,$00,$9e,$33,$32,$aa,$32,$35,$36,$ac,$c2,$28,$34,$34,$29,$00,$00,$00
2019-10-27
Page 37 of 76
CASSIOPEI v2.0
Summary of Contents for CASSIOPEI
Page 1: ...CASSIOPEIv2 0 USER MANUAL this manual is intended for firmware version V20191027 or higher...
Page 62: ......
Page 69: ......