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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!