• No results found

73-74 $49-$4A VARPNT Pointer to variable descriptor

In document Compute's Mapping the Commodore 128 (Page 41-43)

These locations are used as a pointer to the first byte of the descriptor for the variable—the address of the location just be- yond the two-character name in the variable table entry for the variable. The value here is set upon exit from the routines to find [$7AAF] or create [$7B90] a variable. The FN (user-

36

$ 4 F 7 9

defined function) routine will load these locations with the ad- dress of the descriptor for the dummy variable in the function definition,

75-76 $4B-$4C FORPNT

Variable descriptor pointer and working storage

These locations are used during the routine that assigns vari- able values (LET [$53C6]) as a pointer to the variable value or string descriptor. For numeric variables, the address here will be the location in block 1 RAM where the value will be stored. For string variables, the address here will be the loca- tion in block 1 RAM where the length and pointer into the string pool for the string will be stored. The FOR statement uses the value here to find the address of the value for the loop index variable.

For the WAIT statement [$6C2D], location 75/$4B holds the test byte pattern and location 76/$4C holds the mask byte pattern. Location 75/$4B is also used as an index into the cur- rent line during the routine to list BASIC program lines [$5123],

77-78 $4D-$4E VARTXT

Temporary storage for text pointer

These locations are used for temporary storage for the

CHRGET pointer value from 61-62/$3D-$3E during the com- mon input routine [$56B2], which uses CHRGET to retrieve characters from the input source location. Location 77/$4D is also used during the numeric expression evaluation routine [$77EF] as a flag to indicate when the end of the expression has been reached.

79 $4F OPMASK

Relational operator flag

When the main expression evaluation routine [$77EF] finds a relational operator (<, =, or >) in the current expression, it stores a value here indicating which operator has been found. For greater than (>) operations, the value here will be 1. For equals ( = ), the value will be 2; for less than (<) it will be 4. When the expression is evaluated, this value will be trans- ferred to location 20/$14.

69-70 $45-$46

RESTORE statement can be used with a line number param- eter to change the value here. In that case, the pointer value will be reset to the starring address of the specified line. The specified line need not contain a DATA statement. It merely specifies the line from which the search for the next DATA statement will begin.

69-70 $45-$46 INPPTR

Text pointer for input

The common input routine [$56B2], used in the execution of the GET, GETKEY, GET#, INPUT, INPUT*, and READ state- ments, uses these locations as a pointer to the characters to be read as input. The value here will be transferred into the CHRGET pointer at 61-62/$3D-$3E so that CHRGET can be used to retrieve characters from the input. The GET, GETKEY, and GET* statements will initialize the value here to

513/$0201, an input buffer location set to 0/$00 to cause the input routine to read the next character. The INPUT and IN- PUT* statements will initialize the value here to 511/$01FF, a location immediately before the input buffer set to 44/$2C, the code for the comma character. The actual input will be in the input buffer beginning at 512/$0200. The READ statement will initialize these locations with the starting address of the next DATA item (from locations 67-68/$43-$44).

71-72 $47-$48 VARNAM

Current variable name

These locations are used during the routine to find or create a variable [$7AAF] to hold the compressed (two-byte) form of the specified variable name. This compressed form will then be used as a search pattern to check whether a variable of the same name and type currently exists. If not, the characters here will be used as the name for the new variable.

73-74 $49-$4A VARPNT

Pointer to variable descriptor

These locations are used as a pointer to the first byte of the descriptor for the variable—the address of the location just be- yond the two-character name in the variable table entry for the variable. The value here is set upon exit from the routines to find [$7AAF] or create [$7B90] a variable. The FN (user-

36

$ 4 F 7 9

defined function) routine will load these locations with the ad- dress of the descriptor for the dummy variable in the function definition,

75-76 $4B-$4C FORPNT

Variable descriptor pointer and working storage

These locations are used during the routine that assigns vari- able values (LET [$53C6]) as a pointer to the variable value or string descriptor. For numeric variables, the address here will be the location in block 1 RAM where the value will be stored. For string variables, the address here will be the loca- tion in block 1 RAM where the length and pointer into the string pool for the string will be stored. The FOR statement uses the value here to find the address of the value for the loop index variable.

For the WAIT statement [$6C2D], location 75/$4B holds the test byte pattern and location 76/$4C holds the mask byte pattern. Location 75/$4B is also used as an index into the cur- rent line during the routine to list BASIC program lines [$5123],

77-78 $4D-$4E VARTXT

Temporary storage for text pointer

These locations are used for temporary storage for the

CHRGET pointer value from 61-62/$3D-$3E during the com- mon input routine [$56B2], which uses CHRGET to retrieve characters from the input source location. Location 77/$4D is also used during the numeric expression evaluation routine [$77EF] as a flag to indicate when the end of the expression has been reached.

79 $4F OPMASK

Relational operator flag

When the main expression evaluation routine [$77EF] finds a relational operator (<, =, or >) in the current expression, it stores a value here indicating which operator has been found. For greater than (>) operations, the value here will be 1. For equals ( = ), the value will be 2; for less than (<) it will be 4. When the expression is evaluated, this value will be trans- ferred to location 20/$14.

80-81

$50-$51

80-81 $5O-$S1 DEFPNT

In document Compute's Mapping the Commodore 128 (Page 41-43)