T.R | Title | User | Personal Name | Date | Lines |
---|
252.1 | Run-Time? | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Thu Feb 13 1997 15:35 | 38 |
|
When in doubt, work around it. Perform a MOVL of a constant value
into a cell on the stack, and be done with it (at run time).
HELP/MESSAGE
ILLSTATINI, illegal static initialization
Facility: AMAC, MACRO-32 Compiler for OpenVMS AXP
Explanation: An invalid static initialization was detected. The compiler
restricts operations to:
<symbol + or - constant> opr <symbol + or - constant>
where 'opr' represents all MACRO operators and 'constant' can
be an expression that equates to a compile-time constant. This
restriction applies to external symbols and operands that are
labels in other program sections (psects).
Static initialization directives using any operations are
supported on literals, symbols with constant values, and
labels in the same psect.
User Action: Revise the code to contain no more than two external symbols.
.LIBRARY "SYS$LIBRARY:LIB.MLB"
.psect $data,noexe,rd,wrt,long
gbl_flags:
.long 0
.psect $code,exe,rd,nowrt,long
gbl_code:
.call_entry max_args=0
MOVL #sec$m_gbl!sec$m_expreg!sec$m_wrt!sec$m_perm,gbl_flags
movl #SS$_NORMAL,R0
ret
.end gbl_code
|
252.2 | Confusing address with value? | WIBBIN::NOYCE | Pulling weeds, pickin' stones | Thu Feb 13 1997 16:24 | 33 |
| > f1: .long a!b
> f2: .long c!d
> f: .long f1!f2
This tells the assembler to store the bitwise-or of a with b into
a longword, and define symbol f1 to be the address of that longword.
Then store the bitwise-or of c with d into the following longword
and define symbol f2 to be the address of that longword. Finally
compute the bitwise-or of the two addresses, and store that into the
third longword, and define symbol f to be the address of that longword.
Perhaps what you meant to do was to define f1 as equal to the bitwise-or
of a with b, and similarly with f2:
f1 = a!b
f2 = c!d
Now, if you want f to represent the address of a longword containing
all the flags together, you would write
f: .long f1!f2
This would be appropriate if you next intend to reference the memory,
perhaps like this:
movl f, 4(sp)
or pushal f
On the other hand, if you want f to be defined as the value that results
from or-ing together all the flags, you would write
f = f1!f2
This would be appropriate if you intend to use the value directly, perhaps
like this:
movl #f, 4(sp)
If this doesn't help, perhaps we need a more complete example, and explanation
of what it's supposed to do.
|
252.3 | Thanks | COPS02::LECORRE | | Fri Feb 14 1997 11:19 | 5 |
| So simple
Thanks a lot
Christian
|
252.4 | | STAR::BENSON | My other fiddle is a Strad | Mon Feb 17 1997 16:21 | 13 |
| It sounds like you have a fix but... I haven't seen the REAL
explanation here, which is this: In order to report this message, the
compiler must think these (SEC$M_GBL, etc) are external symbols, not
constants. This says to me that you are not including their definitions,
which I believe are in $SECDEF. Try including $SECDEF (which should come
out of sys$library:starlet.mlb) and see if that solves it.
Note that you can compile with /disable=global to tell the compiler not
to assume that symbols which haven't been defined are global
references. If you compile this way, you should be told that SEC$M_GBL,
etc, are undefined. (Until you add $SECDEF).
Tom
|