Well, almost by definition the set of matrices with entries from form the endomorphism ring of (with , ). So the question is "how do we pin these together?" Basically, you pin them together by assuming you have your fgab in a "collected" form, with different copies of isomorphic groups beside each other,

where appears nowhere else in the decomposition of your group.

Then, your ring of endomorphisms is the ring of matrices, where the top elements on the diagonal, and the square around them, have entries from , the to the elements on the diagonal, and the square around them have entries from , etc. Everywhere else is zero.

Clearly all such matrices form a ring, and clearly they are endomorphisms of the abelian group. It is then sufficient to prove that every endomorphism appears in this way, but that is routine...and would take too long to type (I'm lazy).