Instructions

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Instructions

In computer programming, instructions are single operations the computer recognizes and can execute.

For example, a function call, an addition, or assigning a value to a variable.

This is an instruction:

var value := 10 + 15

Any code we write is an instruction. It tells the computer what to do.

Calling it "instruction" is not a coincidence: it's because code is just text; it doesn't do anything. When typing code in a modern interface, it's easy to get fooled and think the code is the program, because of all the fancy colors and the error messages and the autocomplete. But it's just dead text.

What makes it alive is the computer, which reads the text, interprets it, and executes the instructions if it can. It might also decide to skip certain instructions if they're not needed, or optimize others, depending on how it was programmed.

But how does the computer know what to do?

At the lowest level, instructions are binary operations that the CPU can execute. These are called "operation code" instructions, also called opcodes.

Opcodes operate on data, which is stored in memory or registers. The CPU fetches the data, performs the operation, and stores the result back in memory or a register (a register is a very fast memory unit located on the chip).

For example, in a hypothetical assembly language, an instruction to add two numbers might look like this:

ADD R1, R2, R3

Here the opcode ADD takes the values stored in registers R2 and R3, adds them together, and stores the result in register R1.

Because writing Assembly can be somewhat unyieldy, low level compiled languages like C or Rust give us an easier way to write instructions, by abstracting the opcodes into keywords and functions, which get compiled to Assembly. Higher level interpreted languages like Python or GDScript abstract it in a different way: they have a pre-compiled program that can run the opcodes, and reads the instructions from a file.

Assembly itself is an abstraction over the raw binary instructions, giving human-readable names to the opcodes and registers. This makes it easier to write and understand, but it's still very close to the machine code that the CPU executes.

Those binary codes operate on the actual hardware of the CPU. Anything a computer does boils down to enormous amounts of extremely simple operations like adding two numbers, comparing two values, or moving data around, that could be done by a human. Computers just do it very, very fast.

How does a CPU work? That's a bit outside the scope of this glossary, but here are a playlist of a few very nice videos that explain it in simple ways:

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!