[A83] Re: interrupts and APD


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

[A83] Re: interrupts and APD





>
> Hi, I tried to make a little interrupt program, but I experienced some
> problems:
>
> 1) I read the tutorial in ASMGuru. "ei" and "di"
> were used in the interrupt program. But with using these commands, my vti
> crashes. Does somebody knows what I did wrong, how to prevent this. Or is
it
> possible to set up an interrupt without using these commands (I was able
to,
> but...).

The 'ei' and 'di' opcodes are essential to interrupts routines.  Doing a
'di' will disable all interrupts, and 'ei' enables them.  As for the
crashing, make sure that you enable the interrupts only after you've
installed your interrupt routine.

>
> 2) When running an interrupt on the background of ti-OS my vti crashes
after
> (approx.) 5 minutes. This is probably caused by APD (I can't thing of
> another explanation). But ASMGuru says that APD will be turned of in IM 2.
> So what causes the crash and what can I do about it?

I'm guessing that your interrupt routine is installed in the APD ram, right?
With interrupt routines that run in the background of the TI-OS, you must
jump to the beginning of the im1 routine at the end of the im2 routine.
Your interrupt routine is not handling the APD timer, the im1 routine is
when you jump to it =P  When the calc APD's it probably writes over your
routine and/or jump table, making the calc crash.  To fix this, you can
either find another place to install your interrupt routine or disable the
APD when you install it.

bcall(_disableapd)

>
> 3) Btw: does somebody knows a good URL to find asm source codes (for ti-83
> of course)?
>

I wrote a tutorial for the 83+.. you might find it useful.  Just change the
memory equates :)
http://www.ticalc.org/archives/files/fileinfo/168/16891.html

- - Joe




References: