System Variables

From SpecNext official Wiki
Revision as of 15:39, 26 April 2019 by Julian S (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Status/width Address Mnemonic Description
X2 $5B52 OLDHL Temporary register store while switching ROMs.
X2 $5B54 OLDBC Temporary register store while switching ROMs.
X2 $5B56 OLDAF Temporary register store while switching ROMs.
N2 $5B58 TARGET Subroutine address in ROM 3.
X2 $5B5A RETADDR Return address in ROM 1.
X1 $5B5C BANKM Copy of last byte output to Memory Paging Control ($7FFD / 32765). This byte must be kept up to date with the last value output to the port if interrupts are enabled.
X1 $5B5D RAMRST RST 8 instruction. Used by ROM 1 to report old errors to ROM 3.
N1 $5B5E RAMERR Error number passed from ROM 1 to ROM 3. Also used by SAVE/LOAD as temporary drive store.
2 $5B5F BAUD RS232 bit period in T states/26. Set by FORMAT LINE.
N2 $5B61 SERFL Second-character-received-flag, and data.
N1 $5B63 COL Current column from 1 to WIDTH.
1 $5B64 WIDTH Paper column width. Defaults to 80.
1 $5B65 TVPARS Number of inline parameters expected by RS232.
1 $5B66 FLAGS3 Various flags. Bits 0, 1, 6 and 7 unlikely to be useful. Bit 2 is set when tokens are to be expanded on printing. Bit 3 is set if print output is RS232. The default (at reset) is Centronics. Bit 4 is set if a disk interface is present. Bit 5 is set if drive B: is present.
X1 $5B67 BANK678 Copy of last byte output to Plus 3 Memory Paging Control ($1FFD / 8189). This byte must be kept up to date with the last value output to the port if interrupts are enabled.
*N1 $5B68 FLAGN Flags for the NextZXOS system.
*N1 $5B69 MAXBNK Maxmium available RAM bank number.
X2 $5B6A OLDSP Old SP (stack pointer) when TSTACK is in use.
X2 $5B6C SYNRET Return address for ONERR.
5 $5B6E LASTV Last value printed by calculator.
*1 $5B73 TILEBNKL Tiles bank for Lores.
*1 $5B74 TILEML Tilemap bank for Lores.
*1 $5B75 TILEBNK2 Tiles bank for Layer 2.
*X1 $5B77 NXTBNK Bank containing NXTLIN.
*1 $5B78 DATABNK Bank containing DATADD.
1 $5B79 LODDRV Holds 'T' if LOAD, VERIFY, MERGE are from tape, otherwise holds 'A', 'B' or 'M'.
1 $5B7A SAVDRV Holds 'T' if SAVE is to tape, otherwise holds 'A', 'B' or 'M'.
1 $5B7B L2SOFT Soft copy of Layer 2 Access Port ($123B / 4667)
2 $5B7C TILEWL Width of Lo-res tilemap
2 $5B7E TILEW2 Width of Layer 2 tilemap
2 5B80H TILEOFFL Offset in bank for Lo-res tilemap
2 $5B82 TILEOFF2 Offset in bank for Layer 2 tilemap
2 $5B84 COORDSL x,y coords of last point plotted (lo-res)
2 $5B86 COORDS2 x,y coords of last point (layer 2)
2 $5B88 COORDSULA x,y coords of last point (standard)
2 $5B8A COORDSHR x,y coords of last point (hi-res)
2 $5B8C COORDSHC x,y coords of last point (hi-colour)
1 $5B8E INKL INK colour for Lo-res mode
1 $5B8F INK2 INK colour for Layer 2 mode
1 5B90H ATTRULA Attributes for standard mode
1 $5B91 INKHR INK colour for Hi-res mode
1 $5B92 ATTRHC Attributes for Hi-colour mode
1 $5B93 INKMASK Softcopy of Enhanced ULA Ink Color Mask ($42) (or 0)
N8 $5B94 STRIP1 Stripe one bitmap
N8 $5B9C STRIP2 Stripe two bitmap
X91 $5BFF TSTACK Temporary stack grows down from here. Used when RAM page 7 is switched in at top of memory (while executing the editor or calling +3DOS). It may safely go down to $5B9D (and across STRIP1 and STRIP2 if necessary).
N8 $5C00 KSTATE Used in reading the keyboard.
N1 $5C08 LASTK Stores newly pressed key.
1 $5C09 REPDEL Time (in 50ths of a second) that a key must be held down before it repeats.
1 $5C0A REPPER Delay (in 50ths of a second) between successive repeats of a key held downs.
N2 $5C0B DEFADD Address of arguments of user defined function (if one is being evaluated), otherwise 0.
Nl $5C0D K DATA Stores 2nd byte of colour controls entered from keyboard.
N1 $5C0E TVDATA Stores bytes of colour, AT and TAB controls going to TV.
X38 $5C10 STRMS Addresses of channels attached to streams.
2 $5C36 CHARS 256 less than address of character set (which starts with space and carries on to (C)). Normally in ROM, but you can set up your down in RAM and make CHARS point to it.
1 $5C38 RASP Length of warning buzz.
1 $5C39 PIP Length of keyboard click.
1 $5C3A ERRNR 1 less than the report code. Starts off at 255 (for -1) so 'PEEK 23610' gives 255.
X1 $5C3B FLAGS Various flags to control the BASIC system.
X1 $5C3C TVFLAG Flags associated with the TV.
X2 $5C3D ERRSP Address of item on machine stack to be used as error return.
N2 $5C3F LISTSP Address of return address from automatic listing.
N1 $5C41 MODE Specifies 'K', 'L', 'C', 'E' or 'G' cursor.
2 $5C42 NEWPPC Line to be jumped to.
1 $5C44 NSPPC Statement number in line to be jumped to. Poking first NEWPPC and then NSPPC forces a jump to a specified statement in a line.
2 $5C45 PPC Line number of statement currently being executed.
1 $5C47 SUBPPC Number within line of statement currently being executed.
1 $5C48 BORDCR Border colour multiplied by 8; also contains the attributes normally used for the lower half of the screen.
2 $5C49 E PPC Number of current line (with program cursor).
X2 $5C4B VARS Address of variables.
N2 $5C4D DEST Address of variable in assignment.
X2 $5C4F CHANS Address of channel data.
X2 $5C51 CURCHL Address of information currently being used for input and output.
X2 $5C53 PROG Address of BASIC program.
X2 $5C57 NXTLIN Address of next line in program.
X2 $5C57 DATADD Address of terminator of last DATA item.
X2 $5C59 E LINE Address of command being typed in.
2 $5C5B K CUR Address of cursor.
X2 $5C5D CH ADD Address of the next character to be interpreted - the character after the argument of PEEK, or the NEWLINE at the end of a POKE statement.
2 $5C5F X PTR Address of the character after the [] marker.
X2 $5C61 WORKSP Address of temporary work space.
X2 $5C63 STKBOT Address of bottom of calculator stack.
X2 $5C65 STKEND Address of start of spare space.
N1 $5C67 BREG Calculator's B register.
N2 $5C68 MEM Address of area used for calculator's memory
1 $5C6A FLAGS2 More flags. (Bit 3 set when CAPS SHIFT or CAPS LOCK is on.)
X1 $5C6B DF SZ The number of lines (including one blank line) in the lower part of the screen.
2 $5C6C S TOP The number of the top program line in automatic listings.
2 $5C6E OLDPPC Line number to which CONTINUE jumps.
1 $5C70 OSPPC Number within line of statement to which CONTINUE jumps.
N1 $5C71 FLAGX Various flags.
N2 $5C72 STRLEN Length of string type destination in assignment.
N2 $5C74 T ADDR Address of next item in syntax table (very unlikely to be useful).
2 $5C76 SEED The seed for RND. This is the variable that is set by RANDOMIZE.
3 $5C78 FRAMES 3 byte (least significant byte first), frame counter incremented every 20ms.
2 $5C7B UDG Address of first user-defined graphic
1 $5C7D COORDS X-coordinate of last point plotted.
1 $5C7E Y-coordinate of last point plotted.
*1 $5C7F GMODE Graphical layer/mode flags.
X2 5C80h PRCC Full address of next position for LPRINT to print at (in ZX printer buffer). Legal values 5B00 - 5B1F.
2 $5C82 ECHO E 33-column number and 24-line number (in lower half) of end of input buffer.
2 $5C84 DF CC Address in display file of PRINT position.
2 $5C86 DF CCL Like DF CC for lower part of screen.
X1 $5C88 S POSN 33-column number for PRINT position.
X1 $5C89 24-line number for PRINT position.
X2 $5C8A SPOSNL Like S POSN for lower part.
1 $5C8C SCR CT Counts scrolls - it is always 1 more than the number of scrolls that will be done before stopping with 'scroll'?
1 $5C8D ATTR P Permanent current colours, etc., (as set up by colour statements).
1 $5C8E MASK P Used for transparent colours, etc. Any bit that is 1 shows that the corresponding attribute bit is taken not from ATTR P, but from what is already on the screen.
N1 $5C8F ATTR T Temporary current colours, etc., (as set up by colour items).
N1 5C90h MASK T Like MASK P, but temporary.
1 $5C91 P FLAG More flags.
N30 $5C92 MEMBOT Calculator's memory area - used to store numbers that cannot conveniently be put on the calculator stack.
2 $5CB0 NMIADD Holds the address of the users NMI service routine.
2 $5CB2 RAMTOP Address of last byte of BASIC system area.
2 $5CB4 P RAMT Address of last byte of physical RAM.