This preview shows page 1. Sign up to view the full content.
Unformatted text preview: define two types of integers: unsigned and signed. Unsigned integers are ordinary binary values ranging from 0 to the maximum positive number that can be encoded in the selected operand size. Signed integers are two's complement binary values that can be used to represent both positive and negative integer values. Some integer instructions (such as the ADD, SUB, PADDB, and PSUBB instructions) operate on either unsigned or signed integer operands. Other integer instructions (such as IMUL, MUL, IDIV, DIV, FIADD, and FISUB) operate on only one integer type. The following sections describe the encodings and ranges of the two types of integers. 184.108.40.206 Unsigned Integers Unsigned integers are unsigned binary numbers contained in a byte, word, doubleword, and quadword. Their values range from 0 to 255 for an unsigned byte integer, from 0 to 65,535 for an unsigned word integer, from 0 to 232 1 for an unsigned doubleword integer, and from 0 to 264 1 for an unsigned quadword integer. Unsigned integers are sometimes referred to as ordinals. 220.127.116.11 Signed Integers Signed integers are signed binary numbers held in a byte, word, doubleword, or quadword. All operations on signed integers assume a two's complement representation. The sign bit is located in bit 7 in a byte integer, bit 15 in a word integer, bit 31 in a doubleword integer, and bit 63 in a quadword integer (see the signed integer encodings in Table 4-1). 4-4 Vol. 1 DATA TYPES Table 4-1. Signed Integer Encodings
Class Positive Largest Two's Complement Encoding Sign 0 . . Smallest Zero Negative Smallest 0 0 1 . . Largest Integer indefinite 1 1 Signed Byte Integer: Signed Word Integer: Signed Doubleword Integer: Signed Quadword Integer: 11..11 . . 00..01 00..00 11..11 . . 00..00 00..00 7 bits 15 bits 31 bits 63 bits The sign bit is set for negative integers and cleared for positive integers and zero. Integer values range from 128 to +127 for a byte integer, from 32,768 to +32,767 for a word integer, from 231 to +231 1 for a doubleword integer, and from 263 to +263 1 for a quadword integer. When storing integer values in memory, word integers are stored in 2 consecutive bytes; doubleword integers are stored in 4 consecutive bytes; and quadword integers are stored in 8 consecutive bytes. The integer indefinite is a special value that is sometimes returned by the x87 FPU when operating on integer values. For more information, see Section 8.2.1, "Indefinites." 4.2.2 Floating-Point Data Types The IA-32 architecture defines and operates on three floating-point data types: single-precision floating-point, double-precision floating-point, and double-extended precision floating-point (see Figure 4-3). The data formats for these data types correspond directly to formats specified in the IEEE Standard 754 for Binary FloatingPoint Arithmetic. Table 4-2 gives the length, precision, and approximate normalized range that can be represented by each of these data types. Denormal values are also supported i...
View Full Document
This note was uploaded on 10/01/2013 for the course CPE 103 taught by Professor Watlins during the Winter '11 term at Mississippi State.
- Winter '11