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

fix #526: vm emulator raises "call stack exceeded"… #529

Conversation

dorianignee
Copy link
Contributor

… when doing println in last row

The check for printing past the end of the VM screen was only done in Output.printChar(). So, when an Output.println() command was executed in the last row of the virtual screen, a "call stack exceeded" error message was shown.

I moved the check to the println function, so the cursor will just wrap around to row 0, as intended, when a println occurs in the last line (either by an Output.println() command or by printing past the end of the last line

…ing println in last row

move check for last screen row from printChar to println, so the check runs on every newline command
@DavidSouther DavidSouther merged commit cee36e6 into nand2tetris:main Dec 19, 2024
1 check passed
@dorianignee dorianignee deleted the fix/vm-emulator-call-stack-exceeded-on-println-in-last-screen-row branch December 20, 2024 08:53
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