我试图解决一个问题,但起初我正在测试rol
指令,我完全确定我正在做一些非常愚蠢的事情,这使得我的测试不正确。
这是一个片段:
li $t0, 101 ## our data
li $t1, 32 ## our loop because we will rotate 32 times later
loop:
## whatever the bit is, just print it or put it inside the asciiz
## and print it later, after we finish rotating,
## so we rotate starting with the first bit,
## and we put it as the first bit lsb
## first we rotate##
rol $t2, $t0, 1 ## rotate and store the new rotated inside $t7
and $t3, $t2, 1 ## now we AND to check our lsb if it one or not
li $v0, 1
move $a0, $t3 ## Print the result of AND
syscall
我基本上想要做的是将我的 MSB 旋转t0
到 LSB,然后与 1 进行与运算。但是,我得到的始终是 0。
我希望有人能告诉我我的错误以及如何解决它。