1989 Honda Accord problem

So my 1989 honda accord will sometimes act out when im driving, one instance i was driving on the freeway and my car stopped accelerating it would go in gear and the rpm and gas arrows went crazy and if i pressed the gas the rpm would go up but it wont move. and other times when my rpm goes low like when im at a stop the car will die.

I may not be much help here because there are things that are unknown to me. The cause of the RPM going low and dying at a stop could vary greatly because it’s unknown if the car is carbureted or fuel injected.
Carbureted model sounds like a fault in the carburetor idle circuits (meaning an overhaul or possible cleaning) or an intermittent electrical fault in the anti-diesel solenoid circuit.
A fuel injected model issue like this is often caused by a fault in the Idle Air Valve. (cleaning or replaement)
There are other things that could cause this but those are the obvious.

The not accelerating, RPMs going up, the car not moving, etc. could point to a transmission fault. (assuming it’s an automatic transmission of course)
The Tachometer needle going crazy can often point to a problem with a worn distributor shaft. (easily checked by removal of the dist. cap to see if there is any excessive sideplay in the shaft)
This is assuming the Tach needle is bouncing around wildly. If it’s simply jumping straight up to the higher RPM levels without any bouncing this falls back onto a transmission jumping out of gear, etc.

Hope some of that helps anyway.

its feul injected. and its a manuel. and ur helping alot! cause i have no idea whats going on. ive already replaced the front right axle,clutch,transmition,and rack and pinion,feul pump and other small tubes. the needle only went crazy when it has the not accelerating problem and ive noticed that happens when my rpm is up so ive just been driving in the slow lane to help.