MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / cpu_execute_rot_acc

Function cpu_execute_rot_acc

core/cpu.c:598–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598static void cpu_execute_rot_acc(int y)
599{
600 eZ80registers_t *r = &cpu.registers;
601 uint8_t old;
602 switch (y) {
603 case 0: /* RLCA */
604 old = (r->A & 0x80) > 0;
605 r->flags.C = old;
606 r->A <<= 1;
607 r->A |= old;
608 r->flags.N = r->flags.H = 0;
609 break;
610 case 1: /* RRCA */
611 old = (r->A & 1) > 0;
612 r->flags.C = old;
613 r->A >>= 1;
614 r->A |= old << 7;
615 r->flags.N = r->flags.H = 0;
616 break;
617 case 2: /* RLA */
618 old = r->flags.C;
619 r->flags.C = (r->A & 0x80) > 0;
620 r->A <<= 1;
621 r->A |= old;
622 r->flags.N = r->flags.H = 0;
623 break;
624 case 3: /* RRA */
625 old = r->flags.C;
626 r->flags.C = (r->A & 1) > 0;
627 r->A >>= 1;
628 r->A |= old << 7;
629 r->flags.N = r->flags.H = 0;
630 break;
631 case 4: /* DAA */
632 cpu_execute_daa();
633 break;
634 case 5: /* CPL */
635 r->A = ~r->A;
636 r->flags.N = r->flags.H = 1;
637 break;
638 case 6: /* SCF */
639 r->flags.C = 1;
640 r->flags.N = r->flags.H = 0;
641 break;
642 case 7: /* CCF */
643 r->flags.H = r->flags.C;
644 r->flags.C = !r->flags.C;
645 r->flags.N = 0;
646 break;
647 }
648}
649
650static void cpu_execute_bli() {
651 eZ80registers_t *r = &cpu.registers;

Callers 1

cpu_executeFunction · 0.85

Calls 1

cpu_execute_daaFunction · 0.85

Tested by

no test coverage detected