If the slab is 40 years old there's pretty much about a 99.9% chance that there is no intact vapor retarder underneath of it. This means that it will continue to emit moisture forever. Even if there were one, back then they didn't use heavy enough retarders and they are subject to "plastic rot" from the alkalinity naturally present in the concrete. There were also no national standards for the construction of concrete slabs on grade with regard to where the vapor retarder was placed back then. There are millions of slabs in different parts of the country where the vapor retarder was placed first followed by a layer of sand and aggregate and then the slab. This construction method was proven to be faulty and is no longer acceptable in new construction as it allowed for moisture from the ground to penetrate into the sand and stone layer from the sides and then transmit the moisture through the slab.
To fix it properly would require shotblasting, the use of an epoxy sealer, and then a self-leveling concrete topping over the top. This would "cap" the slab and provide a new subfloor surface to install over or to. It's expensive, requires a fair amount of expensive equipment and most flooring installers aren't equipped or trained to do such a project. In most markets you'd generally have to find someone who specializes in commercial installations or who installs and works with concrete overlays. In other words it's an expensive, messy, and laborious project to do it correctly BUT if done correctly it stops the need to deal with future moisture issues.
There are a lot of other ways to put a band-aid on and get something installed. The problem with them is that they are also relatively expensive and they have to be replaced every time you replace the flooring which just increases the cost of ownership down the road. They can also cause more issues down the road and limit your flooring options in the future as they can lead to bonding failures if someone would decide to install a floor that requires being bonded directly to the substrate. I often affectionately refer to the litany of sealers and primers that tout their ability to "reduce slab moisture" as snake oil. They are kind of like that little donut tire that comes with a new car. They will work long enough to get you down the road but at some point you have to buy a new tire.
A carpet with an open backing system can sometimes be installed over a moisture problem like this but there is no guarantee it won't fail. While the chemical makeup of today's adhesives has improved they are not 100% water proof. In this particular situation you might want to consider going to a floating installation of SPC (stone plastic composite) or WPC (water proof core) luxury vinyl plank or tile. You can simply put a 6 mil poly down over the slab and then install the flooring. To do your patching where the concrete has spalled out I'd suggest a moisture resistant cementitious floor patch like Ardex MRF (moisture resistant feather finish). Please note that this will NOT stop the moisture problem it will simply contain it from coming in contact with the flooring and causing a problem with the floor. With moisture present you can still grow mold or mildew underneath the poly. There are a lot of people doing this for the same reasons in basements and older homes all over the country. It's not a perfect solution like capping the slab but it's what they can afford.