This project is a simplified assembler written in C, developed as part of the Systems Programming Lab course at the Open University of Israel. It reads assembly language files (.as), parses and validates the syntax, and generates machine code output files (.ob, .ent, .ext).
- First and second pass parsing
- Symbol table creation
- Error handling and reporting
- Output file generation
All files are written in C (.c) and header files (.h):
main.c– Entry point of the assemblerfirst_pass.c/first_pass.h– Handles the first parsing passsecond_pass.c/second_pass.h– Handles the second parsing passsymbol_table.c/symbol_table.h– Manages symbols and labelsutils.c/utils.h– Helper functions and utilitiesoutput.c/output.h– Generates output filesparser.c/parser.h– Parses assembly lines and instructionserrors.c/errors.h– Error handling and reporting
To compile the assembler:
gcc -Wall -o assembler *.cTo run the assembler on an input file:
./assembler example.asMake sure to provide a valid .as file containing assembly code.
Example input files and sample outputs are available in the folders above.
These include .as files with runnable assembly code and the corresponding generated output files (.ob, .ent, .ext) for reference.
C (compiled with GCC)
Standard libraries only
This project was developed as part of the Systems Programming Lab course at the Open University of Israel. It demonstrates understanding of low-level programming, memory management, and multi-pass parsing techniques.
Ron Stern
Computer Science student at the Open University of Israel