  The sulphur compounds SO and SO$_2$ have not been widely studied in the
circumstellar envelopes of asymptotic giant branch (AGB) stars. By presenting
and modelling a large number of SO and SO$_2$ lines in the low mass-loss rate
M-type AGB star R Dor, and modelling the available lines of those molecules in
a further four M-type AGB stars, we aim to determine their circumstellar
abundances and distributions. We use a detailed radiative transfer analysis
based on the accelerated lambda iteration method to model circumstellar SO and
SO$_2$ line emission and molecular data files for both SO and SO$_2$ that are
more extensive than those previously available. Using 17 SO lines and 98 SO2
lines to constrain our models for R Dor, we find an SO abundance of
6.7x10$^{-6}$ and an SO$_2$ abundance of 5x10$^{-6}$ with both species having
high abundances close to the star. We also modelled $^{34}$SO and found an
abundance of 3.1x10$^{-7}$, giving an $^{32}$SO/$^{34}$SO ratio of 21.6. We
derive similar results for the circumstellar SO and SO$_2$ abundances and their
distributions for the low mass-loss rate object W Hya. For these stars, the
circumstellar SO and SO$_2$ abundances are much higher than predicted by
chemical models and these two species may account for all available sulphur.
For the higher mass-loss rate stars, we find shell-like SO distributions with
peak abundances that decrease and peak abundance radii that increase with
increasing mass-loss rate. The positions of the peak SO abundance agree very
well with the photodissociation radii of H$_2$O. We find evidence that SO is
most likely through the photodissociation of H$_2$O and the subsequent reaction
between S and OH. The S-bearing parent molecule appears not to be H$_2$S. The
SO$_2$ models suggest an origin close to the star for this species, also
disagreeing with current chemical models.
