Dealing with assembler directives
In this section, we will learn about the following:
- What assembler directives do
- How to create a symbol table linking symbolic names to values
- How to access the symbol table
- How to update the symbol table
- Processing labels
We will demonstrate how the names the programmer chooses are manipulated and translated into their appropriate numerical values.
The first version of TC1 required you to provide actual values for all names and labels. If you wanted to jump to an instruction, you had to provide the number of lines to jump. It’s much better to allow the programmer to write the following:
JMP next
Here, next
is the label of the target line. This is preferred over writing the following:
JMP 21
Similarly, if the literal 60
represents minutes in an hour, write the following:
MULL
R0,R1,MINUTES
This is preferred over the following:
MULL
R0,R1,60
We need a means of linking next
with 21
and...