asm: fixed ThumbExpandable's bug, and added test

That bug caused incorrect instructions generation
in certain circumstances.
E.g. ADD R1, R1, 0x00FF0000
would be compiled as
ADD R1, R1, 0x00FF00FF