Machine Code
Explore what machine code is and how it serves as the fundamental set of instructions a computer understands. Understand the use of opcodes, registers, and how assembly language makes programming more readable than raw machine code. This lesson helps you grasp the first steps in computer programming languages and their relation to hardware.
We'll cover the following...
Machine code
Now that we have circuits that can perform some basic operations on numbers, and we have data in the form of numbers, we can start to write programs that will perform operations on the data. We can do that with the only thing the computer understands: machine code. Because numbers can represent everything, the instructions we give to the computer will be, yes, that’s right, just numbers.
Instruction set and assembly code
Each processor type has a specific set of instructions. A program written for a Mac can’t run on a PC running Windows. So, the instructions can be machine code. Machine code has several operations, called opcodes. The operations can be defined as AND, OR, ADD, and so on. Each opcode has a unique number. For example, AND could have an opcode value of 1, and OR could have an opcode value of 9.
The processor will also have several registers. A register is a small ...