Repository navigation
Clarify that LD HL,SP+e8 does not modify SP in gbz80 man page - #2254
Conversation
|
Just to be sure, have you checked out https://gbdev.io/aipolicy ? As for the wording itself, that sounds more confusing so I'd rather go with “Set HL to the value of SP plus/minus the signed offset |
|
Yes I have seen it, I'm sorry if the wording sounds like AI but both the addition and the PR description was written by me and not an AI 😅 and I don't use AI while developing my emulator either. As I said, I just misunderstood the explanation which caused me around 15 minutes of debugging in my emulator. I thought clarifying it would be helpful to others in the future. Your suggested wording also makes sense, I can edit the PR. |
Rangi42
left a comment
There was a problem hiding this comment.
For symmetry with all the other LD command descriptions, we could phrase this as "Copy the value in register SP, plus the signed offset e8, into register HL." But LD HL, SP is an unusual instruction that already has an inconsistent description, so it's fine the way you wrote it too.
I think gbdev's own issue template is to blame. :P That's where the |
ISSOtm
left a comment
There was a problem hiding this comment.
Yep, I like this! Thank you both :)
Description
I am currently using the
gbz80reference while developing my own hobby Game Boy emulator (https://rgbds.gbdev.io/docs/master). While implementing theLD HL, SP-e8instruction (https://rgbds.gbdev.io/docs/master/gbz80.7#LD_HL,SP+e8) in my CPU implementation, the docs lead me to believe that the instruction modifies SP along with HL with it's phrasing. Then Blargg's03-op sp,hl.gbtest ROM didn't pass and I realized the instruction shouldn't actually modify SP.This PR clarifies that the instruction doesn't modify SP in a new sentence, it's a 2 line change in the
gbz80man page. The new description forLD HL, SP-e8reads: