0PricingLogin
Assembly Language & x86 Low-Level Systems Programming · Lesson

x87 FPU Programming Basics

Learn how to use the x87 Floating-Point Unit (FPU) for high-precision floating-point arithmetic in assembly language.

Meet the x87 FPU

The x87 Floating-Point Unit (FPU) is a specialized part of the CPU designed to handle mathematical operations on real numbers, also known as floating-point numbers.

Unlike integer arithmetic, floating-point math requires different internal representations and calculations, which the FPU excels at with high precision.

The FPU Register Stack

The x87 FPU uses a unique register stack, not general-purpose registers. This stack consists of eight 80-bit registers, denoted as ST(0) through ST(7).

  • ST(0) is always the top of the stack.
  • Operations push new values onto the stack or pop values from it, shifting existing values.
  • It behaves like a Last-In, First-Out (LIFO) stack.

All lessons in this course

  1. x87 FPU Programming Basics
  2. SSE/AVX Instruction Sets Introduction
  3. Vectorizing Code with SIMD
  4. Floating-Point Precision, Rounding, and Exceptions
← Back to Assembly Language & x86 Low-Level Systems Programming