You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to cartridge.txt, the cartridge puts the return value for messages in R0 register, but from the YCPU spec, R0 is reserved for message acknowledgement (MSG_ACK, MSG_WAIT, MSG_ERROR).
Should the return value be stored in R1 or R2 instead? (In the meantime I'll use R1 in my implementation.)
The text was updated successfully, but these errors were encountered:
I've just realized that keyboard also sends return value as response in some handler. It's at least consistent on MSG_ERROR. Perhaps I could do the same with cartridge, but it feels weird returning 1 on error, which is MSG_ACK and kind of indicate success.
Since mentioning that R0 could be something else rather than MSG_* would simply fix the issue, for now I'm comfortable as it is. I'll mention it in my own docs though because it's still an unofficial decision.
I see there are two ways to properly resolve this:
change YCPU specs (mainly section about HWQ $02) to match hardware specs: as written above. Hardware may write to R0, R1, and R2 with anything as defined in their specs.
change hardware specs to match YCPU specs: Hardware may only return MSG_* in R0. It also may not modify R1 and R2 if MSG_ERROR is sent via R0.
According to
cartridge.txt
, the cartridge puts the return value for messages in R0 register, but from the YCPU spec, R0 is reserved for message acknowledgement (MSG_ACK
,MSG_WAIT
,MSG_ERROR
).Should the return value be stored in R1 or R2 instead? (In the meantime I'll use R1 in my implementation.)
The text was updated successfully, but these errors were encountered: