Partially implement the undefined instruction
Update the mode and set variables after each tick

Fix a bug with special 0 shift amount