找到伪指令的解释
Move (move)
The move pseudo instruction moves the contents of one register into another register.
move $1, $2
translates to
add $1, $2, $0
下面是代码。
25f0a003 move fp, sp
但是add操作码是这样的。
31-26 special 0x000000
25-21 rs it should be 0x1d
20-16 rt it should be 0x0
15-11 rd it should be 0x1e
10-6 0 it should be 0x0
5-0 add it should be 0x32
但是操作码是不同的。
发布于 2020-08-07 05:49:50
我不确定你在问题中引用的解释是从哪里得到的,但如何实现伪指令是由汇编程序决定的。
单词25f0a003作为MIPS指令没有意义,但如果我们将字节交换为03a0f025,则我们得到:
0000 0011 1010 0000 1111 0000 0010 0101
=>
000000 11101 00000 11110 00000 100101
=>
or $30, $29, $0
=>
or $fp, $sp, $zero
因此,在本例中,您使用的汇编程序将move $fp, $sp
转换为or $fp, $sp, $zero
。
https://stackoverflow.com/questions/63291399
复制相似问题