next up previous contents index
Next: SaM Graphical User Interfaces Up: SaM Front Ends Previous: SaM Front Ends   Contents   Index

SaM Assembler

(CORE/SAMASSEMBLER.JAVA)
 
The SaM assembler is the equivalent of a real assembler, which translates assembly code into binary. It can be invoked with a filename argument, a Reader argument, or a Tokenizer argument. The assembler uses the tokenizer to read the program tokens one-by-one and create Instruction objects using Java reflection for obtaining class names. It reads the operands for each instruction, based on the abstract class it extends (String for SamStringInstruction, character for SamCharInstruction, etc..). The assembler tracks symbol references into a ReferenceTable, and resolves the symbols currently available into a SymbolTable. It combines all this information inside a Program object.



David Levitan 2006-02-12