Skip to content

Adjust assembler to allow compiling our VM output #3

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

Merged
merged 2 commits into from
Jun 16, 2015

Conversation

Ryman
Copy link
Member

@Ryman Ryman commented Jun 14, 2015

I tried to run a jack file through our vm translator as we did when we finished it at the end of a meetup:

  • ran the reference Jack compiler on the square folder from project 9
  • copied the vm files from the supplied "tools/OS" folder into a directory with the vm files generated above
  • ran vm-translator --init file1.vm file2.vm .... filen.vm > square.asm to generate asm
  • ran assembler square.asm, which then failed due to overflowing the ROM

Before adding the abort, the assembler would generate instructions with a length of 17bits (leading zero for an address instruction and then 16bits of address). This was probably what was causing the really funky behaviour in Leo's simulator.

Also, to get the above working, I had to also allow some non-standard mnemonics that our vm-translator generates as mentioned before by @tomstuart in the meetings.

For reference, the Square example in project 9, with the OS code, comes to around 50000 instructions (according to the address after the abort due to overflowing the 32k limit). Are we generating too much assembly from our vm-translator or am I running things wrong?

Ryman added 2 commits June 14, 2015 16:53
This mimics the behaviour of the reference Java assembler and is likely the reason for busted behavior on Leo's JS emulator.
@leocassarani
Copy link
Member

Merging this after discussing at Meeting 11.

leocassarani added a commit that referenced this pull request Jun 16, 2015
Adjust assembler to allow compiling our VM output
@leocassarani leocassarani merged commit 606c2a9 into computationclub:master Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants