This project is an LC4 Assembler programmed in C, which reads an assembly language file and generates its machine code equivalent in binary format. The assembler handles file I/O operations, parsing instructions, and converting them into their binary equivalents.
The LC4 Assembler reads in a .ASM text file containing assembly instructions intended for PennSim and outputs a .OBJ binary file. This project demonstrates handling strings, multidimensional arrays, and file I/O in C.
- Reads assembly instructions from a text file
- Converts instructions to their binary equivalents
- Outputs the binary code to a .OBJ file
- Error handling for file I/O and instruction parsing
- C programming language
- clang compiler
- Compile the program:
clang assembler.c asm_parser.c -o assembler
-
Run the assembler:
./assembler <assembly_file.asm>
Replace
<assembly_file.asm>
with the name of your assembly file. -
Example:
./assembler test.asm
Through the development of my mini LC4 Assembler, this project offered me an opportunity to deepen my understanding of file I/O, string manipulation, and multidimensional arrays in C programming. By successfully completing this project, I not only enhanced my proficiency in C programming but also gained practical experience in working with assembly language and binary file formats.
- Fork the repository
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -m 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Open a Pull Request
This project is licensed under the MIT License.
For any questions or support, please contact [email protected].
Feel free to use this adjusted version to reflect the completion of your project!