Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project In order to get started on creating your assembler you must be able to have the program understand basic syntax of a text file

Project

In order to get started on creating your assembler you must be able to have the program understand basic syntax of a text file containing a program. In this first part of the program you will deal with the basic functions of string processing and reading files. The following is a list of items to complete to help you do the project.

1) You will need to be able to read in arguments pass from the command line.

Ex: project1.exe inputfile.txt outputfile1.txt

2) You will need to be able to parse a string.

Ex: You will need to use the strtok() function in the string.h file.

3) You will need to convert all letters to lowercase letters.

4) You will need to compare a string to a list of know words.

(add, load, store, r0, r1, r2)

5) You will need to have a number in text 123 be converted to a number (integer) in the C program.

6) You will also need to be able to read and write files.

Project #1

Your assignment is to make a simple assembler for the DLX processor. We will simplify the assembler by only using the core instructions, we will not do the floating point instructions. The registers will be named as r0, r1, r2, r29, r30, r31. We will also not allow any advance naming for saving constant or memory locations the assembly source code we write will hard code any constant and memory location to read and write to. The only advance item we will do is use a label for branching and jumping in code.

Items to turn in: a report that tells how you created your program, source code, test files and a flow chart.

Tips

It is common to run an assembler in a two pass structure. The first pass goes through the source files and finds all the labels and addresses for each instruction. You can start your program by assuming the first line of code is at memory location 0. You will make a table of label and address. On the second pass you will then convert the assembly instruction into machine code and fill in any labels using your table.

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

More Books

Students also viewed these Databases questions