| Author |
Message |
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:21:24 am Post subject: Parser Hook Problems |
|
|
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? _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
_player1537

Guru-in-Training

Joined: 25 Nov 2009 Posts: 2958
|
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:23:19 am Post subject: |
|
|
Naw, that is always the same as well. And it isn't OP1. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
_player1537

Guru-in-Training

Joined: 25 Nov 2009 Posts: 2958
|
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:25:04 am Post subject: |
|
|
I'm only handling states 1-3, in which case B should contain the token. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55879 Location: Earth, Sol, Milky Way
|
Posted: 10 Jan 2011 12:38:14 am Post subject: |
|
|
The ParserHook will fire several times. Are you checking all the times it fires? _________________
 |
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:44:29 am Post subject: |
|
|
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. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
_player1537

Guru-in-Training

Joined: 25 Nov 2009 Posts: 2958
|
Posted: 10 Jan 2011 12:46:13 am Post subject: |
|
|
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? _________________ http://tanner.myserverathome.com
 |
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:47:50 am Post subject: |
|
|
I'm sure. When I remove that code, it still crashes. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
_player1537

Guru-in-Training

Joined: 25 Nov 2009 Posts: 2958
|
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 12:49:59 am Post subject: |
|
|
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
_________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55879 Location: Earth, Sol, Milky Way
|
Posted: 10 Jan 2011 01:10:45 am Post subject: |
|
|
jr z, $+2 jumps to the cp a, I believe. _________________
 |
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 01:12:05 am Post subject: |
|
|
It's not really that, I changed it for readability. There's really a label there. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
_player1537

Guru-in-Training

Joined: 25 Nov 2009 Posts: 2958
|
Posted: 10 Jan 2011 01:13:48 am Post subject: |
|
|
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 :/ _________________ http://tanner.myserverathome.com
 |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55879 Location: Earth, Sol, Milky Way
|
Posted: 10 Jan 2011 01:13:55 am Post subject: |
|
|
Aren't you using a proper debugging and breakpoints to avoid having to display bc? _________________
 |
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 01:14:41 am Post subject: |
|
|
KermMartian, this is technically hybrid Axe/Asm. _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55879 Location: Earth, Sol, Milky Way
|
Posted: 10 Jan 2011 01:16:32 am Post subject: |
|
|
| 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...? _________________
 |
|
| Back to top |
|
|
SirCmpwn

Coding Knight

Joined: 06 Feb 2010 Posts: 1477 Location: Colorado Springs
|
Posted: 10 Jan 2011 01:18:08 am Post subject: |
|
|
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 _________________ Drew "Sir Cmpwn" DeVault |
|
| Back to top |
|
|
|