Пример #1
0
        //Register a comparison opcode (CMP or CMN) which does not allow the S bit and does
        //not modify a destination register.
        internal void RegisterDataOpAWC_CMP(DataOpAWCOperation opHandler, uint base_opcode, string basename)
        {
            DataOpBuilderAWC b = new DataOpBuilderAWCCMP();

            b.opcode    = base_opcode;
            b.name      = basename;
            b.opHandler = opHandler;
            b.owner     = this;
            b.StartBuild();
        }
Пример #2
0
        /************* FUNCTIONS TO CREATE AND REGISTER DATA OPS *************/



        //Register an arithmetic opcode which allows the S bit.
        internal void RegisterDataOpAWC(DataOpAWCOperation opHandler, uint base_opcode, string basename)
        {
#if DEBUG
            if ((base_opcode & s_mask) != 0)
            {
                throw new Exception("base_opcode and s_mask not disjoint registering " + basename);
            }
#endif
            DataOpBuilderAWC b = new DataOpBuilderAWC();
            b.opcode    = base_opcode;
            b.name      = basename;
            b.opHandler = opHandler;
            b.owner     = this;
            b.StartBuild();
        }
Пример #3
0
        internal InstructionFunc GenerateAWCDataOp(DataOpEvaluateOperand2Func EvaluateOperand2, DataOpAWCOperation AWCOp, DataOpSaveResultFunc SaveResult, DataOpHandleSetFlagsAWCFunc SetFlags)
        {
            return(delegate(uint opcode)
            {
                uint Rd = ((opcode & rd_mask) >> 12);
                uint Rn = ((opcode & rn_mask) >> 16);
                uint a = get_reg(Rn);

                bool shift_carry = false;
                uint b = EvaluateOperand2(opcode, ref shift_carry);

                AWCResult awcResult = AWCOp(a, b);
                SaveResult(Rd, awcResult.result);
                SetFlags(opcode, Rd, awcResult);
                return 1;
            });
        }