Go to the previous, next section.

Symbolic Addresses

Symbolic addresses are currently only used in immediate values (see section Immediate Values). A symbolic address has two parts, a symbol and an integer offset. In many cases, the offset is set to zero, but for an aggregate data structure the offset may specify the number of bits from the beginning of the data structure to a particular field. The sym_addr class defined in the `symaddr.h' and `symaddr.cc' files implements these symbolic addresses.

The symbol method returns a pointer to the symbol in a symbolic address, and the offset method returns the integer offset. As with most other offsets in SUIF, the offset is in bits. Be careful to avoid treating this as a byte or word offset. As with immediate values, there are no methods to change the contents of a symbolic address. Because these are small structures, it is just as easy to create new sym_addr objects whenever they are needed. To print a symbolic address, use the print method.

Go to the previous, next section.