Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andPUTSP
have the exact same output. That is, if you give a packed string toPUTS
, 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 to0xFE06
, packed or otherwise). I'm not sure if this is intentional or not, but to stay on the safe side my code emulates this.