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

.BLOCK and .BLOCKZ Pseudo-Operations

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .BLOCK and .BLOCKZ pseudo-operations reserve a block of storage.

Syntax

.BLOCK [num_bytes]

.BLOCKZ [num_bytes]

Parameters

Title not available (Parameters )

num_bytes

An integer value for the number of bytes you want to reserve. Permissible values range from zero to 0x3FFFFFFF. The default value is zero.

Discussion

The .BLOCK pseudo-operation reserves a data storage area but does not perform any initialization. The .BLOCKZ pseudo-operation reserves a block of storage and initializes it to zero.

When you label a.BLOCK pseudo-operation, the label refers to the first byte of the storage area.

For large blocks, it is usually better to use the .COMM directive to allocate uninitialized space. Since .COMM storage is allocated at run time, it doesn't increase the size of the object file.

NOTE: Under the present implementation of the Assembler, the .BLOCK pseudo-operation also initializes the reserved area to zero.

Example

The first example requests the Assembler to reserve 64 bytes of memory in the $CODE$ subspace. This area is then followed by a "Load Word" and "Store Word" instruction.

          .SPACE $TEXT$
.SUBSPA $CODE$
.BLOCK 64
swap LDW 0(%r2)%r1
STW %r1,4(%r2)
.END

The second example reserves 32 bytes of memory in the $DATA$ subspace followed by one word intended as an end marker.

          .DATA
word0 .BLOCK 0X20
word8 .WORD 0XFFFF
© 1998 Hewlett-Packard Development Company, L.P.