Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow an immediate of an instruction to reference a symbol that hasn't been seen yet. #11

Open
donno opened this issue Jan 26, 2014 · 0 comments
Assignees

Comments

@donno
Copy link
Owner

donno commented Jan 26, 2014

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.
@ghost ghost assigned donno Jan 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant