50% developed

x86 Assembly

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This book covers assembly language programming for the x86 family of microprocessors. The objective is to teach how to program in x86 assembly, as well as the history and basic architecture of x86 processor family.

When referring to x86 we address the complete range of x86-based processors (since the original Intel 8086 in 1978). This includes:

  • IA-32 assembly, also commonly referred to as x86-32 assembly (Intel architecture 32-bit, since the Intel 80386), a 32-bit extension of the original 16-bit Intel x86 processor architecture (used in Intel 8086 - 80286 CPUs). IA-32 has full backwards compatibility with the 16-bit x86.
  • x86-64, also called the AMD64 or AMD 64-bit extension, backwards compatible with 32-bit code without performance loss.
  • Intel 64, previously named IA-32e or EM64T, almost identical to x86-64.

Throughout the book these terms may be used interchangeably when appropriate. A special notice will be given when covering 16-bit, 32-bit or 64-bit architectures and on any limitations to limit confusion.

Note, that there is a separate 64-bit instruction set, the IA-64 (Itanium). It was meant to replace the x86 line, but did not gain as much popularity as anticipated, so this replacement did not occur.

Table of Contents

75% developed  as of Dec 4, 2011 Introduction
75% developed  as of Dec 4, 2011 Basic FAQ

x86 Basics

100% developed  as of Dec 4, 2011 x86 Family
75% developed  as of Dec 4, 2011 x86 Architecture and Register Description
100% developed  as of Dec 4, 2011 Comments
50% developed  as of Dec 4, 2011 16, 32, and 64 Bits
50% developed  as of Dec 4, 2011 Intrinsic Data Types

x86 Instruction Set

75% developed  as of Dec 4, 2011 x86 Instructions
50% developed  as of Dec 4, 2011 Data Transfer Instructions
50% developed  as of Dec 4, 2011 Control Flow Instructions
50% developed  as of Dec 4, 2011 Arithmetic Instructions
25% developed  as of Dec 4, 2011 Logic Instructions
50% developed  as of Dec 4, 2011 Shift and Rotate Instructions
50% developed  as of Dec 4, 2011 Other Instructions
25% developed  as of Dec 4, 2011 x86 Interrupts

Syntaxes and Assemblers

75% developed  as of Dec 5, 2011 x86 Assemblers
100% developed  as of Dec 4, 2011 GNU assembly syntax (GAS)
25% developed  as of Dec 4, 2011 MASM Syntax
25% developed  as of Dec 4, 2011 HLA Syntax
50% developed  as of Dec 4, 2011 FASM Syntax
50% developed  as of Dec 4, 2011 NASM Syntax

Instruction Extensions

50% developed  as of Dec 4, 2011 Instruction Extensions
75% developed  as of Dec 4, 2011 Floating Point
50% developed  as of Dec 4, 2011 MMX
75% developed  as of Dec 4, 2011 SSE
50% developed  as of Jul 28, 2012 AVX, AVX2, FMA3, FMA4
25% developed  as of Dec 4, 2011 3DNow!

Advanced x86

50% developed  as of Dec 6, 2011 Advanced x86
50% developed  as of Dec 6, 2011 High-Level Languages
75% developed  as of Dec 6, 2011 Machine Language Conversion
50% developed  as of Dec 6, 2011 Protected Mode
50% developed  as of Dec 6, 2011 Global Descriptor Table
50% developed  as of Dec 6, 2011 Advanced Interrupts
75% developed  as of Dec 6, 2011 Bootloaders

x86 Chipset

50% developed  as of Dec 5, 2011 x86 Chipset
25% developed  as of Dec 5, 2011 Direct Memory Access
50% developed  as of Feb 4, 2012 Programmable Interrupt Controller
50% developed  as of Feb 4, 2012 Programmable Interval Timer
25% developed  as of Dec 5, 2011 Programmable Parallel Interface

Embedding and interoperability

50% developed  as of Jul 25, 2012 Interfacing with WinAPI (Communicating directly with the operating system from the article GNU assembly syntax (GAS) above)
75% developed  as of Jul 25, 2012 Interfacing with Linux
75% developed  as of Jul 25, 2012 Calling Conventions (from the Embedded Systems book)
75% developed  as of Jul 25, 2012 Calling Conventions (from the x86 Disassembly book)
25% developed  as of Jul 25, 2012 Interfacing with the C standard library and own static libraries with CDECL
25% developed  as of Jul 25, 2012 Inline Assembler (Embedded Systems book)
50% developed  as of Jul 25, 2012 Linked Assembler (Embedded Systems book)

Resources

75% developed  as of Dec 5, 2011 Resources