private ResultInfo InvokeCommand() { switch (_command) { case 0b_0000_0000_0000_1000: return(_literalControlOperations.RETURN()); //Return from Subroutine case 0b_0000_0000_0000_1001: return(_literalControlOperations.RETFIE()); //return from interrupt case 0b_0000_0000_0110_0011: return(_literalControlOperations.SLEEP()); //Go to standby mode case 0b_0000_0000_0110_0100: return(_literalControlOperations.CLRWDT()); //clear watchdog timer case 0b_0000_0000_0000_0000: // ab hier nop case 0b_0000_0000_0010_0000: case 0b_0000_0000_0100_0000: case 0b_0000_0000_0110_0000: return(_byteOperations.NOP()); //no operation case short n when(n >= 0b_0000_0001_0000_0000 && n <= 0b_0000_0001_0111_1111): return(_byteOperations.CLRW()); //clear w default: return(AnalyzeNibble3()); } }
public void Sleep_PD() { _ram.SetupGet(p => p[MemoryConstants.STATUS_B1]).Returns(0); ResultInfo op_result = _opService.SLEEP(); Assert.AreEqual(1, op_result.Cycles); Assert.AreEqual(1, op_result.PCIncrement); Assert.AreEqual(16, op_result.OperationResults[0].Value); Assert.AreEqual(MemoryConstants.STATUS_B1, op_result.OperationResults[0].Address); _ram.Verify(p => p[MemoryConstants.STATUS_B1]); }