After calling dot, you're invoking print_int and print_char. By taking a look at their body, you can see that they're changing the value of the a0 register.
So, before calling print_int, you have to save a0 first, and then move it back when printing is done.