Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

VAX MACRO and Instruction Set Reference Manual


Previous Contents Index


.F_FLOATING

Floating-point storage directive

Format

.F_FLOATING literal-list

.FLOAT literal-list


Parameter

literal-list

A list of floating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus and unary minus.

Description

.F_FLOATING evaluates the specified floating-point constants and stores the results in the object module. .F_FLOATING generates 32-bit, single-precision, floating-point data (1 bit of sign, 8 bits of exponent, and 23 bits of fractional significance). See the description of .D_FLOATING for information on storing double-precision floating-point numbers and the descriptions of .G_FLOATING and .H_FLOATING for descriptions of other floating-point numbers.

Notes

  1. See the description of .ENABLE for information on specifying floating-point rounding or truncation.
  2. The floating-point constants in the literal list must not be preceded by the floating-point unary operator (^F).

Example


.F_FLOATING  134.5782,74218.34E20     ; Constant list 
.F_FLOATING  134.2,0.1342E3,1342E-1   ; These all generate 134.2 
.F_FLOATING  -0.75,1E38,-1.0E-37      ; Constant list 
.FLOAT       0,25,50 
      


.G_FLOATING

G_floating-point storage directive

Format

.G_FLOATING literal-list


Parameters

literal-list

A list of floating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus or unary minus.

Description

.G_FLOATING evaluates the specified floating-point constants and stores the results in the object module. .G_FLOATING generates 64-bit data (1 bit of sign, 11 bits of exponent, and 52 bits of fraction).

Notes

  1. G_floating-point numbers are always rounded. They are not affected by the .ENABLE TRUNCATION directive.
  2. The floating-point constants in the literal list must not be preceded by the floating-point operator (^F).

Example


.G_FLOATING   1000,  1.0E3,  1.0000000E-9   ; Constant list 
      


.GLOBAL

Global symbol attribute directive

Format

.GLOBAL symbol-list


Parameter

symbol-list

A list of legal symbol names, separated by commas (,).

Description

.GLOBAL indicates that specified symbol names are either globally defined in the current module or externally defined in another module (see Section 3.3.3).

Notes

  1. .GLOBAL is provided for MACRO-11 compatibility only. Digital recommends that global definitions be specified by a double colon (::) or double equal sign (:=,=) (see Section 2.1 and Section 3.8) and that external references be specified by .EXTERNAL when necessary.
  2. The alternate form of .GLOBAL is .GLOBL.

Example


.GLOBAL LAB_40,LAB_30           ; Make these symbol names 
                                ;   globally known 
.GLOBAL UKN_13                  ;   to all linked modules 
      


.H_FLOATING

H_floating-point storage directive

Format

.H_FLOATING literal-list


Parameter

literal-list

A list of floating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus or unary minus.

Description

.H_FLOATING evaluates the specified floating-point constants and stores the results in the object module. .H_FLOATING generates 128-bit data (1 bit of sign, 15 bits of exponent, and 112 bits of fraction).

Notes

  1. H_floating-point numbers are always rounded. They are not affected by the .ENABLE TRUNCATION directive.
  2. The floating-point constants in the literal list must not be preceded by the floating-point operator (^F).

Example


.H_FLOATING  36912,  15.0E18,  1.0000000E-9  ; Constant list 
      


.IDENT

Identification directive

Format

.IDENT string


Parameter

string

A 1- to 31-character string that identifies the module, such as a string that specifies a version number. The string must be delimited. The delimiters can be any paired printing characters other than the left angle bracket (<) or the semicolon (;), as long as the delimiting character is not contained within the text string.

Description

.IDENT provides a means of identifying the object module. This identification is in addition to the name assigned to the object module with .TITLE. A character string can be specified in .IDENT to label the object module. This string is printed in the header of the listing file and also appears in the object module.

Notes

  1. If a source module contains more than one .IDENT, the last directive given establishes the character string that forms part of the object module identification.
  2. If the delimiting characters do not match, or if you use an illegal delimiting character, the assembler displays an error message.

Example


.IDENT  /3-47/                 ; Version and edit numbers 
      

The character string "3-47" is included in the object module.


.IF

Conditional assembly block directives

Format

.IF condition argument(s)

.

.

.

range

.

.

.

.ENDC


Parameters

condition

A specified condition that must be met if the block is to be included in the assembly. The condition must be separated from the argument by a comma (,), space, or tab. Table 6-4 lists the conditions that can be tested by the conditional assembly directives.

argument(s)

One or more symbolic arguments or expressions of the specified conditional test. If the argument is an expression, it cannot contain any undefined symbols and must be an absolute expression (see Section 3.5).

range

The block of source code that is conditionally included in the assembly.

Table 6-4 Condition Tests for Conditional Assembly Directives
Condition
Test
  Complement
Condition Test
  Argument
Type
Number of
Arguments
Condition that
Assembles Block
Long Form Short
Form
Long Form Short
Form
     
EQUAL EQ NOT_EQUAL NE Expression 1 Expression is equal to 0/not equal to 0.
GREATER GT LESS_EQUAL LE Expression 1 Expression is greater than 0/less than or equal to 0.
LESS_THAN LT GREATER_EQUAL GE Expression 1 Expression is less than 0/greater than or equal to 0.
DEFINED DF NOT_DEFINED NDF Symbolic 1 Symbol is defined /not defined.
BLANK 1 B NOT_BLANK 1 NB Macro 1 Argument is blank/ nonblank.
IDENTICAL 1 IDN DIFFERENT 1 DIF Macro 2 Arguments are identical/different.


1The BLANK, NOT_BLANK, IDENTICAL, and DIFFERENT conditions are only useful in macro definitions.

Description

A conditional assembly block is a series of source statements that is assembled only if a certain condition is met. .IF starts the conditional block and .ENDC ends the conditional block; each .IF must have a corresponding .ENDC. The .IF directive contains a condition test and one or two arguments. The condition test specified is applied to the arguments. If the test is met, all VAX MACRO statements between .IF and .ENDC are assembled. If the test is not met, the statements are not assembled. An exception to this rule occurs when you use subconditional directives (see the description of the .IF_x directive).

Conditional blocks can be nested; that is, a conditional block can be inside another conditional block. In this case, the statements in the inner conditional block are assembled only if the condition is met for both the outer and inner block.

Notes

  1. If .ENDC occurs outside a conditional assembly block, the assembler displays an error message.
  2. VAX MACRO permits a nesting depth of 31 conditional assembly levels. If a statement attempts to exceed this nesting level depth, the assembler displays an error message.
  3. Lowercase string arguments are converted to uppercase before being compared, unless the string is surrounded by delimiters. For information on string arguments and delimiters, see Chapter 4.
  4. The assembler displays an error message if .IF specifies any of the following: a condition test other than those in Table 6-4, an illegal argument, or a null argument specified in an .IF directive.
  5. The .SHOW and .NOSHOW directives control whether condition blocks that are not assembled are included in the listing file.

Examples

#1

An example of a conditional assembly directive is: 
 
   .IF EQUAL  ALPHA+1        ; Assemble block if ALPHA+1=0. Do 
     .                       ;   not assemble if ALPHA+1 not=0 
     . 
     . 
   .ENDC 
      

#2

Nested conditional directives take the form: 
 
   .IF   condition,argument(s) 
   .IF   condition,argument(s) 
     . 
     . 
     . 
   .ENDC 
   .ENDC 
      

#3

The following conditional directives can govern whether assembly 
is to occur: 
 
   .IF DEFINED  SYM1 
   .IF DEFINED  SYM2 
     . 
     . 
     . 
   .ENDC 
   .ENDC 
      

In this example, if the outermost condition is not satisfied, no deeper level of evaluation of nested conditional statements within the program occurs. Therefore, both SYM1 and SYM2 must be defined for the code to be assembled.


.IF_x

Subconditional assembly block directives

Format

.IF_FALSE

.IF_TRUE

.IF_TRUE_FALSE


Description

VAX MACRO has the following three subconditional assembly block directives:
Directive Function
.IF_FALSE If the condition of the assembly block tests false, the program includes the source code following the .IF_FALSE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block.
.IF_TRUE If the condition of the assembly block tests true, the program includes the source code following the .IF_TRUE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block.
.IF_TRUE_FALSE Regardless of whether the condition of the assembly block tests true or false, the source code following the .IF TRUE_FALSE directive (and continuing up to the next subconditional directive or to the end of the assembly block) is always included.

The implied argument of a subconditional directive is the condition test specified when the conditional assembly block was entered. A conditional or subconditional directive in a nested conditional assembly block is not evaluated if the preceding (or outer) condition in the block is not satisfied (see Examples 3 and 4).

A conditional block with a subconditional directive is different from a nested conditional block. If the condition in the .IF is not met, the inner conditional blocks are not assembled, but a subconditional directive can cause a block to be assembled.

Notes

  1. If a subconditional directive appears outside a conditional assembly block, the assembler displays an error message.
  2. The alternate forms of .IF_FALSE, .IF_TRUE, and .IF_TRUE_FALSE are .IFF, .IFT, and .IFTF.

Examples

#1

Assume that symbol SYM is defined: 
 
   .IF DEFINED   SYM               ; Tests TRUE since SYM is defined. 
     .                             ;   Assembles the following code. 
     . 
     . 
   .IF_FALSE                       ; Tests FALSE since previous 
     .                             ;   .IF was TRUE.  Does not 
     .                             ;   assemble the following code. 
     . 
   .IF_TRUE                        ; Tests TRUE since SYM is defined. 
     .                             ;   Assembles the following code. 
     . 
     . 
   .IF_TRUE_FALSE                  ; Assembles the following code 
     .                             ;   unconditionally. 
     . 
     . 
   .IF_TRUE                        ; Tests TRUE since SYM is defined. 
     .                             ;   Assembles remainder of 
     .                             ;   conditional assembly block. 
     . 
   .ENDC 
      

#2

Assume that symbol X is defined and that symbol Y is not defined: 
 
   .IF DEFINED  X                  ; Tests TRUE since X is defined. 
   .IF DEFINED  Y                  ; Tests FALSE since Y is not defined. 
   .IF_FALSE                       ; Tests TRUE since Y is not defined. 
     .                             ;   Assembles the following code. 
     . 
     . 
   .IF_TRUE                        ; Tests FALSE since Y is not defined. 
     .                             ;   Does not assemble the following 
     .                             ;   code. 
     . 
   .ENDC 
   .ENDC 
      

#3

Assume that symbol A is defined and that symbol B is not defined: 
 
   .IF DEFINED  A                  ; Tests TRUE since A is defined. 
     .                             ;   Assembles the following code. 
     . 
     . 
   .IF_FALSE                       ; Tests FALSE since A is defined. 
     .                             ;   Does not assemble the following 
     .                             ;   code. 
     . 
   .IF NOT_DEFINED B               ; Nested conditional directive 
     .                             ;   is not evaluated. 
     . 
     . 
   .ENDC 
   .ENDC 
      

#4

Assume that symbol X is not defined but symbol Y is defined: 
 
   .IF DEFINED  X                  ; Tests FALSE since X is not defined. 
     .                             ;   Does not assemble the following 
     .                             ;   code. 
     . 
   .IF DEFINED  Y                  ; Nested conditional directive 
     .                             ;   is not evaluated. 
     . 
     . 
   .IF_FALSE                       ; Nested subconditional 
     .                             ;   directive is not evaluated. 
     . 
     . 
   .IF_TRUE                        ; Nested subconditional 
     .                             ;   directive is not evaluated. 
     . 
     . 
   .ENDC 
   .ENDC 
      


.IIF

Immediate conditional assembly block directive

Format

.IIF condition [,]argument(s), statement


Parameters

condition

One of the legal condition tests defined for conditional assembly blocks in Table 6-4 (see the description of .IF). The condition must be separated from the arguments by a comma (,), space, or tab. If the first argument can be a blank, the condition must be separated from the arguments with a comma.

argument(s)

An expression or symbolic argument (described in Table 6-4) associated with the immediate conditional assembly block directive. If the argument is an expression, it cannot contain any undefined symbols and must be an absolute expression (see Section 3.5). The arguments must be separated from the statement by a comma.

statement

The statement to be assembled if the condition is satisfied.

Description

.IIF provides a means of writing a one-line conditional assembly block. The condition to be tested and the conditional assembly block are expressed completely within the line containing the .IIF directive. No terminating .ENDC statement is required.

Note

The assembler displays an error message if .IIF specifies a condition test other than those listed in Table 6-4, an illegal argument, or a null argument.


Example


.IIF DEFINED EXAM, BEQL ALPHA 
      

This directive generates the following code if the symbol EXAM is defined within the source program:


BEQL    ALPHA 


.IRP

Indefinite repeat argument directive

Format

.IRP symbol,<argument list>

.

.

.

range

.

.

.

.ENDR


Parameters

symbol

A formal argument that is successively replaced with the specified actual arguments enclosed in angle brackets (<>). If no formal argument is specified, the assembler displays an error message.

<argument list>

A list of actual arguments enclosed in angle brackets and used in expanding the indefinite repeat range. An actual argument can consist of one or more characters. Multiple arguments must be separated by a legal separator (comma, space, or tab). If no actual arguments are specified, no action is taken.

range

The block of source text to be repeated once for each occurrence of an actual argument in the list. The range can contain macro definitions and repeat ranges. .MEXIT is legal within the range.

Description

.IRP replaces a formal argument with successive actual arguments specified in an argument list. This replacement process occurs during the expansion of the indefinite repeat block range. The .ENDR directive specifies the end of the range.

.IRP is analogous to a macro definition with only one formal argument. At each expansion of the repeat block, this formal argument is replaced with successive elements from the argument list. The directive and its range are coded in line within the source program. This type of macro definition and its range do not require calling the macro by name, as do other macros described in this section.

.IRP can appear either inside or outside another macro definition, indefinite repeat block, or repeat block (see the description of .REPEAT). The rules for specifying .IRP arguments are the same as those for specifying macro arguments.


Example

The macro definition is as follows:


.MACRO  CALL_SUB        SUBR,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 
.NARG   COUNT 
.IRP    ARG,<A10,A9,A8,A7,A6,A5,A4,A3,A2,A1> 
.IIF    NOT_BLANK ,     ARG,    PUSHL ARG 
.ENDR 
CALLS   #<COUNT-1>,SUBR         ; Note SUBR is counted 
.ENDM   CALL_SUB 
      

The macro call and expansion of the macro defined previously is as follows:


CALL_SUB        TEST,INRES,INTES,UNLIS,OUTCON,#205 
.NARG   COUNT 
.IRP    ARG,<,,,,,#205,OUTCON,UNLIS,INTES,INRES> 
.IIF    NOT_BLANK ,     ARG,      PUSHL ARG 
.ENDR 
.IIF    NOT_BLANK ,     ,         PUSHL 
.IIF    NOT_BLANK ,     ,         PUSHL 
.IIF    NOT_BLANK ,     ,         PUSHL 
.IIF    NOT_BLANK ,     ,         PUSHL 
.IIF    NOT_BLANK ,     ,         PUSHL 
.IIF    NOT_BLANK ,     #205,     PUSHL #205 
.IIF    NOT_BLANK ,     OUTCON,   PUSHL OUTCON 
.IIF    NOT_BLANK ,     UNLIS,    PUSHL UNLIS 
.IIF    NOT_BLANK ,     INTES,    PUSHL INTES 
.IIF    NOT_BLANK ,     INRES,    PUSHL INRES 
CALLS   #<COUNT-1>,TEST         ; Note TEST is counted 
      

This example uses the .NARG directive to count the arguments and the .IIF NOT_BLANK directive (see descriptions of .IF and .IIF in this section) to determine whether the actual argument is blank. If the argument is blank, no binary code is generated.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
4515PRO_008.HTML