assign2.asm - Tan Dao Assigment 2 CSE 230 Professor DR...

This preview shows page 1 out of 1 page.

# Tan Dao # Assigment 2 # CSE 230 # Professor: DR. Debra Callis # I open the program and write down the requirement for a .data .globl main .text main: addi $s0,$0,25 # initiallize $S0 to 25 ` addi $s1,$0,18 # initialize $s1 to 18 addi $s2,$0,-6 # initialize S$s2 to -6 # Set $s3 to $s1 - $s0 + $s2 sub $t0, $s1,$s0 # Set $t0 equal to $s1-$S0 add $s3, $t0,$s2 # then set $s3 equal to $s3 equal $t0+$s2 # Set $s4 to $s3 + $s2 - 7 add $t1, $s3,$s2 # Set $t1 equal to $s3 + $s2 addi $s4,$t1,-7 # then set $s4 equal to $t1 +(-7) # Set $s5 to 10 + $s1 -$s2 addi $t2,$s1,10 # Set $t2 euqal to 10 + $s1 sub $s5,$t2,$s2 # Set $s5 euqal to $t2 - $s2 # Exchange or swap the values in $s0 and $s1 addi $t3,$0,0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture