Seems like I was wrong that ANDI2R doesn't require a temporary register here. There is *one* case when the mask won't fit in the ARM AND instruction: mask = 0xFFFFFFFF But let's just use MOV instead of AND here for this case...