Question
Write a C++ program to parse your prog.s file and convert that to the Logisim required format to load into the memory module of the
Write a C++ program to parse your prog.s file and convert that to the Logisim required format to load into the memory module of the Logisim 8-bit computer. Please note, the assembler should be a general assembler, able to parse all of the opcodes included in the Logisim 8-bit computer, not an assembler that only converts the mnemonics in your program. The output file has to be named data.out. You may need to add the stdc++ library explicitly when compiling using gcc (e.g., gcc assembler.cpp -o assembler -l stdc++). Additionally, the assembler program in C++ should be named assembler.cpp and take prog.s as the first argument and data.out as the second argument.
Have the first line include "v2.0 raw" and the pad the beginning of the second line with "4*0", see below. Again, your program must be different than this program.
Once the assembler works properly, write a disassembler (named disassembler.cpp) that will take data.out as an input and recreates the mnemonics and values in prog.s. The output of the disassembler should be named (disout.s). This is essentially just a reverse of what your code is doing in the assembler. The assembler and disassembler must be different programs (cpp files).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started