Assembler Directives and Pseudo-Operations

.ALLOW Directive

 

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.

 

The .ALLOW and .LEVEL directives replace the +DA and +DS

NOTE

 

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

Chapter 4

59