Class Op_Interface

  • 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:
    Op_LOAD, Op_SAVE

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

      Fields 
      Modifier and Type Field Description
      private static short @NotNull [] AF_Text
      File type Text for All-Files
      private static int Alpha_Id
      Don't use a numeric file Id.
      protected net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Backup_Active
      Keep a backup of the active A register
      private int Backup_Display_Count
      Remember the display character count for the A_Text register.
      private net.sourceforge.uiq3.calculator.ICalculator.DisplayType Backup_Display_Mode
      Keep a backup of the display mode register
      private net.sourceforge.uiq3.math.Number Backup_L
      Keep a backup of the L Register
      private short @Nullable [] Backup_Numeric
      Keep a backup of the A Register
      private short @Nullable [] Backup_Print
      Keep a backup of the A Register
      private int Backup_Printer_Count
      Remember the printer character count for the A_Text register.
      private short @Nullable [] Backup_Text
      Keep a backup of the A Register
      private static int Bits_4  
      private static short @NotNull [] DF_Text
      File type Text for Data-Files
      private static Logger Logger
      Class logger instance.
      private static int Null_Id
      Don't use a numeric file Id.
      private int Num_Id
      Numeric file name
      private static short[] PF_Text
      Filetype Text for Program-Files
      private static String TAG
      Class logger tag.
    • Constructor Summary

      Constructors 
      Constructor Description
      Op_Interface​(@NotNull Calculator Owner)
      Create operation and attach to owning calculator.
    • Field Detail

      • AF_Text

        private static final short @NotNull [] AF_Text
        File type Text for All-Files
      • Alpha_Id

        private static final int Alpha_Id
        Don't use a numeric file Id.
        See Also:
        Constant Field Values
      • DF_Text

        private static final short @NotNull [] DF_Text
        File type Text for Data-Files
      • Logger

        private static final Logger Logger

        Class logger instance.

      • PF_Text

        private static final short[] PF_Text
        Filetype Text for Program-Files
      • TAG

        private static final String TAG

        Class logger tag.

      • Backup_Display_Count

        private int Backup_Display_Count
        Remember the display character count for the A_Text register.
      • Backup_Display_Mode

        private net.sourceforge.uiq3.calculator.ICalculator.DisplayType Backup_Display_Mode
        Keep a backup of the display mode register
      • Backup_L

        @Nullable
        private net.sourceforge.uiq3.math.Number Backup_L
        Keep a backup of the L Register
      • Backup_Numeric

        private short @Nullable [] Backup_Numeric
        Keep a backup of the A Register
      • Backup_Print

        private short @Nullable [] Backup_Print
        Keep a backup of the A Register
      • Backup_Printer_Count

        private int Backup_Printer_Count

        Remember the printer character count for the A_Text register.

      • Backup_Text

        private short @Nullable [] Backup_Text
        Keep a backup of the A Register
      • Num_Id

        private int Num_Id
        Numeric file name
      • Backup_Active

        protected net.sourceforge.uiq3.calculator.ICalculator.AlphaRegisterType Backup_Active
        Keep a backup of the active A register
    • Constructor Detail

      • Op_Interface

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

      • Backup_Display

        private void Backup_Display()

        Backup the display (A and L Register). This is necessary as I/O operations might be followed by file name or file number which will is composed in the A_Text and L_X register respectively. To change this a massive change Op_Alpha or Op_Num would be needed. A backup is a lot simpler.

      • Casio_File_Name

        @Contract(pure=true)
        int @NotNull [] Casio_File_Name()
        return filename to be used inside the file header.
        Returns:
        alpha register as internal file name as array of integer range 0 .. 255
      • 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)
      • Clear_Backup

        public final void Clear_Backup()

        clear the backup data so it won't be accidentally used

      • Display_File_Name

        void Display_File_Name​(@NotNull
                               net.sourceforge.uiq3.tape.Interface.File_Type Type)
        Display filename.
        Parameters:
        Type - File Type to print oder display
      • Execute

        public void Execute​(short Opcode)
                     throws net.sourceforge.uiq3.calculator.Error
        Specified by:
        Execute in interface net.sourceforge.uiq3.calculator.IOperation
        Throws:
        Error - numeric error
        net.sourceforge.uiq3.calculator.Error
        See Also:
        IOperation.Execute(short)
      • Java_File_Name

        protected String Java_File_Name()
        Returns:
        alpha register as file name
      • Restore_Display

        protected final void Restore_Display()
                                      throws Error
        Restore the Display (A and L Register)
        Throws:
        Error - when something failed