# Instruction Set of a Processor: Definition & Components

Lesson Transcript
Instructor: Martin Gibbs

Martin has 16 years experience in Human Resources Information Systems, has a PhD in Information Technology Management, and a degree in Information Systems Management. He is an adjunct professor of computer science and computer programming.

In this lesson, you will learn how an instruction set is used to communicate with a processor of a computer. We will discuss instructions, operations and operands, and basics of assembly language Updated: 09/26/2020

## The Instruction Set

The closer we get to the core of a computer, the more unfamiliar things may appear. In fact, we are getting closer and closer to the atoms of the computer: the 1s and 0s! This is the language of the machine, rather than a language we are used to using. At this level, you can still talk to the processor and tell it what to do.

An instruction set (used in what is called ISA, or Instruction Set Architecture) is code that the computer processor (CPU) can understand. The language is 1s and 0s, or machine language. It contains instructions or tasks that control the movement of bits and bytes within the processor.

But if it's 1s and 0s, how do we actually communicate with the processor? Systems programmers use assembly language, which is a type of programming language. The statements are assembled into machine language--into the instructions that the processor can understand. Assembly language is a lot like machine language with labels--because binary alone would quickly get hard to keep track of.

What makes up an instruction set? When we start talking about 1s and 0s, machine language, assembly language, and registers, it might all become murky. Let's start with the overall structure of an instruction and go from there.

The instruction set consists of a limited set of unique codes that let the processor know what to do next, along with some basic rules of how to express them. We can explain more about it using the following:

1. Instruction length (this can vary)
2. Opcodes (the command to be carried out)
3. Operands (what the command will operate on)
4. Registers (internal locations--limited in number and ability, but quick to access)
5. Memory (external storage--a larger and more versatile number of locations, but slower to access)

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Creating an Assembly Language Using an Instruction Set

### You're on a roll. Keep up the good work!

Replay
Your next lesson will play in 10 seconds
• 0:04 The Instruction Set
• 2:01 Instructions
• 4:05 Operands & Opcodes
• 4:48 Registers & Main Memory
• 5:42 Lesson Summary
Save Save

Want to watch this again later?

Timeline
Autoplay
Autoplay
Speed Speed

## Instructions

So what is an instruction? Let's take a look at instructions and instruction length.

An instruction can vary in length depending on the architecture. In x86 systems, the length of the instruction is typically 1 to 3 bytes (for the opcode), plus a number of bytes needed for the operands, depending on the addressing mode. What's an addressing mode? Different operations may be performed directly on pure numbers, indirectly on numbers in internal registers, or very indirectly on locations in main memory. Each of those is a different addressing mode.

Additionally, shorter instructions do not always mean faster instructions. Sometimes a short instruction hides a lot of machine cycles. Think of riding a bike that is too small for you; you might be pedaling faster, but are you really getting there faster?

The instruction itself is made up of a bit pattern (those 1s and 0s again), but in assembly, you will see syntax such as MOV, ADD, and CMP. These are called mnemonics rather than opcodes (a mnemonic is something that makes another thing easier to remember). For example, to add two operands such as the number 42 to the contents of the EAX register, the code is:

An instruction is a specific length, as specified by the ISA. However, consider the following instruction, shown in this figure appearing here that we've labeled Figure 1:

The length of an instruction is dependent on how much can be specified in the least number of bits. Some instructions, like the one in Figure 1, can be specified in just 16 bits or two bytes (also called a word). That's because these two 6 bit operands can only specify something that can be described with 6 bits, in the previous example. We can specify 32 different things with 6 bits, which is often enough to specify a register. But if we need to specify a memory location in main memory, it can take 4 bytes or more to specify each address.

To unlock this lesson you must be a Study.com Member.

### Register to view this lesson

Are you a student or a teacher?