Common Terminologies
- Mnemonic: The actual CPU operation.
- Operand: Arguments passed to the mnemonic, which could be a register, intermediate or a memory location.
- Instruction: Something the CPU can execute. It includes both the mnemonic and the operands.
- Immediate: An immediate is a constant value, like
4
. - Label: A name given to a particular memory address in the code.
- It is made up of letters, digits and underscore.
- A label must start with a letter or underscore.
- A label must end with a colon.
- There are
.
prepended labels which are used to make a label available to its parent and hides from others. Just don’t think about it for now, it’s a complicated thing. - It holds meaning for the assembler (
GAS
, in our case), not the CPU. The assembler replaces the labels with virtual addresses or offsets.
- Directive (or Pseudo-Instruction): Instructions defined for the assembler program, not the CPU.
- They begin with a period (
.
). - Ex:
.section
creates a section within the program.
- They begin with a period (
- Section: The code is divided into multiple sections to organize the memory layout.
- Comment: Anything after a semi-colon (;) or hash (#) is ignored by the assembler and is a note for the programmer itself.
- Keyword: In high-level languages, keywords are reserved words (like if, for, while). In assembly, the idea of keywords basically overlaps with mnemonics and directives.
- Symbol: Everything is a symbol. More on this in future.
Last updated on