Program Indirects, what are they?

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
freshlamb
Vic 20 Dabbler
Posts: 76
Joined: Sun Apr 04, 2004 5:38 pm
Website: http://www.rufnoiz.com
Location: Prince Albert SK Can

Program Indirects, what are they?

Post by freshlamb »

I was looking for another place in RAM that one could store 40 or 50 bytes (aside from the cassette buffer), and found Program Indirects at 673 to 767. I was wondering what these actually hold. Are they for GOSUBS and the like, or do they just hold operations during Cassette LOADing. I found that using the first few bytes while loading a chained program will return a CAN'T CONTINUE error, so I am leaning toward the latter. I just want to make sure these bytes are untouched while BASIC is running. Thanks for any help on this.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

In my simple, BASIC programs, I've used this area to store variables. I've never had any conflicts by doing so. My last game uses it to store high scores. I'm not sure what the real purpose is.
High Scores, Links, and Jeff's Basic Games page.
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Post by buzbard »

From Compute!'s Mapping the VIC:

Code: Select all

673-767       $2A1-2FF       USRVCTRS
                             (user storage)
User indirect vectors or other storage area.
Ninety-four bytes of memory are available in this area to the
user for 47 user-program indirect link addresses or for any other
purpose. This is an excellent area to store a short ML routine without
having to alter BASIC'S pointers.
Note that locations 673-678 ($2A1-2A6) are used in the Commodore 64,
so refrain from using these if you're writing a program
meant for both the VIC-20 and the Commodore 64.
I've used this area a lot for small ML routines, I usually avoid using 673-678 though, so the code will be compatible with the C64 since it uses those few bytes.
I haven't had any problem using this area before, so you should be ok to use it. Not sure why you would get the "CAN'T CONTINUE" error unless the loader is also using those bytes for something else.
Ray..
User avatar
freshlamb
Vic 20 Dabbler
Posts: 76
Joined: Sun Apr 04, 2004 5:38 pm
Website: http://www.rufnoiz.com
Location: Prince Albert SK Can

Post by freshlamb »

Just to clarify, I had problems when I stored stuff right at 673. When I left that byte and the next zeroed, and stored a little ML at 675, it SEEMED to be OK. I just want to be certain this area wasn't used. I think these two responces make me feel confident this area is safe. Thank you both so much.

btw/ Jeff thanks for this awesome site, and although I have mostly lurked here for 9 years, I have ALWAYS appreciated it. I hope someday I feel I have something worthwhile I can contribute to the community.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Very nice to meet you! According to the member list you were the 17th person to start an account here! When the forum was just over a month old!
High Scores, Links, and Jeff's Basic Games page.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

One post a year. BAN THE SPAMMER!
Vic20-Ian
Vic 20 Scientist
Posts: 1213
Joined: Sun Aug 24, 2008 1:58 pm

Post by Vic20-Ian »

ROFL - very good!
Vic20-Ian

The best things in life are Vic-20

Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

He will reply in 2014... :P
User avatar
Witzo
Vic 20 Afficionado
Posts: 381
Joined: Thu Dec 01, 2011 9:14 am
Location: The Hague

Post by Witzo »

freshlamb wrote:I hope someday I feel I have something worthwhile I can contribute to the community.
You already have: your post pointed me to this little piece of RAM usable when running BASIC programs. I have taken note and will likely use it in my projects.
Post Reply