2

I'm currently implementing gameboy emulator. When I was implementing rotate instructions, I've noticed that RL instruction is rotate through carry, while RLC instruction is rotate without carry. Wouldn't it be more logical to interchange the names. Why are they called this way, is there some hidden reason behind it?

1
  • The Intel 8080 (the Game Boy CPU is derived from it) did it first, but that just pushes the same question onto the 8080
    – user555045
    Commented Jul 12, 2020 at 14:23

1 Answer 1

10

With instruction mnemonics, it's often hard to give too much importance to the names. However, here there is some answer, by looking at the long names shown in some (but not all) places:

RL: Rotate Left

RLC: Rotate Left Circular

These names make sense if you think about the carry being a part of the circular cycle in the case of RLC. The 'C' in RLC isn't for "carry", it's for "circular".

1
  • It's made even more confusing since 8086's ROR is without carry, and 6800's ROR is with carry.
    – bryc
    Commented Jun 27, 2021 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.