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

Enforce 12-bit PC and I limits #1

Closed
jon-axon opened this issue Feb 22, 2023 · 2 comments
Closed

Enforce 12-bit PC and I limits #1

jon-axon opened this issue Feb 22, 2023 · 2 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@jon-axon
Copy link
Owner

These fields are 16-bit but for the original CHIP-8 interpreter they were 12-bit, so for ideal emulation in CHIP-8 mode we should throw an error if an attempt is made to assign to/increment these registers beyond the 12-bit max.

This will be most easily achieved by replacing direct assignment to the fields with a setter method that specifically checks for emulation mode and checks for 12-bit overflow if appropriate.

@jon-axon jon-axon added the enhancement New feature or request label Feb 22, 2023
@jon-axon jon-axon self-assigned this Feb 22, 2023
@jon-axon jon-axon added this to the v0.2 milestone Feb 22, 2023
@jon-axon jon-axon changed the title Enforce 12-bit program counter and index register for CHIP-8 mode Enforce 12-bit PC and I limits Feb 22, 2023
@jon-axon jon-axon added invalid This doesn't seem right and removed enhancement New feature or request labels Feb 23, 2023
@jon-axon
Copy link
Owner Author

It seems this is actually misinformation, as per https://laurencescotford.com/chip-8-on-the-cosmac-vip-indexing-the-memory/

The PC and I registers were fully 16-bit on the COSMAC, despite the address space only being at most 12-bit addressable.

@jon-axon
Copy link
Owner Author

Closed as per the above.

@jon-axon jon-axon closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant