Magnetic properties in terms of localized quantities. VI. Small hydrides, fluorides, and homonuclear molecules of phosphorus and silicon