Muon pair production in p-A, S-U and Pb-Pb collisions has been studied by t
he NA38 and NA50 collaborations at the CERN SPS. In this paper we present a
n analysis of the dimuon invariant mass region between the phi and the J/ps
i. In p-A collisions we find that, after the subtraction of the combinatori
al background due to pi and K decays, the superposition of dimuons from sem
i-leptonic decays of D mesons and from the Drell-Yan process reproduces wel
l the measured mass and transverse momentum spectra. The yield of open char
m dimuons required to fit our data leads to a charm production cross sectio
n in good agreement with previous measurements. A linear extrapolation of t
he p-A sources with the product of the mass numbers of the projectile and t
arget nuclei, A x B, underestimates the dimuon yield measured in S-U and Pb
-Pb collisions. The excess increases with the number of participant nucleon
s, and the ratio between the observed dimuon yield and the expected sources
reaches a factor 2 for central Pb-Pb interactions. The kinematical distrib
utions of the measured dimuon excess are compatible with those expected fro
m the open charm contribution.