开发者

in SRC assembly, what's the difference between "la" and "ld" commands?

i kn开发者_开发百科ow "la" stands for "load address", but is there's a difference at the loaded value to the register?

for example:

"la r1,X"
"ld r1,20"

in:
    0 ld r1,30
...
X: 20 add r6,7

where X is in address 20.


I'm not familiar with this assembler, but in general if you have a variable declared as X, then "la r1,X" will load the address of X and "ld r1,X" will load the contents of X. In this case, that means that ld r1,20 will read the memory at location 20 and put the contents into r1, where la r1,x will just put 20 into r1 without an additional memory read.


la r2,X means ....load dispalcemebt X to r2.....its opcode in SRC architecture is 5 while ld r1,20 means content of memory ie 20 is stored in r1...its opcode in SRC architecture is 1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜