High-level languages must be translated into low-level languages so the computer can understand them.
🔽 Types of Low-level Languages
Binary code (0s and 1s) that the CPU can execute directly.
❓ How is high-level code converted into machine code?
There are two main approaches, depending on whether the language is compiled or interpreted.
🔧 Compile
📝 Interpret
❓ What’s the difference between an object file and an executable file?
A. An object file is the result of compilation, but it can't run on its own.
To become an executable, the object file must go through a linking process:
🔗 Example:
An instruction is made up of two main parts:
1️⃣ Operation Code (Opcode)
Addressing mode: How should I find the real data (effective address) using the operand in the instruction?
🔽 Types of Addressing Modes:
1) Direct Addressing
-> The operand contains the memory address directly
-> The range of accessible memory is limited by the size of the operand field
2) Indirect Addressing:
-> The operand contains the address of a memory location,
and that memory location contains the effective address (where the data is)
-> This allows access to a wider range of memory, since the real address is stored in memory, not in the instruction
3) Regiser Addressing
-> The operand contains the name or ID of a register
4) Register Indirect Addressing
-> The operand refers to a register
-> That register contains the effective memory address where the actual data is stored