【发布时间】:2013-03-21 11:13:19
【问题描述】:
各位 SO 用户,
如果我有一个值,比如 1010 保存在内存中,我如何一次加载从 MSB 到 LSB 的每个位?我的意思是,
while loop
load $t1 with 1
shift some number by the amount indicated by the value in $t1 (1)
load $t1 with 0
shift some number by the amount indicated by the value in $t1 (0)
do the same until you load the LSB which is 0
start again at MSB (rotate right?)
end loop
我需要一些关于如何在内存中声明这个值的技巧,首先在.data 段中。我是否将其声明为:
value: .byte 00001010
我如何将各个位加载到寄存器中?
亲切的问候
【问题讨论】:
-
编写二进制立即数的方式取决于汇编程序。汇编器可能支持例如
b后缀 (00001010b),也可能不是。您总是可以用十六进制 (0Ah/0x0A) 或十进制 (10) 写入相同的数字。
标签: mips declaration bits