Class Op_M

  • All Implemented Interfaces:
    net.sourceforge.uiq3.calculator.IClear, net.sourceforge.uiq3.calculator.IOperation, net.sourceforge.uiq3.calculator.IOwned_Operation, net.sourceforge.uiq3.calculator.IProgrammable_Operation
    Direct Known Subclasses:
    A_Register, Op_M_Minus, Op_M_Plus, Op_Min, Op_MR, Op_X_M

    abstract class Op_M
    extends Owned_Operation
    implements net.sourceforge.uiq3.calculator.IProgrammable_Operation
    Halt Calculator
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Field Detail

      • Logger

        private static final Logger Logger

        Class logger instance.

      • TAG

        private static final String TAG

        Class logger tag.

      • Is_M_Register

        boolean Is_M_Register
        True when operating on an M-Register
      • Register

        protected int Register
        Register number worked on
    • Constructor Detail

      • Op_M

        Op_M​(@NotNull
             @NotNull Calculator Owner)
        Create operation and attach to owning calculator.
        Parameters:
        Owner - Calculator which will call this Opcode
    • Method Detail

      • Check_M

        void Check_M​(int Memory,
                     boolean Is_M)
              throws M_Error
        Check im M Register is valid
        Parameters:
        Memory - Memory register to test
        Is_M - true when M register is handled
        Throws:
        M_Error - exeption of memory is not valid
      • Clear

        public void Clear​(boolean AC)
        Reset state - for state full operations.
        Specified by:
        Clear in interface net.sourceforge.uiq3.calculator.IClear
        Parameters:
        AC - All Clear reset
        See Also:
        IClear.Clear(boolean)
      • Execute

        public void Execute​(short Opcode)
                     throws net.sourceforge.uiq3.calculator.Error
        Specified by:
        Execute in interface net.sourceforge.uiq3.calculator.IOperation
        Throws:
        Error - something went wrong
        M_Error - Memory accessed does not exist
        net.sourceforge.uiq3.calculator.Error
        See Also:
        IOperation.Execute(short)
      • Get_M

        int Get_M​(int Opcode)
        Parameters:
        Opcode - Opcode for which the memory register should be determined
        Returns:
        number of the register
      • Is_M

        @Contract(pure=true)
        boolean Is_M​(int Opcode)
        Parameters:
        Opcode - Opcode for which the F or M register use need to be determined
        Returns:
        true if normal memory is used.