-
-
Notifications
You must be signed in to change notification settings - Fork 172
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 the instruction documentation #1561
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this thorough improvement! I have comparatively few nitpicks.
I wonder what @nummacway thinks?
@@ -782,9 +814,9 @@ and | |||
bytes away. | |||
For example: | |||
.Bd -literal -offset indent | |||
JR Label ; no-op; encoded offset of 0 | |||
JR Label ; no-op; encoded offset of 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other code samples weren't indented, and with just three lines, "indented unindentedLabel indented" looked odd to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it helps making the label stand out from the instructions, especially in the absence of syntax highlighting.
If you think the other samples should be indented, then I'll agree.
.Sy NOP | ||
byte as the second | ||
.Sy STOP | ||
byte by default if one is not specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps an example should be given of how to do so? Otherwise, it's not clear that the syntax is stop $AF
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opcode table documents it as "STOP n8
"; should we do the same here to make that clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the canonical definition as just STOP
, and mention the optional STOP n8
syntax in the description, since it's really uncommon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is why
.Xr rgbasm 1
allows explicitly specifying the second byte
.Pq Sy STOP Ar n8
to override the default of $00.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please turn to override the default of $00.
into to override the default of $00 (NOP).
and I'm fine with the latest suggestions.
Damn the diff is impossible to read with just one word per line. How do manpage maintainers do this? Two comments of the things I can decipher:
|
Thanks for your feedback!
|
One important thing: The "bitwise NOT" was not meant for CCF but CPL. Because CCF affects a flag which is basically a boolean, CCF would be called the "logical NOT". I personally wouldn't even use a term here at all, but say that this "inverts" or "flips the carry flag", though I'm not sure if this wording makes sense to other people and where to put this. |
You could also call CPL the "subtraction from 255" (A = 255-A). |
|
Note that using Split diff (click the little cog menu in the Files tab) is much more readable, at least for this kind of diff. (I sometimes switch back to Unified for some code changes, but rarely.) I agree that “bitwise NOT” should be called out for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed another thing—you certainly are far more thorough than I! 😅
Store into | ||
.Sy A | ||
the bitwise OR of the value in | ||
Bitwise OR between the value in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? I'm surprised that you felt it was preferable to not call out explicitly where the result gets stored. Why's that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mimics the wording for AND
and XOR
: "Bitwise OP between the argument and A."
However, you're right, it could be better. The arithmetic operations are worded as "Add the argument to A", and "Subtract the argument from A". Maybe the bitwise ones should be "Bitwise OP A with the argument".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe, but IMO that's still a little tenuous and thus leaves the door open to confusion. I'd like the destination register pointed out explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the "Store into ..." wording, because it also keeps the order of the arguments.
Fixes #1560:
STOP
's second byte.u3
as a bit index.And does more cleanup: