ARM assembly puzzle
Posted
by ivant
on Stack Overflow
See other posts from Stack Overflow
or by ivant
Published on 2010-06-02T18:46:40Z
Indexed on
2010/06/02
19:04 UTC
Read the original article
Hit count: 288
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.
© Stack Overflow or respective owner