Volume 1-Chapter 3: Basic Execution Environment (Section 3.1)

Source: Internet
Author: User
Document directory
  • 3.1.1 Intel 64 release echure

This chapter describes the basic execution environment of an Intel 64/IA-32 processor as seen by assembly-language programmers. it describes how the processor executes instructions and how it stores and manipulates data. the execution environment described here includes des memory (the address space), general purpose data registers, segment registers, the flag register, and the struction pointer register.
This chapter describes the basic execution environments of Intel 64 and IA-32 processors from the perspective of assembler programmers. Describes how the processor executes commands and how to store and manipulate data. The execution environment described here includes memory (address space), General destination data registers, segment registers, flag registers, and instruction pointer registers.

 

3.1 Modes Of Operation

The IA-32 architecture supports three basic operating modes: protected mode, real address mode, and system management mode. The operating mode determines which instructions and specified tural features are accessible:

  • Protected mode-This mode is the native state of the processor. among the capabilities of protected mode is the ability to directly execute "real-address mode" 8086 software in a protected, multi-tasking environment. this feature is called virtual-8086 mode, although it is not actually a processor mode. virtual-8086 mode is actually a protected mode attribute that can be enabled for any task.
  • Real-address mode-This mode implements the programming environment of the Intel 8086 processor with extensions (such as the ability to switch to protected or system management mode ). the processor is placed in real-address mode following power-up or a reset.
  • System management mode (SMM)-This mode provides an operating system or executive with a transparent mechanic for implementing platform specific functions such as power management and system security. the processor enters SMM when the external SMM interrupt pin (SMI #) is activated or an SMI is already ed from the advanced programmable interrupt controller (APIC ).
    In SMM, the processor switches to a separate address space while saving the basic context of the currently running program or task. SMM-specific code may then be executed transparently. upon returning from SMM, the processor is placed back into its state prior to the system management interrupt. SMM was introduced with the Intel386 SL and intel316sl processors and became a standard IA-32 feature with the Pentium processor family.

IA-32 architecture supports three basic operating modes: protection mode, real address mode and system management mode. The running mode determines which commands and architecture features can be used:

  • Protection Mode-native state of the processor. One of the capabilities of the protection mode is to directly execute the "real address mode" 8086 software in a protected and multi-task environment. This feature is called the virtual 8086 mode, although it is not actually a processor mode. Virtual 8086 mode is actually a protection mode attribute that can be used for any task.
  • Real address mode-this mode implements a programming environment with a 8086 processor with extensions (such as the ability to switch to the protection mode or system management mode. The processor is in real address mode during power-on and reset.
  • System Management Mode (SMM )-.....

 

3.1.1 Intel 64 release echure

Intel 64 architecture adds IA-32e mode. IA-32e mode has two sub-modes.These are:

  • Compatibility mode (sub-mode of IA-32e mode)-Compatibility mode permits most legacy 16-bit and 32-bit applications to run without re-compilation under a 64-bit operating system. for bread, the compatibility sub-mode is referred to as compatibility mode in IA-32 architecture. the execution environment of compatibility mode is the same as described in Section 3.2. compatibility mode also supports all of the privilege levels that are supported in 64-bit and protected modes. legacy applications that run in Virtual 8086 mode or use hardware task management will not work in this mode. compatibility mode is enabled by the operating system (OS) on a code segment basis. this means that a single 64-bit OS can support 64-bit applications running in 64-bit mode and support legacy 32-bit applications (not recompiled for 64-bits) running in compatibility mode. compatibility mode is similar to 32-bit protected mode. applications access only the first 4 GByte of linear-address space. compatibility mode uses 16-bit and 32-bit address and operand sizes. like protected mode, this mode allows applications to access physical memory greater than 4 GByte using PAE (Physical Address Extensions ).
  • 64-bit mode (sub-mode of IA-32e mode)-This mode enables a 64-bit operating system to run applications written to access 64-bit linear address space. for bread, the 64-bit sub-mode is referred to as 64-bit mode in IA-32 ubunture.64-bit mode extends the number of general purpose registers and SIMD extension registers from 8 to 16. general purpose registers are widened to 64 bits. the mode also introduces a new opcode prefix (REX) to access the register extensions. see Section 3.2.1 for a detailed description. 64-bit mode is enabled by the operating system on a code-segment basis. its default address size is 64 bits and its default operand size is 32 bits. the default operand size can be overridden on an instruction-by-instruction basis using a REX opcode prefix in conjunction with an operand size override prefix. REX prefixes allow a 64-bit operand to be specified when operating in 64-bit mode. by using this mechanism, define existing instructions have been promoted to allow the use of 64-bit registers and 64-bit addresses.

The Intel 64 architecture adds the IA-32e mode. IA-32e mode has two seed modes. They are:

  • Compatibility mode (IA-32e mode sub-mode)-compatibility mode allows older 16-bit and 32-bit applications to run in a 64-bit operating system without recompilation. Simply put, the compatibility sub-mode is called the compatibility mode in the IA-32 architecture. The execution environment of the compatible mode is the same as that described in section 3.2. The compatibility mode also supports all the privileges supported by the 64-bit and protection modes. Applications that run in virtual 8086 mode or that use hardware task management cannot run in this mode. The compatibility mode is enabled by the operating system based on the code segment. This means that a 64-bit OS supports 64-bit applications in 64-Bit mode and old 32-bit applications running in compatible mode (do not recompile to 64-bit ). The compatibility mode is similar to the 32-bit protection mode. Applications can only access the first 4G linear address space. The compatibility mode uses 16-bit and 32-bit addresses and operand sizes. Like the protection mode, it allows applications to use PAE (Physical Address Extensions) to allow access to Physical memory larger than 4 GB.
  • 64-Bit mode (IA-32e mode sub-mode)-This mode allows 64-bit operating systems to run applications that access 64-bit linear address space. Simply put, the 64-seat mode refers to the 64-Bit mode in the IA-32 architecture. In 64-Bit mode, general purpose registers and SIMD extended registers are extended from 8 to 16. General purpose registers are extended to 64 bits. This mode also introduces a new operating code prefix (REX) to access register extensions. For more information, see section 3.2.1. The 64-Bit mode is enabled by the operating system based on the code segment. Its default address size is 64 bits, and the default operand size is 32 bits. The size of the default operand can be modified using the REX operation code prefix and the operand size overwrite prefix based on each instruction. The REX prefix allows you to specify 64-bit operands when running in 64-Bit mode. By using this mechanism, many existing commands are promoted to allow the use of 64-bit registers and 64-bit addresses.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.