Thread: Mips/spim
View Single Post
Old Mar 26th, 2006, 1:23 PM   #9
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
was going through some mips code, just wanted to correct what i said earlier about branching. you take the immediate field and the new Program counter or address to branch to would be PC = (PC + 4) + (immediate* 4)
PC +4 because well this is how mips works....
immediate *4 because mips is byte adressable
this way in branching we can cover all 32-bits of the memory only by a 16 bit immediate field.. (PC+4) +/- 2^15
hbe02 is offline   Reply With Quote