The strong electronic absorption systems of the BΣu+1-XΣg+1 Lyman and the CΠu1-XΣg+1 Werner bands can be used to probe possible mass-variation effects on a cosmological time scale from spectra observed at high redshift, not only in H2 but also in the second most abundant hydrogen isotopomer HD. High resolution laboratory determination of the most prominent HD lines at extreme ultraviolet wavelengths is performed at an accuracy of Δλ/λ∼5×10-8, forming a database for comparison with astrophysical data. Sensitivity coefficients Ki=dln λi/dln μ are determined for HD from quantum ab initio calculations as a function of the proton-electron mass ratio μ. Strategies to deduce possible effects beyond first-order baryon/lepton mass ratio deviations are discussed. © 2008 The American Physical Society.