Skip to content

Instantly share code, notes, and snippets.

@RdlP
Created July 10, 2016 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RdlP/321cd30fb9807a0a6b663f6d67425334 to your computer and use it in GitHub Desktop.
Save RdlP/321cd30fb9807a0a6b663f6d67425334 to your computer and use it in GitHub Desktop.
void CPU::step()
{
BYTE instruction = fetch();
registers.pc++;
decode(instruction);
}
BYTE CPU::fetch()
{
BYTE instruction = memory->readByte(registers.pc);
return instruction;
}
void CPU::decode(BYTE instruction)
{
(this->*bOps[instruction])();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment