A86: Re: Interrupts and calling
[Prev][Next][Index][Thread]
A86: Re: Interrupts and calling
Wait - the way I understand it - Check for the keypress On+F1. If not the
interrupt just returns. This happens 200 times/sec. If the keypress is
made, then the interrupt takes over, loads the prog, and executes it. Then
when that is done, interrupt exits, well jp $38, and TI-OS takes over. Are
you saying that it will be still be doing interrupts during the program?
How if the program is basically a call from the interrupt, followed by a jp
$38 to reti.
The way I've figured out how to execute jmv (my choice for mem
editing/viewing) is to use the ti86abs.inc calls. There is a routine which
mimicks the ldir instruction on the z80. Using three calls, and ahl as
input for each one, you set the source address, the destination address,
the number of bytes, and then call the load routine. Load jmv to $D748
using that routine, do a "call $D748". That is what I've figured out so
far, however it has bugs.
I.E. it wont work!!!. But that's due to my sucking as a programmer. There
is still however the problem of saving system address like the cursor
position, and flags.
The above problem could be fixed by not loading jmv but some sort of loader
prog, that saves all these values in a table and then puts them back. Then
it would be easy to call jmv from within that program by using the asm
module equates (maybe.) Question to ask there is the issue of what happens
if the calc isn't "aware" it's executing an .86p since it wasn't executed
with "asm(program", so it cant save the current program's name.
Dang it. I wish TI would just release everything they knew.
Andres Garcia
--------------------
mailto:xrigel@q-net.net
----------
> From: Martin Blix Grydeland <grydelan@stud.ntnu.no>
> To: 'Garcia' <xrigel@q-net.net>
> Cc: TI-86 Assembly Mailing List (E-post) <assembly-86@lists.ticalc.org>
> Subject: RE: Interrupts and calling
> Date: Wednesday, November 26, 1997 7:22 AM
>
> There is no easy way to call a program from an interrupt. I have one
idea, but haven't had the time yet to test it out. At the end of the
interrupt handler at $38, there is a reti instruction. This function will
jump to the location topmost in stack, which is the address of the code
being execute when the interrupt occured. It would be possible to push the
address of a code to execute to the stack during the interrupt, which would
then be jumped to at the end of $38.
>
> This code had to make sure that the system would be unchanged at the end,
because you would have no idea of what the calc wwas doing at the time the
interrupt occured. All registers would have to be pushed/poped, the system
flags had to be set back to what they were, and all changed memory
locations (_curRow etc.) restored. I'm not sure if it would be possible to
do a rom-call in this code. The problem is that our code could just as well
be executed during a rom-call. If we do another rom-call during this code,
some variables used by that rom-call could be changed, and leave no sense
when returning to that rom-call. This has to be tested. At the end of our
code, a single ret instruction would jump back to the original code.
>
> I'll check this out, and come back with more info.
>
> -Martin
>
> -----Original Message-----
> From: Garcia [SMTP:xrigel@q-net.net]
> Sent: Monday, November 24, 1997 10:38 PM
> To: grydelan@stud.ntnu.no
> Subject: Interrupts and calling
>
> Martin:
>
> What would be the easiest way to run a asm program from the interrupt
> handler?
>
> Andres
> ----------------------
> mail: xrigel@q-net.net
>