Page 1 of 1

C64 38K of RAM

Posted: Wed May 11, 2011 8:38 pm
by administrator
I recently received an email that stated:
...The Truth is , there is 64K of RAM available but only when programming in Machine Code. In BASIC you can only directly access 38K, NOT because the Operating system is USING the remaining 16K, but because 16K of RAM is actually TURNED OFF by the PLA chip, so that the computer (CPU) Can access BASIC & The Operating Sytem (Kernal) ROM's.
Is that accurate? I always thought it was because BASIC used 16K.

Re: C64 38K of RAM

Posted: Mon May 16, 2011 8:20 pm
by administrator
come guys... someone must know this. Please give me your thoughts.

Re: C64 38K of RAM

Posted: Mon May 16, 2011 9:44 pm
by brain
38kB is available because:

$0000-$07ff is zpage, stack, screen RAM, temp buffers, etc. (2048)
$a000-$bfff is BASIC (8kB)
$c000-$cfff is RAM, but can't be used by BASIC (4kB)
$d000-$dfff is IO (4kB)
$e000-$ffff is KERNAL (8kB)

So, 26kB is lost to those things. That leaves 38kB available for BASIC.

BASIC uses 8kB, and KERNAL uses 8kB. Together they use 16kB.

But, later machines like the +4 also had 64kB of RAM, but was able to ofer 60kB for BASIC:

They would BANK the ROMs and IO out and allow BASIC statements to be in the RAM under those areas. You can use the same approach with the 64, and some utilities existed to do just that (SMORE BASIC did it)

Jim