How much RAM can the VIC address?

Modding and Technical Issues

Moderator: Moderators

Post Reply
User avatar
JohnnyRockets
Vic 20 Enthusiast
Posts: 178
Joined: Wed Jun 13, 2012 5:42 pm
Location: Michigan, USA
Occupation: IT Manager

How much RAM can the VIC address?

Post by JohnnyRockets »

I was thinking and doing a small amount of internet research and found that there were 64k RAM expansion cartridges available for the VIC-20.

This got me to thinking... How much RAM can the VIC address if the RAM could be "hooked" up appropriately to the VIC?

Could four 64k carts be put into an expansion board to give 256k?

Is there any limit for that matter?
Thanks!

JR


><>
16KVIC20
Vic 20 Nerd
Posts: 510
Joined: Tue Apr 06, 2010 5:02 am

Post by 16KVIC20 »

I thought I'd read the limit was 32k, so 35.5K, I suppose.

I don't actually know though.
User avatar
JohnnyRockets
Vic 20 Enthusiast
Posts: 178
Joined: Wed Jun 13, 2012 5:42 pm
Location: Michigan, USA
Occupation: IT Manager

Post by JohnnyRockets »

16KVIC20 wrote:I thought I'd read the limit was 32k, so 35.5K, I suppose.

I don't actually know though.
Yeah, I wonder if that "64K module" I read about wasn't just a couple 32k's put together in some fashion?

I think you are right, 35.5k seems to be the magic number.
Thanks!

JR


><>
wimoos
Vic 20 Afficionado
Posts: 350
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Post by wimoos »

The VIC has eight addressable blocks, called BLK0 to BLK7, of 8 Kilobytes each.

A stock VIC 20 comes with 5 K RAM in BLK0, of which 0,5 K is reserved for screen memory and 1 K for system usage (amongst which Zeropage, stack, command buffer, cassettebuffer).

Leaves 3.5K (3568 bytes) for your Basic program .

In BLK0 there is room for 3K RAM expansion.
BLK1, BLK2, BLK3 may be filled with RAM through expansion cartridges.

So, together you can add 27K RAM to a stock VIC, and with little effort you can get 30.5 K space for your Basic program.

BLK4 contains the character generator ROMS, the user I/O ports, the video chip and 4-bits wide RAM that holds screen character colors.
BLK5 is used for ROM-cartridges that start automatically when the VIC starts.
BLK6 contains the Basic interpreter ROM and BLK7 contains the VIC kernal.

A 64K module probably has physical or electronic switches to map 8K in each one of the BLKs BLK1, BLK2 or BLK3.

Regards,
Last edited by wimoos on Wed Nov 28, 2012 9:15 am, edited 1 time in total.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

The cpu can address 64k, but some of it is occupied by ROM, so you can at most have 5+8+8+8+8+3 = 40 kb plus the 4 bit color ram.

BUT it's of course possible to make a memory expansion with memory pages. For example, that a 16 k block of memory is accessible at a time depending on a register in the expansion. That way you could expand the vic-20 with gigabytes but that would not be much of a point in that I think. You would have to write special programs to make any use of it.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
TLovskog
Vic 20 Enthusiast
Posts: 194
Joined: Fri Mar 25, 2011 3:16 pm
Location: Kävlinge, Sweden

Post by TLovskog »

Yes. The CPU in the VIC in itself can only address 64k (16 bit address-bus). Of these only 32k (+3k) is available on the cartridge port.

Just as you say, these expansions have the ability to switch in and out different parts of the 64k to different parts of the VICs memory.

For example you could have 8 banks of 8K in the expansions 64K mapped (one at a time) to the cartridge area of the VIC. This would give you quick access to 8 different cartridges. Or you can have 4 8K cartridges available + full RAM expansion to the VIC, or ...

With the same technology you can have virtually any memory size.

The problem is that the programs that run in such huge memory, must be specifically written for them.

It may or may not (probably not) work with multiple 64K expansions. It all depends on how it was designed and the software running.
BR
Thomas Lövskog
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

TLovskog wrote: The problem is that the programs that run in such huge memory, must be specifically written for them.
Unless you use the RAM as a RAM disk for switching in parts of your program or data when needed. That way you could write a program that runs on original hardware (albeit slower) and benefit from RAM expansions like the Final Expansion 3. Unfortunately, the latter's bank switching mode limits speed of access to the extra RAM and SD2IEC + SJLOAD is almost equally fast.
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
TLovskog
Vic 20 Enthusiast
Posts: 194
Joined: Fri Mar 25, 2011 3:16 pm
Location: Kävlinge, Sweden

Post by TLovskog »

True ... but to use the expansion RAM as a RAMdisk you need a driver wedge for the kernal especially written for the expansion.
BR
Thomas Lövskog
Post Reply