Dynamic vs Static instruction count

The dynamic instruction count is the actual number of instructions executed by the CPU for a specific program execution, whereas the static instruction count is the number of instruction the program has. We usually use dynamic instruction count as if for example you have a loop in your program then some instructions get executed more … Read more

What is the use of a $zero register in MIPS?

The zero register always holds the constant 0. There’s not really anything special about it except for the fact that 0 happens to be a very useful constant. So useful that the MIPS designers dedicated a register to holding its value. (This way you don’t have to waste another register, or any memory, holding the … Read more

error: “store address not aligned on word boundary”

Are you sure that the error is happening on that line? I think the error is actually happening here: The problem is that you’re trying to store a word (because you’re using sw) to an address that’s not word-aligned. 0xFFFF0011 is not word-aligned. The reason why 0xFFFF0010 works is because it is word-aligned. A word … Read more

MIPS – Fetch address not aligned on word boundary

I’m pretty new to assembly programming and programming in general and I’m doing my best to learn. I’ve been having trouble storing inputs to variables, can you help me please? The problem seems to occur when I load the addresses of n1 and n2, or something like that. I have tried looking at similar problems … Read more

Loading and storing bytes in MIPS

This performs the addition $s3 = 0 + 0, effectively setting the register $s3 to a value of zero. This loads a byte from a location in memory into the register $t0. The memory address is given by 1($s3), which means the address $s3+1. This would be the 0+1=1st byte in memory. Since we have a big-endian architecture, we read bytes the 4-byte … Read more