Opcode (Operation Code): This is the part of the instruction that identifies the specific action the CPU should perform, such as loading data, adding numbers, or jumping to a different code section.
Operand: This component provides the necessary parameters for the opcode, which can be a constant value (literal), a register name, or a memory address.
Notation Standards: Assembly often uses specific prefixes to denote data types, such as # for denary (decimal) values, B for binary strings, and & for hexadecimal addresses.
| Feature | Machine Code | Assembly Language | High-Level Language |
|---|---|---|---|
| Generation | 1st Generation | 2nd Generation | 3rd/4th Generation |
| Format | Binary (s and s) | Mnemonics (Text) | English-like statements |
| Execution | Direct by CPU | Needs Translation | Needs Compilation/Interpretation |
| Hardware | Hardware-specific | Hardware-specific | Portable (Cross-platform) |
Identify the Opcode First: When tracing code, always determine the operation being performed before looking at the data to avoid confusion about the instruction's intent.
Check the Operand Prefix: Pay close attention to symbols like #. An instruction like might move the contents of address , while moves the literal number .
Verify CPU Specificity: Remember that assembly code is written for a specific instruction set; if an exam question asks about portability, the answer is almost always that it cannot run on a different CPU architecture.
Trace the Accumulator: Most basic assembly operations revolve around a primary register called the Accumulator (ACC); keep a clear log of its value at every step.
Direct Execution Myth: A common error is assuming the CPU can run assembly files directly; it must always pass through a translator (assembler) to become binary machine code.
Opcode vs. Operand Confusion: Students often swap the two; remember that the Opcode is the 'verb' (what to do) and the Operand is the 'noun' (what to do it to).
Portability Assumption: Unlike languages like Java, assembly is not 'write once, run anywhere.' It is deeply tied to the specific electronic logic of the processor.