One frequently needs to know the type of a particular operand. This can be determined from the variable's type or the instruction's result type, but checking for these different kinds of operands and then extracting the type is cumbersome. Instead, you can use the type method which performs this operation for you. It returns the SUIF void type for null operands. Another common operation is testing an operand to see if it contains an integer constant from a load constant instruction.
Operands have two different methods for printing themselves out to a file as text.
The print method is used by the library when printing instructions. Because source and destination operands are handled differently, print requires that you specify the instruction that contains the operand so that it can determine how the operand is being used. However, when debugging a program, you may not know which instruction contains an operand. Go to the previous , next section.