Home Web Design Computing Music

CBM 5/6/700 - Basic 4+ RAM Chart

This chart shows how RAM was used by the system. Note that some locations had more than one usage and therefore more than one label. Some of the 500 labels were my own as, at the time, I could not find references - possibly, these have now come to light and, no doubt, someone will email me with the corrections. Unless specified, the locations were present in all machines whether 500 or 700, 128K or 256K. Many of the pointers were three bytes long of which the last was usually the Bank number.

In the chart below the Screen Editor RAM usage for the 500 and 6/700 is listed separately. The differences between the two versions is where keysiz was repositioned after the 500 ROM was finalised so that the function keys no longer got reset when the reset button was pressed. The 500 also had some extra vectors near the end.

The Inter-process communication (IPC) variables only exist when expansion memory was installed at $0800 onwards (this was part of the extra processor board).

Zero Page
LabelHexDecUsage
e65090006509 execution bank
i65090116509 indirection bank
usrpok02-042-4USR Jump vector
tmhour055TI$ calculations hour
tmmin066TI$ calculations minutes
tmsec077TI$ calculations seconds
tmten088TI$ calculations 10th seconds
form09-0B9-11Format pointer
integr0C12One-byte integer
charac0C12Search delimiting character (0 or $3A)
endchr0D13Another delimiting character (quote)
count0E14Counter used by I/P buffer, DOS filename length & other misc uses
xcnt0F15Number of DOS parameters to be set up
dimflg1016Indicates whether this is an array variable or not
valtyp1117Variable type : 0=numeric, 1=string
intflg1218Integer ($80) or Real ($00) flag
garbfl1319Flag for whether or not to do garbage collection
dores1319Flag for whether or not the 'Crunch' routine to convert keywords into tokens (or vice versa) is activated
subflg1420Flag for whether array variables are allowed (used by FOR etc)
inpflg1521$00=INPUT, $40=GET, $98=READ (input flag)
dsdesc16-1922-25Contains DS error and pointer+bank of DS$
channl1A26Current Input Channel (device) number
linnum1B-1C27-28Misc pointer, temp for line number etc.
temppt1D29Temppst relative offset to 1st free temp descr
lastpt1E-1F30-31Pointer to last-used str temporary
tempst20-2132-33Ptr to storage for 3 temporary descriptors.
index122-2434-36Direct cells for 1st indexing usage
index225-2737-39Direct cells for 2nd indexing usage
resho2840Result of multiplier and divider
resmoh2941
addend2A42Temp used by umult
resmo2A42
reslo2B43
2C44Overflow previous cells
txttab2D-2E45-46Pointer to the start of BASIC program
txtend2F-3047-48Pointer to the end of BASIC program
vartab31-3249-50Pointer to start of simple variable space
varend33-3451-52Ptr to end of simple variables (256k only)
arytab35-3653-54Pointer to start of array table
aryend37-3855-56Pointer end of arrays (192k, 256k only)
strend39-3A57-58End of storage in use.
fretop3B-3C59-60Top of string free space
frespc3D-3E61-62Pointer to new string
memtop3F-4163-65Highest location in memory
curlin42-4366-67Current line number
oldlin44-4568-69Old line no (set up by STOP/END in a program)
oldtxt46-4870-72Old text pointer
datlin49-4A73-74Data line number
datptr4B-4C75-76Pointer to data. initialised to point at the zero in front of (txttab) by CLR command. Updated by execution of a READ.
inpptr4D-4E77-78Remembers where input is coming from.
varnam4F-5079-80Current variable name
fdecpt5181Pointer into power of tens table.
varpnt51-5381-83Pointer to variable in memory
forpnt5484FOR loop pointer
lstpnt54-5684-86Pointer to list string (3 bytes).
vartxt5787Save current txtptr on read.
opptr57-5987-89Pointer to current op's entry in optab.
opmask5A90Mask created by current operation.
tempf35B91Temp float reg
grbpnt5B91Pointer used in garbage collection.
defpnt5B-5D91-93Pointer used in function definition.
dscpnt5E-6094-96Pointer to a string descriptor.
jmper61-6297-98Jump vector for functions
oldov6399The old overflow.
tempf164100Temp float reg/also various INSTR vars
arypnt64100Pointer used in array building.
highds64-66100-102Destination of highest element in blt.
hightr67-69103-105Source of highest element to move.
tempf26A106Temp float reg (5bytes)
lowds6A106Loc. of last byte transferred (3 bytes).
deccnt6B107Number of places before decimal point.
tenexp6C108Base ten exponent
grbtop6D109Pointer used in garbage collection.(3 bytes)
lowtr6D109Last thing to move in blt (3 bytes).
dptflg6E110Has a dec. pt been input
expsgn6F111Sign of exponent
dsctmp70112Temporary descriptors are built here. Dsctmp overlaps up to facmoh.
facexp71113Floating-point-accumulator (FAC) #1 exponent
facho72114Most significant byte of mantissa.
facmoh73115
indice74116Used by qint.
facmo74116
faclo75117
facsgn76118
degree77119Count used by polynomials.
sgnflg77119
bits78120Cell for shiftr to use.
argexp79121FAC #2
argho7A122
argmoh7B123
argmo7C124
arglo7D125
argsgn7E126
arisgn7F127A sign reflecting the result
facov80128Overflow byte of the FAC
81129Not used
strng282130Ptr to string or desc
polypt82130Ptr to polynomial coefficients
curtol82130Absolute linear index is formed here
fbufpt83-84131-132Pointer into buffer (cassette) used by fout
txtptr85-87133-135Pointer to current term (CHRGET ptr)
buffpt88-8A136-138Input buffer pointer
noze8B139Using's leading zero counter
parsts8B139Dos standard parser word
point8C140Using's pointer to decimal point
parstx8C140Dos aux parser word
seedpt8D-8F141-143
errnum8F143
fnadr90-92144-146Address of file name string
sal93-95147-149Current load/store address
eal96-98150-152End of load/save
stal99-9B153-155Start of load/save
status9C156I/o operation status
fnlen9D157File name length
la9E158Current logical index
fa9F159Current device number
saA0160Current secondary address
dfltnA1161Default input device
dfltoA2162Default output device
tape1A3-A5163-165Address of tape buffer
ribufA6-A8166-168Input buffer pointer
stkeyA9169Stop key flag
ctempAA170Used to reduce cassette read times
c3poAA170IEEE buffer flag
snsw1AB171Used to reduce cassette read times
bsourAB171IEEE character buffer
synoAC172Cassette
dpswAD173Cassette
ptr1AE174Cassette index to pass1 errors
pchAE174Mon program counter high
ptr2AF175Cassette index to pass2 errors
pclAF175Monitor program counter lo
flgsB0176Processor status
accB1177Accumulator
xrB2178.X register
cntdnB2178Monitor counter
yrB3179.Y register
spB4180Stack pointer
xi6509B5181Old indirection segment
re6509B6182Return execution segment
invhB7-B8183-184User interrupt vector
tmp0B9-BA185-186Monitor temp ptr
tmp2BB-BC187-188Monitor temp ptr
tmpcBD189Place to save last cmd
t6509BE190Temporary i6509
ddiskBF191Default disk unit # for monitor
cdataBF191How to turn cassette timers on
pkybufC0-C1192-193Start address of function key buffer
keypntC2-C3194-195Current function key pointer
sedsalC4-C5196-197Scroll pointer 1
sedealC6-C7198-199Scroll pointer 2
pntC8-C9200-201Current character pointer
tblxCA202Cursor line
pntrCB203Cursor column
grmodeCC204Graphic/text mode flag
lstxCD205Last character index
lstpCE206Screen edit start position
lsxpCF207
crswD0208INPUT or GET from the keyboard
ndxD1209Index to keyboard queue
qtswD2210Quote mode flag
insrtD3211Inserts outstanding
gdblnD4212Character under cursor (500)
configD4212Cursor type (6/700)
indxD5213Last byte position of line
kyndxD6214Count of program key string
rptcntD7215Delay between chars
delayD8216Delay to next repeat
sedt3D9217Used by f.keys (500 only, 6/700 = $03b7)
sedt1D9217Frequently used temp variables
sedt2DA218Frequently used temp variables
dataDB219Current print data
sctopDC220Top screen 0-25
scbotDD221Bottom 0-25
sclfDE222Left margin
scrtDF223Right margin
modkeyE0224Keyscan mode ($ff = no key down last scan)
norkeyE1225Keyscan normal ($ff = no key down last scan)
bitablE2-E5226-229Wrap bitmap
blnswE6230Cursor blink switch (500 only)
blnctE7231Cursor blink countdown (500 only)
userE8-E9232-233Colour memory pointer (500 only)
color2EA234Colour ? (500 only)
blnonEB235Cursor blink phase (500 only)
colorEC236Text colour (500 only)
gdcolED237Colour of chr under cursor (500 only)
edsaveEE238Save for various editor routines (500 only)
tbankEF239Bank for text screen (500 only)
F0-FF240-255Not used.
Stack
LabelHexDecUsage
stack0100-01FF256-511Processor stack
 
LabelHexDecUsage
vspbuf0200-020F512-527Buffer used to interface with vsp. Filename usage.
dosf1l0210528Dos file name 1 length
dosds10211529Dos disk drive 1
dosf1a0212-0213530-531Dos file name 1 address
dosf1b0214532Dos file name 1 bank
dosf2l0215533Dos file name 2 length
dosds20216534Dos disk drive 2
dosf2a0217-0218535-536Dos file name 2 address
dosf2b0219537Dos file name 2 bank
dosbnk021A538Dos bank number
dosofl021B-021C539-540Dos low offset (bsave,bload)
dosofh021D-021E541-542Dos high offset (bsave)
dosla021F543Dos logical address
dosfa0220544Dos physical address
dossa0221545Dos secondary address
dosrcl0222546Dos record length
dosdid0223-0224547-548Dos disk identifier (ID)
didchk0225549Dos ID flag
dosstr0226550Dos output string buffer
dosspc0227-0254551-596Space used by dos routines to build up command
trmpos0255597Cursor column on crt
andmsk0255597Mask used by wait
eormsk0256598Mask used by wait
dfbank0257599Default bank number
dolu0258600Default output logical unit (0 => not std output) keeps DS + dir ok
tansgn0259601Used in determining sign of tan
ldaabs025A-025D602-605LDA abs routine (see initat)
tttemp025B603Temporary store
 
LabelHexDecUsage
hulp025E606Print Using: Counter
bnr025F607Print Using: Pointer to begin no
enr0260608Print Using: Pointer to end no
dolr0261609Print Using: Dollar flag
flag0262610Print Using: Comma flag
swe0263611Print Using: Counter
usgn0264612Print Using: Sign exponent
uexp0265613Print Using: Pointer to exponent
vn0266614Print Using: # digits before decimal point
chsn0267615Print Using: Justify flag
vf0268616Print Using: # pos before dec point (field)
nf0269617Print Using: # pos after dec point (field)
posp026A618Print Using: +/- flag (field)
fesp026B619Print Using: Exponent flag (field)
etof026C620Print Using: Switch
cform026D621Print Using: Char counter (field)
sno026E622Print Using: Sign no
blfd026F623Print Using: Blank/star flag
begfd0270624Print Using: Pointer to begin of field
lfor0271625Print Using: Length of format
endfd0272626Print Using: Pointer to end of field
pufill0273627Print Using: Fill symbol
pucoma0274628Print Using: Comma symbol
pudot0275629Print Using: Decimal point symbol
pumony0276630Print Using: Monetary symbol
 
LabelHexDecUsage
ierror0280-0281640-641Vector: Error routine, output err in .X
imain0282-0283642-643Vector: Interpreter main loop
icrnch0284-0285644-645Vector: Tokenisation routine
iqplop0286-0287646-647Vector: Token output expander routine
igone0288-0289648-649Vector: Dispatcher
ieval028A-028B650-651Vector: Eval routine
ifrmev028C-028D652-653Vector: Frmevl routine
ichrgo028E-028F654-655Vector: Chrgot routine
ichrge0290-0291656-657Vector: Chrget routine
adray10292-0293658-659Vector: Convert float -> integer
adray20294-0295660-661Vector: Convert integer -> float
trapno0296-0297662-663Vector: Error trap
 
LabelHexDecUsage
errlin0298-0299664-665Holds line # of last error
errtxt029A-029B666-667Text pointer at time of error
oldstk029C668Stack pointer before execution of last instruction
tmptrp029D669Used to save hi byte of trap line >trap & <resume
dsptmp029E670Temporary for dispose
oldtok029F671Temporary for dispose
tmpdes02A0-02A5672-677Temporary for instr$
highst02A6-02A7678-679Max offset for any user bank
msiism02A8680Used to save length of string to be added in garbage collect
 
LabelHexDecUsage
cinv0300-0301768-769Vector: IRQ
cbinv0302-0303770-771Vector: BRK
nminv0304-0305772-773Vector: NMI
iopen0306-0307774-775Vector: Open file
iclose0308-0309776-777Vector: Close file
ichkin030A-030B778-779Vector: Open channel in
ickout030C-030D780-781Vector: Open channel out
iclrch030E-030F782-783Vector: Close channel
ibasin0310-0311784-785Vector: Input from channel
ibsout0312-0313786-787Vector: Output to channel
istop0314-0315788-789Vector: Check STOP key
igetin0316-0317790-791Vector: Get from queue
iclall0318-0319792-793Vector: Close all files
iload031A-031B794-795Vector: Load from file
isave031C-031D796-797Vector: Save to file
usrcmd031E-031F798-799Vector: Monitor extension
escvec0320-0321800-801Vector: User esc key
ctlvec0322-0323802-803Vector: Unused control key
 
LabelHexDecUsage
isecnd0324-0325804-805IEEE listen secondary address
itksa0326-0327806-807IEEE talk secondary address
iacptr0328-0329808-809IEEE character in routine
iciout032A-032B810-811IEEE character out routine
iuntlk032C-032D812-813IEEE bus untalk
iunlsn032E-032F814-815IEEE bus unlisten
ilistn0330-0331816-817IEEE listen device primary address
italk0332-0333818-819IEEE talk device primary address
 
LabelHexDecUsage
lat0334-033D820-829Logical file numbers
fat033E-0347830-839Device numbers
sat0348-0351840-849Secondary addresses
 
LabelHexDecUsage
lowadr0352-0354850-852Pointer to start of system memory
hiadr0355-0357853-855Top of system memory
memstr0358-035A856-858Start of user memory
memsiz035B-035D859-861Top of user memory
 
LabelHexDecUsage
timout035E862Ieee timeout enable
verck035F863Load/verify flag
ldtnd0360864Device table index
msgflg0361865Message flag
bufpt0362866Cassette buffer index
t10363867Kernal temp value 1
t20364868Kernal temp value 2
xsav0365869Temporary .X save
savx0366870Temporary .X save
svxt0367871Kernal temp value
temp0368872Kernal temp value
alarm0369873IRQ variable holds 6526 irq's
itape036A-036B874-875Indirect for cassette code
cassvo036C876Cassette read variable
aservo036D877Flagt1 (indicates t1 timeout cassette read)
caston036E878How to turn on timers
relsal036F879Moveable start load address for cassette lo
relsah0370880Moveable start load address for cassette hi
relsas0371881
oldinv0372-0374882-884Restore user irq and i6509 after cassettes
cas10375885Cassette switch flag
 
LabelHexDecUsage
m51ctr0376886RS-232: 6551 control image
m51cdr0377887RS-232: 6551 command image
0378-0379888-889RS-232: Other two RS232 characters stored here
rsstat037A890RS-232: Status
dcdsr037B891RS-232: Last dcd/dsr value
ridbs037C892RS-232: Input start index
ridbe037D893RS-232: Input end index
037E-037F894-895Unused
Screen editor (6/700 only)
LabelHexDecUsage
pkyend0380-0381896-897Program key buffer end address
keyseg0382898Segment number for function key ram page
keysiz0383-0396899-918Function key sizes
rvs0397919Reverse field flag
lintmp0398920Line # between in and out
lstchr0399921Last char printed
insflg039A922Auto insert flag
scrdis039B923Scroll disable flag
fktmp039C924Function key temporary
bitmsk039C924Temporary bit mask
keyidx039D925Index to programmables
logscr039E926Logical/physical scroll flag
bellmd039F927Flag to turn on end of line bell
pagsav03A0928Temp ram page
tab03A1-03AA929-938Tab stop flags 1-bit each (80 max)
keyd03AB-03B4939-948Keyboard character queue
funvec03B5-03B6949-950Indirect jump vector for function keys
sedt303B7951Another temp used during function key listing
Screen editor (500 only).
LabelHexDecUsage
pkyend0380-0381896-897Program key buffer end address
keyseg0382898Segment number for function key ram page
rvs0383899Reverse field flag
lintmp0384900Line # between in and out
lstchr0385901Last char printed
insflg0386902Auto insert flag
scrdis0387903Scroll disable flag
fktmp0388904Function key temporary
bitmsk0389904Temporary bit mask
keyidx038A905Index to function keys
logscr038B906Logical/physical scroll flag
bellmd038C907Flag to turn on end of line bell
pagsav038D908Temp ram page
keysiz038E-03A0909-928Function key sizes
tab03A1-03AA929-938Tab stop flags 1-bit each (80 max)
keyd03AB-03B4939-948Keyboard character queue
funvec03B5-03B6949-950Indirect jump vector for function keys
c5vec103B7-03B8951-952Vector to store chr on screen (my mnemonic)
c5vec203B9-03BA953-954Vector to store colour in colour memory
c5vec303BB-03BC955-956Spare vector
c5vec403BD-03BE957-958Spare vector
c5xtra03BF959Flag??
 
LabelHexDecUsage
evect03F8-03F91016-1017Start up vector (either $8000 or $E000 or cartridge)
warm03FA1018Warm start flag ($A5 for warm else cold start)
winit03FB1019Initialisation complete flag ($5A if done)
 
LabelHexDecUsage
ipb0800-080F2048-2063IPC: buffer
ipjtab0810-090F2064-2319IPC: jump table
ipptab0910-098F2320-2448IPC: param spec table