delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/19/17:19:33

Date: Fri, 20 Sep 1996 08:56:25 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Porting from Watcom to DJGPP
To: MIKAEL BACKMAN <di95mba AT student DOT hk-r DOT se>
Cc: djgpp AT delorie DOT com
Message-id: <32425C39.570D@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <Pine DOT SOL DOT 3 DOT 95 DOT 960919093325 DOT 3454B-100000 AT columbia>

MIKAEL BACKMAN wrote:
> 
> Hello.
> 
> I heard that DJGPP would produce faster code than Watcom, so I'm trying to
> port my Watcom sources to DJGPP. I've encountered a few problems with
> this.
> 
> ----------------
> 
> 1. When using Watcom I declared my interrupt routines as follows :
> 
> void (__interrupt __far __cdecl Introutine)()
> 
> This won't work with DJGPP, I get a parse error from the compiler.
> 
> *** How do I overcome this problem ?

Your best bet is to check the FAQ, your problem is covered in all its 
gory details. I don't know the section number but I'm sure Eli will give 
it to you.

> ------------------
> 
> 2. In Watcom I used pragmas for inline assembly functions.
> 
> #pragma aux func =  \
>  "shl eax,1"        \
>  parm caller [eax]  \
>  value [eax];
> 
> Doesn't really do much... Just an example.
> 
> * parm caller [eax] show where to put the input parameter.
> * value [eax] shows where it will be returned.
> 
> *** How do I declare the in & out parameters in DJGPP's assembler AS?

The above would become:

asm("shll $1,%0" : "=a"(value):"0"(param));

see the gcc info documentation for more details ('info gcc "c ex" ex' 
will get you to the extended asm section)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019