The gamma ray spectrometer for the Solar Maximum Mission