-
Notifications
You must be signed in to change notification settings - Fork 2
Symbol Table Manager
Optionally, wAx maintains a symbol table for use with its somewhat symbolic assembly (see "Labels"). The * tool provides a few ways to manage these symbols.
*addr
If you provide a 16-bit hexadecimal address after *, wAx will set its persistent counter to this address. The persistent counter is the next location at which code will be assembled, data will be added, disassembly or memory dump will be displayed, or assertion testing will be performed. All of these tools will also set the persistent counter to the address after the last address they use. The * tool lets you set the persistent counter to any address.
All of wAx's tools, except the * tool itself, will replace * with the persistent address, so * can be widely used within tools (although some uses, like .*, are redundant).
The persistent counter is stored in memory locations $0003 and $0004; if you need to access it within a BASIC program, you can do so as PC=PEEK(3)+PEEK(4)*256
*
On a line by itself, * shows the symbol table. It will show you the following information:
- Defined labels with the label sigil (-)
- If followed by a hexadecimal number, the symbol's address
- If followed by > and a number, it indicates that the label was used as a forward reference and is still undefined. The number indicates the number of times the label was used and, thus, how many forward references will be resolved when the symbol's address is defined.
- The last line of the symbol table shows the current persistent counter address
- If the persistent counter address is followed by a > and a number, it indicates the number of forward references that could not be defined because the number of forward references exceeded 12. This means that your code will probably not function properly. If you're entering code in direct mode, you'll be notified of this condition immediately with a ?SYMBOL ERROR. If this condition occurs within a BASIC program, it can be addressed with a second pass (see "Multi-Pass Assembly").
*-
This clears the symbol table by writing $00 to all symbol table memory. This should be done at the start of a BASIC program that uses several labels.
The wAx symbol table is stored between $02a2 and $02ff. This memory is not addressed at all by wAx unless you use the somewhat symbolic features. The persistent counter is stored at locations $0003 and $0004, and can be used without affecting the symbol table area.