At the moment the following code doesn't work:
bar:
bt r2, done
; more code here
j bar
done:
jr r1
Moving done section and instructions before the use of done, works.
The problem is only a single pass is done such that the symbol table isn't populated at the time it sees done.
Two solutions:
- Perform two passes, 1 for just populating symbols and another for generating the machine code
- Allow references to symbols in the machine code which are substituted with the final values after everything has been read in.
At the moment the following code doesn't work:
Moving done section and instructions before the use of done, works.
The problem is only a single pass is done such that the symbol table isn't populated at the time it sees done.
Two solutions: