A92: PLEASE ! > HELP ! Interrupt & stack ! PLEH <
[Prev][Next][Index][Thread]
A92: PLEASE ! > HELP ! Interrupt & stack ! PLEH <
////////////////////////////
!!!! P L E A S E !!!!
////////////////////////////
I need some help about interrupt & the stack.
Here is my problem.
First I just saw a few minutes ago that when we was into an interrupt (like the timer at 350Hz), the stack was the Supervisor Stack, isn't it ? (I saw it with calling hexlib in the interrupt routine).
So the stack pointer change when it call the interrupt, and is restored when it come back to the program.
HERE IS MY QUESTION : I want to change the return adress. (after each interrupt, it goes to a specified address). So can I do
move.l #the_routine,(a7) ;put adr of new routine to go after the interrupt
move.l old_int,-(a7) ;put the old interrupt adress
rts ;to go there
It should change the return adress, isn't it ?
(for that I think it work, because it work when I make it with 'bsr' and I trace it with db92)
Now, i want to do something harder :I want to change the stack pointer when it will come back to the program.
So I thought that If I changed a7 (with the right return adress, ok), it would be OK. (it work when I use 'bsr' instead of the interrupt and when I trace it with db92)
BUT the stack pointer in the interrupt routine was in the supervisor stack, and will change when It come back to the program (it will be in the user stack)
>>> COULD SOMEONE TELL ME HOW I COULD DO TO HAVE A NEW STACK POINTER WHEN IT COME BACK TO THE PROGRAM ??
* What is saved when it called the interrupt ? (and in which order ?)
I saw that there was the PC and the SR ? Is there something else ? And is which order ?
* Is the old stack register saved in order to restore it when It come back to the program ? (so I could change that)
>>>PLEASE<<<<
If you have answers for that, mail me !
I would be so grateful to you !
THANKS A LOT
Benoit SCHERRER
p.c.scherrer@wanadoo.fr
Follow-Ups: