please explain to me how and when it first started giving trouble
i think you have a bad crank sensor..these will do this when they start going bad..this is located near the harmonic balancer...also remove the ignition control module[this is under the coils,take it to auto zone or most other auto parts stores,they can test the icm for free
this 98 must have the crank sensor...no way around it..do check the icm..it can cause this also
that and the icm work as the distributer...
yes,,the ecu could cause this,,,but,try the crank sensor and have the icm checked