Question

Please help me to answer those three questions.

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

1)char ch1-,ch2-$ ch1: .byte ch2: .byte $ 2)int x-0,y -1,z; x: .word 0 y: .word -1 Word 0 3) name: .asciiz Merge Simpson

qes 15

in this code i tacking the value of c0,c1,c2,c3 and x for testing purpose but you change it accrding to your need


.text
.globl main


main:

li $t0,1
li $t1,2
li $t2,3
li $t3,4
li $t7,5

move $t9,$t0

mul $t4,$t1,$t7
add $t9,$t9,$t4

mul $t4,$t7,$t7
move $t5,$t4
mul $t4,$t4,$t2

add $t9,$t9,$t4

mul $t5,$t5,$t7
mul $t5,$t5,$t3

add $t9,$t9,$t5

li $v0, 4
la $a0,result
syscall

li $v0, 1
move $a0, $t9
syscall

li $v0,10
syscall

.data

result: .asciiz "result: "

#sample output

Mars Messages Run O result: 586 Clear -- program is finished running

qes:16

.text
.globl main


main:

li $t0,0xFEDC
li $t1,0x9876
li $t2,0xAAAA

li $t4,4
loop:

sll $t0,$t0,1
srl $t1,$t1,1
xor $t3,$t0,$t1
nor $t3,$t2,$t3
sub $t4,$t4,1
bnez $t4,loop


li $v0, 4
la $a0,result
syscall

li $v0, 1
move $a0, $t0
syscall

li $v0, 4
la $a0,space
syscall

li $v0, 1
move $a0, $t1
syscall

li $v0, 4
la $a0,space
syscall

li $v0, 1
move $a0, $t2
syscall

li $v0, 4
la $a0,space
syscall

li $v0, 1
move $a0, $t3
syscall

li $v0,10
syscall

.data

result: .asciiz "result t0,t1,t2,t3: "

space: .asciiz "\n"

Mars Messages Run IVO result to,ti, t2,t3: 1043904 2439 Clear 43690 1044208

Add a comment
Know the answer?
Add Answer to:
Please help me to answer those three questions. 15. A third degree polynomial equation (a cubic...
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
  • Please comment the MIPS code to help me understand. Here is what the code accomplishes. Here...

    Please comment the MIPS code to help me understand. Here is what the code accomplishes. Here is the code, partially commented. .data Matrix: .word 41,45,5, 34,8, 15,16,23,44,48,12,32,18,47,22,8,22 .word 46,40,42,33,13,38,27,6, 29,25,18,40,47,22,26,14,3 .word 7, 48,35,9, 43,38,9, 49,28,25,42,5, 44,10,5, 38,14 .word 46,33,16,6, 13,20,31,1, 8, 17,1, 47,28,46,14,28,7 .word 32,2, 48,25,41,29,14,39,43,46,3, 39,32,49,41,28,46 .word 5, 43,2, 48,13,4, 33,41,32,19,9, 25,30,22,2, 9, 40 .word 14,47,22,18,47,3, 35,44,18,6, 33,22,11,6, 47,50,4 .word 28,34,20,30,18,27,38,5, 26,40,37,23,16,13,37,8,7 .word 48,38,39,12,10,39,23,20,21,20,33,16,24,21,25,3,46 .word 49,38,40,38,13,47,5, 13,4, 13,23,26,12,30,29,29, 3 .word 8, 20,10,13,31,7, 12,41,12,21,28,26,43,14,35,10,19 .word 49,33,25,26,24,29,46,22,7, 5, 15,41,10,31,19,41,27 .word 48,9,...

  • 5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2,...

    5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2, $0, 11 add $t3, $t1,$t2 move $t4, $t3 The following image shows a screen shot of QtSPIM page when this program is loaded, and executed in step-by step fashion. Current instruction is highlighted. Data Text x Text Regs Int Regs [16] Int Regs [16] PC = 400028 EPC 0 Cause = 0 BadAddr = 0 Status = 3000ff10 HI LO = 0 = 0...

  • please answer all the questions! really need the help! >of 5 4. ZOOM Page The questions...

    please answer all the questions! really need the help! >of 5 4. ZOOM Page The questions listed below are intended to be answered using MATLAB which is available t p eapps.ps.edu. MATLAB are available lastpage o tis project, You should work out the solutions to these questions before starting the online quiz. You may use your solutions when you take the online quiz 1. Find the augmented matrix [Ab when T30, T 0, T = 20° and T= 10. 2....

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