Intel(R) 64 and IA-32 Architectures Software Developer's Manual

Total Page:16

File Type:pdf, Size:1020Kb

Intel(R) 64 and IA-32 Architectures Software Developer's Manual Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 1: Basic Architecture NOTE: The Intel® 64 and IA-32 Architectures Software Developer's Manual consists of five volumes: Basic Architecture, Order Number 253665; Instruction Set Reference A-M, Order Number 253666; Instruction Set Reference N-Z, Order Number 253667; System Programming Guide, Part 1, Order Number 253668; System Programming Guide, Part 2, Order Number 253669. Refer to all five volumes when evaluating your design needs. Order Number: 253665-033US December 2009 INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANT- ED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR IN- TENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUA- TION WHERE PERSONAL INJURY OR DEATH MAY OCCUR. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "unde- fined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without no- tice. Do not finalize a design with this information. The Intel® 64 architecture processors may contain design defects or errors known as errata. Current char- acterized errata are available on request. Intel® Hyper-Threading Technology requires a computer system with an Intel® processor supporting Intel Hyper-Threading Technology and an Intel® HT Technology enabled chipset, BIOS and operating system. Performance will vary depending on the specific hardware and software you use. For more information, see http://www.intel.com/technology/hyperthread/index.htm; including details on which processors support Intel HT Technology. Intel® Virtualization Technology requires a computer system with an enabled Intel® processor, BIOS, virtual machine monitor (VMM) and for some uses, certain platform software enabled for it. Functionality, perfor- mance or other benefits will vary depending on hardware and software configurations. Intel® Virtualization Technology-enabled BIOS and VMM applications are currently in development. 64-bit computing on Intel architecture requires a computer system with a processor, chipset, BIOS, oper- ating system, device drivers and applications enabled for Intel® 64 architecture. Processors will not operate (including 32-bit operation) without an Intel® 64 architecture-enabled BIOS. Performance will vary de- pending on your hardware and software configurations. Consult with your system vendor for more infor- mation. Enabling Execute Disable Bit functionality requires a PC with a processor with Execute Disable Bit capability and a supporting operating system. Check with your PC manufacturer on whether your system delivers Ex- ecute Disable Bit functionality. Intel, Pentium, Intel Xeon, Intel NetBurst, Intel Core, Intel Core Solo, Intel Core Duo, Intel Core 2 Duo, Intel Core 2 Extreme, Intel Pentium D, Itanium, Intel SpeedStep, MMX, Intel Atom, and VTune are trade- marks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other coun- tries. *Other names and brands may be claimed as the property of others. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an ordering number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting Intel’s website at http://www.intel.com Copyright © 1997-2009 Intel Corporation CONTENTS PAGE CHAPTER 1 ABOUT THIS MANUAL 1.1 INTEL® 64 AND IA-32 PROCESSORS COVERED IN THIS MANUAL. 1-1 1.2 OVERVIEW OF VOLUME 1: BASIC ARCHITECTURE . 1-3 1.3 NOTATIONAL CONVENTIONS . 1-5 1.3.1 Bit and Byte Order . 1-5 1.3.2 Reserved Bits and Software Compatibility. 1-5 1.3.2.1 Instruction Operands. 1-6 1.3.3 Hexadecimal and Binary Numbers. 1-7 1.3.4 Segmented Addressing. 1-7 1.3.5 A New Syntax for CPUID, CR, and MSR Values . 1-7 1.3.6 Exceptions . 1-8 1.4 RELATED LITERATURE . 1-9 CHAPTER 2 INTEL® 64 AND IA-32 ARCHITECTURES 2.1 BRIEF HISTORY OF INTEL® 64 AND IA-32 ARCHITECTURE. 2-1 2.1.1 16-bit Processors and Segmentation (1978) . 2-1 2.1.2 The Intel® 286 Processor (1982) . 2-1 2.1.3 The Intel386™ Processor (1985) . 2-2 2.1.4 The Intel486™ Processor (1989) . 2-2 2.1.5 The Intel® Pentium® Processor (1993) . 2-2 2.1.6 The P6 Family of Processors (1995-1999) . 2-3 2.1.7 The Intel® Pentium® 4 Processor Family (2000-2006) . 2-4 2.1.8 The Intel® Xeon® Processor (2001- 2007) . 2-4 2.1.9 The Intel® Pentium® M Processor (2003-Current). 2-5 2.1.10 The Intel® Pentium® Processor Extreme Edition (2005-2007). 2-5 2.1.11 The Intel® Core™ Duo and Intel® Core™ Solo Processors (2006-2007). 2-5 2.1.12 The Intel® Xeon® Processor 5100, 5300 Series and Intel® Core™2 Processor Family (2006-Current) . 2-6 2.1.13 The Intel® Xeon® Processor 5200, 5400, 7400 Series and Intel® Core™2 Processor Family (2007-Current) . 2-6 2.1.14 The Intel® Atom™ Processor Family (2008-Current) . 2-7 2.1.15 The Intel® Core™i7 Processor Family (2008-Current) . 2-7 2.2 MORE ON SPECIFIC ADVANCES. 2-8 2.2.1 P6 Family Microarchitecture . 2-8 2.2.2 Intel NetBurst® Microarchitecture. 2-10 2.2.2.1 The Front End Pipeline . 2-12 2.2.2.2 Out-Of-Order Execution Core . 2-13 2.2.2.3 Retirement Unit . 2-13 2.2.3 Intel® Core™ Microarchitecture . 2-13 2.2.3.1 The Front End . 2-15 2.2.3.2 Execution Core . 2-16 2.2.4 Intel® Atom™ Microarchitecture . 2-16 Vol. 1 iii CONTENTS PAGE 2.2.5 Intel Microarchitecture (Nehalem) . 2-17 2.2.6 SIMD Instructions . 2-18 2.2.7 Intel® Hyper-Threading Technology . 2-21 2.2.7.1 Some Implementation Notes. 2-22 2.2.8 Multi-Core Technology . 2-22 2.2.9 Intel® 64 Architecture. 2-26 2.2.10 Intel® Virtualization Technology (Intel® VT) . 2-27 2.3 INTEL® 64 AND IA-32 PROCESSOR GENERATIONS . 2-27 CHAPTER 3 BASIC EXECUTION ENVIRONMENT 3.1 MODES OF OPERATION . 3-1 3.1.1 Intel® 64 Architecture . 3-2 3.2 OVERVIEW OF THE BASIC EXECUTION ENVIRONMENT . 3-2 3.2.1 64-Bit Mode Execution Environment . 3-6 3.3 MEMORY ORGANIZATION. 3-8 3.3.1 IA-32 Memory Models . 3-8 3.3.2 Paging and Virtual Memory . 3-10 3.3.3 Memory Organization in 64-Bit Mode. 3-10 3.3.4 Modes of Operation vs. Memory Model . 3-10 3.3.5 32-Bit and 16-Bit Address and Operand Sizes . 3-11 3.3.6 Extended Physical Addressing in Protected Mode. 3-12 3.3.7 Address Calculations in 64-Bit Mode . 3-12 3.3.7.1 Canonical Addressing. ..
Recommended publications
  • X86 Assembly Language Syllabus for Subject: Assembly (Machine) Language
    VŠB - Technical University of Ostrava Department of Computer Science, FEECS x86 Assembly Language Syllabus for Subject: Assembly (Machine) Language Ing. Petr Olivka, Ph.D. 2021 e-mail: [email protected] http://poli.cs.vsb.cz Contents 1 Processor Intel i486 and Higher – 32-bit Mode3 1.1 Registers of i486.........................3 1.2 Addressing............................6 1.3 Assembly Language, Machine Code...............6 1.4 Data Types............................6 2 Linking Assembly and C Language Programs7 2.1 Linking C and C Module....................7 2.2 Linking C and ASM Module................... 10 2.3 Variables in Assembly Language................ 11 3 Instruction Set 14 3.1 Moving Instruction........................ 14 3.2 Logical and Bitwise Instruction................. 16 3.3 Arithmetical Instruction..................... 18 3.4 Jump Instructions........................ 20 3.5 String Instructions........................ 21 3.6 Control and Auxiliary Instructions............... 23 3.7 Multiplication and Division Instructions............ 24 4 32-bit Interfacing to C Language 25 4.1 Return Values from Functions.................. 25 4.2 Rules of Registers Usage..................... 25 4.3 Calling Function with Arguments................ 26 4.3.1 Order of Passed Arguments............... 26 4.3.2 Calling the Function and Set Register EBP...... 27 4.3.3 Access to Arguments and Local Variables....... 28 4.3.4 Return from Function, the Stack Cleanup....... 28 4.3.5 Function Example.................... 29 4.4 Typical Examples of Arguments Passed to Functions..... 30 4.5 The Example of Using String Instructions........... 34 5 AMD and Intel x86 Processors – 64-bit Mode 36 5.1 Registers.............................. 36 5.2 Addressing in 64-bit Mode.................... 37 6 64-bit Interfacing to C Language 37 6.1 Return Values..........................
    [Show full text]
  • Assembly Language: IA-X86
    Assembly Language for x86 Processors X86 Processor Architecture CS 271 Computer Architecture Purdue University Fort Wayne 1 Outline Basic IA Computer Organization IA-32 Registers Instruction Execution Cycle Basic IA Computer Organization Since the 1940's, the Von Neumann computers contains three key components: Processor, called also the CPU (Central Processing Unit) Memory and Storage Devices I/O Devices Interconnected with one or more buses Data Bus Address Bus data bus Control Bus registers Processor I/O I/O IA: Intel Architecture Memory Device Device (CPU) #1 #2 32-bit (or i386) ALU CU clock control bus address bus Processor The processor consists of Datapath ALU Registers Control unit ALU (Arithmetic logic unit) Performs arithmetic and logic operations Control unit (CU) Generates the control signals required to execute instructions Memory Address Space Address Space is the set of memory locations (bytes) that are addressable Next ... Basic Computer Organization IA-32 Registers Instruction Execution Cycle Registers Registers are high speed memory inside the CPU Eight 32-bit general-purpose registers Six 16-bit segment registers Processor Status Flags (EFLAGS) and Instruction Pointer (EIP) 32-bit General-Purpose Registers EAX EBP EBX ESP ECX ESI EDX EDI 16-bit Segment Registers EFLAGS CS ES SS FS EIP DS GS General-Purpose Registers Used primarily for arithmetic and data movement mov eax 10 ;move constant integer 10 into register eax Specialized uses of Registers eax – Accumulator register Automatically
    [Show full text]
  • AMD64 Architecture Programmer's Manual Volume 1: Application
    AMD64 Technology AMD64 Architecture Programmer’s Manual Volume 1: Application Programming Publication No. Revision Date 24592 3.09 September 2003 AMD64 Technology 24592—Rev. 3.09—September 2003 © 2002, 2003 Advanced Micro Devices, Inc. All rights reserved. The contents of this document are provided in connection with Advanced Micro Devices, Inc. (“AMD”) products. AMD makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice. No license, whether express, implied, arising by estoppel or otherwise, to any intellectual property rights is granted by this publication. Except as set forth in AMD’s Standard Terms and Conditions of Sale, AMD assumes no liability whatsoever, and disclaims any express or implied warranty, relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particular pur- pose, or infringement of any intellectual property right. AMD’s products are not designed, intended, authorized or warranted for use as components in systems intended for surgical implant into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of AMD’s product could create a situation where personal injury, death, or severe property or environmental damage may occur. AMD reserves the right to discontinue or make changes to its products at any time without notice. Trademarks AMD, the AMD arrow logo, and combinations thereof, and 3DNow! are trademarks, and AMD-K6 is a registered trademark of Advanced Micro Devices, Inc.
    [Show full text]
  • Module I What Is Microprocessor? Evolution of Microprocessors
    Module I Evolution of microprocessors, 8086 Microprocessor - Architecture and signals, Memory organisation, Minimum and maximum mode of operation, Minimum mode Timing Diagram. Comparison of 8086 and 8088. What is Microprocessor? A single chip processor is called microprocessor. It is also called Central Processing Unit (CPU). It is the brain of a computer system. It is also used in many electronic devices. Microprocessor is a semiconductor device consisting of electronic logic circuits manufactured by techniques such as large scale integration (LSI) or very large scale integration. It is capable of performing computing functions and making decisions to change the sequence of program execution. A computer built with a microprocessor is called micro computer. Examples Intel 8086, Intel 80286, Pentium II A microprocessor in which most instructions operate on n-bit data and its registers are of n-bit size is said to be a n-bit microprocessor. Evolution of microprocessors 4-bit Microprocessors The first microprocessor was introduced in 1971 by Intel Corp. It was named Intel 4004 as it was a 4 bit processor. It was a processor on a single chip. It could perform simple arithmetic and logic operations such as addition, subtraction, boolean AND and boolean OR. Intel introduced the enhanced version of 4004, the 4040. 8-bit Microprocessors The first 8 bit microprocessor which could perform arithmetic and logic operations on 8 bit words was introduced in 1973 again by Intel. This was Intel 8008 and was later followed by an improved version, Intel 8088. 16-bit Microprocessors The 8-bit processors were followed by 16 bit processors.
    [Show full text]
  • Embedded Intel486™ Processor Family Developer's Manual
    Embedded Intel486™ Processor Family Developer’s Manual Release Date: October 1997 Order Number: 273021-001 The Intel486™ processors may contain design defects known as errata which may cause the products to deviate from published specifications. Currently characterized errata are avail- able on request. Information in this document is provided in connection with Intel products. No license, express or implied, by estoppel or oth- erwise, to any intellectual property rights is granted by this document. Except as provided in Intel’s Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel retains the right to make changes to specifications and product descriptions at any time, without notice. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. *Third-party brands and names are the property of their respective owners. Copies of documents which have an ordering number and are referenced in this document, or other Intel literature, may be obtained from: Intel Corporation P.O. Box 5937 Denver, CO 80217-9808 or call 1-800-548-4725 or visit Intel’s website at http:\\www.intel.com Copyright © INTEL CORPORATION, October 1997 CONTENTS CHAPTER 1 GUIDE TO THIS MANUAL 1.1 MANUAL CONTENTS .................................................................................................
    [Show full text]
  • FLAGS Register (Computing) - Wikipedia, the Free Encyclopedia Page 1 of 3
    FLAGS register (computing) - Wikipedia, the free encyclopedia Page 1 of 3 FLAGS register (computing) From Wikipedia, the free encyclopedia This article discusses the flag register specific to the x86 architecture. For a general discussion about flag registers, see status register. The FLAGS register is the status register in Intel x86 microprocessors that contains the current state of the processor. This register is 16 bits wide. Its successors, the EFLAGS and RFLAGS registers are 32 bits and 64 bits wide, respectively. The wider registers retain compatibility with their smaller predecessors. Intel x86 FLAGS Register Bit # Abbreviation Description Category [1] FLAGS 0 CF Carry flag S 1 1 Reserved 2 PF Parity flag S 3 0 Reserved 4 AF Adjust flag S 5 0 Reserved 6 ZF Zero flag S 7 SF Sign flag S 8 TF Trap flag (single step) X 9 IF Interrupt enable flag X 10 DF Direction flag C 11 OF Overflow flag S 12, 13 IOPL I/O privilege level (286+ only) X 14 NT Nested task flag (286+ only) X 15 0 Reserved EFLAGS 16 RF Resume flag (386+ only) X 17 VM Virtual 8086 mode flag (386+ only) X 18 AC Alignment check (486SX+ only) X 19 VIF Virtual interrupt flag (Pentium+) X 20 VIP Virtual interrupt pending (Pentium+) X 21 ID Identification (Pentium+) X 22 0 Reserved http://en.wikipedia.org/wiki/FLAGS_register_(computing) 9/22/2010 FLAGS register (computing) - Wikipedia, the free encyclopedia Page 2 of 3 23 0 Reserved 24 0 Reserved 25 0 Reserved 26 0 Reserved 27 0 Reserved 28 0 Reserved 29 0 Reserved 30 0 Reserved 31 0 Reserved RFLAGS 32-63 0 Reserved 1.
    [Show full text]
  • Microcontroller Slide1
    Quote of the day “Learn from yesterday, live for today, hope for tomorrow. The important thing is to not stop questioning.” ― Albert Einstein, Relativity: The Special and the General Theory Microprocessors and Microcontrollers • Microprocessor: general-purpose CPU – Emphasis is on flexibility and performance – Generic user-interface such as keyboard, mouse, Memory etc. – Used in a PC, PDA, cell phone, etc. • Microcontroller: general-purpose CPU + memory + timer circuit on a single chip(application oriented manufacturing) – Emphasis is on size and cost reduction. – The user interface is tailored to the application, such as the buttons on a TV remote control. – Used in a digital watch, TV remote control, car and many common day-to-day appliances. • Microcontroller architecture refers to the internal hardware organization of a microcontroller. • It determines how and when various operations are performed by the microcontroller. • Each hardware architecture has its own set of software instructions called assembly language that allows programming of the microcontroller. • Harvard Architecture—a type of computer architecture where the instructions (program code) and data are stored in separate memory spaces – Example: Intel 8051 architecture • Von Neumann Architecture—another type of computer architecture where the instructions and data are stored in the same memory space – Example: Intel x86 architecture (Intel Pentium, AMD Athlon, etc.) • Some of the popular microcontroller architectures – Intel 8051 – Zilog Z80 – Atmel AVR • The Intel 8051 is a very popular general purpose microcontroller widely used for small scale embedded systems. • Many vendors such as Atmel, Philips, and Texas Instruments produce MCS-51 family microcontroller chips. • In recent years some companies have incorporated many different and additional features into 8051.
    [Show full text]
  • Intel Microprocessors: 8008 to 8086
    Intel Microprocessors: 8008 to 8086 Stephen P. Morse / Bruce W Ravenel / Stanley Mazor / William B. Pohlman Originally published in IEEE Computer, Vol 13, No. 10, pages 42-60, October 1980 Reprinted in Computer Structures, pages 615-646, Siewiorek/Bell/Newell, 1982 I. Introduction "In the beginning Intel created the 4004 and the 8008." A. The Prophecy Intel introduced the microprocessor in November 1971 with the advertisement, "Announcing a New Era in Integrated Electronics." The fulfillment of this prophecy has already occurred with the delivery of the 8008 in 1972, the 8080 in 1974, the 8085 in 1976, and the 8086 in 1978. During this time, throughput has improved 100-fold, the price of a CPU chip has declined from $300 to $3, and microcomputers have revolutionized design concepts in countless applications. They are now entering our homes and cars. Each successive product implementation depended on semiconductor process innovation, improved architecture, better circuit design, and more sophisticated software, yet upward compatibility not envisioned by the first designers was maintained. This paper provides an insight into the evolutionary process that transformed the 8008 into the 8086, and gives descriptions of the various processors, with emphasis on the 8086. B. Historical Setting In the late 1960s it became clear that the practical use of large-scale integrated circuits (LSI) depended on defining chips having High gate-to-pin ratio Regular cell structure Large standard-part markets In 1968, Intel Corporation was founded to exploit the semiconductor memory market, which uniquely fulfilled these criteria. Early semiconductor RAMs, ROMs, and shift registers were welcomed wherever small memories were needed, especially in calculators and CRT terminals, In 1969, Intel engineers began to study ways of integrating and partitioning the control logic functions of these systems into LSI chips.
    [Show full text]
  • The Intel Microprocessors
    THE INTEL MICROPROCESSORS 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, Pentium Pro Processor, Pentium II, Pentium III, Pentium 4, and Core2 with 64-Bit Extensions Architecture, Programming, and Interfacing Eighth Edition BARRY B. BREY Upper Saddle River, New Jersey Columbus, Ohio Library of Congress Cataloging in Publication Data Brey, Barry B. The Intel microprocessors 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, Pentium Pro processor, Pentium II, Pentium III, Pentium 4, and Core2 with 64-bit extensions: architecture, programming, and interfacing / Barry B. Brey—8th ed. p. cm. Includes index. ISBN 0-13-502645-8 1. Intel 80xxx series microprocessors. 2. Pentium (Microprocessor) 3. Computer interfaces. I. Title. QA76.8.I292B75 2009 004.165—dc22 2008009338 Editor in Chief: Vernon Anthony Acquisitions Editor: Wyatt Morris Editorial Assistant: Christopher Reed Production Coordination: GGS Book Services Project Manager: Jessica Sykes Operations Specialist: Laura Weaver Design Coordinator: Mike Fruhbeis Cover Designer: Ilze Lemesis Cover image: iStockphoto Director of Marketing: David Gesell Marketing Manager: Jimmy Stephens Marketing Assistant: Les Roberts This book was set in Times by GGS Book Services. It was printed and bound by Hamilton Printing. The cover was printed by Phoenix Color Corp. Copyright © 2009, 2006, 2003, 2000, 1997, 1994, 1991, 1987 by Pearson Education, Inc., Upper Saddle River, New Jersey 07458. Pearson Prentice Hall. All rights reserved. Printed in the United States of America. This publication is protected by Copyright and per- mission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.
    [Show full text]
  • Verification of Hypervisor Subroutines Written in Assembler
    Verification of Hypervisor Subroutines written in Assembler Dissertation zur Erlangung des Doktorgrads der technischen Fakult¨at der Albert-Ludwigs-Universit¨at Freiburg im Breisgau von Stefan Maus 8th September 2011 Dekan Prof. Dr. Hans Zappe Gutachter Prof. Dr. Andreas Podelski Prof. Dr. Wolfgang J. Paul 29th August 2011 Abstract We present a methodology for the specification and verification of functional specifications of programs written in Assembler. We have evaluated the method- ology in an industrial setting, the verification of the Microsoft Hypervisor. Many industrial software projects are written in a high-level language like C. For performance reasons or for direct hardware access, some of the routines are implemented in Assembler. Our goal is the automatic modular verification of functional specifications for C programs with subroutines in Assembler. This goal entails the need for checking an Assembler procedure against its functional specification. The specification of the Assembler program is used also in the specification of the C code that calls the Assembler program as a subroutine. Therefore, we need to translate back and forth between specifications for C code and specifications for Assembler code. The particular context of our work is the verification of the Microsoft Hyper- visor where the static checker VCC is used to verify the part of the code written in C. VCC uses modular reasoning and comes with its own annotation language for functional specifications for C programs. The functional specifications for the Assembler routines in the Microsoft Hypervisor are given in the form of specifications for the C routines that call them. In this thesis, we introduce the tool Vx86 and the corresponding method- ology to verify Assembler code against functional specifications of the form described above.
    [Show full text]
  • X86-32 and X86-64 Assembly (Part 1) (No One Can Be Told What the Matrix Is, You Have to See It for Yourself)
    x86-32 and x86-64 Assembly (Part 1) (No one can be told what the Matrix is, you have to see it for yourself) Emmanuel Fleury <[email protected]> LaBRI, Université de Bordeaux, France October 8, 2019 Emmanuel Fleury (LaBRI, France) x86-32 and x86-64 Assembly (Part 1) October 8, 2019 1 / 72 Overview 1 Assembly Languages 2 Intel x86 CPU Family 3 Intel x86 Architecture 4 Intel x86 Instruction Sets 5 Interruptions & System Calls 6 Assembly In Practice 7 References Emmanuel Fleury (LaBRI, France) x86-32 and x86-64 Assembly (Part 1) October 8, 2019 2 / 72 Overview 1 Assembly Languages 2 Intel x86 CPU Family 3 Intel x86 Architecture 4 Intel x86 Instruction Sets 5 Interruptions & System Calls 6 Assembly In Practice 7 References Emmanuel Fleury (LaBRI, France) x86-32 and x86-64 Assembly (Part 1) October 8, 2019 3 / 72 Motivations and Warnings What is Assembly Good for? Understand the machine (debugging is easier, less design errors are made, . ) Better optimization of routines (manage and tune your compiler options) Code hardware-dependant routines (compilers, operating systems, . ) Reverse-engineering and code obfuscation (malware/driver analysis) Knowing assembly will enhance your code ! What is Assembly Bad for? Portability is lost (code is working only for one family of processors) Obfuscate the code (only a few programmers can read assembly) Debugging is difficult (most of the debuggers are lost when hitting assembly) Optimization is tedious (compiler are usually more efficient than humans) Use it with caution and sparsity ! Emmanuel Fleury (LaBRI, France) x86-32 and x86-64 Assembly (Part 1) October 8, 2019 4 / 72 Unstructured Programming Assembly is an unstructured programming language, meaning that it provides only extremely basic programming control structures such as: Basic expressions (arithmetic, bitwise and logic operators); Read/write over memory; Jump operators; Tests.
    [Show full text]
  • X86-64 Machine-Level Programming∗
    x86-64 Machine-Level Programming∗ Randal E. Bryant David R. O'Hallaron September 9, 2005 Intel’s IA32 instruction set architecture (ISA), colloquially known as “x86”, is the dominant instruction format for the world’s computers. IA32 is the platform of choice for most Windows and Linux machines. The ISA we use today was defined in 1985 with the introduction of the i386 microprocessor, extending the 16-bit instruction set defined by the original 8086 to 32 bits. Even though subsequent processor generations have introduced new instruction types and formats, many compilers, including GCC, have avoided using these features in the interest of maintaining backward compatibility. A shift is underway to a 64-bit version of the Intel instruction set. Originally developed by Advanced Micro Devices (AMD) and named x86-64, it is now supported by high end processors from AMD (who now call it AMD64) and by Intel, who refer to it as EM64T. Most people still refer to it as “x86-64,” and we follow this convention. Newer versions of Linux and GCC support this extension. In making this switch, the developers of GCC saw an opportunity to also make use of some of the instruction-set features that had been added in more recent generations of IA32 processors. This combination of new hardware and revised compiler makes x86-64 code substantially different in form and in performance than IA32 code. In creating the 64-bit extension, the AMD engineers also adopted some of the features found in reduced-instruction set computers (RISC) [7] that made them the favored targets for optimizing compilers.
    [Show full text]