Next: SaM I/O
Up: Internal Simulator Classes
Previous: SaM Reference Table
Contents
Index
- (CORE/PROGRAM.JAVA,
- CORE/SAMPROGRAM.JAVA)
A SaM Program is an enclosing container for Instructions, a ReferenceTable,
and a SymbolTable. The assembler generates a Program object, and resolves
any references using the constructed symbol table. The processor loads
the program, and executes each instruction of the program object,
using the PC register as a numeric index.
The SaM program provides the following methods:
- void addInst (Instruction ins) - append an instruction object to the
program
- void addInst (Instruction[] ins) - append an array of instruction
objects to the program
- Instruction getInst(int pos) - return the instruction at the specified
index
- List<Instruction> getInstList() - return all instructions of this
program as a list
- int getLength() - return the number of instructions
- SymbolTable getSymbolTable() - return the symbol table for this program
- ReferenceTable getReferenceTable() - return the reference table for
this program
- void setSymbolTable(SymbolTable table) - set the symbol table for
this program
- void setReferenceTable(ReferenceTable table) - set the reference table
for this program
- boolean isExecutable() - return if the program is executable (all
references are resolved)
- void resolveReferences() - resolve the program's references from its
symbol table
- void resolveReferencesFrom(Program prog) - resolve another program's
references
Next: SaM I/O
Up: Internal Simulator Classes
Previous: SaM Reference Table
Contents
Index
David Levitan
2006-02-12