Internal/vm/{exec_funcs,opcodes}: missed one, add exec func for BCS opcode

This commit is contained in:
Bradford Lamson-Scribner 2020-05-31 21:34:48 -06:00
parent a9a3ae5c0a
commit e5709ad58b
2 changed files with 10 additions and 1 deletions

View File

@ -330,6 +330,15 @@ func execBPL(a *Appleone, o op) error {
return nil
}
// branch on C = 1 N Z C I D V
// - - - - - -
func execBCS(a *Appleone, o op) error {
if a.getCarry() != 0 {
a.branch(o)
}
return nil
}
// X - M N Z C I D V
// + + + - - -
func execCPX(a *Appleone, o op) error {

View File

@ -336,7 +336,7 @@ var opcodes = map[uint8]op{
// addressing assembler opc bytes cyles
// --------------------------------------------
// relative BCS oper B0 2 2**
0xB0: newOp("BCS", 0xB0, 2, relative, todo),
0xB0: newOp("BCS", 0xB0, 2, relative, execBCS),
// CPX Compare Memory and Index X
// addressing assembler opc bytes cyles