Skip to content

Classic systems programming labs: assembler, loader, linker, macro processor (typically taught under Operating Systems / Compiler Design)

Notifications You must be signed in to change notification settings

Tanisha411/system-programming-assignments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System Programming Assignments

This repository contains System Programming assignments, implemented in Java.

Each program demonstrates key concepts in assembler design, macro processing, and lexical analysis, inspired by the classical problems in system software. Wrote this before vibe coding became a thing so I'll cherish this repository forever :')


Contents

Assignment 1 – Two-Pass Assembler (Pass 1)

  • Location Counter (LC) processing
  • Assembly code → Intermediate code
  • Symbol Table (SYMTAB) generation
  • Error checks:
    • Invalid mnemonics
    • Missing comma between operands

Assignment 2 – Two-Pass Assembler (Pass 2)

  • Location Counter (LC) processing
  • Assembly code → Intermediate code (IC)
  • Literal Table generation
  • Pool Table generation

Assignment 3 – Intermediate Code to Machine Code

  • Location Counter (LC) processing
  • Intermediate code → Machine code

Assignment 4 – Macro Processor

  • Macro expansion: final assembly code with macros expanded
  • Generation and use of:
    • MNT (Macro Name Table)
    • MDT (Macro Definition Table)
    • EVNTAB (Expansion Variable Name Table)
    • EVTAB (Expansion Variable Table)
    • APTAB (Argument Parameter Table)

Assignment 5 – Lexical Analyser for C

  • Lexical analysis of a C program
  • Symbol table generation

How to Run

Each assignment is self-contained within its folder (SP1/, SP2/, etc.).
To run any program:

  1. Open the .java file in your IDE (e.g., IntelliJ IDEA, Eclipse, VS Code).
  2. Run the program.
  3. Provide the required input through the terminal when prompted.
  4. Assignments 4 and 5 use file handling. The respective input files are present in those folders.
  5. Sorry I forgot to modify the file paths, please remove my file paths in assignments 4 and 5 and add yours (please look through the entire code so you don't miss any line where I've specified a file path) :(

Notes

These assignments have been implemented with respect to the hypothetical assembly language described in the textbook
Systems Programming by D.M. Dhamdhere.

About

Classic systems programming labs: assembler, loader, linker, macro processor (typically taught under Operating Systems / Compiler Design)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages