MFC r267372-267374: fix various misimplementation of instructions.
MFC r267372-267374: fix various misimplementation of instructions.

Submitted by:	Wolf Ramovsky <wolf.ramovsky gmail.com>

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase