DefinitionQuestion 1 · Recall
Loading…
By the end you can explain the relationship between assembly language and machine code: what an instruction is made of, what a mnemonic is, and why one line of assembly becomes exactly one machine code instruction.
A processor cannot run total = total + price. It has no idea what a "total" is.
What it can do is obey small, fixed commands stored as binary: load this number, add that number, store the answer, jump back a few steps. Each of those commands is one machine code instruction.
Assembly language is that same list of commands, written with short readable names instead of binary. It is not a friendlier way of writing something else — it is the processor's own language with the bits swapped for words.
Machine code
The binary instructions a particular processor can execute directly. Each instruction has two parts:
Opcode is the verb; operand is the object.
The readable name for an opcode is called a mnemonic (said "nem-on-ick" — it means "memory aid"). LDD for load direct, STO for store, ADD for add. Short, easy to remember, and impossible to confuse with a number.
A program written in mnemonics is assembly language, or assembly code. It still needs translating before the processor can run it, because the processor only accepts binary.
Assembler
The program that translates assembly language into machine code. Its input is the assembly source code; its output is object code, ready to be loaded and run. Every processor family needs its own assembler, because every processor family has its own instruction set.