There is no speedometer cable. However, both your speedometer and shifting concern are probably caused by a problem with the Vehicle Speed Sensor (VSS), mounted on the transmission. Check the wiring, and the sensor.
RepairPal Certified shops can diagnose and repair your 1995 Mazda B4000. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.