Welcome to the System Programming repository! This repository serves as a comprehensive guide to understanding fundamental concepts of system programming, focusing on assemblers and macros. πβ¨
An assembler is a system program that converts assembly language into machine code. It bridges the gap between human-readable code and machine-readable instructions.
- Input: Assembly language code π‘
- Output: Machine code βοΈ
A Single Pass Assembler processes the source code in one pass. It performs the translation of assembly instructions and symbol resolution simultaneously.
- Faster translation β‘
- Limited error handling β
- Suitable for simpler assembly programs π―
A Two Pass Assembler processes the source code in two distinct passes:
1οΈβ£ Pass 1: Analyzes and collects information.
2οΈβ£ Pass 2: Generates machine code based on the data collected.
- Handles forward references β
- Provides better error diagnostics π‘οΈ
The first pass of a two-pass assembler performs the following tasks:
- Constructs the Symbol Table ποΈ
- Calculates Instruction Lengths π
- Detects Labels and Addresses π
- Symbol Table
- Intermediate Code
The second pass utilizes the outputs from the first pass to:
- Translate intermediate code into Machine Code π
- Perform Address Binding π
- Generate the Object Code π¨οΈ
A macro is a sequence of instructions grouped under a name, used to simplify repetitive tasks.
- Reduces code duplication π
- Enhances code readability π
- Improves development efficiency π
The Macro Expansion process replaces a macro name with the actual sequence of instructions it represents. It ensures the assembly code integrates seamlessly during preprocessing.
- Locate macro definitions in the code. π
- Replace macro calls with corresponding code. π
π Happy Learning and Coding! π