HPlogo HP Assembler Reference Manual: HP 9000 Computers > Chapter 1 Introduction to PA-RISC Assembly Language

Assembler Features

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The Assembler provides a number of features to make assembly language programming convenient. These features include:

  • Mnemonic Instructions. Each machine instruction is represented by a mnemonic operation code, which is easier to remember than the binary machine language operation code. The operation code, together with operands, directs the Assembler to output a binary machine instruction to the object file.

  • Symbolic Addresses. You can select a symbol to refer to the address of a location in virtual memory. The address is often referred to as the value of the symbol, which should not be confused with the value of the memory locations at that address. These symbols are called relocatable symbols because the actual addresses represented by such symbols are subject to relocation by the linker.

  • Symbolic Constants. A symbol can also be selected to stand for an integer constant. These symbols are called absolute symbols because the values of such symbols are not relocatable.

  • Expressions. Arithmetic expressions can be formed from symbolic addresses and constants, integer constants, and arithmetic operators. Expressions involving only symbolic and integer constants, or the difference between two relocatable symbols, defined in the current module, are called absolute expressions. They can be used wherever an integer constant can be used. Expressions involving the sum or difference of a symbolic address and an absolute expression are called relocatable expressions or address expressions. The constant part of an expression, the part that does not refer to relocatable expressions, can use parenthesized subexpressions to alter operator precedence.

  • Storage Allocation. In addition to encoding machine language instructions symbolically, storage may be initialized to constant values or simply reserved. Symbolic addresses and labels can be associated with these memory locations.

  • Symbol Scope. When two or more object files are to be combined by the linker, certain symbolic addresses can be defined in one module and used in another. Such symbols must be exported from the defining module and imported into the using module. In the defining module, the symbol has universal scope, while in the using module, the symbol is unsatisfied. Other symbols declared in the source program that are not exported have local scope.

  • Subspaces and Location Counters. You can organize code and data into separate subspaces, and into separate location counters within each subspace. The programmer can move among the subspaces and location counters, while the Assembler changes the code and data into the correct order. In 64-bit mode, however, the Executable and Linking Format (ELF) uses segments and sections rather than spaces and subspaces.

  • Macro Processing. A macro is a user-defined word, which is replaced by a sequence of instructions. Including a macro in a source program causes the sequence of instructions to be inserted into the program wherever the macro appears.

© 1998 Hewlett-Packard Development Company, L.P.