A86: RE: Interrupts and calling


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

A86: RE: Interrupts and calling



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