Question

For project six, you will be given a list of MIPS machine language code instructions in memory. Your task is to Disassemble the contents and show the MIPS instructions. Make sure to calculate the correct branch target address for each branch instruction. If the resulting BTA happens to be outside the given code, this is OK, just make sure you calculate the BTA correctl Contents Address 0x00400024 Ox3c111001 0x00400028 Ox3410000a 0x0040002c Ox2a01000a 0x00400030 0x14200006 0x00400034 Ox8e280000 0x00400038 Ox01094820 0x0040003c Ox22100001 0x00400040 0x22310004 0x00400044 Ox0401fffa Solution Format: When writing your solution please use the following rules: 1. The REQUIRED file name is LastNameFirstName-p7.txt , where Last Name is your last name and FirstName is your first name 2. each line should be formatted in the following way address;contents;mips_instruction Please replace address, contents and mips instruction with their respective correct values 3. Each value on each line is REQUIRED to be separated by a semi-colon(;) . There should be nothing else inside the file, not even your name 5. There should only be 9 rows in your file. Anymore is breaking solution format 6. IF you wish to submt the work you did to get your answers, you may do so in a different file. This file can be named whatever you like

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:

According to the given data the following CODE follows that illustrates the given data;

According to the following data the below instructions and contents,address follows as shown below;

Here the content with MIPS instruction and address that illustrates the data ;

Address

Contents

MIPS_Instructions

0x00400024

0x3c111001

LUI $s1,x1001

0x00400028

0x3410000a

ORI $s0, $zero ,10

0x0040002c

0x2a01000a

SLTI $1 ,$s0 ,10

loop1:

0x00400030

0x14200006

BNE 1t $zero loop

0x00400034

0x8e280000

LW $t0 0($s1)

0x00400038

0x01094820

ADD $t1 $t0 $t1

0x0040003c

0x22100001

ADDI $s0 $s0 1

0x00400040

0x22310004

ADDI $s1 $s1 4

0x00400044

0x0401fffa

BGEZ $zero loop1

loop:

àthe loop is considered or it means that the jump into the instruction in the address itself of "0x0040004c"

àthe loop is considered or it means that the jump into the instruction in the address itself of

"0x00400030”.

Therefore by using the above information we can get our required data

Add a comment
Know the answer?
Add Answer to:
For project six, you will be given a list of MIPS machine language code instructions in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given this MIPS machine language code fragment in memory: Address Contents 0x00400024 0x00400028 ...

    Given this MIPS machine language code fragment in memory: Address Contents 0x00400024 0x00400028 0x0040002c 0x00400030 0x00400034 0x00400038 0x0040003c 0x00400040 0x00400044 0x00400048 0x3411000b 0x3c101001 0x2a21000b 0x14200007 0xae080004 0x2231ffff 0x01129020 0x221Offfc 0x2a210002 0x1020fffb Disassemble and show the MIPS instructions For constants in I-format instructions, you may leave them in hexadecimal, or translate them into decimal Do not worry about labels. Show clearly target addresses for all branches and jumps. Given this MIPS machine language code fragment in memory: Address Contents 0x00400024 0x00400028...

  • Usc only the following MIPS instructions for assignment questions 3, 4 and 5: add, sub, addi,...

    Usc only the following MIPS instructions for assignment questions 3, 4 and 5: add, sub, addi, j, beq, bne, lw, sw. You may not need as many lines as we provide space for 4. (4 pts) Write a MIPS program starting at address 20 that writes a value of 488 to register $7. Next, you will test if register $10 is equal to register $7. If the values are equal, continue execution at address 48; otherwise set the value in...

  • directly 3- Consider the C++ code below. Translate the code into MIPS instructions as possible. Put...

    directly 3- Consider the C++ code below. Translate the code into MIPS instructions as possible. Put them in a file called program2.s. as int B[4] {300, 200, 100, 0 }; = int i = 3; B[i =BI01 + B[1] B 21; Run your code to make sure it has correct behavior. You should make sure the memory locations of the array hold the expected values. directly 3- Consider the C++ code below. Translate the code into MIPS instructions as possible....

  • Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt,...

    Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt, $rs, immediate # add immediate swr $rt, immedi ate ($rs) # store word write register These instructions are I-format instructions similar to the load word and store word instructions. The addi and swr instructions store a computed value to the destina- tion register $rt. The instructions do not require any physical hardware changes to the datapath. The effect of each instruction is given below....

  • Translate each of the following pseudo-instructions into MIPS instructions. You should Produce a minimal sequence of...

    Translate each of the following pseudo-instructions into MIPS instructions. You should Produce a minimal sequence of MIPS instructions to accomplish the required computation. (8 Points) 1) bgt $t1, 100, Label # bgt means branch if greater than 2) ble $s2, 10, Next # ble means branch if less than or equal 3) ror $s0, $s4, 7 # ror means rotate right $s4 by 7 bits and store the result in $s0 4) neg $s5, $s4 # $s5 will have the...

  • 2- Consider the C++ code below. Translate the code into MIPS instructions as directly as possible. Put them in a file c...

    2- Consider the C++ code below. Translate the code into MIPS instructions as directly as possible. Put them in a file called program1.s. int x 20; // use $t0 to keep track of x's value /use $t1 int y = x + 5; to keep track of y's value y = y| 2; X = X &4; /use $t2 to keep track of z's value Z ~X ^ y >> 2; Z Z Run your code to make sure it...

  • Instructions: Written in English (Basic Language) Modify the Base Project Sample Code to create a database...

    Instructions: Written in English (Basic Language) Modify the Base Project Sample Code to create a database of your own design that includes at least four data fields. The overall design and format of your program is up to you. Your program should implement the following menu options – A. Add Item B. List All Items C. Quit Any data theme or motif is acceptable, provided your project has at least four data elements. Please make sure your data structure implements...

  • 5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer...

    5 Exercises Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A- The MiteASM Assembler and Appendix B - The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should display a count on the 7-segment display. The count should increase by 1 when button 0 is 1. pressed. It should reset to 0 when button 1 is...

  • Write MIPS code for each of the following instructions, Your assembly should implement the C code...

    Write MIPS code for each of the following instructions, Your assembly should implement the C code directly – i.e.,do not ’optimize’ the C code to change the order of operations or reduce computations. Use commands only like add, sub, lw, sw, immediate Part 1. x = 3-13*x; Do not use multiply. One way of doing the multiply without a multiply instruction is by using many add instructions (x+x+...+x). For this problem, you should do it with fewer additions. Hint: We...

  • C++ Code Please, Three employees in a company are up for a special pay increase. You...

    C++ Code Please, Three employees in a company are up for a special pay increase. You are given a file, say Ch3_Ex5Data.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee’s last name, first name, current salary, and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT