Title: Introduction to Intel IA32 and IA64 Instruction Set Architectures
1Introduction to Intel IA-32 and IA-64 Instruction
Set Architectures
2Dr. Alexey Lugovskoy will be giving a
presentation at 4pm this Thursday (Feb 21) in 499
Dirac. After the presentation there will be a
brief discussion about the new undergraduate
computational biology degree at FSU and Dr.
Lugovskoy will answer questions regarding
opportunities for employment in this field.
Refreshments and pizza will also be provided.
3History
4Recent Intel Processors
- The Intel Pentium 4 Processor Family
(2000-2006) - The Intel Xeon Processor (2001-2006)
- The Intel Pentium M Processor (2003-Current)
- The Intel Pentium Processor Extreme Edition
(2005-2007) - The Intel Core Duo and Intel Core Solo
Processors (2006-Current) - The Intel Xeon Processor 5100 Series and Intel
Core2 Processor Family (2006-Current)
5History
6Most Recent Intel Processors
7Intel Core 2 Duo Processors
8Intel Core 2 Quad Processors
9Bit and Byte Ordering
10Intel Assembly
- Each instruction is represented by
- Where label presents the line
- A mnemonic is a reserved name for a class of
instruction opcodes which have the same function. - The operands argument1, argument2, and argument3
are optional. There may be from zero to three
operands, depending on the instruction
11Memory Modes
12Addressing
- The processors use byte addressing
- Intel processors support segmented addressing
- Each address is specified by a segment register
and byte address within the segment
13(No Transcript)
14Intel Registers
15Basic Program Execution Registers
- General purpose registers
- There are eight registers (note that they are not
quite general purpose as some instructions assume
certain registers) - Segment registers
- They define up to six segment selectors
- EIP register Effective instruction pointer
- EFLAGS Program status and control register
16General Purpose and Segment Registers
17General Purpose Registers
- EAX Accumulator for operands and results data
- EBX Pointer to data in the DS segment
- ECX Counter for string and loop operations
- EDX I/O pointer
- ESI Pointer to data in the segment pointed to
by the DS register source pointer for string
operations - EDI Pointer to data (or destination) in the
segment pointed to by the ES register
destination pointer for string operations - ESP Stack pointer (in the SS segment)
- EBP Pointer to data on the stack (in the SS
segment)
18Alternative General Purpose Register Names
19Registers in IA-64
20Segment Registers
21Operand Addressing
- Immediate addressing
- Maximum value allowed varies among instructions
and it can be 8-bit, 16-bit, or 32-bit - Register addressing
- Register addressing depends on the mode (IA-32 or
IA-64)
22Register Addressing
23Memory Operand
- Memory operand is specified by a segment and
offset
24Offset
- Displacement - An 8-, 16-, or 32-bit value.
- Base - The value in a general-purpose register.
- Index The value in a general-purpose register.
- Scale factor A value of 2, 4, or 8 that is
multiplied by the index value.
25Effective Address
26Effective Address
- Common combinations
- Displacement
- Base
- Base displacement
- (Index scale) displacement
- Base index displacement
- Base (Index scale) displacement
27Addressing Mode Encoding
28Fundamental Data Types
29Example
30Pointer Data Types
31128-Bit SIMD Data Types
32BCD Integers
- Intel also supports BCD integers, where each
digit (0-9) is represented by 4 bits
33Floating Point Numbers
34General Purpose Instructions
- Data transfer instructions
35Data Transfer Instructions
36Data Transfer Instructions
37Binary Arithmetic Instructions
38Decimal Arithmetic Instructions
39Logical Instructions
40Shift and Rotate Instructions
41Bit and Byte Instructions
42Bit and Byte Instructions
43Control Transfer Instructions
44(No Transcript)
45String Instructions
46I/O Instructions
- These instructions move data between the
processors I/O ports and a register or memory
47Enter and Leave Instructions
- These instructions provide machine-language
support for procedure calls in block structured
languages
48Segment Register Instructions
- The segment register instructions allow far
pointers (segment addresses) to be loaded into
the segment registers
49Procedure Call Types
- The processor supports procedure calls in the
following two different ways - CALL and RET instructions.
- ENTER and LEAVE instructions, in conjunction with
the CALL and RET instructions
50Stack
51Calling Procedures Using CALL and RET
- Near call (within the current code segment)
- Near return
52Far Call and Far Return
53Stack During Call and Return
54Parameter Passing
- Passing parameters through the general-purpose
registers - Can pass up to six parameters by copying the
parameters to the general-purpose registers - Passing parameters on the stack
- Stack can be used to pass a large number of
parameters and also return a large number of
values - Passing parameters in an argument list
- Place the parameters in an argument list
- A pointer to the argument list can then be passed
to the called procedure
55Saving Procedure State Information
- The processor does not save general purpose
registers - A calling procedure should explicitly save the
values in any of the general-purpose registers
that it will need when it resumes execution after
a return - One can use PUSHA and POPA to save and restore
all the general purpose registers (except ESP)
56Calls to Other Privilege Levels
57Stack For Calling and Called Procedure
58Procedure Calls For Block-structured Languages
- ENTER and LEAVE instructions automatically create
and release, respectively, stack frames for
called procedures - The ENTER instruction creates a stack frame
compatible with the scope rules typically used in
block-structured languages - The LEAVE instruction, which does not have any
operands, reverses the action of the previous
ENTER instruction
59ENTER Instruction
60IA-32 and IA-64 Instruction Format
61Examples of Instruction Formats
62ADD Instructions
63ADD Instructions
64Add Instruction Description
65SCAS/SCASB/SCASW/SCASDScan String
66Next Time
- SSE Instructions
- Brief Introduction to Inline Assembly Programming
- Using gcc