  We study the box dimensions of sets invariant under the toral endomorphism
$(x, y) \mapsto (m x \text{ mod } 1, \, n y \text{ mod } 1)$ for integers $n>m
\geq 2$. The basic examples of such sets are Bedford-McMullen carpets and, more
generally, invariant sets are modelled by subshifts on the associated symbolic
space. When this subshift is topologically mixing and sofic the situation is
well-understood by results of Kenyon and Peres. Moreover, other work of Kenyon
and Peres shows that the Hausdorff dimension is generally given by a
variational principle. Therefore, our work is focused on the box dimensions in
the case where the underlying shift is not topologically mixing and sofic. We
establish straightforward upper and lower bounds for the box dimensions in
terms of entropy which hold for all subshifts and show that the upper bound is
the correct value for coded subshifts whose entropy can be realised by words
which can be freely concatenated, which includes many well-known families such
as $\beta$-shifts, (generalised) $S$-gap shifts, and transitive sofic shifts.
We also provide examples of transitive coded subshifts where the general upper
bound fails and the box dimension is actually given by the general lower bound.
In the non-transitive sofic setting, we provide a formula for the box
dimensions which is often intermediate between the general lower and upper
bounds.
