Operating System - OpenVMS
1753328 Members
4997 Online
108792 Solutions
New Discussion юеВ

Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

 
SOLVED
Go to solution
John Simmonds
Occasional Contributor

Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

Is there a technique to get at the FP registers
from MACRO32 source ?

Thanks very much!
John H Simmonds.
6 REPLIES 6
Volker Halle
Honored Contributor

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

John,

here is a pointer to an answer from Ask The Wizard:

http://h71000.www7.hp.com/wizard/wiz_2553.html

... the Macro32 compiler has no idea how to access F0 nor any of the other floating point registers ...

Volker.
kari salminen
Advisor
Solution

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

You can do it with a small trick in MACRO-32.

See,

http://h71000.www7.hp.com/freeware/freeware80/probe/src/DMS.MAR

has nice routine AXP_FIX_R0 how to move F0 in R0.

It's actually MACRO-64 embedded into MACRO-32 code.

Kari Salminen
John Simmonds
Occasional Contributor

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

Volker, Thanks for confirming what I knew :)
I was wondering whether there were some
unsupported things like asm {} ;) but was
good to learn that the MACRO-64 compiler
is free too.

Kari, Now that's more like it !! Lovely
stuff !!

Thanks to you both.
John Reagan
Respected Contributor

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

BTW, that Macro-32 hack is just plain nasty. It assumes that the PSECT that contains the hand-crafted instructions will always be after the PSECT that ends with the label for AXP_FIX_R0. Make sure you use sufficient linker magic to keep them together. Also, don't even think about doing this in I64.
John Simmonds
Occasional Contributor

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

John,

Thanks for your wise comments .. I meant
to bracket my (wicked) delight at seeing that
horrible hack with a "tounge firmly in cheek"
indicator.

But I did use it .. (and modified the machine
code a little to do an integer scaling with
the FP number) .. simply because the target
machine (in Production) had no license for
any compiler and I had no approval to install
the Macro-64 compiler.

Do you know any way just using the Macro-32
compiler ?

Best wishes,
John.
John Reagan
Respected Contributor

Re: Read Alpha F0 reg. from MACRO32 ? (need to call math$random)

No, the Macro-32 compiler has absolutely no knowledge of the Alpha (or I64) floating register set. We don't use 'em at all.

You need the jacket routine to move F0 into R0. No way around that.