Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 2003 23:01:29 +0100
From:      Marcin Gryszkalis <mg@fork.pl>
To:        alpha@FreeBSD.ORG
Subject:   Re: Open Watcom compiler
Message-ID:  <3E4972B9.5060102@fork.pl>
In-Reply-To: <20030211214435.GI1877@gsmx07.alcatel.com.au>
References:  <20030211003353.GA12187@athlon.pn.xcllnt.net> <15945.1278.292937.743702@grasshopper.cs.duke.edu> <20030211192217.GD2881@dhcp01.pn.xcllnt.net> <20030211214435.GI1877@gsmx07.alcatel.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
> I don't know what the OW support for inline assember is.

There's Watcom FAQ made by Paul Hsieh, go to
http://www.azillionmonkeys.com/qed/watfaq.shtml#27
for more information on inline assembly in watcom.

In short, it's usually (always?) function-based mode
but you can specify which registers are parameters,
which are modified (so the compiler know) and which is
return value. eg.

void DWORDCopy(long *Source, long *Destination, int Length);
#pragma aux DWORDCopy = " rep movsd " parm [ESI] [EDI] [ECX] modify [ESI EDI ECX];

or

double RDTSC(void);
   #pragma aux RDTSC = " .586 "            \
   "       rdtsc                   "       \
   "       push    edx             "       \
   "       push    eax             "       \
   "       fild    qword [esp]     "       \
   "       pop     eax             "       \
   "       pop     edx             "       \
   modify [eax edx] value [8087];

(I have no idea what it does, just copy-n-paste :) )



-- 
Marcin Gryszkalis
http://fork.pl
<><


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E4972B9.5060102>