abcscnuk@csuna.UUCP (News Manager) (06/02/88)
I know this kind of sounds stupid, but I thought that there may be
a few people who might be interrested, as there was a posting several
months ago on the net requesting info on this.
Finally after several months of scratching my head and going over
the manual several times, I finally figured out how to write an ISR
function in C. One day, I decided to put 'interrupt' in front of the
function name, and got the message 'must be declared as far', "aha! so
this must be it!" I thought as I put 'far' next to it and compiled
again. I then took a look at the code generated, and sure enough, the
registers were PUSHed in the beginning and POPped at the end, then an
IRET. I find it kind of interesting that the 'interrupt' keyword (I'm
assuming that it's a keyword, like 'far' and 'near') isn't mentioned
anywhere in the manuals (or at least I haven't found it yet).
//-n-\\ Naoto Kimura
_____---=======---_____ (csun!csuna!abcscnuk)
====____\ /.. ..\ /____====
// ---\__O__/--- \\ Enterprise... Surrender or we'll
\_\ /_/ send back your *&^$% tribbles !!
P.S.: It took me some time to figure out why the compiler kept dying
on the code fragment:
{
/* ... */
outp(CTRL_PORT,inp(CTRL_PORT) & MASK);
/* ... */
}
Seems that I had turned on the intrinsic functions somewhere
through a '#pragma'