Msg: 928 *Conference*
11-14-91 20:45:00
From: TRACY ALLEN
To : ROBERT BENSON
Subj: REPLY TO MSG #908 (BASIC TOKENS)
Dear Robert, The information comes from peeking at memory to see what is actually there. The best way to start is with a 100 that has just been cold started by poking zeros into every memory location starting at 32768. Then write a small program that contains the REMARK or whatever you want to learn about. Since that program will be the first one in memory, starting at 32768, it is very easy to find it. You can peek at stuff in memory directly from the BASIC interpreter, because the lines you type directly into the interpreter aree parsed in the LINEINPUT buffer, not in the program memory. If you use any variables in the lines you type, you can see those variables appear immediately above the program and document area. The ROM2 is a great help, because you can use the MAP function to examine memory in both HEX and ASCII. The best reference is Chris Morgan's book, in my opinion. I had to learn about the remark token in great detail, because I use remarks at the end of BASIC program lines to pass arguments to machine language routines. For example, in the extRAM software, the command to load a file from extRAM into RAM is XR$="file.ex" : CALL63012'+ The call to 63012 jumps to location zero in the extRAM, and the DE register points to the ascii 58 (colon) that immediately follows the 2 in the call. The DE register actually points to the end of the line in the BASIC code. Then I have to increment the DE register twice to get to the +. The code checks for the ascii 142 and 255 along the way to be sure this is correct syntax. The + specifies the load operation. The sofware then finds the variable XR$ in the BASIC variable table and uses the name as the file to look up and move to RAM. The business of the DE register pointing to the remark in the program code is a trick that has been used by lots of programmers to pass information from BASIC to machine language rouines. -- Tracy