If something is stored at 0x1001 0000 the next thing is stored at 0x1001 0004. And if I'm correct the memory pieces in a 32-bit architecture are 32 bits each. So would 0x1001 0002 point to the second half of the 32 bits?
相关问题
- What uses more memory in c++? An 2 ints or 2 funct
- Memory for python.exe on Windows 7 python 32 - Num
- Translate the following machine language code (0x2
- How to make memory allocation in MSVC C++ determin
- java.lang.OutOfMemoryError: GC overhead limit exce
相关文章
- Why are memory addresses incremented by 4 in MIPS?
- Is my heap fragmented
- Is there a way to avoid this memory error?
- Why doesn't there exists a subi opcode for MIP
- How do I store a Python object in memory for use b
- Why am I not getting a stack overflow?
- How much memory does a Java object use when all it
- InputMethodManager holds reference to the tabhost
First of all, memory addresses in MIPS architecture are not incremented by 4. MIPS uses byte addressing, so you can address any byte from memory (see e.g.
lb
andlbu
to read a single byte,lh
andlhu
to read a half-word).The fact is that if you read words which are 32 bits length (4 bytes,
lw
), then two consecutive words will be 4 bytes away from each other. In this case, you would add 4 to the address of the first word to get the address of the next word.Beside this, if you read words you have to align them in multiples of 4, otherwise you will get an alignment exception.
In your example, if the first word is stored in 0x10010000 then the next word will be in 0x10010004 and of course the first half/second half would be in 0x1001000 and 0x1001002 (the ordering will depend on the endianness of the architecture).
You seem to have answered this one yourself! 32 bits make 4 bytes, so if you're e.g. pushing to a stack, where all elements are pushed as the same size, each next item will be 4 bytes ahead (or before) the next.