Molecular-dynamics method is used to study the influence of mass ratio of anions and cations on the phonon spectrum of the crystal with NaCl structure and on the conditions of existence and properties of gap discrete breathers (DBs). We show that DBs can be easily excited when the mass ratio of light to heavy components is less than 0.2 and the gap in the phonon spectrum is sufficiently wide. Nonexistence of DBs for larger mass ratios is explained through the excitation of the harmonic with the frequency equal to half of the main DB frequency that interacts with phonons below the gap. For the mass ratio equal to 0.1 we could find at least three types of stable DBs that differ by the number of atoms with the largest amplitude and by polarization of oscillations. A zone-boundary phonon mode with sufficiently large amplitude was found to be modulationally unstable. Dynamics of such mode lead to spontaneous localization of energy in the form of large-amplitude DBs according to the anti-Fermi-Pasta-Ulam mechanism.