Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

HP BASIC & $XABFHCDEF

SOLVED
Go to solution
Garry Fruth
Trusted Contributor

HP BASIC & $XABFHCDEF

Question: In a BASIC program, is there a way using compiler directives to identify the architecture and selectively include a text library module?

On an Alpha, I have a program that does
%INCLUDE "$XABDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
and later does
FHCXAB(I)::XAB$B_COD = XAB$C_FHC

When I compile on itanium, the reference to XAB$C_FHC fails as the constant is not declared.

On itanium, I see the value declared in $XABFHCDEF in SYS$LIBRARY:BASIC$STARTLET.TBL. I figure I could do something like:

%IF %DECLARED(%xyzzy)=0 %THEN
%INCLUDE "$XABDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
%END %IF

But I don't know what "%xyzzy" should be. Any suggestions?
11 REPLIES
Robert Gezelter
Honored Contributor

Re: HP BASIC & $XABFHCDEF

Garry,

What are the versions on BOTH Alpha and Itanium? That sounds like a problem that should be reported.

- Bob Gezelter, http://www.rlgsc.com
John Reagan
Respected Contributor

Re: HP BASIC & $XABFHCDEF

The building of BASIC$STARLET.TLB was changed for OpenVMS V8.3 (both Alpha and I64). It is now built during the OpenVMS build process and BASIC$STARLET.TLB is shipped with the OS, not with the compiler kit. Seems something isn't correct. I just checked and $XABDEF on both my Alpha V8.3 and I64 V8.3-1H1 systems are much smaller than the older $XABDEF on my VAX system (which came from the compiler kit).

Please report this so we can track it.
Garry Fruth
Trusted Contributor

Re: HP BASIC & $XABFHCDEF

Bob,

Alpha VMS Version = OpenVMS V7.3-2
Itanium VMS Version= OpenVMS V8.3

John,

Indeed there is a big difference between the sizes of $XABDEF on our Alpha 7.3 vs our Itanium 8.3. I'll get a case open with the support team. But I suspect now, I need a way to distinguish with a compiler directive, which version of VMS is being used.
Steven Schweda
Honored Contributor

Re: HP BASIC & $XABFHCDEF

> [...] which version of VMS is being used.

I'm no BASIC user, but if it's possible to
determine directly whether the item in
question is defined/declared/whatever, then
I'd do that instead of trying to deduce it
from the VMS or compiler version.

In this case, can't you include both modules
to be sure of getting the critical item? (Or
am I missing the point (as often happens)?)
Robert Gezelter
Honored Contributor

Re: HP BASIC & $XABFHCDEF

Garry,

I would recommend just using an %INCLUDE with a logical name.

I would not be shocked if a patch comes out on this one in a relatively short time. In that case, it would be bad to discover that major edits are needed to put things back.

Another possibility, that you can confirm for yourself, is to print out the 7.3-2 and the 8.3 definitions and check if the difference is significant. If there are no real differences, just copy the 7.3-2 TLB to an alternate directory, and define SYS$LIBRARY as a process logical name to pre-pend the additional directory to the search path. That will solve the problem without ANY source changes. It will also be straightforward to remove when the problem is resolved through support.

- Bob Gezelter, http://www.rlgsc.com
Hein van den Heuvel
Honored Contributor
Solution

Re: HP BASIC & $XABFHCDEF

Just now I compared XABDEF and XABFHC between Alpha V8.2, Alpha 8.3, Itanium 8.3 and Alpha 7.3-1 and they are all pretty much the same.

I don't think it is a 'problem' but I'll be happy to be proven wrong.

In the VERY old days (pre V7) the OpenVMS shipped a humongo XABDEF to capture all XABs. Best I know that had long since been change to this HORRIBLE contruct of a shared XABDEF for the header fields (BNL,COD,NXT) and individual XABxxxDEFs for the details.

So now you need a VARIANT or a COMMON to map the begin and the end. I never liked that. Too tedious.

Have google groups search comp.os.vms for "hein xabdef basic" and you'll see a 2007 topic about that. Ditto try google:hein basic xabdef +site:itrc.hp.com


I suspect someone 'helped' the V73.2 system to an Old Basic compiler Startlet to solve a problem back then.

Note... the V8.3 XABFHC is of course different in that it defines the new GBC fields. The old definition will still work.

ready to be proven wrong...

Regards,
Hein.
John Reagan
Respected Contributor

Re: HP BASIC & $XABFHCDEF

Yep, Hein has it correct. You need $XABFHCDEF as well from newer BASIC$STARLET.TLB files (both Alpha and I64).
Hein van den Heuvel
Honored Contributor

Re: HP BASIC & $XABFHCDEF

I found my notes back. They suggest the split from a single manually created large XABDEF (which was mighty handy) to multiple SDL generated files was done starting with DECbasic V1.3 in 1998.

TURRIS::DECBASIC:254

fwiw,
Hein.
Garry Fruth
Trusted Contributor

Re: HP BASIC & $XABFHCDEF

In C, there are several predefined macros to help with coding in situations like this. For instance, I could use __VAXC to select code specific to the VAX architecture. Granted, it sounds like this is more closely related to the version of Basic or VMS than it is with architecture; in this shop if I could in Basic distinguish between Alpha and Itanium, I could have $XABDEFFHC included conditionally. The following two-line program compiles fine on our Itanium; but fails to compile on our Alpha.

$ TY TMP.BAS
%INCLUDE "$XABDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
%INCLUDE "$XABFHCDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"


CU6: BAS TMP

%INCLUDE "$XABFHCDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
.................^
%BASIC-E-ERRACCLIB, error accessing module $XABFHCDEF in text library SYS$LIBRAR
Y:BASIC$STARLET.TLB
-BASIC-E-KEYNOTFND, key not found
at line number 2 in file MBR_DISK:[CU6]TMP.BAS;3
%BASIC-E-ENDNOOBJ, MBR_DISK:[CU6]TMP.BAS;3 completed with 1 diagnostic - object
deleted
/SWITCHES=NOAUTOCOMP not used - is it misspelled?
(This warning can be suppressed with /SWITCH=NO_UNUSED_SWIDMP)

Hein van den Heuvel
Honored Contributor

Re: HP BASIC & $XABFHCDEF

In C, there are several predefined macros to help with coding in situations like this.


No there are not... read on.

>>> in this shop if I could in Basic distinguish between Alpha and Itanium,

No you should not.

>> I could have $XABDEFFHC included conditionally.

You should be able to include is unconditionally.

There is an XABDEFFHC on for the version of OpenVMS since 7.3-X / DECbasic 1.3 on Alpha, as well as on Itanium.

If there is not one om the particular Alpha system which is being used then is is 99.99% certain to be non-standard, out-of-date library and placed there explicitly.

You can do the exact same thing on Itanium. That would not be a bad thing to do. No worse then the Alpha situation today. There is NO platform dependencies in XAB(FHC)DEF for Alpha/Itanium. They are exactly the same, both conforming to the RMS defitions which are the same.

>> The following two-line program compiles fine on our Itanium; but fails to compile on our Alpha.

The operative word is *our*.
It will work on any other Alpha.

Best regards,
Hein van den Heuvel

Garry Fruth
Trusted Contributor

Re: HP BASIC & $XABFHCDEF

Just adding a bit more information in case someone runs into a similar situation. The installation kit prompts the user whether or not to create the 'system definitions'. The default is NO. Consequently, if you install the new versions of the compiler, and select the default, you get to keep the old definitions.

I'm not sure if this option is shown when installing on a VMS 8.3 machine; where BASIC$STARLET is distributed with OpenVMS.

Somewhere along the line, some coding changes needed to be made with the compiler upgrade.