• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Easy way to clear registers in mips assembly?

TGCid

Platinum Member
This is my first time experience with mips assembly. I am using spim. We are doing the program where after some manipulation, the program loops back to the beginning unless a quit command is given. My problem is that I don't know what registers I messed with but after the 1st loop, some weird behaviors would occur. I think it is the fault of the registers not being reset. How would you reset all the registers back to the way it was when you first run the code? Thanks.
 
Ummm, copy all the values in the registers into the stack before modifying them. Technically, the only ones you need to copy are the caller-saved ones, but practically there is no difference. When you need to recall the values just read them from the stack.
 
Originally posted by: Marty
Ummm, copy all the values in the registers into the stack before modifying them. Technically, the only ones you need to copy are the caller-saved ones, but practically there is no difference. When you need to recall the values just read them from the stack.

What he said. I don't have any experience with MIPS; at our school, CPE's use MIPS, and EE's program for the MC68000. But from what you've described, it seems comparable (the only difference I can remember is, I believe, MIPS has more address registers than the 68.
 
Back
Top