简体   繁体   English

在 SRC 汇编中,“la”和“ld”命令有什么区别?

[英]in SRC assembly, what's the difference between “la” and “ld” commands?

i know "la" stands for "load address", but is there's a difference at the loaded value to the register?我知道“la”代表“加载地址”,但是加载到寄存器的值有区别吗?

for example:例如:

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

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

where X is in address 20.其中X在地址 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.我不熟悉这个汇编程序,但一般来说,如果你有一个声明为 X 的变量,那么“la r1,X”将加载 X 的地址,“ld r1,X”将加载 X 的内容。在这个在这种情况下,这意味着 ld r1,20 将读取位置 20 处的 memory 并将内容放入 r1,其中 la r1,x 只会将 20 放入 r1,而无需额外读取 memory。

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 la r2,X 表示....将 dispalcemebt X 加载到 r2 ......它在 SRC 架构中的操作码是 5 而 ld r1,20 表示 memory 的内容,即 20 存储在 r1 中......它在 SRC 架构中的操作码是1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM