next up previous contents index
Next: SaM Reference Table Up: Internal Simulator Classes Previous: SaM Instructions   Contents   Index

SaM Symbol Table

(CORE/SYMBOLTABLE.JAVA,
CORE/SAMSYMBOLTABLE.JAVA)
A SaM program supports the use of labels, defined as a string ending with ':', such as "ThisIsALabel:" Jump instructions can then take the name of such a label, and jump to that address in the program. The SaM Symbol Table is responsible for mapping labels (symbols) to addresses, and vice versa. It is implemented by using two hash tables, enabling a search using a symbol, or a search using an address.

The SaM core package will support multiple labels per address. Unfortunately, as of SaM 2.3, the GUI does not handle multiple stacked labels quite properly, and simplifies them down to one. This is nontrivial to fix, but will be corrected in a future release.

The symbol table provides the following methods:


next up previous contents index
Next: SaM Reference Table Up: Internal Simulator Classes Previous: SaM Instructions   Contents   Index
David Levitan 2006-02-12