예제 #1
0
        //Register a logical opcode which does not support the S bit or update a destination
        //register (such as TST or TEQ)
        internal void RegisterDataOpLogical_CMP(DataOpLogicalBinary opHandler, uint base_opcode, string basename)
        {
            DataOpBuilderLogical b = new DataOpBuilderLogicalCMP();

            b.opcode           = base_opcode;
            b.name             = basename;
            b.IsUnaryOperation = false;
            b.BinaryOp         = opHandler;
            b.owner            = this;
            b.StartBuild();
        }
예제 #2
0
        //Register an arithmetic opcode which allows the S bit.
        internal void RegisterDataOpLogical(DataOpLogicalBinary 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
            DataOpBuilderLogical b = new DataOpBuilderLogical();
            b.opcode           = base_opcode;
            b.name             = basename;
            b.IsUnaryOperation = false;
            b.BinaryOp         = opHandler;
            b.owner            = this;
            b.StartBuild();
        }
예제 #3
0
        internal InstructionFunc GenerateLogicalDataOpBinary(DataOpEvaluateOperand2Func EvaluateOperand2, DataOpLogicalBinary BinaryOp, DataOpSaveResultFunc SaveResult, DataOpHandleSetFlagsFunc 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);

                uint result = BinaryOp(a, b);
                SaveResult(Rd, result);
                SetFlags(opcode, Rd, result, shift_carry);
                return 1;
            });
        }