PRG format for LOAD "*",8

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

PRG format for LOAD "*",8

Post by Kweepa »

Hi,
What is the format of PRG files that must be loaded with LOAD "*",8?
It seems that using the first two bytes as a start address is wrong.
Thanks!
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

The first two bytes are always the start address. Loading ,8,1 loads the program into that address. Loading ,8 loads it into the current basic area address instead.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Wonder-Boy
Vic 20 Enthusiast
Posts: 187
Joined: Wed Sep 13, 2006 3:04 pm

Post by Wonder-Boy »

Is there an advantage to using the ,1 ? Does it matter into what area you load a program?
Our holy mission is doomed to succeed
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

,<device> or ,<device>,0 always loads to the start of BASIC memory, regardless of RAM expansion in use. Pure BASIC programs should only be loaded this way.

,<device>,1 forces the LOAD command to load the PRG file at its stored loading address. Most machine code programs only work at a specified address, so this is the preferred way to load machine code.

Michael
Athlor
Vic 20 Drifter
Posts: 30
Joined: Mon Sep 01, 2008 11:58 pm

Post by Athlor »

I though load"*",8
was for loading the first file in the directory irregardless of what it's actually named. Like what's been said above that's not really a different file format just a different form of the load command.
JJ Abrams Star Trek: Boldly going where we've already been...
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Thanks for all the responses! JarVIC can now relocate BASIC programs!
CurtisP
Vic 20 Dabbler
Posts: 99
Joined: Tue Mar 08, 2005 8:24 pm

Post by CurtisP »

Athlor wrote:I though load"*",8
was for loading the first file in the directory irregardless of what it's actually named. Like what's been said above that's not really a different file format just a different form of the load command.
The "*" actually tells the disk drive to load the last program loaded from disk. If you haven't loaded one yet, then it defaults to the first one.
MacbthPSW
Vic 20 Afficionado
Posts: 478
Joined: Wed Apr 06, 2005 1:56 pm

Post by MacbthPSW »

CurtisP wrote:The "*" actually tells the disk drive to load the last program loaded from disk. If you haven't loaded one yet, then it defaults to the first one.
I guess we're getting even further away from the original topic, but yeah, and to force the first file to be loaded, LOAD ":*",8 (and the optional ,1 if you want to force the file to be loaded to it's original saved address)
Post Reply