private ResultInfo AnalyzeNibble3() { int nibble3 = (int)_command & 0b_0011_0000_0000_0000; //bitoperation nur auf int ausführbar switch (nibble3) { case 0b_0010_0000_0000_0000: int bit12 = (int)_command & 0b_0000_1000_0000_0000; int address = (int)_command & 0b_0000_0111_1111_1111; if (bit12 == 0b_0000_1000_0000_0000) { return(_literalControlOperations.GOTO(address)); } else { return(_literalControlOperations.CALL(address)); } case 0b_0001_0000_0000_0000: //bit oriented operations return(AnalyzeBits11_12()); case 0b_0011_0000_0000_0000: //literal operations return(AnalyzeNibble2Literal()); case 0b_0000_0000_0000_0000: //byte oriented operations return(AnalyzeNibble2Byte()); default: return(null); } }
public void Call() { _ram.SetupGet(p => p[MemoryConstants.PCL_B1]).Returns(1); _ram.SetupGet(p => p[MemoryConstants.PCLATH_B1]).Returns(0); int address = 0x_0f; int return_address = 2; int newPc = address; ResultInfo op_result = _opService.CALL(address); Assert.AreEqual(return_address, _mem.Object.PCStack.Pop()); Assert.AreEqual(newPc, op_result.JumpAddress); Assert.AreEqual(2, op_result.Cycles); Assert.AreEqual(0x_0f, op_result.OperationResults[0].Value); Assert.AreEqual(MemoryConstants.PCL_B1, op_result.OperationResults[0].Address); _ram.Verify(p => p[MemoryConstants.PCL_B1]); _ram.Verify(p => p[MemoryConstants.PCLATH_B1]); }