开发者

How to add 1234 1234 base 16 to MIPS Registers?

开发者 https://www.devze.com 2023-02-22 05:34 出处:网络
I know how to add 1234 to a register in MIPS. For this I basically use ADDI r1, r0, 1234. However, I cannot figure ou开发者_StackOverflowt how to add 1234 1234 to a register. I think it overflows.

I know how to add 1234 to a register in MIPS. For this I basically use ADDI r1, r0, 1234. However, I cannot figure ou开发者_StackOverflowt how to add 1234 1234 to a register. I think it overflows.

Thanks for advance.


There's no single instruction. Rather, load the immediate value using the common idiom into another register. Thus, your code looks something like:

LUI r2, 1234
ORI r2, r2, 1234
ADD r1, r0, r2
0

精彩评论

暂无评论...
验证码 换一张
取 消