matrixofdynamism
Advanced Member level 2
- Joined
- Apr 17, 2011
- Messages
- 593
- Helped
- 24
- Reputation
- 48
- Reaction score
- 23
- Trophy points
- 1,298
- Activity points
- 7,681
This is about the load word and store word instructions in MIPS. The MIPS load word instruction looks like this: lw $rt, offset($rs) and the sw instructions is simillar. In both cases we have a word at a 32 bit address location in main memory that we want to load/store. So we first store a base address into a resgister $rs and add an offset to it when sw or lw is called. The value in register $rs is 32 bits anyway right!? And the offset is a 16 bit signed number.
Why don't we just have use the single 32 bit value in $rs rather than bother about base and offset addresses and adding them. Does this not cause confusion?
Why don't we just have use the single 32 bit value in $rs rather than bother about base and offset addresses and adding them. Does this not cause confusion?