Search code examples
assemblycpuhardwaregameboy

Gameboy rotate instructions


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?


Solution

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