The difference between the word load and displacement?

What's the difference between

ldw r8,0(r4)

and

mov r8, r4

Download word says "copy from memory", but when loading a word it copies from r4, is it copied from the register, and not from memory to the right?

+5
source share
1 answer

The instruction lw(I assume that what you meant with ldwis not a standard MIPS instruction, although all the loads will be the same in the context of this answer) loads the word from the memory address specified in 0 + r4, and move 1 just transfers the value r4to r8.

For example, let's say, r4at present 1234, and the word stored 1234in memory is 5678.

The difference is as follows:

move r8, r4            ; r8 is now 1234
lw   r8, 0(r4)         ; r8 is now 5678

1 move " -, move $rt, $rs addi $rt, $rs, 0.

+11

All Articles