System Software: - The Subject Introduced The Design and Implementation of System Software
System Software: - The Subject Introduced The Design and Implementation of System Software
We Discussed On
Machine Architecture Assemblers Loaders and Linkers
Compilers
Lex and Yacc
Machine Architecture
RISC Machines
Reduced Instruction Set Computers
Intended to simplify the design of processors. Greater reliability, faster execution and less expensive processors
Standard and fixed instruction length Number of machine instructions, instruction formats, and addressing modes relatively small
Assemblers
Assemblers
Translating source code written in assembly language to object code. Assigning machine address to symbolic labels.
Assembler Design
Assembler Design can be done in:
Single pass Two pass
First pass:
Scans the code Validates the tokens Creates a symbol table
Second Pass:
Solves forward references Converts the code to the machine code
Machine independent features Literals Symbol defining statements Expressions Program blocks Control Sections and program linkings
Types of Assemblers
One-pass assembler Multi-pass assembler Two-pass assembler with overlay
Role of Loader
Source Program Translator Object Program
Object program ready for execution
Loader
Translator Assembler/Compiler
Memory
Role of Loader
Source Program Assembler Object Program
Object program ready for execution
Loader
Memory
Object Program
Linker
Object program ready for execution
Executable Code
Loader
Absolute Loader
2000
Memory
Linking Loaders
Object Program(s)
Library
Linking loader
Memory
The source program is first assembled or compiled, producing an object program. A linking loader performs all linking and loading operations, and loads the program into memory for execution
Linkage Editors
Library
Object Program(s)
Linkage editor
Linked program
Relocating loader
Memory
Implementation examples
Brief description of loaders and linkers for actual computers
They are MS-DOS Linker SunOS Linkers - Pentium architecture - SPARC architecture
Macros
A macro instruction (Macro) is a notational convenience for the programmer Allows the programmer to write short hand programs (modular programming). The macro processor replaces each macro instruction with its equivalent block of instructions. The macro processor is not concerned with the meaning of the involved statements during expansion. The design of the macro processor is generally machine independent.
Pass 2:
Expand all macro invocation statements
-Machine-Independent Macro Processor Features -Concatenation of Macro Parameters -Generating Unique Labels -Macro-time Looping -Conditional Macro expansion -Keyword macro parameters -Recursive Macros -Line-by-Line Macros -Integrated Macros
Compilers
Syntactic Analysis
Operator-Precedence Parsing Shift Reduce Parsing
Source Program
Phases of Compilers
Table Management
Error Handling
Code Generation
Machine Independent Compiler Features Storage Allocation Block Structured Languages Compiler Design Options Division Into Passes Interpreters P-Code Compilers Compiler-Compilers
YACC Yet Another Compiler-Compiler YACC Basic Specification How does the Parser Works? Ambiguity and Conflicts
YACC Programs
simple expression with +, - , /, and *.