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

#8 ERSITY 7. (49o) Translate the following arihmetie expression into MIP\'S asse

ID: 3715358 • Letter: #

Question

#8

ERSITY 7. (49o) Translate the following arihmetie expression into MIP'S assembly instructions. sso sao-sao + $al . Sal 8. (6% Translate the following "if .. then.. else.." control structure into MIPS assembly instructions. if (S12 0) ( Ss0 St6+ 10; else f Ss0 St6 10 9, (12%) Answer the following questions for the following ARC assembly language code Create the symbol table for the ARC code Symbol Value main op (1) begin org 1000 ld [%r0+x), %r2 ld [P0rO+v], %r3, addcc %r3, %r2, %r4 main: loop: bneg loop jmpl %r15+4, %r0 x 20 y: 1000 end Translate the following two ARC assembly ructions from the given ARC code into object code addcc %r3, %r2, %r4 rsl li 29 282726 2524 23 2221 20 1918 17 16 15 1413 12 111009 0807 06 0504 03 020100 simml 3 ; rs2 . rd op3

Explanation / Answer

Solution

8)

slt $t1,$t2,0 # test $t2 < 0

beq $t1,$0,ELSE # if false goto ELSE

addi $s0,$t6,10 # $s0 = St6 + 10

j ENDIF # goto ENDIF

ELSE :

sub $s0,$t6,10 # $s0 = $t6 - 10

ENDIF :

Feel free to reach out regarding any queries . And please do rate the answer . Thank you .