Mattel Aquarius


Memory Layout

Memory on the Mattel Aquarius computer is divided in the following main parts:

ROM PartNot addressable with PEEK and POKE
00 00
2F FF
0
12287
RAM PartVIDEO AND COLOR MATRIX
30 00
37 FF
12288
14335
RAM PartSYSTEM INFORMATION
38 00
38 FF
14336
14591
RAM PartSTART BASIC PROGRAMMCODE
39 0114593This pointer can be found at 14414(LSB) and 14415(MSB)
LENGTH DEPENDS ON BASICPROGRAMEnds with two zero's
RAM PartSTART SIMPLE VARIABLE LIST
Following after BASIC programmcode. The pointer to this start address can be found at 14550(LSB) and 14451(MSB)
RAM PartSTART ARRAY-VARIABLE LIST
Following after the simple variable list. The pointer to this start address can be found at 14552(LSB) and 14453(MSB)
RAM PartSTART REST MEMORY
Following after the array-variable list. The pointer to this start address can be found at 14554(LSB) and 14455(MSB). This part of memory is used by the computer as "stack" and "overhead"
RAM PartSTART STRING-VARIABLE MEMORY
The pointer to this start address can be found at 14411(LSB) and 14412(MSB). Default 50 bytes, can be enlarged with the CLEAR command (e.g. CLEAR 100)
MAX MEMORYPointer at 14509(LSB) and 14510(MSB)


After the memory reserved for the character and color matrix is a part of the memory reserved for the system and BASIC. This area is about 256 bytes and runs from memory address 14336 up to 14591 (0x3800 -> 0x3FF)

AddressMnemonicStart
value
Description
HexDec
0x380014336TTYPOS:0x00Row position of cursor on screen (0x00-0x27)
0x3801
0x3802
14337
14338
CHRPOS:Address of the cursor within the cursor matrix
0x380314339USRGO:0xC3The number 179, which is the JUMP (0xC3) instruction for the Z80, is used for the execution of the USR() function.
0x3804
0x3805
14340
14341
USRAL:
USRAH
0x97
0x06
The start address to the machinecoded programm used by the USR() function. On startup it uses LSB=151 (0x97) and MSB=6 (0x06), pointing to memory address 1687 (0x0697) --> JMP FCERR. Jump to an errormessage routine within ROM)
0x3806
0x3807
14342
14343
HOKDSP:0x3B
0x00
Pointer to the "HOOK SERVICE ROUTINE" LSB=59 (0x3B) and MSB=0, address 59 (0x003B) in the standard ROM. If BASIC Extension-ROM is used the address will be changed.
0x380814344LISTCT:0x00Counter for LIST-command. The listening will be stopped after every 24 rows.
0x380914345PTOLD:0xA3Contains the code which will be send to the protection port
0x380A14346CHARQ:0x00ASCII-value of the latest key pressed on the keyboard, but not yet been transferred to the character-matrix. Hence the value which will be used by the key-scanning routine (0x380E). The value will eventually end op at address 14350 (0x380F)
0x380B
0x380C
14347
14348
SKEY:0x00
0x00
Pointer use in the single key command
0x380D14349BUFO:0x20Storage of the character behind the cursor
0x380E14350CTRLFG:0x00Debounce count for the key scanning routine
0x380F14351FLAG:0x00Current key value after scanning
0x3810
0x381E
14352
14366
FDIV:Subroutine for division
0x381F
0x3844
14367
14404
RANDOM:For the use in generation random numbers
0x384514405LPTLST:0x00Last printer operation status.
0x384614406LPTPOS:0x00Position of the printerhead (0-131)
0x384714407PRTFLG:0x28Flag to direct output to printer or CRT.
0x384814408LINLEN:0x28Line length. Initially set to 40
0x384914409CLMLST:0x0EPosition of last comma column
0x384A14410RUBSW:0x00Rubout switch
0x384B
0x384C
14411
14412
STKTOP:Top location to be used for stack. It is followed by the RAM-stack where the strings are stored. At default there are 50 bytes reserved for strings at the top of the memory. With the command 'CLEAR 100' the stringspace will be enlarged en the stack therefor has to start at a lower address.
0x384D
0x384E
14413
14414
CURLIN:0xFE
0xFF
Current line number. Set to 0xFFFF for direct statement mode.
0x384F
0x3850
14415
14416
TXTTAB:0x01
0x39
Pointer to the beginning of Text of Basic programm.
0x3851
0x3856
14417
14422
CASNAM:6 bytes for cassette name.
0x3857
0x385C
14423
14428
CASNM2:6 bytes for cassette name read from tape
0x385D
0x385E
14429
14430
CASFL2:
CASFL3:
0xBE
0x08
Flags for cassette input/output routines.
0x385F14431BUFMIN:0x31Used by INPUT statement
0x3860
0x38A8
14432
14504
BUF:73 bytes used for the current line input buffer.
0x38A914505BUFEND:End of input buffer
0x38AA14506DIMFLG:Flag to differentiate variable type.
0x38AB14507VALTYP:To differentiate between string or nummeric value.
0x38AC14508DORES:Flag for crunch.
0x38AD
0x38AE
14509
14510
MEMSIZ:Contains the highest RAM location.
0x38AF
0x38C0
14511
14528
For string functions
0x38C1
0x38C2
14529
14530
FRETOP:Top of string free space.
0x38C3
0x38C5
14531
14533
TEMP:Pointer for addresses of string storage.
0x38C6
0x38CB
14534
14539
Use for FOR function.
0x38CC
0x38D3
14538
14547
Pointer and flags for programm execution
0x38D4
0x38D5
14548
14549
Points to the start of the BASIC line which was interrupted by the break.
0x38D6
0x38D7
14550
14551
VARTAB:Points to start of simple variable table
0x38D8
0x38D9
14552
14553
ARYTAB:Points to start of array table.
0x38DA
0x38DB
14554
14555
Contains the end address of the BASIC & simple & array list.
0x38DC
0x38DD
14556
14557
Points to where the DATA has been READ. At start of programm or after a RESTORE this points to the address before the start of the BASIC programm (14592) which always contains zero.
0x38DE
0x38E3
14558
14563
Pointer and flags for arrays
0x38E4
0x38F8
14556FACLO:Floating number (exponent & mantissa stored here.)