Check engine light and speedometer on a 96 Civic

Driving on highway, check engine light goes on, speedometer drops from 60 to 0 but nothing else happens. Come to a stoplight and engine light stays on and speedometer works again. Any diagnostics?

Your speedometer cable broke, and you need a new one.