Introduction to Intel IA32 and IA64 Instruction Set Architectures - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to Intel IA32 and IA64 Instruction Set Architectures

Description:

CALL and RET instructions. ENTER and LEAVE instructions, in ... Calling Procedures Using CALL and RET. Near call (within the current code segment) Near return ... – PowerPoint PPT presentation

Number of Views:643
Avg rating:3.0/5.0
Slides: 67
Provided by: zhen6
Learn more at: http://www.cs.fsu.edu
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Intel IA32 and IA64 Instruction Set Architectures


1
Introduction to Intel IA-32 and IA-64 Instruction
Set Architectures
2
Dr. 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.
3
History
4
Recent 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)

5
History
6
Most Recent Intel Processors
7
Intel Core 2 Duo Processors
8
Intel Core 2 Quad Processors
9
Bit and Byte Ordering
10
Intel 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

11
Memory Modes
12
Addressing
  • 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)
14
Intel Registers
15
Basic 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

16
General Purpose and Segment Registers
17
General 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)

18
Alternative General Purpose Register Names
19
Registers in IA-64
20
Segment Registers
21
Operand 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)

22
Register Addressing
23
Memory Operand
  • Memory operand is specified by a segment and
    offset

24
Offset
  • 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.

25
Effective Address
26
Effective Address
  • Common combinations
  • Displacement
  • Base
  • Base displacement
  • (Index scale) displacement
  • Base index displacement
  • Base (Index scale) displacement

27
Addressing Mode Encoding
28
Fundamental Data Types
29
Example
30
Pointer Data Types
  • Near pointer
  • Far pointer

31
128-Bit SIMD Data Types
32
BCD Integers
  • Intel also supports BCD integers, where each
    digit (0-9) is represented by 4 bits

33
Floating Point Numbers
34
General Purpose Instructions
  • Data transfer instructions

35
Data Transfer Instructions
36
Data Transfer Instructions
37
Binary Arithmetic Instructions
38
Decimal Arithmetic Instructions
39
Logical Instructions
40
Shift and Rotate Instructions
41
Bit and Byte Instructions
42
Bit and Byte Instructions
43
Control Transfer Instructions
44
(No Transcript)
45
String Instructions
46
I/O Instructions
  • These instructions move data between the
    processors I/O ports and a register or memory

47
Enter and Leave Instructions
  • These instructions provide machine-language
    support for procedure calls in block structured
    languages

48
Segment Register Instructions
  • The segment register instructions allow far
    pointers (segment addresses) to be loaded into
    the segment registers

49
Procedure 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

50
Stack
51
Calling Procedures Using CALL and RET
  • Near call (within the current code segment)
  • Near return

52
Far Call and Far Return
  • Far call
  • Far return

53
Stack During Call and Return
54
Parameter 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

55
Saving 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)

56
Calls to Other Privilege Levels
57
Stack For Calling and Called Procedure
58
Procedure 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

59
ENTER Instruction
60
IA-32 and IA-64 Instruction Format
61
Examples of Instruction Formats
62
ADD Instructions
63
ADD Instructions
64
Add Instruction Description
65
SCAS/SCASB/SCASW/SCASDScan String
66
Next Time
  • SSE Instructions
  • Brief Introduction to Inline Assembly Programming
  • Using gcc
Write a Comment
User Comments (0)
About PowerShow.com