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
精彩评论