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

Improve instruction documentation #69

Open
nummacway opened this issue Nov 20, 2024 · 0 comments
Open

Improve instruction documentation #69

nummacway opened this issue Nov 20, 2024 · 0 comments

Comments

@nummacway
Copy link

nummacway commented Nov 20, 2024

STOP
When reading through gbz80(7)'s documentation, I noticed it says STOP was 2 bytes long, when the instruction itself is only 1, not located in CB and doesn't take useful arguments. People on Discord pointed me to this chart (which BTW misses a "Yes" label at the very bottom). I suggest the documentation say something like this:
"Because the CPU might take the next byte as either a useless argument to the STOP instruction or as a new opcode, rgbds will always add an implicit NOP for safety. Visit Pan Docs for more information."

Some other suggestions:

  • Legend:
    • Exclamation mark is only used once, and that's in the legend. There's no need to explain symbols that are never used.
    • u3 should say that it always refers to bit indizes, and if 0 refers to the least or most significant bit.
  • Remove pointless anchors, e.g. any of these that aren't a heading. By using most browsers' default style of <abbr> HTML tag, one would expect the anchors to have a hint or point to the legend (or something like that), when in fact it's just a useless link. The legend of the 8-bit instructions looks really odd as B, D, E and L are underlined, but A, C, and H are not.
  • CPL should mention that the operation is also known as "bitwise NOT". I do programming for 20 years (though in high-level languages) and this was the first time I ever saw this operation being called the complement.
  • It could say that LD r8,r8 doesn't do anything at all if both arguments are the same. I thought that there must be a use if these exist, but LD [HL], [HL] does not - but there's no use, except for BGB using LD B, B for breakpoints and LD D, D for debug.
  • Several commands that work with a constant (literal, value, immediate data) could state that more efficient shortcuts exist if that value is 0, e.g. LD A, 0 could be written as XOR A, and CP 0 could be written as AND A or OR A, although flags are different. I acknowledge that this document is probably the wrong place for notes like that. If so, is there a location for community notes and advice on individual instructions?
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

1 participant