-
Notifications
You must be signed in to change notification settings - Fork 10
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
Do 8XY6 and 8XYE change VY as well? #4
Comments
Yes, it seems that VY would be shifted in the original CHIP-8 interpreter, according to this great write-up about it. This could help explain why the "common misconception" arose in SCHIP in the first place – it doesn't make much practical sense to "return" both VX and VY with the same value, but that does seem to be what it originally did. Great catch, this is something I haven't seen much discussion about before. |
The table in the write-up says that VY as well as VX should be updated, but the flowchart on the same page says that the result of the operation should be saved in only VX. :S |
Interesting! It should be straightforward to write a small CHIP-8 program that verifies how |
For now, I believe that the original CHIP-8 interpreter on the COSMAC VIP changed only VX: VX = VY >> 1 and VX = VY << 1. The flowcharts on "VIPER, Volulme 1, Issue 2" and "Chip-8 on the COSMAC VIP", which appear to have been written by disassembling the machine code for the CHIP-8 interpreter listed in the original manual (RCA COSMAC VIP CDP18S711 Instruction Manual, Appendix C - CHIP-8 Interpreter), say so. |
Yeah, it seems that's the case after all. I just tried out in Emma 02, which I have to assume is accurate, and it does leave VY intact. |
Thanks for verifying, @tobiasvl. I've updated the instruction set on the wiki to note that |
Can you clarify whether the 8XY6 and 8XYE instructions change the VY register as well? The table below in your "Mastering CHIP-8" (and the Wiki) appears to mean that they change only the VX register: VX = VY >> 1 and VX = VY << 1.
On the other hand, the paragraph below the table gives an impression that register VY has to be modified as well: VX = VY = VY >> 1 and VX = VY = VY << 1.
I found that Octo, a popular CHIP-8 assembler, uses the first interpretation while there are some documentation that supports the second one: Chip-8 on the COSMAC VIP and the previous version of the CHIP-8 page on Wikipedia.
Anyway, thank you for your great documentation!
The text was updated successfully, but these errors were encountered: