SPOS LAB
System Programming and Operating Systems Laboratory
By Mr. VK
Complete SPOSL (Windows)
SPOS LAB ZIP (Windows & Linux)
Assignment 1 (Pass 1 of 2 Pass Assembler)
Problem Statement: Design suitable data structures and implement pass-I of a two-pass assembler for a
pseudo-machine using object-oriented feature. Implementation should consist of a few
instructions from each category and few assembler directives.
Input:
- data.txt (Pneumonic Opcode Table)
- input.txt (Assembly Language Program)
Output:
- literaltab.txt (Literal Table)
- phase1.txt (Intermediate Code)
- pool.txt (Pool Table)
- symtab.txt (Symbol Table)
Steps:
- g++ ass1.cpp
- a.exe //for Windows
- ./a.out //for Linux
Assignment 2 (Pass 2 of 2 Pass Assembler)
Problem Statement: Implement Pass-II of two pass assembler for a pseudo-machine using object-oriented features.
The output of assignment-1 (intermediate file and symbol table) should be input for this
assignment.
Input:
- symtab.txt (Symbol Table)
- literaltab.txt (Literal Table)
- intermediate.txt (Intermediate Code)
Output:
Assignment 3 (Pass 1 of 2 Pass Macro Processor)
Problem Statement: Design suitable data structures and implement pass-I of a two-pass macro-processor using
OOP features.
Input:
- input.txt (Assembly Code without Macros)
- input.txt (Assembly Code without Macros)
Output:
- aal.txt (Argument Array List)
- intermediate.txt (Intermediate Code)
- mdt.txt (Macro Definition Table)
- mnt.txt (Macro Name Table)
- aal.txt (Argument Array List)
- intermediate.txt (Intermediate Code)
- mdt.txt (Macro Definition Table)
- mnt.txt (Macro Name Table)
Steps:
Assignment 4 (Pass 2 of 2 Pass Macro Processor)
Problem Statement: Write a program for pass-II of a two-pass macro-processor. The output of assignment-3 (MNT,
MDT and file without any macro definitions) should be input for this assignment.
Input:
- ala.txt (Argument List Array)
- input.txt (Intermediate Code)
- mdt.txt (Macro Definition Table)
- mnt.txt (Macro Name Table)
- ala.txt (Argument List Array)
- input.txt (Intermediate Code)
- mdt.txt (Macro Definition Table)
- mnt.txt (Macro Name Table)
Output:
- output.txt (Assembly Code without Macros)
- output.txt (Assembly Code without Macros)
Steps:
Assignment 5 (Lexical Analysis Using Lex tool)
Problem Statement: Write a program using Lex specifications to implement lexical analysis phase of compiler to
generate tokens of subset of ‘C’ program.
Input:
- A1.l (Lex Program)
- sample.txt (Sample Code)
- A1.l (Lex Program)
- sample.txt (Sample Code)
Output:
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
Steps:
- lex A1.l
- gcc lex.yy.c
- a.exe //for Windows
- ./a.out //for Linux
Assignment 6 (Syntax Analysis Using Lex and YACC tool Code Analysis)
Problem Statement: Write a program using YACC specifications to implement syntax analysis phase of compiler to
validate type and syntax of variable declaration in C program.
Input:
- ass6.l (Lex Program)
- ass6.y (Y Program)
- ass6.tab.c
- ass6.tab.h
- ass6.l (Lex Program)
- ass6.y (Y Program)
- ass6.tab.c
- ass6.tab.h
Output:
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
Steps:
- lex ass6.l
- bison -dy ass6.y
- gcc lex.yy.c ass6.tab.c
- a.exe //for Windows
- ./a.out //for Linux
Assignment 7 (Syntactic Analysis Using Lex & YACC tool Simple & Compound Statement)
Problem Statement: Write a program using YACC specifications to implement syntax analysis phase of compiler to
recognize simple and compound sentences given in input file.
Input:
- ass6.l (Lex Program)
- ass6.y (Y Program)
- ass6.tab.c
- ass6.tab.h
- ass6.l (Lex Program)
- ass6.y (Y Program)
- ass6.tab.c
- ass6.tab.h
Output:
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
- lex.yy.c (Lex Output C Program)
- a.exe (Executable File)
Steps:
- lex ass6.l
- bison -dy ass6.y
- gcc lex.yy.c ass6.tab.c
- a.exe //for Windows
- ./a.out //for Linux
Assignment 8 (CPU Scheduling Algorithms)
Problem Statement: Write a program to implement following CPU scheduling algorithms: FCFS, SJF (Non
Preemptive), Priority (Non-Preemptive) and Round Robin (Preemptive)
Steps:
- python FCFS.py
- python sjf.py
- python priority.py
- python rr.py
OR- gcc spos8.c
- a.exe //for Windows
- ./a.out //for Linux
Assignment 9 (Unix System Calls ps, fork, join, exec Process Management)
Problem Statement: Implement UNIX system calls like ps, fork, join, exec family, and wait for process
management (use shell script/ Java/ C programming).
Steps:
- g++ as9.cpp
- a.exe //for Windows
- ./a.out //for Linux
Assignment 10 (Page Replacement Algorithms)
Problem Statement: Write a Program to implement page replacement simulation using following algorithms
1. FIFO 2. LRU and 3. Optimal
Comments
Post a Comment
Please Provide Your Valuable Feedback