COMPUTE! ISSUE 17 / OCTOBER 1981 / PAGE 101
Atari 400/800 Variable Name Utility
Arthur McGraw
Whitehall, OH
For compactness, Atari BASIC stores the ATASCII strings of variable names in a table called the variable name table. The program needs only a one byte reference to the variable name table to determine the desired variable name. This allows the programmer to use long descriptive variable names as the ATASCII string is stored only once, regardless of the number of times that variable name is used in the program.
When studying a program it is sometimes desirable to know what variable names are already in use. This utility will display the contents of the variable name table.
User Instructions
1 POKE 1664, PEEK(130) : POKE 1665, PEEK(131) 2 IF PEEK (1664) = PEEK(132) THEN IF PEEK (1665) = PEEK(133) THEN ?: STOP 3 ?CHR$ (PEEK(PEEK(1664) + 256 * PEEK(1665))); 4 IF PEEK (PEEK(1664) + 256 * PEEK(1665)) > 127 THEN PRINT " "; 5 IF PEEK(1664) = 255 THEN POKE 1664, 0 : POKE 1665, PEEK(1665) + 1 : GOTO 2 6 POKE 1664, PEEK(1664) + 1 : GOTO 2
Address List
| 130, 131 | Contains the address of the start of the variable name table. |
| 132, 133 | Contains the address of the end of variable name table + 1. |
| 1664,1665 | Pointer used by variable name table dump routine. The pointer is stored in memory that is not used either by the operating system or by BASIC. |
| Line Description | |
| 1 | Set up pointer. |
| 2 | Check if done. |
| 3 | Print one character of variable name. |
| 4 | Print space if last character of variable name. |
| 5-6 | Increment two byte pointer. |
Notes