作者skyhigh8988 (Aesthetic)
看板ASM
标题[问题] 一个MIPS指令的问题
时间Tue Apr 5 13:50:58 2011
有个阵列的起始位址是 十进位的 4000000
换成二进位是 0000 0000 0011 1101 0000 1001 0000 0000
指令说要把这个载入
用了下列两个指令
lui t1 0000 0000 0011 1101
ori t1 t1 0000 1001 0000 0000
我看不懂第二个为什麽是用ori欸
上来问一下 看有没有高手解答一下
谢谢罗 感恩
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.141.170.12
1F:推 attomahawk:lui 载入 Address的上半部, 从31bit 到 16 bit。 04/05 14:20
2F:→ attomahawk:ori 载入 Address的下半部, 从15 bit 到 0 bit。 04/05 14:20
3F:推 attomahawk:如此一来,暂存器t1 才拥有完整的 32-bit address. 04/05 14:23
4F:→ attomahawk:可以参考白算盘(Computer Org. and Design )的课本。 04/05 14:23
5F:→ attomahawk:我的是英文版 3ed, 在p.96 有类似的课本例子。 04/05 14:25
6F:推 christianSK:作ori这个动作等同於 load lower immediate 04/11 16:34
7F:推 slayptter: lui 就是load upper immediate 04/18 22:32
8F:→ slayptter: ori 就是or immediate 04/18 22:32
9F:→ slayptter: 先做lui後,32bit数的前16bit都会是0,此时再or 一个只 04/18 22:38
10F:→ slayptter: 有前16bit有值的数字(任意数字or 0还是任意数字),就 04/18 22:38
11F:→ slayptter: 可完成32bit的数字组合 04/18 22:38
12F:→ slayptter: 虽然已经经过11年了 ^U^ 04/18 22:38