[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::pascal

Title:DEC Pascal Notes
Notice:See note 1 for kits. Bug reports to CLT::DEC_PASCAL_BUGS
Moderator:TLE::REAGAN
Created:Sat Jan 25 1986
Last Modified:Tue Jun 03 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2675
Total number of notes:13409

2657.0. "Alignment of .PEN versus .PAS questions" by UTRTSC::WDEBAKKER (Feed your head) Tue Feb 11 1997 12:30

Hello,

A customer came with the following situation:
They're using a PEN file which they have aligned with
/ALIGN=ALPHA. The .PAS source, however, they have aligned
with /ALIGN=VAX. What they're trying to do, is to
have a 'uniform' platform with a.o. the .PEN files (using
large libraries etc), and then their idea was, that to
use 'platform-specific' executables, they'd use the
/ALIGN qualifier to overrule the alignment of the .PEN if necessary
(I hope I've made it a bit clear..).

What happens in practice is, that the alignment is not
overruled, but is preserved. So, in this case, the
alignment is ALPHA (for the particular fields)
although /ALIGN=VAX was specified.
I do have some examples, might this be necessary to
make it clear.

My questions are, is this intended behaviour (I can imagine
that), and, is there an option maybe, to 'force' the
alignment during compiletime, thereby including the
alignment of the .PEN ?

Cheers,
Willem
T.RTitleUserPersonal
Name
DateLines
2657.1TLE::REAGANAll of this chaos makes perfect senseTue Feb 11 1997 13:0934
    It is the expected behavior.
    
    The alignment/layout of a type is determine when the source is
    processed/precompiled.  The PEN file contains the compressed symbol
    table of the compiler with the alignment/layout already decided.  
    
    Allowing you to re-compute the alignment during the inherit attribute
    would make type checking impossible since the "name" wouldn't be
    sufficient anymore to confirm that all users of the "name" agree on its
    layout.
    
    If you want to have a VAX version and an Alpha version, you'll have to
    have 2 seperate PEN files.  Since there isn't any pre-processor on
    OpenVMS (or any cleaver %HOST or %TARGET directives) you can use a
    logical name in the filespec so you can have only one set of sources.
    
    For example,
    
    [inherit('penfiles:data_layout.pen')]
    module whatever;
    end.
    
    and then at compilation-time,
    
    $ if f$getsyi("arch_name") .eqs. "VAX"
    $ then
    $	define/user penfiles disk$:[vax-specific]
    $ else
    $   define/user penfiles disk$:[alpha-specific]
    $ endif
    $ pascal whatever
    
    				-John
    
2657.2...but do you really need two versions?WIBBIN::NOYCEPulling weeds, pickin' stonesWed Feb 12 1997 12:284
Why do you want to have /ALIGN=VAX sometimes?  Using
/ALIGN=ALPHA does take a bit more space, but it should
be faster, even on VAX.  The /ALIGN=VAX rules date from
a time when memory was much more expensive...
2657.3TLE::REAGANAll of this chaos makes perfect senseWed Feb 12 1997 13:589
    Has the customer looked at the SYS$HELP:PASCAL_RECORD_LAYOUT_GUIDE.MEM
    file?  This document talks about different alignment, how to work
    with both, why to keey using /ALIGN=VAX, when to convert existing data, 
    etc.
    
    Are you sharing a single disk in a mixed-architecture cluster?
    
    				-John
    				
2657.4Customer is happyUTRTSC::WDEBAKKERFeed your headThu Feb 13 1997 12:0416
Thanks for the replies.

The reason that the customer is using this setup, is that 
they have an application that gets data from DECmessageQ,
and I've been told that the inputdata is delivered as a
bytestream, and it is important for the application to
know that the fields are positioned identically in
memory on both platforms.
They have redefined the types to packed, and now the
application is 'seeing' the same image on both
platforms.

Thanks for your input,
Cheers,
Willem
2657.5TLE::REAGANAll of this chaos makes perfect senseThu Feb 13 1997 17:005
    Yes, PACKED is good way to help ensure data packing between
    VAX and Alpha machines as long as you don't mind the performance
    overhead of manipulating small data on non-byte boundaries.
    
    				-John