Example #1
0
        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());
            }
        }
Example #2
0
        public void CLRW()
        {
            ResultInfo op_result = _opService.CLRW();

            Assert.AreEqual(1, op_result.Cycles);
            Assert.AreEqual(1, op_result.PCIncrement);
            Assert.IsTrue(op_result.CheckZ);
            Assert.AreEqual(0, op_result.OperationResults[0].Value);
            Assert.AreEqual(MemoryConstants.WRegPlaceholder, op_result.OperationResults[0].Address);
        }