/* I came up with the following C routine to add 1 to an integer, in case your instruction set lacks that particular capability. I think it might have some hack value. By Brian */ int inc (int x) { int m = 1; while (m) { x ^= m; m = (m & ~x) << 1; } return x; } /* You can likewise subtract 1 from an integer through some simple 2s compliment manipulation, as follows: int dec(int x) { return inc(~inc(inc(~x))); }