how would i set a register's lower bits to the lower bits of some register?
#1
how would i set a register's lower bits to the lower bits of some register?
example:
r12 is 3b00 0000
r11 is 0000 0005
and i want r10 to be 3b00 0005
Reply
#2
For that specific example you can do----

Code:
or r10, r11, r12

This does a logical OR with the values in r11 and r12, Result is written to r10. Anything in r10 beforehand is completed wiped out.

You also have the ability to use the Record feature (.) for a free use of cmpwi rX, 0 (rX being w/e register you are wanting to use)

Example:
Code:
or. r10, r11, r12 #Notice the dot in the instruction operand
bne+ some_label #Example branch
Reply
#3
If you want to specifically get the upper and lower halves in cases where the registers have bits set in the halves you don't want, you can do it with a rlwinm with one register then a rlwimi with the other I think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)