delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/27/23:16:09

From: "d-range" <d-range AT thefridge DOT vet DOT fnt DOT hvu DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: DJGPP, inline and GAS
Date: Fri, 26 Jun 1998 16:49:39 +0200
Organization: World Online
Lines: 27
Message-ID: <6n0mqf$37j$1@news.worldonline.nl>
NNTP-Posting-Host: hlv1-p152.worldonline.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

How can I convert the following WATCOM-style pragma to an inlined asm
function under DJGPP? I tried for hours but I cannot get it to work ;-(

#pragma aux FixMul= "imul ebx",
                                      "shrd eax,edx,16",
                                       parms [eax] [ebx] modify [edx] value
[eax];

I tried:

inline Fixed FixMul(int x, int y) __asm__ (    "imull %%ebx" \

"shrdl 16,%%edx,%%eax" \
                                                                          :
"=a" : "a" (x), "b" (y): "%edx" );

but I think I'm doing something terribly wrong. the shrd opcode isn't even
recognized, and GCC (or GAS) gives a parse error before ':'

Regards,
    Wouter Bijlsma,
        <d-range AT thefridge DOT vet DOT fnt DOT hvu DOT nl>



- Raw text -


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