Open hippietrail opened 3 weeks ago
Or does FEND
actually behave differently when it ends a FOR
compared to when it ends a FMT
?
"The Graphics Programming Language" by R. A. Green has this on page 81 "E.2 Format Suboperations"
FB FEND >FB {End of FMT}
FB FEND >FB,GGGG {End of FOR}
But on page 38 "9.29 FEND—End of Formatted Screen Write" it specifically says there is no operand:
[label] FEND [comment]
This instruction is a suboperation of the formatted screen write instruction and is only valid after an FMT instruction. The FEND instruction terminates a FOR group if one is active, or the FMT instruction. The instruction has no operands. STATUS is unaffected by this instruction. Although a “label” is allowed, it is illegal to branch to a formatted write suboperation. Example:
FMT Formatted screen write ··· Suboperands FEND End of formatted write
And this
GGGG
doesn't occur anywhere else in the book. So now I'm not sure at all...
First of all, thanks alot for the bug report! It seems that the FOR argument is disassembled incorrectly. It's also a cool project you're doing!
Regarding the FOR-END, this weird address argument does exist, and GROM cartridges containing this statement do execute it. Of course, my disassembly is also wrong.
That's just my first glance, I'll have to look at it again later. Please note, however, I'm going on vacation later this week, and I don't know if I have time before that.
I'll keep my eye out for your fix to see if it matched RetroGhidra's output. Let me know if you have a look at my project. I haven't pushed the GPL disassembler yet because I haven't worked out all of the addressing mode binary encodings yet.
I've been working on my own GPL disassembler extension for the Ghidra reverse-engineering tool and found an anomaly disassembling a hello world example posted in the atariage forum for me to test on. I use xdg99 as a reference to check that my results match.
Here is xdg99's output:
And here is RetroGhidra's output:
Notice how at
602c
it looks like theFEND
instruction uses the three bytesfb 60 23
rather than justfb
as would be normal and the60
and23
bytes are blank to their right.After looking through the GPL docs I have I implemented the
6x
VCHA
instruction which seems correct for that position.