Re: A83: Error Handlers (83+ Flash SDK)


[Prev][Next][Index][Thread]

Re: A83: Error Handlers (83+ Flash SDK)




In accordance with the prophecy, Robert Maresh uttered:

> 
> Hey,
> 
> Hmm, you know, I tried debugging it in TI's Flash debugger (today) and I
> found that it wouldn't even make it past the _parseInp.  The _parseInp rom
> call causes the calc to lock up, but only when the error handler is
> installed.  I can't understand why, though. . .
> 
> Anyone know why this happens??

Are you using the provided error handler routines, or your own workaround
routines? The provided ones don't work, because they go somewhere in rom page
12, then call a routine in page 0 which adds an error handler to the stack,
then jumps back to rompage 12 and then does a 'ret'. But this 'ret' will read
its return address from the error handler stack frame that was just pushed, so
things will screw up.

The workaround is to fetch the correct page 0 address from the pusherrorhandler
stub in rom page 12, and then call it yourself. To be able to do so with a
pointer to the error handler passed in hl, you have to use self modifying code
(i.e. write the address into a jp instruction).

HTH
Linus

bomb nsa clinton assasin fbi kill overthrow president hello echelon cia kgb
---------------------------------------------------------------------------
All generalizations are false.




References: