1

I'm trying to understand how the lui operation works. I know lui stands for 'load upper immediate'. I read about it but I'm not sure how I would be able to use it to solve a problem.

Can someone please walk me through some simple code that would demonstrate what lui does?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
AnchovyLegend
  • 12,139
  • 38
  • 147
  • 231
  • 2
    lui r0,0x1234 means r0 = (0x1234)<<16 – old_timer Sep 27 '12 at 13:31
  • It doesnt get any more clear than that other than to say assume the notation on the right is C meaning the lower 16 bits are zero. The upper 16 bits are the value in the instruction. It loads an immediate in the upper 16 bits of the register and zeros the lower, it is the simplest instruction of all the mips instructions. – old_timer Sep 27 '12 at 13:43
  • http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html – old_timer Sep 27 '12 at 13:44
  • http://vhouten.home.xs4all.nl/mipsel/r3000-isa.html – old_timer Sep 27 '12 at 13:45
  • http://refcards.com/docs/waetzigj/mips/mipsref.pdf – old_timer Sep 27 '12 at 13:47

0 Answers0