3

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?

alex mafas
  • 41
  • 3
  • The Intel 8080 (the Game Boy CPU is derived from it) did it first, but that just pushes the same question onto the 8080 – harold Jul 12 '20 at 14:23

1 Answers1

11

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

Thomas Jager
  • 4,836
  • 2
  • 16
  • 30
  • It's made even more confusing since 8086's `ROR` is without carry, and 6800's `ROR` is with carry. – bryc Jun 27 '21 at 01:32