|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsinclair.basic.ZX81SysVars
This class provides utilities to access ZX81 system variables.
From the ZX81 manual:
1 16384 ERR_NR 1 less than report code. X1 16385 FLAGS Various flags to control Basic. X2 16386 ERR_SP Address of first item on machine stack (after GOSUB returns). 2 16388 RAMTOP Address of first byte above BASIC system area. You can poke this to make NEW reserve space above that area (see chapter 26) or to fool CLS into setting up a minimal display file (chapter 27). Poking RAMTOP has no effect until one of these two is executed. N1 16390 MODE Specifies K, L, F or G cursor. N2 16391 PPC Line number of statement currently being executed. Poking this has no lasting effect except in the last line of the program. S1 16393 VERSN 0 identifies ZX81 Basic in saved programs. S2 16394 E_PPC Number of cuurent line (with cursor). SX2 16396 D_FILE Address of display file. S2 16398 DF_CC Address of print position in display file. SX2 16400 VARS Address of variables area. SN2 16402 DEST Address of variable in assignment. SX2 16404 E_LINE Address of line being typed. SX2 16406 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. S2 16408 X_PTR Address of character preceding the S marker. SX2 16410 STKBOT Address of calculator stack. SX2 16412 STKEND Address of start of spare space. SN1 16414 BREG Calculator's B register. SN2 16415 MEM Address of area used for calculator's memory. (Usually MEMBOT, but not always.) S1 16417 Unused. SX1 16418 DF_SZ The number of lines (including one blank line) in the lower part of the screen. S2 16419 S_TOP The number of the top program line in automatic listings. SN2 16421 LAST_K Shows which keys pressed. SN1 16423 Debounce status of keyboard. SN1 16424 MARGIN Number of blank lines above or below picture: 55 in Britain, 31 in America. SX2 16425 NXTLIN Address of next program line to be executed. S2 16427 OLDPPC Line number to which CONT jumps. SN1 16429 FLAGX Various Flags. SN2 16430 STRLEN Length of string type destination in assignment. SN2 16432 T_ADDR Address of next item in syntax table (very unlikely to be useful). S2 16434 SEED The seed for RND. This is the variable that is set by RAND. S2 16436 FRAMES Counts the frames displayed on the television. Bit 15 is 1. Bits 0 to 14 are decremented for each frame set to the television. This can be used for timing, but PAUSE also uses it. PAUSE resets to 0 bit 15, & puts in bits 0 to 14 the length of the pause. When these have been counted down to zero, the pause stops. If the pause stops because of a key depression, bit 15 is set to 1 again. S1 16438 COORDS x-coordinate of last point plotted. S1 16439 y-coordinate of last point plotted. S1 16440 PR_CC Less significant byte of address of next position for LPRINT to print as (in PRBUFF). SX1 16441 S_POSN Column number for print position. SX1 16442 Line number for print position. S1 16443 CDFLAG Various flags. Bit 7 is on (1) during compute & display mode. S33 16444 PRBUFF Printer Buffer. 33rd character = newline. SN30 16477 MEMBOT Calculator's memory area; used to store numbers that cannot conveniently be put on the calculator stack. S2 16507 unused.
Field Summary | |
---|---|
static int |
BREG
Calculator's B register. |
static int |
CDFLAG
Various flags. |
static int |
CH_ADD
Address of the next character to be interpreted. |
static int |
COORDS
X-coordinate of last point plotted. |
static int |
COORDY
Y-coordinate of last point plotted. |
static int |
D_FILE
Address of display file. |
static int |
DEBOUN
Debounce status of keyboard. |
static int |
DEST
Address of variable in assignment. |
static int |
DF_CC
Address of print position in display file. |
static int |
DF_SZ
The number of lines (including one blank line) in the lower part of the screen. |
static int |
E_LINE
Address of line being typed. |
static int |
E_PPC
Number of cuurent line (with cursor). |
static int |
END
The end of system variables. |
static int |
ERR_NR
1 less than report code. |
static int |
ERR_SP
Address of first item on machine stack (after GOSUB returns). |
static int |
FLAGS
Various flags to control Basic. |
static int |
FLAGX
Various Flags. |
static int |
FRAMES
Counts the frames displayed on the television. |
static int |
LAST_K
Shows which keys pressed. |
static int |
MARGIN
Number of blank lines above or below picture. |
static int |
MEM
Address of area used for calculator's memory. |
static int |
MEMBOT
Calculator's memory area. |
static int |
MODE
Specifies K, L, F or G cursor. |
static int |
NXTLIN
Address of next program line to be executed. |
static int |
OLDPPC
Line number to which CONT jumps. |
static int |
PPC
Line number of statement currently being executed. |
static int |
PR_CC
Less significant byte of address of next position for LPRINT to print as (in PRBUFF). |
static int |
PRBUFF
Printer Buffer. |
static int |
RAMTOP
Address of first byte above BASIC system area. |
static int |
S_POSL
Line number for print position. |
static int |
S_POSN
Column number for print position. |
static int |
S_TOP
The number of the top program line in automatic listings. |
static int |
SAVE_START
The address of the system variable area that a save starts at. |
static int |
SEED
The seed for RND. |
static int |
START
The address of the first system variable. |
static int |
STKBOT
Address of calculator stack. |
static int |
STKEND
Address of start of spare space. |
static int |
STRLEN
Length of string type destination in assignment. |
static int |
T_ADDR
Address of next item in syntax table (very unlikely to be useful). |
static int |
UN1
Unused. |
static int |
UN2
Unused. |
static int |
VARS
Address of variables area. |
static int |
VERSN
Identifies ZX81 Basic in saved programs. |
static int |
X_PTR
Address of character preceding the S marker. |
Constructor Summary | |
---|---|
ZX81SysVars()
|
Method Summary | |
---|---|
static void |
dumpSystemVariables(byte[] memory,
int start,
int firstVar,
java.lang.StringBuffer buff)
Dump the system variables in the given area of memory. |
static int |
getVariableValue(byte[] memory,
int varAddr,
int varSize)
Obtain the value of a system variable. |
static int |
getVariableValue(byte[] memory,
int start,
int firstVar,
int varAddr,
int varSize)
Obtain the value of a system variable. |
static int |
getVariableValueOffset(byte[] memory,
int varAddr,
int varSize)
Obtain the value of a system variable, offset into the given array. |
static int |
getVariableValueOffset(byte[] memory,
int start,
int firstVar,
int varAddr,
int varSize)
Obtain the value of a system variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int START
public static final int ERR_NR
public static final int FLAGS
public static final int ERR_SP
public static final int RAMTOP
public static final int MODE
public static final int PPC
public static final int VERSN
public static final int E_PPC
public static final int D_FILE
public static final int DF_CC
public static final int VARS
public static final int DEST
public static final int E_LINE
public static final int CH_ADD
public static final int X_PTR
public static final int STKBOT
public static final int STKEND
public static final int BREG
public static final int MEM
public static final int UN1
public static final int DF_SZ
public static final int S_TOP
public static final int LAST_K
public static final int DEBOUN
public static final int MARGIN
public static final int NXTLIN
public static final int OLDPPC
public static final int FLAGX
public static final int STRLEN
public static final int T_ADDR
public static final int SEED
public static final int FRAMES
public static final int COORDS
public static final int COORDY
public static final int PR_CC
public static final int S_POSN
public static final int S_POSL
public static final int CDFLAG
public static final int PRBUFF
public static final int MEMBOT
public static final int UN2
public static final int END
public static final int SAVE_START
Constructor Detail |
public ZX81SysVars()
Method Detail |
public static void dumpSystemVariables(byte[] memory, int start, int firstVar, java.lang.StringBuffer buff)
memory
- The memory containing the values.start
- The start index in memort to dump.firstVar
- The first variable to process.buff
- The buffer to contain the result.public static int getVariableValueOffset(byte[] memory, int varAddr, int varSize)
memory
- The memory containing the values.varAddr
- The address of the variable.varSize
- The size of the variable.
public static int getVariableValueOffset(byte[] memory, int start, int firstVar, int varAddr, int varSize)
memory
- The memory containing the values.start
- The start index in memory to dump.firstVar
- The first variable to process.varAddr
- The address of the variable.varSize
- The size of the variable.
public static int getVariableValue(byte[] memory, int varAddr, int varSize)
memory
- The memory containing the values.varAddr
- The address of the variable.varSize
- The size of the variable.
public static int getVariableValue(byte[] memory, int start, int firstVar, int varAddr, int varSize)
memory
- The memory containing the values.start
- The start index in memory to dump.firstVar
- The first variable to process.varAddr
- The address of the variable.varSize
- The size of the variable.
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |