Chapter 3. Exceptions

This chapter describes the exceptions that you can encounter while running assembly programs. The system detects some exceptions directly, and the assembler inserts specific tests that signal other exceptions. This chapter lists only those exceptions that occur frequently.

Main Processor Exceptions

The following exceptions are the most common to the main processor:

  • Address error exceptions, which occur when a data item is referenced that is not on its proper memory alignment or when an address is invalid for the executing process.

  • Overflow exceptions, which occur when arithmetic operations compute signed values and the destination lacks the precision to store the result.

  • Bus exceptions, which occur when an address is invalid for the executing process.

  • Divide-by-zero exceptions, which occur when a divisor is zero.

Floating-Point Exceptions

The following are the most common floating-point exceptions:

  • Invalid operation exceptions which include:

    • Magnitude subtraction of infinities, for example: -1.

    • Multiplication of 0 by 1 with any signs.

    • Division of 0/0 or 1/1 with any signs.

    • Conversion of a binary floating-point number to an integer format when an overflow or the operand value for the infinity or NaN precludes a faithful representation in the format (see Chapter 4, “Lexical Conventions”).

    • Comparison of predicates that have unordered operands, and that involve Greater Than or Less Than without Unordered.

    • Any operation on a signaling NaN.

  • Divide-by-zero exceptions.

  • Overflow exceptions occur when a rounded floating-point result exceeds the destination format's largest finite number.

  • Underflow exceptions these occur when a result has lost accuracy and also when a nonzero result is between 2Emin (2 to the minimum expressible exponent).

  • Inexact exceptions.