Assignment
Assignment
Assignment
B.Tech-CS&IT-VI-Sem
Sub : System Software Engineering
Graded Assignment-2
LTORG thus is used when we want to keep the literal operands close to the
instruction that uses it
Machine-Independent features Of Assembler :-
– Literals
– Symbol-defining statements
– Expressions
– Program blocks
– Control sections and program linking
Op code table
Looked up for the translation of mnemonic code
Difficulties in hashing
Problem
in symbol tables
constant declaration
space reservation
begin
if starting address is given
LOCCTR = starting address;
else
LOCCTR = 0;
while OPCODE != END do ;; or EOF
begin
read a line from the code
if there is a label
if this label is in SYMTAB, then error
else insert (label, LOCCTR) into SYMTAB
search OPTAB for the op code
if found
LOCCTR += N ;; N is the length of this instruction
Load-and-go assembler
Forward Reference:
o Load-and-go assembler
Omits the operand address if the symbol has not yet been
defined
Enters this undefined symbol into SYMTAB and indicates
that it is undefined
Adds the address of this operand address to a list of forward
references associated with the SYMTAB entry
Scans the reference list and inserts the address when the
definition for the symbol is encountered.
Reports the error if there are still SYMTAB entries indicated
undefined symbols at the end of the program
Search SYMTAB for the symbol named in the END
statement and jumps to this location to begin execution if
there is no error