Defining a symbol with a pseudo-op

Use a symbol as the name operand of a pseudo-op to define the symbol.

Use a symbol as the name operand of a .set pseudo-op to define the symbol. This pseudo-op has the format:

.set name,exp

The assembler evaluates the exp operand, then assigns the value and type of the exp operand to the symbol name. When the assembler encounters that symbol in an instruction, the assembler puts the symbol's value into the instruction's object code.

For example:

       .set               number,10
  .
  .
        ai         4,4,number

In the preceding example, the object code for the ai instruction contains the value assigned to number, that is, 10.

The value of the symbol is assembled directly into the instruction and does not occupy any storage space. A symbol defined with a .set pseudo-op can have an absolute or relocatable type, depending on the type of the exp operand. Also, because the symbol occupies no storage, you cannot change the value of the symbol at run time; reassembling the file will give the symbol a new value.

A symbol also can be defined by using it as the name operand of a .comm, .lcomm, .csect, .dsect, or .rename pseudo-op. Except in the case of the .dsect pseudo-op, the value assigned to the symbol describes storage space.