Mail Archives: djgpp/1996/09/19/15:40:34
In article <Pine DOT SOL DOT 3 DOT 95 DOT 960919093325 DOT 3454B-100000 AT columbia>,
MIKAEL BACKMAN <di95mba AT student DOT hk-r DOT se> wrote:
>1. When using Watcom I declared my interrupt routines as follows :
>
>void (__interrupt __far __cdecl Introutine)()
DJGPP has no idea what __interrupt __far and __cdecl mean. If you
need to do interrupts with DJGPP you'll have to check you the FAQ
>
>2. In Watcom I used pragmas for inline assembly functions.
>
>#pragma aux func =3D \
> "shl eax,1" \
> parm caller [eax] \
> value [eax];
>
In DJGPP you use extended assembly. See
http://www.rt66.com/~brennan/djgpp_asm.html for a tutorial. Your
function above would be...
inline unsigned int func(unsigned int value) /* inline is optional */
{
unsigned int retval;
__asm__ ( "shll $1,%0"
: "=r" (retval) /* Use any GP register for return value */
: "0" (value) /* Use same register for input value */
);
return (retval);
}
--
Eric Korpela | An object at rest can never be
korpela AT ssl DOT berkeley DOT edu | stopped.
<a href="http://www.cs.indiana.edu/finger/mofo.ssl.berkeley.edu/korpela/w">
Click here for more info.</a>
- Raw text -