HPlogo HP Assembler Reference Manual: HP 9000 Computers > Chapter 4 Assembler Directives and Pseudo-Operations

.EXPORT Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .EXPORT directive allows symbols to be defined in one program and used in other programs.

Syntax

.EXPORT symbol [, type] [, argument-description]...

Parameters

symbol

The name of an identifier whose definition is being exported or imported.

type

A linker symbol type that can take one of the following values:

Title not available (Parameters )

ABSOLUTE

Designates an absolute symbol.

In PA-RISC 2.0W (64-bit mode) ABSOLUTE symbols map to STT_NOTYPE with a section index of SHN_ABS.

DATA

Designates a data symbol.

In PA-RISC 2.0W (64-bit mode) DATA symbols map to STT_OBJECT.

CODE

Designates a code location. The location can not be a procedure entry.

In PA-RISC 2.0W (64-bit mode) CODE symbols map to STT_OBJECT.

ENTRY

Designates the entry point of a procedure.

In PA-RISC 2.0W (64-bit mode) ENTRY symbols map to STT_FUNC.

MILLICODE

Locates code for the entry point of a millicode routine.

MILLI_EXT

Locates code for the entry point of an external millicode routine.

PLABEL

Locates a pointer to a procedure.

PRI_PROG

Designates the primary program entry point. The outer block of HP Pascal/HP-UX and the main program in HP FORTRAN 77/HP-UX are type PRI_PROG.

In PA-RISC 2.0W (64-bit mode) PRI_PROG symbols map to STT_FUNC.

SEC_PROG

Designates a secondary program entry point.

In PA-RISC 2.0W (64-bit mode) SEC_PROG symbols map to STT_FUNC.

argument- description

Allows you to communicate to the linker the types of registers used to receive floating point arguments and return floating point return results. Similarly, this information can be communicated in the .CALL directive.

The linker requires this information, since the Procedure Calling Convention described in the documents under the topic PA-RISC Architecture at http://www.software.hp.com/STK/ allows floating point arguments and return values to reside in either general registers or floating point registers, depending on source language convention. At link time, the linker ensures that both the caller and called procedure agree on argument location. If not, the linker may insert code to relocate the arguments (or return result) before control is transferred to the called procedure or a procedure return is completed.

The form of argument-description is described in “.CALL Directive” in this chapter.

Discussion

The .EXPORT directive uses a series of keywords to define a symbol to the linker. These keywords declare the symbol's type, and its argument relocation information if the symbol is the name of a procedure.

Example

This example makes the symbol proc available to the linker as an entry point. It also specifies that the first argument is expected in a general register.

.EXPORT proc,ENTRY,ARGW0=GR
© 1998 Hewlett-Packard Development Company, L.P.