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

Bytes and cycles for prefix opcodes #3

Open
tobiasvl opened this issue May 25, 2020 · 2 comments
Open

Bytes and cycles for prefix opcodes #3

tobiasvl opened this issue May 25, 2020 · 2 comments

Comments

@tobiasvl
Copy link
Member

Some people (on the emudev Discord server) seem to be confused by the fact that the table lists 0xCB as 1 byte and 4 cycles, while all the 0xCB-prefixed opcodes in the separate table add that 1 byte and those 4 cycles to their totals.

For example, RLC B at 0xCB 0x00 is listed as taking 2 bytes and 8 cycles, but in the main table PREFIX at 0xCB is listed as taking 1 byte and 4 cycles.

That's not incorrect per se, since fetching the 1-byte prefix takes 4 cycles, so I'm not sure what the best "solution" would be. Perhaps just a footnote?

@Rangi42
Copy link

Rangi42 commented Mar 3, 2021

Since all the prefix opcodes take the same 2 bytes and 8 cycles, I would expect the PREFIX CB to list that. If anything is footnoted it should be the time to fetch just the $CB prefix byte.

@SonoSooS
Copy link
Contributor

This problem has already been solved in the documentation of other platforms (NEC 78-series MCUs come to mind) where it's just written as

PREFIX 2/3/4
see table (2/3/4)

with every other info removed from the table cell, so it's obvious that it's a multi-byte opcode, and the actual size and timings depend on the other following bytes.

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

No branches or pull requests

3 participants