ARM assembly puzzle
- by ivant
First of all, I'm not sure if solution even exists. I spent more than a couple of hours trying to come up with one, so beware.
The problem:
r1 contains an arbitrary integer, flags are not set according to its value. Set r0 to 1 if r1 is 0x80000000, to 0 otherwise, using only two instructions.
It's easy to do that in 3 instructions (there are many ways), however doing it in 2 seems very hard, and may very well be impossible.