Skip to content

Symbol Table Manager

Chysn edited this page Jan 23, 2022 · 16 revisions

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.

Displaying the Symbol Table

.@

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 a reverse-text 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 Command Pointer address is followed by a reverse-text 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").

Setting a Value

There are two ways to set the value associated with a label:

.A addr label
.@ label addr
.@ label byte

where addr is a valid 16-bit hexadecimal value, and label is a valid label name (@0 ~ @9, @A ~ @Z, @@, and @&). byte is a valid 8-bit hexadecimal value, which will be converted to a 16-bit value.

Clearing the Symbol Table

.@-

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.

Clone this wiki locally