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

.ALLOW Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .ALLOW directive tells the Assembler to temporarily allow PA-RISC features from a higher version level of the PA-RISC architecture. The .ALLOW directive also tells the Assembler to temporarily allow implementation-specific features in the assembly source file.

Syntax

.ALLOW 1.1

Lines of source code

.ALLOW

Parameters

Title not available (Parameters )

1.1

Allows PA-RISC 1.1 features.

2.0

Allows PA-RISC 2.0 features.

Discussion

Use the .ALLOW directive with the .LEVEL directive. The Assembler uses the .LEVEL directive to mark the relocatable object file with the proper PA-RISC architecture version level. In the source file, the Assembler emits warning messages whenever a feature is used that is not appropriate for the specified .LEVEL directive.

Use the .ALLOW directive when it is necessary to include features or instructions from a later version of PA-RISC while leaving the relocatable object file marked as an earlier PA-RISC architecture version. For example, use the .ALLOW directive when you need to include PA-RISC 2.0 features or instructions while leaving the relocatable object file marked as a PA-RISC 1.1 architecture version.

NOTE: A 2.0W parameter is not permitted with .ALLOW, because the code generated for 2.0W(64-bit mode) is incompatible with other levels.

When using the .ALLOW directive, a run-time check must be inserted into the assembly source code. This run-time check should insure that the code is executing on a PA-RISC processor that supports the feature or features being used after the .ALLOW directive. See the example below.

An .ALLOW directive without a parameter signals the end of the region that the previous .ALLOW directive was controlling. Control is returned to the .LEVEL specified for the file.

NOTE: The .ALLOW and .LEVEL directives replace the +DA and +DS command-line compiler options.

Example

The following example shows how to set a range of memory to 0. In PA-RISC 1.1 architecture, use the stw instruction. In PA-RISC 2.0 architecture, use the more efficient std instruction.

        .LEVEL  1.1
; This object file will be marked as a PA 1.1 object file

; Check what version of PA Architecture we are linked for
addil LR'_SYSTEM_ID-$global$,%dp
ldw RR'_SYSTEM_ID-$global$(%r1),%r5
ldi CPU_PA_RISC1_1,%r4
combt,<,n %r4,%r5,$00000002
; 1.1 specific code
$00000001
addib,< 1,%r23,$00000001
stw,ma %r0,4(%r31)
b,n $00000003
; 2.0 specific code
$00000002
.ALLOW 2.0
addib,< 2,%r23,$00000002
std,ma %r0,8(%r31)
.ALLOW
$00000003
; General code
© 1998 Hewlett-Packard Development Company, L.P.