Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data In Just 7 Chapters

Authors: Prof Marcus Vinicius Pinto

1st Edition

B09NZ7ZX72, 979-8787954036

More Books

Students also viewed these Databases questions