www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/25/21:03:10

From: Mark Goodwin <mgoodwin AT cray DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Using ASM with DJGPP
Date: Fri, 25 Jul 1997 10:22:47 -0500
Organization: Cray Research a division of Silicon Graphics, Inc.
Lines: 25
Message-ID: <33D8C4C7.41C6@cray.com>
NNTP-Posting-Host: fsgi091.cray.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello,

	I am having trouble compiling the following assembler code with
	DJGPP.  Could somebody show me an assembler variation of these
	two macros that will compile with DJGPP?

Much appreciated,

Mark Goodwin
mgoodwin AT cray DOT com


#define fixmul(Result, Fac1, Fac2, Prec) \
  {  asm { mov eax, Fac1 } \
     asm { imul Fac2 } \
     asm { shrd eax, edx, 32-Prec } \
     asm { mov Result, eax } }

#define fixdiv(Result, Num, Denom, Prec) \
  {  asm { mov eax, Num } \
     asm { mov edx, eax } \
     asm { sar edx, Prec } \
     asm { shl eax, 32-Prec } \
     asm { idiv Denom } \
     asm { mov Result, eax } }

- Raw text -


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