Skip to main content
deleted 4 characters in body
Source Link
Omar and Lorraine
  • 39.7k
  • 14
  • 138
  • 284

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.

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.

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 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.

fixed spelling & grammar
Source Link
Omar and Lorraine
  • 39.7k
  • 14
  • 138
  • 284

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 byproductby-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.

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 byproduct 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 job at.

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.

edited title
Link
Omar and Lorraine
  • 39.7k
  • 14
  • 138
  • 284

Why does the Z80 include the RLD instructionand RRD instructions?

Source Link
Omar and Lorraine
  • 39.7k
  • 14
  • 138
  • 284
Loading