delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/02/17:08:49

Message-Id: <m0wulJn-0003FjC@fwd03.btx.dtag.de>
Date: Sat, 2 Aug 97 23:02 MET DST
To: djgpp AT delorie DOT com
References: <33DE0617 DOT 446B AT cray DOT com> <33DE0617 DOT 446B AT cray DOT com>
Subject: Re: FIXDIV for ASM
MIME-Version: 1.0
From: Georg DOT Kolling AT t-online DOT de (Georg Kolling)

Mark Goodwin schrieb:
> Hello,
>
> 	I am new to assembler, and I want to write a FIXDIV function
> 	using AT&T syntax.  Following is my attempt at writing this
> 	function; however it does not compile under DJGPP:
>
>   inline static long FIXDIV(long Num, long Denom)
>   {
>       long Result;
>       asm ("movl Num, %%eax;"
>            "movl %%eax, %%edx;"
>            "sarl %%edx, 16;"
>            "shll %%eax, 16;"
>            "idivl Denom"

You just have to use _Num and _Denom!



- Raw text -


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