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! 🌟