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

VM SP off by one #546

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

VM SP off by one #546

wants to merge 1 commit into from

Conversation

maueroats
Copy link

VM test script should set SP to be 262, not 261, to agree with assembler version.

In the assembler version, SP=256 at the start.
Then the stack upon calling the Fibonacci function for the first time contains:

  • n=4 is the argument to Fibonacci
  • return address
  • args, local, this, that
    That means SP=262 at the start of the function call.

SP should be 262, not 261, to agree with assembler version.
see PR.
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.

1 participant