Skip to content

Repository files navigation

🌟 System Programming 🌟

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. πŸ“šβœ¨


πŸ› οΈ What is an Assembler?

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 βš™οΈ

πŸŒ€ Single Pass Assembler

A Single Pass Assembler processes the source code in one pass. It performs the translation of assembly instructions and symbol resolution simultaneously.

πŸ”‘ Key Features:

  • Faster translation ⚑
  • Limited error handling ❌
  • Suitable for simpler assembly programs 🎯

🌐 Two Pass Assembler

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.

🎯 Advantages:

  • Handles forward references βœ…
  • Provides better error diagnostics πŸ›‘οΈ

πŸ“‹ Pass 1 of a Two Pass Assembler

The first pass of a two-pass assembler performs the following tasks:

  • Constructs the Symbol Table πŸ—‚οΈ
  • Calculates Instruction Lengths πŸ“
  • Detects Labels and Addresses πŸ“

πŸ› οΈ Outputs:

  • Symbol Table
  • Intermediate Code

🧩 Pass 2 of a Two Pass Assembler

The second pass utilizes the outputs from the first pass to:

  • Translate intermediate code into Machine Code πŸ”„
  • Perform Address Binding πŸ“Œ
  • Generate the Object Code πŸ–¨οΈ

πŸ“ Macro Definition

A macro is a sequence of instructions grouped under a name, used to simplify repetitive tasks.

✨ Benefits of Macros:

  • Reduces code duplication πŸŒ€
  • Enhances code readability πŸ“–
  • Improves development efficiency πŸš€

πŸ”„ Macro Expansion

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.

πŸ› οΈ Steps:

  1. Locate macro definitions in the code. πŸ”
  2. Replace macro calls with corresponding code. πŸ”„

🌟 Happy Learning and Coding! 🌟

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages