Home
CBM
  ASCII-X
  BASIC
    Disk Commands
    Enter RUN mode
    Program Format
    Secret Variables
    Variable Format
    Expressions
    Keywords
    Syntax
    Tokens
  C128
  D64plus
  Disk
  Escape Codes
  Hardware
  PCxface
  PETSCII
  Pet2asc
Futurama
IBM PC-AT
Contact
Games
Glossary
Hall of fame
Hall of shame
Miscellaneous
Privacy policy
Programming
Twisty puzzles
If you've ever written software of any reasonable complexity (something more useful than "Hello World") then you're probably aware that software typically has many internal or "secret" variables.  These are never (directly) exposed the user.  This is, generally speaking, good software design: hiding the complexity of the software (i.e., hiding trivial variables) makes it easier to use and easier to upgrade.  The CBM BASIC interpreter (really, almost any BASIC implementation) is software itself (which in this case lets you create BASIC software).
 
So on the one hand, "secret" variables should come as no suprise.  On the other hand, CBM BASIC (indeed, every BASIC that I know) includes "secret" variables that are important to the programmer but not directly accessibly.  These are usually "write-only" variables; which is to say BASIC allows you some way to change them, but BASIC provides no direct way to read them.  (In rare cases, they are read-only or completely hidden.)  This is bad because if you need to know it/their value(s) in a program, then you have only a few "bad" choices:
  1. Use machine-specific PEEKs (bad because it is non-portable)
  2. Maintain a normal variable ("shadow") that mimics the hidden variable (bad because this is very error-prone)
  3. Use knowledge of BASIC's internal behavior to anticipate the value (bad because it may be non-portable AND is error-prone) 
Most BASIC software I have seen relies on option #3.  On the one hand, this is the worst method because it allows for the greatest chance of failure.  I'm guessing the reason for its popularity is that it is the fastest method (because you are neither PEEKing nor maintaining a "shadow").
 
Below is a table listing some important "secret variables" of BASIC.  Some versions of BASIC lack the features that need an associated "secret variable" and they are indicated with "n/a".  Note that some of them are actually maintained by the KERNAL and not the BASIC interpreter.  By looking at the table, you will see that virtually all secret variables are located at a machine-specific location, which makes their use non-portable (unless you include special detection code and act appropriately).  The different values are listed under PEEK (POKE) Address; the column "CBM-II" refers to the "business" line of machines with various names in different countries (these machines are pretty easy to recognize because they power-up in lower/upper case PETSCII font, unlike all the others which default to upper/graphic ASCII-X font); the TED column refers to the C16 and Plus/4.
 
This is definately not a complete list!  Many things maintained by the system are not important to a BASIC programmer (mainly temporary values and indirect pointers) and thus are not included.  For example the BASIC Text Pointer is very important to the BASIC interpreter, but not very relevant to the BASIC programmer (mainly because it is constantly changing while a program runs).  The same is true of the floating-point accumulator; so I would not normally include it in such a listing, but it is specifically needed by the USR function.  In other words, I've tried to keep the list short, but with 110 entries (assuming I counted correctly) it seems I'm not good at picking relevant entries or CBM BASIC is littered with secret variables.  Check out the list and decide for yourself!
 
Secret VariableTypePEEK (POKE) AddressRead
method
Write
method
Default
Value
Note(s)
PETCBM-IIVIC-20C64TEDC128
CPU P registerByte?none!?78320375RREGSYS0 ?RREG/SYS access only with C128
CPU A registerByte?none!?78020346RREGSYS0 ?RREG/SYS access only with C128
CPU X registerByte?none!?78120357RREGSYS0 ?RREG/SYS access only with C128
CPU Y registerByte?none!?78220368RREGSYS0 ?RREG/SYS access only with C128
File#Byte?26?19 ?19 ?21noneCMD00 = keyboard input and screen output
Start of Text
"TxtTab"
Unsigned Word40 ~ 4145 ~ 46?43 ~ 4443 ~ 4445 ~ 46noneGRAPHICvariesGRAPHIC only in v3.5 and v7.0
End of Text
"TxtEnd"
Unsigned Wordn/a47 ~ 48n/an/an/a4624 ~ 4625FRECLR, DELETE, DLOAD, LOAD, NEW, RUNvariesFor machines with more than 64K RAM, this refers to Bank 0 (program text).  For machines with 64K or less RAM, this is equivalant to Start of Variables.
FRE() only gives a value indirectly.
Start of Variables
"VarTab"
Unsigned Word42 ~ 4349 ~ 50?45 ~ 4645 ~ 4647 ~ 48noneCLR, DELETE*, DLOAD, LOAD, NEW, RUNvaries(D)LOAD does not update this when executed in a program. *DELETE only affects machines with 64K or less.
Limit of Scalars
"VarEnd"
Unsigned Wordn/a 51 ~ 52n/an/an/an/aFRE(2) CLR, DLOAD, LOAD, NEW, RUNStart of variables For machines with more than 192K.  Other machines use Start of Arrays
Start of Arrays
(Limit of Scalars)
"AryTab"
Unsigned Word44 ~ 4553 ~ 54?47 ~ 4847 ~ 4849 ~ 50noneCLR, DELETE*, DLOAD, LOAD, NEW, RUNStart of variables(D)LOAD does not update this when executed in a program. *DELETE only affects machines with 64K or less.
Limit of Arrays
"AryEnd"
Unsigned Wordn/a55 ~ 56n/an/an/an/aFRE(3)CLR, DLOAD, LOAD, NEW, RUNStart of ArraysFor machines with more than 128K.  Other machines use Free Space. 
Free Space
(Limit of Arrays)
"StrEnd"
Unsigned Word46 ~ 4757 ~ 58?49 ~ 5049 ~ 5051 ~ 52FRECLR, DELETE*, DLOAD, LOAD, NEW, RUNStart of arrays
+Size of arrays
(D)LOAD does not update this when executed in a program.
FRE() only gives a value indirectly. *DELETE only affects machines with 64K or less.
Start of Strings
"FreTop"
Unsigned Word48 ~ 4959 ~ 60?51 ~ 5251 ~ 5253 ~ 54FRECLR, DELETE*, DLOAD, LOAD, NEW, RUNEnd of Variables(D)LOAD does not update this when executed in a program.  Note this value grows "down" in memory.
FRE() only gives a value indirectly. *DELETE only affects machines with 64K or less.
Limit of Variables
"MemTop"
Unsigned Word52 ~ 5363 ~ 65?55 ~ 5655 ~ 5657 ~ 58FREnoneStart of StringsFor machines with over 64K RAM, this refers to the limit of variables (Bank 1 in the C128).  For machines with 64K or less RAM, it is the limit of BASIC (program text plus variables).  In either case, it is a memory limit.
FRE() only gives a value indirectly
Limit of Text
(Points to input buffer on CBM-II)
Unsigned Wordn/a136 ~ 137n/an/an/a4626 ~ 4627 FREnonevaries This is for machines with more than 64K RAM; it refers to the limit of program text. In other words, should End of Text (attempt) to exceed this value, an OUT OF MEMORY error is generated.  For machines with 64K or less RAM, this is equivalant to Start of Strings.  In either case, they are a memory limit.
FRE() only gives a value indirectly
Current Line#Unsigned Word?66 ~ 67?57 ~ 5857 ~ 5859 ~ 60COLLISION, ELSEGOSUB, GOTO, LOOP, NEXTRESUME, RETURNRUN, THEN, TRAPnoneThe value here is always valid (when a program is running) and is saved to another location (the reserved variable EL) when an error occurs.
COLLISION, LOOP, NEXT, RETURN and TRAP update this value indirectly.
DATA line#Unsigned Word?72 ~ 73?63 ~ 6463 ~ 6465 ~ 66noneRESTORE, RUNfirst line of program 
DATA pointerUnsigned Word?74 ~ 75?65 ~ 6665 ~ 6667 ~ 68noneRESTORE, RUNstart of first line of programRESTORE lineNumber will set this to the start of the specified lineNumber
Stop Line#Unsigned Word?68 ~ 69?59 ~ 60601 ~ 6024608 ~ 4609nonenonevariesSet to the current line# whenever the END or STOP statements are encountered or the user presses the STOP key.  Intended for use with CONT
Stop AddressUnsigned Word?70 ~ 71?61 ~ 62603 ~ 6044610 ~ 4611nonenonevariesSave the value of TextPointer (actual RAM address) for use with CONT (see above). 
Error Line#Unsigned Wordn/a664 ~ 665n/an/a?4617 ~ 4618EL, HELPCLR, RESUME, any program error65535Saved Line# where last error occured.  This is not really a secret because of "public" EL, however the related TRAP Address (see below) is a secret.
Error AddressUnsigned Wordn/a666 ~ 667n/an/a1269 ~ 12704622 ~ 4623noneany errorvariesSaves the value of TextPointer (actual RAM address) for use by HELP and RESUME.  The address points to the token that generated the error.
TRAP Line#Unsigned Wordn/a662 ~ 663n/an/a1266 ~ 12674619 ~ 4620noneTRAP65280Line# to 'GOSUB' when an error occurs.  If the high-byte is 255 then error trapping is not enabled.  This may be due to either no TRAP routine was set, or TRAP has been disabled (such as when an error first occurs, to prevent recursion).
Enable TraceByten/an/an/an/a7474463noneTRON, TROFF0A non-zero value (TRON sets 255) enables "tracing" of a running program.  A zero value (set by TROFF) disables program tracing. 
Collision Line# Low BytesByte[3]n/an/an/an/an/a4729 ~ 4731noneCOLLISIONnone! Holds the low-byte of the BASIC line# to be called (like GOSUB) when a VIC-II event occurs and COLLISION is enabled.  The 3 events are: sprite-sprite collision, sprite-foreground collision, and light-pen triggered.  Set by COLLISION.  Used by the main BASIC loop (in program mode only). 
Collision Line# High BytesByte[3]n/an/an/an/an/a4732 ~ 4734noneCOLLISIONnone! Holds the high-byte of the BASIC line# to be called (like GOSUB) when a VIC-II event occurs; see above. 
Collision ControlByten/an/an/an/an/a4735noneCOLLISION, enter RUN mode0The low 3 bits determine which type of VIC-II event(s) will cause a program to call a subroutine (like GOSUB).  An event is enabled when a bit is set (1).  All three bits are set by COLLISION.  When the BASIC main loop actually calls the subroutine, bit 7 is set (to prevent recursion) and the next RETURN will clear bit 7. Cleared to zero when entering program mode (typically with RUN).
AUTO valueUnsigned Wordn/an/an/an/a115 ~ 116116 ~ 117noneAUTO, CONT, GOSUB, GOTO, RUN0Every write method except AUTO sets the value to 0
USR Vector
"UsrPok"
Unsigned Word?3 ~ 4?785 ~ 7861281 ~ 12824633 ~ 4634nonenonevariesThis is a pointer to some machine language routine that runs whenever USR is called.  The default routine will print an error message.
SeedPacked Float???139 ~ 1431283 ~ 12874635noneRNDvariesThis is a floating-point value used to generate the next random number when the argument to RND is zero.  This value may be set by giving a negative argument to RND. 
FAC (USR value)Unpacked
Float
?113 ~ 118?97 ~ 10297 ~ 10299 ~ 104manymanynoneThis is the Floating Point Accumulator and is used by nearly all numeric operations of BASIC.  In particular, it holds the argument to USR function, and the result of the function should be stored in FAC as well.
BASIC top-of-stackUnsigned Wordn/an/an/an/a124 ~ 125125 ~ 126noneDO, FOR, GOSUB, LOOP, NEXT, RETURNC128: 2559, TED: 1968Most versions of CBM BASIC use the CPU stack for DO / FOR / GOSUB.
CPU top-of-stackByten/a668n/an/a1271?130noneeverything, RESUME, RUNvariesAlmost everyting affects the CPU stack pointer; in particular, an error TRAP will (effectively) save the value, RESUME will (literaly) restore it, and RUN will reset it.
Current BankByten/a599n/an/an/a981noneBANK15Holds the Bank# to be used by various commands: BOOT, BLOAD, BSAVE, FETCH, PEEK, POKE, STASH, SWAP, SYS, WAIT.
RUN ModeByte?67??129127CONT, END, GOSUB, GOTO, LOOP, NEXTRETURN, RUN, STOP0A value of zero indicates direct mode; except CBM-II, a value less than 255 indicates RUN mode.  See also Enter RUN Mode.
I/O StatusByte?156?144144144STvaries0Updated by any non-keyboard or non-screen I/O; reading the reserved variable ST will reset this secret variable to zero
EnableByte 673? 673 1998? 2000?2575 none none varies Bit 0 (value 1) is set when transmitting RS-232 data 
Number of OPEN filesByte?864?152151152noneAPPEND, CLOSE, CLR, COLLECT, DCLEAR, DCLOSE, DOPEN, OPEN, RUN0(D)OPEN normally increases this value by 1; DOPEN a REL files increases it by 2;
DCLEAR decreases this value based on the number files opened on the particular device;
CLR and RUN reset the value to 0.
Input DeviceByte?161?153152153noneGET#, INPUT#0Default is the keyboard
Output DeviceByte?162?154153154noneCMD, PRINT#3Default is the (active) display screen
DosFAByte n/a 544 n/a n/a 631284 none Disk Commands8?Used by DS and DS$.  On the C128, this is located in the cassette error pass log, so reading from cassette may foul-up DS or DS$... possibly locking up the system.  On any system it is not updated by CLOSE, CMD, GET#, LOAD, OPEN, PRINT#, SAVE, or VERIFY. 
DS DescriptorString descriptor n/a 22 ~ 25n/a n/a 122 (indirect) DS, DS$Disk commands, CLOSE, CMD, GET#, INPUT#, LOAD, OPENPRINT#, SAVE, VERIFY null descriptorThis describes a string which is the most recently read "disk" error/status message (actually any device 8 to 11, channel 15).  The descriptor is cleared (null string) for any of the listed write methods.  Some of the disk commands will later (after null) read a new string from the device.  It is referenced by DS and DS$; if the descriptior is null, the error/status channel is read into a new string.
Message ModeByte???157129157noneerror, CONT, END, GOSUB, GOTO, RUN, STOP0 (RUN mode)
128 (direct mode)
Enables messages such as SEARCHING FOR and LOADING.  When you enter the built-in MONITOR, this value is set to 192, which results in cryptic IO ERROR numbers in some cases.
Start AddressUnsigned Wordn/a?n/an/a178 ~ 179172 ~ 173noneBOOT, BLOAD, BSAVE, DLOAD, DSAVE, DVERIFY, LOAD, SAVE, VERIFYvariesBOOT, BLOAD, BSAVE and the ML-versions of LOAD and VERIFY set this value based on the value in the file header by default (BOOT, BLOAD, BSAVE have parameters to specify a specific value).  The BASIC-versions of LOAD, SAVE, and VERIFY set it to the Start of Text.
End Address
(plus 1)
Unsigned Word???174 ~ 175157 ~ 158174 ~ 175noneBOOT, BLOAD, BSAVE, DLOAD, DSAVE, DVERIFY, LOAD, SAVE, VERIFYvariesThe listed write methods set the value to the last address loaded/saved/verified plus one.
Last DeviceByte?159?186174186nonevaries0Set by the most recent I/O command (except PRINT, GET, GETKEY, and INPUT)
RS-232 Input Buffer PointerUnsigned Word???247 ~ 248?200 ~ 201noneCLOSE*, OPEN*varies*On the C128, the default is 3072 ($C00); Dynamically set on C64 by OPEN and CLOSE.
RS-232 Output Buffer PointerUnsigned Word???249 ~ 250?202 ~ 203noneCLOSE*, OPEN*varies*On the C128, the default is 3328 ($D00); Dynamically set on C64 by OPEN and CLOSE.
Cursor RowByte?202?214205235nonevariesnoneAnything that writes to the screen can update this value.  CHAR can set a specific value.
Cursor ColumnByte?203?211202236POSvariesnoneAnything that writes to the screen can update this value; only TAB() and CHAR can set a specific value.
Cursor OffByte???20413402599noneEND, INPUT, STOPvariesA zero value enables the text screen cursor (not C128 80-column mode); a non-zero value hides it.  In direct mode, or during program INPUT, the value is 0 so the user can see where (s)he is typing. A non-zero value is present during normal program execution so the cursor is hidden. 
Bottom of WindowByten/a221n/an/a2021228noneCMD, PRINT, PRINT#, WINDOW18A zero-based physical line number.  Can be set with WINDOW command or by printing "ESC B" [CHR$(27);"B"].
Top of WindowByten/a220n/an/a2022229noneCMD, PRINT, PRINT#, WINDOW0A zero-based physical line number.  Can be set with WINDOW command or by printing "ESC T" [CHR$(27);"T"].
Left of WindowByten/a222n/an/a2023230noneCMD, PRINT, PRINT#, WINDOW0A zero-based physical column number.  Can be set with WINDOW command or by printing "ESC T" [CHR$(27);"T"].
Right of WindowByten/a223n/an/a2024231noneCMD, PRINT, PRINT#, WINDOW39 (most), 79 (C128 80-column)A zero-based physical column number.  Can be set with WINDOW command or by printing "ESC T" [CHR$(27);"T"].
Vertical WrapByten/a923n/a658 ?2025248noneCMD, PRINT, PRINT#0A value of 128 or more enables vertical wrap: printing past the last line of the screen will resume on the top screen line.  A value less than 128 enables the classic behavior: the text scrolls up one (or more) lines when printing goes past the last screen line.  Printing "ESC M" [CHR$(27);"M"] will enable vertical wrap, while "ESC L" [CHR$(27)"L"] sets normal line scrolling.
Text AttributeByte???646 ?1339241RCLR, RLUMCMD, COLOR, PRINT, PRINT#variesRCLR only returns the color; on the TED series, RLUM returns the luminance.  Other attribtues may present: Flashing characters for the TED series, and C128 80-column mode may include Flashing, Underline, Reverse, and Alternate Font bits.  COLOR can't change the non-color (or non-luminance) attributes. CMD/PRINT# can only write this value if the fileNumber refers to the screen.
Rvs OnByte?919?199194243noneCMD, PRINT, PRINT#0A non-zero value enables reverse-font.  Set to non-zero by printing "Reverse on" CHR$(18).  Clear to zero by printing "Reverse off" CHR$(146) or [Shift]Return CHR$(13) [or CHR$(147)].
Quote ModeByte?210?212203244noneCMD, PRINT, PRINT#0A non-zero value enables "quote mode" where control characters appear as reverse-font characters. This value is toggled on/off by printing (or typing) a double-quote ("), CHR$(34). It is zeroed by [Shift]Return, CHR$(13) [or CHR$(147)].
Insert ModeByte?211?216207245noneCMD, PRINT, PRINT#0A non-zero value enables "insert mode" where control characters appear as reverse-font characters (similar to quote mode). This value is increased by each printing (or typing) an INSert code, CHR$(148) and is decreased (until 0) by printing/typing any other character. It is zeroed by [Shift]Return, CHR$(13) [or CHR$(147)].
Auto-InsertByten/a922n/an/a2026246noneCMD, PRINT, PRINT#, RUN0A non-zero value enables "auto-insert mode". Unlike (manual) "Insert Mode", control characters operate normally. Printing "ESC A" [CHR$(27);"A"] sets this to non-zero.  Printing "ESC C" [CHR$(27);"C"] or  or entering RUN mode clears it to zero.
Scroll LockByten/a?n/an/a2402593nonenone0A non-zero value will prevent output to the screen, effectively halting a program using PRINT.  Unlike similar flags dealing with screen output, there are no control codes to change this value!  Without resorting to POKE, only the user can toggle the value on/off with Control+S key combination or (C128) the NO SCROLL key.
Repeat ModeByte???65013442594nonenonevariesControls which keyboard keys will repeat when held down: 0 = few (space, cursor, insert, delete), 64 = none, 128 = all.
Font LockByte???657 ?1351247noneCMD, PRINT, PRINT#0A non-zero value locks the current font, so it can not be changed by pressing C= and Shift keys (font can still be changed with other methods).  The CHR$ code needed to enable / disable the lock varies by machine.  See the ASCII-X or PETSCII tables.
Disable BellByten/a?n/an/an/a249noneCMD, PRINT, PRINT#0(C128 Only) A value of 128 or more will disable the "ASCII Bell", otherwise it is enabled (a little beep generated when Control-G = CHR$(7) is printed or typed).  Printing "ESC H" [CHR$(27);"H"] will set this to 128 and disable the bell; while "ESC G" [CHR$(27);"H"] will clear this and enable the bell.
Last CharacterCharn/a219n/an/a2027240nonevariesnoneAnything that writes to the screen updates this value; used to recognize ESCape key sequences. 
Keyboard BufferByte[10]?939 ~ 948?631 ~ 6401319 ~ 1328842 ~ 851GET, GETKEY, INPUTnoneKeys pressed by the user are stored here until they can be processed.  Some programs will PRINT instructions on the screen and POKE a Return-key-code (or multiple Returns) here and then END so that BASIC will execute the PRINTed instructions as if the user had typed them.  Needed for some BASIC statements that "fail" in program mode.
Number of buffered keysByte?209?198239208noneGET, GET#, GETKEY, INPUT, INPUT#0GET# and INPUT# only write a new value if the fileNumber refers to the keyboard
Shift flagByte?224?6531348211nonenone0
Indicates which (if any) of ALT, C=, CAPS LOCK, CTRL, or SHIFT[lock] key(s) are currently pressed
Key CodeByte?225?197 ?2038212GET, GET#, GETKEY, INPUT, INPUT#none64 (most)
88 (C128)
A machine-specific code indicating which key is currently is pressed; if none the default value is present.  Some keys (like RESTORE and SHIFT) do not update this.  The listed read methods will translate the Key Code into a PETSCII value, but they will return the value of any buffered keys first, and GET# / INPUT# only apply if the fileNumber refers to the keyboard.
Function Key LengthsByte[varies]n/a899 ~ 918n/an/a1375 ~ 13824096 ~ 4105noneKEYvariesSee note below
Function Key DefinitionsByte[varies]n/a64512 ~ 65022n/an/a1383 ~ 15114106 ~ 4351noneKEYvariesThere is no real way to get the values; KEY can be used to display them, but the result can't be used (like assigned to a variable).
PRINT USING Virtual Characters
"PUchrs"
Char[4]n/a627 ~ 630n/an/a1255 ~ 12584612 ~ 4615nonePUDEFSpace, Comma, Period, DollarThese are the actual characters that will be used by PRINT USING when it needs to print a corresponding virtual character.  For example, you can use PUDEF to change the monetary symbol from the default dollar ($) to British Pound (£) or some other character.  However BASIC provides no way to determine the current assignment(s).
Screen StartByte???64813422619nonenone4 (many) 12 (TED)The high-byte of the start of the text screen; used by the screen editor.  To relocate the text screen in RAM, not only this value, but chip register(s) must be changed too.  On the C128, this only applies to the 40-column screen. 
Screen Start 80Byten/an/an/an/an/a2606nonenone0(C128 Only) The high-byte of the start of the 80-column text screen; used by the screen editor.  To relocate the text screen in RAM, not only this value, but chip registers must be changed too 
Color Start 80Byten/an/an/an/an/a2607nonenone8(C128 Only) The high-byte of the start of the 80-column attributes; used by the screen editor.  To relocate the attributes in RAM, not only this value, but chip registers must be changed too 
PAL / NTSCByte???678?2563nonenonevariesZero indicates an NTSC system; non-zero indicates (most) PAL systems.  Unknown value for the rare "PAL-M" system.  This may be important for using reserved variable TI or generating SOUND. 
Bitmap allocatedByten/an/an/an/a117118noneGRAPHIC0 
Split RasterByten/an/an/an/an/a2612noneGRAPHIC208(C128 Only) This value determines the start of the text-mode part of a split-screen.  Value = 48 + 8 * Text_Row (0-based row#).  Although the Plus/4 has split-screen, the text part appears at a fixed location.
SCALE XUnsigned Wordn/an/an/an/an/a137 ~ 138noneSCALE20480 (high-res)
10240 (multi-color)
 
SCALE YUnsigned Wordn/an/an/an/an/a139 ~ 140noneSCALE12800 
Enable SCALEByten/an/an/an/a7424458noneSCALE0A non-zero value enables bitmap coordinate scaling.  A zero value treats bitmap coordinates a literal pixel locations. 
Bitmap line widthByten/an/an/an/a7434459noneWIDTH0A non-zero value causes a "dot" to be plotted on the bitmap as two pixels horizontally (this applies to drawing lines, circles, and boxes, not just random dots).  A zero value draws only one pixel for each coordinate used in a bitmap drawing command.
Sprite pointersByte[8]n/an/an/a2040 ~ 2047n/aText: 2040 ~ 2047 Bitmap: 8184 ~ 8191nonenone56 ~ 63These pointers determine the address where SPRITE data is stored (one pointer for each sprite).  On the C128, there are actually two sets of pointers (one for text mode, one for bitmap mode) although they both point to the same locations.  On the C64 the values are not defined but need to be set in order to use sprites. 
Sprite dataByte[8,64]n/an/an/avariesn/a3584 ~ 4095SPRSAVSPRSAVnoneOn the C128, this area is the default area for sprite data storage; on the C64 the user must select an appropriate location(s). The SPRSAV command can be used to read/write the data to BASIC strings, but not read/write them to a disk file (use BLOAD / BSAVE instead). 
Sprite vector tableByte[8,11]n/an/an/an/an/a4478 ~ 4565RSPPOSMOVSPRvariesThis table controls the position and movement of each SPRITE (88 bytes, 11 for each of 8 sprites).  The values can be set with MOVSPR, and for moving sprites the values are updated by the BASIC IRQ routine.  The RSPPOS function can retrieve most of the values; but not the direction of movement.  The horizontal direction is determined by an unsigned word beginning at offset 3; the vertical direction is determined by an unsigned word beginning at offset 5; and the sign of those two is determined by a code at offset 2 (0=NE, 1=SE, 2=SW, 3=NW).
Alternate Font StartByten/an/an/an/a?4587nonenone216High-byte of start of font to be used by CHAR (when used on a bitmap).  By default it points to the upper/lower (PETSCII) font.  The value here may be selected by using CHR$(14) in the CHAR string.
Primary Font StartByten/an/an/an/a?4588nonenone208High-byte of start of font to be used by CHAR (when used on a bitmap).  By default it points to the upper/graphic (ASCII-X) font.  The value here is the default used by CHAR; it may be manually selected by using CHR$(142) in the CHAR string.  By POKEing this location, you make CHAR use your own custom font.
Tempo RateByten/an/an/an/an/a4642noneTEMPO16This determines the speed of notes during PLAY.  The default works out to about 3 quarter notes per second. 
Play RemaindersWord[3]n/an/an/an/an/a4643 ~ 4648nonePLAY-256 Remaining time for each of the 3 SID voices.  Set by PLAY and updated by the Tempo Rate during the BASIC IRQ.  The note ends when the value "underflows" (becomes negative).
OctaveByten/an/an/an/an/a4651nonePLAY4Determines note frequency.  Set by PLAY octave directive.  Should be 0 to 6. 
Current WaveformByte[3]n/an/an/an/an/a4656noneENVELOPE, PLAY 65This is the gated waveform for one of the 3 corresponding SID registers.  The value is here is copied by PLAY to the SID chip (derived from ENVELOPE).  The value minus 1 is copied by BASIC IRQ to the SID chip when the note ends (technically the value AND 254).
Attack TableByte[10] n/an/an/an/an/a4671 ~ 4680noneENVELOPEvaries Holds the SID Attack/Decay chip register settings for each of 10 instruments (selected by PLAY instrument "tone" directive). 
Sustain TableByte[10] n/an/an/an/an/a4681 ~ 4690noneENVELOPEvaries Holds the SID Sustain/Release chip register settings for each of 10 instruments (selected by PLAY instrument "tone" directive). 
Waveform TableByte[10] n/an/an/an/an/a4691 ~ 4700noneENVELOPEvaries Holds the SID waveform chip register settings for each of 10 instruments (selected by PLAY instrument "tone" directive). 
Pulse-Wdith Low TableByte[10] n/an/an/an/an/a4701 ~ 4710noneENVELOPEvaries Holds the SID Pulse Width (low byte) chip register settings for each of 10 instruments (selected by PLAY instrument "tone" directive). 
Pulse-Width High TableByte[10] n/an/an/an/an/a4711 ~ 4720noneENVELOPEvaries Holds the SID Pulse Width (high byte) chip register settings for each of 10 instruments (selected by PLAY instrument "tone" directive). 
Filter FrequencyUnsigned Wordn/an/an/an/an/a4721 ~ 4722noneFILTERnone!Holds the SID registers setting for filter frequency (maximum is 2047).  It has the last-used value from FILTER, it is never initialized.
Filter ResonanceByten/an/an/an/an/a4723noneFILTERnone!Holds the SID register setting for filter resonance (upper 4 bits) and voice application (lower 3 bits).  It has the last-used value from FILTER, it is never initialized.
Filter / VolumeByten/an/an/an/an/a4724noneFILTER, VOL15Holds the SID register settings for filter mode (bits 4~6) and master volume (lower 4 bits).  The high bits are set by FILTER.  The lower four bits are set by VOL and the PLAY "u" directive. 
Sound Remainder Low BytesByte[2 or 3]n/an/an/an/a1276 ~ 12774738 ~ 4740noneSOUNDnone!Remaining time for each of the 3 audio voices (the TED only has 2 voices).  Set by SOUND and decremented each BASIC IRQ.  The value from this table, and a corresponding one from the next determine a 16-bit signed word.
Sound Remainder High BytesSigned Byte[2 or 3]n/an/an/an/a1278 ~ 12794741 ~ 4743noneSOUND-1Remaining time for each of the audio voices.  Set by SOUND and decremented by the BASIC IRQ until the value "underflows", and then the SOUND is silenced.
Sound Maximum Frequency Low BytesByte[3]n/an/an/an/an/a4744 ~ 4746noneSOUNDnone!Maximum frequency for each of the 3 audio voices.  Set by SOUND and possibly checked each BASIC IRQ.  These are the low bytes of an unsigned 16-bit word.
Sound Maximum Frequency High BytesByte[3]n/an/an/an/an/a4747 ~ 4749noneSOUNDnone!Maximum frequency for each of the 3 audio voices (see above); these are the high bytes.
Sound Minimum Frequency Low BytesByte[3]n/an/an/an/an/a4750 ~ 4752noneSOUNDnone!Minimum frequency for each of the 3 audio voices.  Set by SOUND and possibly checked each BASIC IRQ.  These are the low bytes of an unsigned 16-bit word.
Sound Minimum Frequency High BytesByte[3]n/an/an/an/an/a4753 ~ 4755noneSOUNDnone!Minimum frequency for each of the 3 audio voices (see above); these are the high bytes.
Sweep ModesByte[3]n/an/an/an/an/a4756 ~ 4758noneSOUNDnone!Determines how Sound Frequency is modulated; 0 = increase then reset, 1 = decrease then reset, 2 = increase then decrease, 3 =decrease then increase.  Set by SOUND and tested each BASIC IRQ.
Sound Step Low BytesByte[3]n/an/an/an/an/a4759 ~ 4761noneSOUNDnone!Determines moulation amount (step size) for each of the 3 audio voices.  Set by SOUND and possibly used each BASIC IRQ to update Sound Frequency.
Sound Step High BytesByte[3]n/an/an/an/an/a4762 ~ 4764noneSOUNDnone!Determines moulation amount (step size) for each of the 3 audio voices (see above); these are the high bytes.
Sound Frequency Low BytesByte[3]n/an/an/an/an/a4765 ~ 4767noneSOUNDvariesCurrent audio chip freqency register value for each of the 3 audio voices.  Set by SOUND and modulated each BASIC IRQ by the "step size" according to the "sweep mode".  The value from this table, and a corresponding one from the next determine a 16-bit unsigned word.
Sound Frequency High BytesByte[3]n/an/an/an/an/a4768 ~ 4770noneSOUNDvariesCurrent audio chip freqency register value for each of the 3 audio voices (see above); these are the high bytes.
Sound Pulse WidthUnsigned Wordn/an/an/an/an/a4782 ~ 4783noneSOUNDnoneValue of pulse-width used in the most recent SOUND statement.
Sound WaveformByten/an/an/an/an/a4784noneSOUNDvariesWaveform setting for an audio chip register used in the most recent SOUND statement.

© H2Obsession, 2014