I'm really struggling in my EE class this semester and my professor goes through MIPS instructions like we're fluent in it! I've tried the book, Google, YouTube, tutoring, and talking with students, but it either doesn't make sense or they're not confident enough to help.
I really have little to no confidence in how to begin the code. I got it set up, but idk what to do. I'll provide the question and I'll update what I have as I receive help.
Question:
"Using only MIPS integer instructions, write a function that will make x = abs(y) where x and y are floating-point numbers. Your function only needs to handle normal float values correctly, not NaN, etc."
Attempt in the works:
(haven't made progress yet :( )
####
#
# Float absolute value
#
# x = abs(y)
#
.text
.globl myabs
myabs:
li $t0,y #register t0 = y
# more code..
#
jr $ra # return
If anyone can provide some good reference material, tips, suggestions, advice, hints, or anything, I'd greatly appreciate it! Thanks.
So, ieee754.
Read about it.
Think about it.
Realize it's signed-magnitude.
On MIPS, it so happens that the sign-bit is in the same position in the word as the most significant bit in an integer.