Thread: [Tutorial] GBA ASM Programming
View Single Post
Old January 6th, 2011 (6:43 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
  • Crystal Tier
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,584
I'm pretty sure it takes two. Let's say you have some value in r0. In order to clear the top 29 bits, you would have to load 7 into an arbitrary register and then AND the two. I can't think of any way to do it with only one register other than to use logical shifts. Plus, I think that the "mov" instruction takes up more cycles than logical shifts so it'll save you a nanosecond or two. :D

Brother of Vrai
Reply With Quote