Skip to content

Opening book details…

Can I read Ficheiro: /home/miguel/UA/AC2/P02/1/troca.s Página 1 de 1: LW $t0,0 ($a0) LW $t1,0 ($a1) SW $t0,0 ($a1) SW $t1,0 ($a0) JR $ra on EtoBox?

Ficheiro: /home/miguel/UA/AC2/P02/1/troca.s Página 1 de 1: LW $t0,0 ($a0) LW $t1,0 ($a1) SW $t0,0 ($a1) SW $t1,0 ($a0) JR $ra by Miguel Horta is a document available to read on EtoBox.

What is Ficheiro: /home/miguel/UA/AC2/P02/1/troca.s Página 1 de 1: LW $t0,0 ($a0) LW $t1,0 ($a1) SW $t0,0 ($a1) SW $t1,0 ($a0) JR $ra about?

This code defines a function called "troca" that swaps the values stored in two memory addresses passed as arguments. It loads the values from the first and second addresses into registers $t0 and $t1. It then stores the value in $t0 to the second address and the value in $t1 to the first address, swapping the values. It finally returns using the register $ra.

Author
Miguel Horta
Language
EN