change the sequence in putc when writing to D reg