Core-electron binding energies for compounds of boron, carbon, and chromium