I am facing a rather peculiar problem. I am working on a compiler for an architecture that doesn\'t support bitwise operations. However, it handles signed 16-bit integer arithme
In this environment it might be best if you could set up to actually use arithmatic operators to peel out components of integers.
E.G.
if (a & 16) becomes if ((a % 32) > 15)
a &= 16 becomes if ((a % 32) < 15) a += 16
The transforms for these operators are obvious enough if you restrict RHS to a constant power of 2.
Peeling off two or four bits is also easy to do.