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:

> I am installing an error handler to trap errors, such as err:memory,
> err:break, etc, when my asm program executes BASIC programs. The problem is
> that when the BASIC program encounters the 'Stop' command, the calc locks

I'm not so fluent in 83+ programming, but based on what I know about the 83,
these are my guesses:

>   ld hl, my_error_handler
>   call  APP_PUSH_ERRORH ; Initialize Error handler
>   bit   ProgExecuting,(iy+newDispf)
>   push  af  ; Save it.
>   set   ProgExecuting,(iy+newDispf)
>   bcall(_parseInp) ; Run program!
>   pop   af  ; Restore state.
> ;not sure if this next line is needed, but it does NOT cause the problem.

Nope. The problem is most probably occuring during the parseInp call. However,
the next line is needed, and you'd better have a closer look at what this code
does if you don't understand it. But I digress.

>   jr    nz,stateset ; Jump if on
>   res   ProgExecuting,(iy+newDispf) ; reset
>   call APP_POP_ERRORH  ;no error, then close error handler
> 
> my_error_handler:
> 
> ;no matter what code I put here, the calc still locks up, and even when I do
> a dispHL and try pausing the program at this point, the program execution
> never makes it here.
> 
>   ;bcall(_dispHL)
>   ld a,(iy+asm_Flag1)   ;restore a
>   or 0                  ;is 'a' zero?
>   ret z                 ;quit then.
>   call copy             ;copy a prog name
>   bcall(_chkfindsym)    ;look it up
>   bcall(_DelVar)        ;delete it
>   ret                   ;quit

An error handler on the ti-83 isn't just a do-anything-then-ret routine. IIRC,
you have to end it with a jump to a certain system routine. (Isn't there a
macro called bjump() to do this under ion?) 

Now, I don't remember what system routine you have to jump to, but it should
be easy to find in the ROM (Just look for anything calling Push Errorhandler,
and examine the handler it provides). But I think this might be the cause of
the lockup.

HTH
Linus
----------------------------------------------------------------------------
   "Science without religion is lame. Religion without science is blind."
                                                       -- Albert Einstein
----------------------------------------------------------------------------




References: