Welcome, Guest. Please login or register.

Author Topic: Amiga interrupt-routines in C.  (Read 3629 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas

Re: Amiga interrupt-routines in C.
« on: April 17, 2003, 04:05:37 PM »

The code is called with the is_Data pointer in register a0, so your compiler must support something like "register __a0".

Also the interrupt does not run as part of your program's task, so if you use the small data model you have to initialize the base register prior to access any global variable. This is can usualy be told to the compile by the __saveds attribute.

In addition, if you write an interrupt server, your routine must signal if other servers should be called or not by setting the zero flag. Might be a bit tricky to do that in C.

So the correct declaration of your interrupt code is:

__saveds BOOL DummyINTCode(register __a1 struct mydata *data);

This is Dice C syntax, your compiler may be different.

You should really read the according sections in the RKRM manuals before you start experimenting.

Bye,
Thomas