TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Patrick Annette
from: Russ Parks
date: 1995-12-22 02:39:34
subject: power() for VirtualPasca

Patrick Annette wrote in a message to Russ Parks:

 PA> Russ, thanks for the power function code.  It compiled in
 PA> Virtual Pascal with no problem; only change needed was "var
 PA> OldCw,TempCw:SmallWord."

 Yeah..seems I had to do something like that too. But my VP code was on an
HPFS partition and my mailer was over in DOS...so the TP6 code got posted
:-)

 PA> But beyond that, your code is definitely shorter, avoiding the
 PA> FPREM complications.  This is supposed to be necessary in
 PA> order to limit the argument of F2XM1 to the range [-0.5,
 PA> +0.5], but after trying your code, I'm not sure it's needed.

 That's one thing I wondered about... Seems I heard the range was -0.5 to
+0.5 on the '387 and -1 to +1 on the '486 (or something like that); anyway,
the concern was about people running on a '386 based system. Then the
possible problem of having to insert FWAIT's -- haven't needed 'em on the
'486 and no longer have a '386 system to test with. I really haven't a clue
to what systems it works with other than a '486.

PA>  That's the trouble with using a cookbook approach, you only
PA> *think* you understand!  Now I'll have to work through and
PA> see if it's really needed.  If not, there will definitely be
PA> some time saved.

 Well, for what it's worth, I know basically how it's *supposed* to work,
but not exactly sure why it *does* work...if that makes any sense at all


 PA> I'd like to make sure it will work with any OS/2 system FPU.
 PA> You don't happen to know a good reference on this, do you?

 Been looking for one myself. My only reference has been the TurboAssembler
docs, a few short asm programs, and using debug a lot -- essentially, the
try-an-instruction-and-see-what-happens approach. Lot's of fun :-)

 PA> Your example also encouraged me to convert the function to use
 PA> the assembler directive.  That should also save some time,
 PA> since it eliminates the code VP generates for 'begin' and
 PA> 'end' statements.

 Glad someone could put it to good use :-)


Russ

..."But sir, no one worries about upsetting a droid." -- C3PO
--- EZQuote 4.0
* Origin: Linux: The choice of a GNU generation (1:170/200.12)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515
SEEN-BY: 712/517 628 713/888 800/1 7877/2809
@PATH: 170/200 400 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.