Is it possible to implement bitwise operators using integer arithmetic?
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 arithmetics and I was wondering if it would be possible to implement bitwise operations using only: Addition ( c = a + b ) Subtraction ( c = a - b ) Division ( c = a / b ) Multiplication ( c = a * b ) Modulus ( c = a % b ) Minimum ( c = min(a, b) ) Maximum ( c = max(a, b) ) Comparisons ( c = (a < b), c = (a == b), c = (a <= b), et.c. ) Jumps ( goto, for, et.c. ) The bitwise operations I want to be able to support are: Or ( c =