  The spectrum of quarter BPS dyons in N=4 supersymmetric string theories can
change as the asymptotic moduli cross walls of marginal stability on which the
dyon can break apart into a pair of half BPS states. In this paper we classify
these marginal stability walls and examine this phenomenon in the context of
exact dyon spectrum found in a class of N=4 supersymmetric string theories. We
argue that the dyon partition functions in different domains separated by
marginal stability walls are the same, but the choice of integration contour
needed for extracting the degeneracies from the partition function differ in
these different regions. We also find that in the limit of large charges the
change in the degeneracy is exponentially suppressed compared to the leading
contribution. This is consistent with the fact that in the computation of black
hole entropy we do not encounter any change as the asymptotic moduli fields
move across the walls of marginal stability. Finally we carry out some tests of
S-duality invariance in the theory.
