fixed SBC not giving proper result and not setting flags correctly