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

Bug Fix: PUTSP #16

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open

Conversation

keinkaihere
Copy link

I'm in a class that uses your simulator and our current assignment works with packed strings. Unfortunately, those don't work in this version. I've done some poking around between this version and the downloaded version and found that the issue isn't the LC-3 code itself, but instead the way output gets handled after being stored in 0xFE06. In the current version of lc3web, only the first two bytes get read, completely ignoring the extra packed bytes. This code fixes that (albeit sort of messy).

One interesting quirk I found playing with the downloadable version is that PUTS and PUTSP have the exact same output. That is, if you give a packed string to PUTS, it actually parses the packed bytes correctly. I tried following the LC-3 instructions in both trap routines, and they seem to be doing the exact same thing (storing to 0xFE06, packed or otherwise). I'm not sure if this is intentional or not, but to stay on the safe side my code emulates this.

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