Q3. a) 8 boxes in consequitive with the first and 5th box being num and dec b) Swap by value:
Won't change the address nor swap the memory c) temp = *a *a = *b * b=temp Will swap
// this is true swap
Q4. mult $s1, $s2 mflo $to add $s3, $s0, $t0 #d = a+b* addi $t0 , $0 , 3 #store 3 into the register DIV $s3, $t0 #d/3 MFLO $s4
Division lo -> Quotient Hi -> remainder
Multiplication Lo -> Lower 32 bits Hi -> Upper 32 bits (Sometimes when we multiply may overshot 32 bits so there's two registers to handle it)
Share: TwitterFacebookLinkedIn