  This paper derives the anisotropic superexchange interactions from a Hubbard
model for excitations within the copper 3d band and the oxygen 2p band of the
undoped insulating cuprates. We extend the recent calculation of Yildirim et
al. [Phys. Rev. B {\bf VV}, pp, 1995] in order to include the most general
on--site Coulomb interactions (including those which involve more than two
orbitals) when two holes occupy the same site. Our general results apply when
the oxygen ions surrounding the copper ions form an octahedron which has
tetragonal symmetry (but may be rotated as in lanthanum cuprate). For the
tetragonal cuprates we obtain an easy--plane anisotropy in good agreement with
experimental values. We predict the magnitude of the small in--plane aniso
