Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Introduction to Mars IDE MARS is a software simulator for the MIPS assembly lang

ID: 667114 • Letter: I

Question

Introduction to Mars IDE

MARS is a software simulator for the MIPS assembly language intended for educational use.

MARS may be downloaded from www.cs.missouristate.edu/MARS.

Procedure:

I. After downloading the Mars software, just double click on the downloaded file. The following figure will show up.

Figure 1

II. From the main menu, choose “File”à “New”

III. You will find a blank file. Start typing the program below in the blank file.

The code:

li $s2, 100

li $s4,200

add $s6,$s2,$s4

IV. Click on the following icon “Assemble the current file”

V. The following screen will show up. Click on the following icon to Run the program

Observe the registers values. Record these values in Table 1.

Table 1

Here is what I got for table 1

Initial Value

Value

$S2

0

100

$S4

0

200

$S6

0

300

Questions:

Determine the instruction format for each instruction in the program

Determine the instruction content for each field per each instruction in the program

Any help answering these two questions would be greatly appreciated.

Initial Value

Value

$S2

0

100

$S4

0

200

$S6

0

300

Explanation / Answer

Hi,

You have already got the solution to your problem:

1.Determine the instruction format for each instruction in the program

Answer:

1st Instruction:li $s2, 100

Data Transfer Group:

The data transfer instructions move data between registers or between memory and registers

LDA           Load Accumulator Directly from Memory

s2 thus stores 100

2nd Instruction:li $s4,200

The data transfer instructions move data between registers or between memory and registers

LDA           Load Accumulator Directly from Memory

s4 thus stores 200

Instruction 3:add $s6,$s2,$s4

Arithmetic Group:

The arithmetic instructions add, subtract, increment, or decrement data in registers or memory.

ADD           Add to Accumulator

instructions are used when all the data values used by the instruction are located in registers.

All R-type instructions have the following format:

Where "OP" is the mnemonic for the particular instruction. rs, and rt are the source registers, and rd is the destination register. As an example, the add mnemonic can be used as:

Where the values in $s2 and $s3 are added together, and the result is stored in $s1. In the main narrative of this book, the operands will be denoted by these names.

Thus now $s6 has 300

Question 2:Determine the instruction content for each field per each instruction in the program

You have already got this answer in your table :

Initial Value

Value

$S2

0

100

$S4

0

200

$S6

0

300

Hope that helps....HAPPY ANSWERING!!!!!!!!!!!!!!!!

Initial Value

Value

$S2

0

100

$S4

0

200

$S6

0

300

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote