Hello,
I've been pulling my hair out over this, but I can't seem to figure it out. For some reason, when the parser hook fires for me, the value in BC is always the same, and doesn't represent the token being parsed. Does anyone know why this might be happening?
I believe op1 or one of the other's holds the actual token.
Naw, that is always the same as well. And it isn't OP1.
I'm only handling states 1-3, in which case B should contain the token.
The ParserHook will fire several times. Are you checking all the times it fires?
Yeah. The code is something like this:
Code: or a
ret z ; Return on state 0
[Display BC's value in hex]
cp a
ret
This crashes for anything other than state 0.
Are you sure whatever it is you are displaying BC with isn't screwing up something you need? Like one of the pointers or something?
I'm sure. When I remove that code, it still crashes.
You return Z every time with that code, is that right? "Return Z to run the standard function." (WikiTI)
Code: cp 1
jr nz,ReturnZ
<display BC>
xor a
inc a
ret
ReturnZ:
xor a
ret
That is correct. Right now, I just want to get through it without crashing.
This is my current code:
Code: cp 1
jr z, $+2
cp a
ret
[Display BC's hex value]
cp a
ret
jr z, $+2 jumps to the cp a, I believe.
It's not really that, I changed it for readability. There's really a label there.
Nope, it doesn't. BrandonW and I worked that out one HCWP, it jumps from the end of instruction. So the literal "jr" followed by a literal 0 will continue execution normally. Err, kinda like what we are talking about :/
Aren't you using a proper debugging and breakpoints to avoid having to display bc?
KermMartian, this is technically hybrid Axe/Asm.
SirCmpwn wrote:
KermMartian, this is technically hybrid Axe/Asm.
And that somehow precludes you from using an emulator with a debugger to set breakpoints on your ParserHook...?
My hook works fine for non-class 1 events. But on class 1 events, I get ERR:Argument when exiting with Z reset. With Z set, it works, but still executes the token.
I use the following on my exits, straight from Omnicalc:
-With Parser
xor a
ret
-Without Parser
xor a
inc a
ret