Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C that takes a MIPS Assembly Language (MAL) program as an input and gives a list of labels of the MAL

Write a program in C that takes a MIPS Assembly Language (MAL) program as an input and gives a list of labels of the MAL program used as variables, a list of labels of the MAL program used for the flow control, or both as an output.

The program must run by being given command line arguments (int main(int argc, char* argv[]). So, supposing the executable version of the program is called example.out. The program will be executed with the following command: example.out flag inputfile outputfile

Note that a valid flag argument is one of -f, -v, or -b.

The program guidelines:

- if the flag is -v, the program should only produce a list of labels of the MAL source program used as variables in the specified output file.(Variable labels are identifiers defined in the .DATA segment of a MAL program.)

- if the flag is -f, the program should produce only a list of labels of the MAL program used for the flow control in the specified output file. (Flow control labels are identifiers defined in the .TEXT segment of a MAL program.)

- if the flag is -b, the program must produce a.) a list of labels of the MAL source program used as variables, and b.) a list of labels of the MAL program used for the flow control in the specified output file.

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions