FlyHigh wrote
For doing just logical operations would be easier, wouldn't it?
Shortcut logical operations will sometimes execute faster, but you need to analyze your code when you write your program so that the first term that is evaluated usually causes the short cut.
However, on modern processors with instruction caches, shortcuts that jump are often
slower than evaluating both terms because the branch makes the pipeline stall.
On the Hack Computer, shorted code is better than faster code because the ROM is small.
(And btw. you use bitwise operations not too often, do you?)
I'm an embedded systems programmer; I use bitwise operations all the time. For example, to turn on or off one bit of a parallel I/O port:
portA = portA | 0x04; // This turn on bit 2.
portB = portB & ~0x01; // This turns off bit 0.
OS programming also uses lots of bitwise operations; they are very useful in packing and unpacking numeric fields like IP addresses (192.168.200.1, for instance is 4 8-bit numbers crammed into one 32-bit number: 3232286721).
Software that implements mathematical code also uses lots of bit shifts and bitwise operations.
--Mark