www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/06/17:00:17

From: Lars Andersson <lars_and AT algonet DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Watcom->DJGPP inline ASM
Date: Wed, 06 May 1998 19:52:44 +0000
Organization: Algonet/Tninet
Lines: 36
Message-ID: <3550BF8C.F9DD536D@algonet.se>
Reply-To: lars_and AT algonet DOT se
NNTP-Posting-Host: kairos.algonet.se
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

I'm trying to convert the C++ source code for my 3d engine from 
Watcom C/C++ 10.6 to DJGPP2 and I'm having some problems with 
inline asm pragmas... The AT&T syntax should be no problem but
I don't know how to pass parameters and return values etc...
If someone could translate the short pragmas below to DJGPP inline 
asm for me I'd be grateful... (Please reply by email as well...)

/Lars Andersson

#pragma aux Fixed_Mul64=\
               "imul  ebx           "\
               "shrd  eax, edx, 20  "\
               parm [eax] [ebx]      \
               modify [eax edx]      \
               value [eax];


#pragma aux Fixed_Div64=\
               "cdq                 "\
               "shld  edx, eax, 20  "\
               "sal   eax, 20       "\
               "idiv  ebx           "\
               parm [eax] [ebx]      \
               modify [eax edx]      \
               value [eax];


#pragma aux Float2Int=\
                "push  eax                "\
                "fld   dword ptr [esp]    "\
                "fistp dword ptr [esp]    "\
                "pop   eax                "\
                parm[eax]                  \
                value[eax];

- Raw text -


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