The Z80 has an instruction RLD
, which apparently treats the lower 4 bits in the accumulator and the full 8 bits in (HL)
as a twelve bit integer which it then rotates left by 4 bits. The carry flag does not participate in the rotation and the rest of the accumulator is left alone.
Correspondingly, there's an RRD
.
Why would the designers put something like that in? I don't imagine it's was a simple by-product of some other part of the design, but I can't think of a use-case which the other shift/rotate instructions wouldn't do a reasonably good job at.