I have to do a lot of bit operations, like decoding a 32 bit variable into
values represented by groups of bits, (for example the value of
bits[12:15]), swapping the bytes, etc. These would be done very nicely using
the asm instructions.
Be sure to write longer snips or assembly than 1-10 lines, and write it
well, otherwise it might have negative effect on the performance. Visual C++
6 doesn't optimize "over" assembly blocks, so your "optimization" might make
your code run slower, not faster. Be sure you are doing the right thing
whipping assembly mnemonics out in the open.
For your example, check what compiler does first for:
int v = (a >> 11) & 0x0f;
.. or whatever it is that you wanted to do in your example! Can you do it
faster in assembly, and more importantly, can you fuse it together with rest
of the generated code as tirelessly and correctly as machine can? That kind
of boring details are what the machines are best at, human mind is wasted on
trivial details like that, concentrate on the big picture first, that's
where the God's Creation is at it's best. You have a powerful, abstractly
thinking mind: the computer doesn't, it is your slave, use it!
Also look into realtime code generators and JIT-like compiler technology.
Those are the near-future for high-performance low-level bitfucking software
engineering. Shaders in GPU's and shader compilers by nVidia and Microsoft
show the way the technologies like JIT from Sun have made popular in the
past decade or so.
Human operators writing assembly is backwards development. Just my opinion,
not the ultimate truth.