Ab initio study of the CO adsorption on NiAl(110) and Pt(100)