• Aucun résultat trouvé

Data Types

Dans le document ® PROCESSOR UNIT (Page 27-32)

III ABCD ADD Mnemonic ADDA

ARCHITECTURE SUMMARY

2.3 Data Types

Six basic data types are supported:

1. Bits

2. Binary-Coded Decimal (BCD) Digits 3. Byte Integers (8 bits)

4. Word Integers (16 bits) 5. Long-Word Integers (32 bits) 6. Quad-Word Integers (64 bits) 2.3.1 Organization in Registers

The eight data registers can store data operands of 1, 8, 16,32, and 64 bits and addresses of 16 or 32 bits. The seven address registers and the two stack pointers are used for address operands of 16 or 32 bits. The PC is 32 bits wide.

2.3.1.1 Data Registers

Each data register is 32 bits wide. Byte operands occupy the low-order 8 bits, word operands, the low-order 16 bits, and long-word operands, the entire 32 bits. When a data register is used as either a source or destination operand, only the appropriate low-order byte or word (in byte or word operations, respectively) is used or changed- the remaining high-order portion is neither used nor changed. The least significant bit (LSB) of a long-word integer is addressed as bit zero, and the most significant bit (MSB) is addressed as bit 31.

Figure 2-4 shows the organization of various types of data in the data registers.

MOTOROLA 2-4

ARCHITECTURE SUMMARY CPU32 REFERENCE MANUAL

31 30 1 0

MSB

I I

LSB

BYTE

31 24 23 1615 8 7 o

I

HIGH-ORDER BYTE MIDDLE HIGH BYTE

I

MIDDLE LOW BYTE LOW-ORDER BYTE 31

31

63 62 MSB 31

HIGH-ORDER WORD

WORD 16 15

LONG WORD LONG WORD QUAD WORD HIGH-ORDER LONG WORD LOW-ORDER LONG WORD

LOW-ORDER WORD

Figure 2-4. Data Organization in Data Registers

o

o

32

1 0

I

LSB

Quad-word data consists of two long words: for example, the product of 32-bit multiply or the quotient of 32-bit divide operations (signed and unsigned). Quad words may be organized in any two data registers without restrictions on order or pairing. There are no explicit instructions for the management of this data type; however, the MOVEM instruction can be used to move a quad word into or out of the registers.

BCD data represents decimal numbers in binary form. CPU32 BCD instructions use a format in which a byte contains two digits - the four LSB contain the low digit, and the four MSB contain the high digit. The ABCD, SBCD, and NBCD instructions operate on two BCD digits packed into a single byte.

CPU32 REFERENCE MANUAL ARCHITECTURE SUMMARY MOTOROLA

2-5

lEI

fII

2.3.1.2 Address Registers

Each address register and stack pointer holds a 32-bit address. Address . registers cannot be used for byte-sized operands. When an address register is used as a source operand, either the low-order word or the entire long-word operand is used, depending upon the operation size. When an address register is used as a destination operand, the entire register is affected, regardless of operation size. If the source operand is a word, it is first sign extended to 32 bits, and then used in the operation. Address registers can be used to support address computation. The instruction set includes instructions that add to, subtract from, compare, and move the contents of address registers.

Figure 2-5 shows the organization of addresses in address registers.

31 16 15 o

SIGN EXTENDED 16-BIT ADDRESS OPERAND

31 o

FULL 32-BIT ADDRESS OPERAND

Figure 2-5. Address Organization in Address Registers

2.3.1.3 Control Registers

The control registers contain control information for supervisor functions. The registers vary in size. With the exception of the user portion of the SR (CCR), they are accessed only by instructions at the supervisor privilege level.

The SR shown in Figure 2-3 is 16 bits wide. Only 11 bits of the SR are defined, and all undefined values are reserved by Motorola for future definition. The undefined bits are read as zeros and should be written as zeros for future compatibility. The lower byte of the SR is the CCR. Operations to the CCR can be performed at the supervisor or user privilege level. All operations to the SR and CCR are word-size operations. For all CCR operations, the upper byte is read as all zeros and is ignored when written, regardless of privilege level.

The alternate function code registers (SFC and DFC) are 32-bit registers with only bits [2:0] implemented. These bits contain address space values (FC2 to FCO) for the read or write operand of the MOVES instruction. The MOVEC instruction is used to transfer values to and from the alternate function code registers. These are long-word transfers - the upper 29 bits are read as zeros and are ignored when written.

MOTOROLA 2-6

ARCHITECTURE SUMMARY CPU32 REFERENCE MANUAL

2.3.2 Organization in Memory

Memory is organized on a byte-addressable basis. An address corresponds to a high-order byte. For example, the address (N) of a long-word data item is the address of the most significant byte of the high-order word. The address of the

most significant byte of the low-order word is (N + 2), and the address of the

2

least significant byte of the long word is (N + 3). The CPU32 requires data words and long words, as well as instruction words to be aligned on word boundaries. Data misalignment is not supported. Figure 2-6 shows how operands and instructions are organized in memory. Note that (N + X) is below (N) - that is, address value increases as one moves down the page.

CPU32 REFERENCE MANUAL ARCHITECTURE SUMMARY MOTOROLA

2-7

Ell

MSD = Most Significant Digit LSD = Least Significant Digit

15

Figure 2-6. Memory Operand Addressing

o

o

LSB

MOTOROLA 2-8

ARCHITECTURE SUMMARY CPU32 REFERENCE MANUAL

SECTION 3

DATA ORGANIZATION AND

Dans le document ® PROCESSOR UNIT (Page 27-32)

Documents relatifs