T03 Dec 18, 2025 2 min read

Machine instruction

The smallest unit of work a CPU can execute: an encoded operation plus its operands and addressing mode.

Definition

A machine instruction is a single, CPU-understandable command encoded as bits: “do operation X using operands Y and write the result to Z”.

It’s the level of detail the CPU actually executes.

  • Related: machine code, assembly (human-readable representation), opcode, register, ISA
  • Often contrasted with: source code

What’s inside an instruction (conceptually)

While instruction formats differ by CPU architecture, most instructions encode:

  • an opcode (what operation to perform: add, compare, jump, load, store, etc.)
  • operands (which registers/memory locations to use)
  • an addressing mode (how to interpret operands: direct register, memory at address, memory at base+offset, etc.)

Instruction set architecture (ISA)

Machine instructions are defined by a CPU’s instruction set architecture. Different ISAs (x86-64, ARM64, RISC-V, etc.) have different instruction formats and semantics, which is why binaries are typically tied to a specific architecture.

What it is (and isn’t)

  • It is not “a line of source code”. One line of source code can become many machine instructions, and sometimes none (comments).
  • It is architecture-specific. An instruction for x86-64 isn’t the same as an instruction for ARM64.
  • It’s typically the output of compilation (or produced during JIT compilation).

Where you encounter machine instructions

You don’t need to write assembly to care about machine instructions. They show up indirectly via:

  • performance profiling (hot loops ultimately map to instruction sequences)
  • crashes and debugging (instruction pointers, backtraces, disassembly)
  • compatibility issues (building for the wrong architecture)

Machine code vs “binary”

A binary can contain machine code, but also includes metadata and sections such as headers, relocation tables, symbol information, and debug data. “Binary” means “bytes on disk”. “Machine instructions” means “bytes interpreted by the CPU as operations.”

Why this term matters

Machine instructions are the boundary where abstractions stop. Regardless of language or framework, CPU work becomes instruction sequences that move data, branch, call, and compute.

A useful analogy

If source code is a recipe written for humans, machine instructions are the tiny, explicit motions in the kitchen: pick up this ingredient, add it here, stir, check, repeat. A single “make the sauce” step in the recipe expands into many concrete actions.