Calculator

abstract class Calculator

Author

"Martin Krischik" «krischik@users.sourceforge.net»

Inheritors

Constructors

Link copied to clipboard
constructor()
just testing the Logger.

Types

Link copied to clipboard
Do a single step and return to Execution_Halt.
Link copied to clipboard
Mode was pressed
Inv
Keyboard in inverse move
Hyp
Keyboard in hyperbolic mode - also used for password entry
K
Constant calculation mode
Hlt
halted program - also used for debugger
Run
Mode1, interactive or program run mode
Wrt
Mode2, write programs
Pcl
Mode3, clear, save, load programs.
Deg
Mode4, Tr
Rad
Mode5
Gra
Mode6
Keyboard_Alpha
Alpha entry and display mode
Link copied to clipboard
Keyboard is in normal mode
Keyboard_Normal
Keyboard is in normal mode
Keyboard_Inv
Keyboard is in inverse mode
Keyboard_Hyp
Keyboard is in hyperbolic mode
Keyboard_Inv_Hyp
Keyboard is in inverse hyperbolic mode
Keyboard_Alpha
Keyboard is in alpha mode
Keyboard_Inv_Alpha
Keyboard is in inverse alpha mode
Link copied to clipboard
A Program which may be from P0 … P19
Link copied to clipboard
Alpha register to display messages.
Link copied to clipboard
Available Token Planes

Properties

Link copied to clipboard
private open var A: Array<A_Register>
The A Register contains the Keyboard_Alpha data of the display.
Link copied to clipboard
private val A_Active: Array<AlphaRegisterType>
Active A register for row.
Link copied to clipboard
private open var Calculator_Running: Boolean
Calculator is running - needed for power saving.
Link copied to clipboard
private open var Calculator_Shutdown: Boolean
Calculator is not running - needed for end program.
Link copied to clipboard
Current Current_Program
Link copied to clipboard
private open var Display_Enable: Boolean
Display enable - used to switch off the display so that intermediate result are not shown to the user.
Link copied to clipboard
Error Message displayed on using the wrong display mode!
Link copied to clipboard
private val Display_Mode: Array<DisplayType>
Current display mode
Display_Alpha
Displays the content of the Alpha register.
Display_L
Displays the content of the L0 aka X register.
Display_Formated
Displays the content of the L0 aka X register inside an alpha
Link copied to clipboard
Error Message displayed on using the wrong execution mode!
Link copied to clipboard
Current Execution mode.
Link copied to clipboard
open var FA6: Tape
A simulated cassette Interface
Link copied to clipboard
open var Form: ICalculatorCanvas
Canvas class where we display our result or get our keycodes
Link copied to clipboard
open var FP40: Printer
A simulated Printer Printer
Link copied to clipboard
private val Half_Second: Int = 500
Link copied to clipboard
private open var Hlt_Position: Int
Return Position for HLT Mode.
Link copied to clipboard
The last operation was one of the operations (+-) which disable the clear key.
Link copied to clipboard
private val Indicators: Array<Boolean>
Indicator_Type.
Link copied to clipboard
private open var Indirect: Boolean
Currently indirect addressing is active
Link copied to clipboard
The memory from 10000 ..
Link copied to clipboard
The memory from 10000 ..
Link copied to clipboard
private open var IO_Count: Int
Number of virtual CPU cycles until next IO run.
Link copied to clipboard
private open var Key_Buffer: Int
last key pressed
Link copied to clipboard
private open var Key_Flag: Boolean
a key was pressed
Link copied to clipboard
private open var Key_Operations: Array<Keyboard>
Operations as they come from the keyboard.
Link copied to clipboard
private open var Key_Time: Long
System time when last Key was clicked or the last PAUSE started.
Link copied to clipboard
private val Keyboard_Error: String
Error Message displayed on using the wrong keyboard mode!
Link copied to clipboard
private open var L: Array<L_Register>
The L-Register are used for general calculations.
Link copied to clipboard
val L_CHANGED: String = "L_Changed"
The L or A register where changed.
Link copied to clipboard
val L_Count: Int = 12
Amount of L Register
Link copied to clipboard
open var L_Used: Int
Amount of L Register used
Link copied to clipboard
val L_X: Int
L [0] is also the X register.
Link copied to clipboard
val L_Y: Int
L [1] is also the Y register.
Link copied to clipboard
the last comp mode used.
Link copied to clipboard
Last operation chosen by user - used for the K option.
Link copied to clipboard
private val Logger: Logger
class Logger instance
Link copied to clipboard
private open var M: Array<Number>
The M-Register are used for general data storage.
Link copied to clipboard
val M_CHANGED: String = "M_Changed"
An M or MF register has changed.
Link copied to clipboard
val M_Count: Int = 100
Amount of M Register
Link copied to clipboard
val M_n: Int
M [9] is also the statistical register n.
Link copied to clipboard
val M_Sx: Int
M [8] is also the statistical register Σx.
Link copied to clipboard
val M_Sx2: Int
M [7] is also the statistical register Σx².
Link copied to clipboard
open var Merge_Key: Keyboard
Key Operations which currently merged to a Calculator operation.
Link copied to clipboard
Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
Link copied to clipboard
Operations as they executed by the calculator.
Link copied to clipboard
private open var MF: Array<Number>
The MF-Register are used for special data storage.
Link copied to clipboard
Link copied to clipboard
The memory from 1000 ..
Link copied to clipboard
private val Null_Steps: Array<Short>
Do not display the steps.
Link copied to clipboard
private val Off_Text: Array<Short>
Text to display when ( is pressed
Link copied to clipboard
private val P1x_Info_Character: Int = 14
Link copied to clipboard
Text to display when ( is pressed
Link copied to clipboard
private open var Program_Counter: Int
Current Program counter .
Link copied to clipboard
open var Program_Stack: Array<Int>
Program stack used for GSB commands .
Link copied to clipboard
private open var Program_Stack_Pointer: Int
Program stack poiunter used for GSB commands .
Link copied to clipboard
private open var Program_Store: Int
Where to store the next merged operations.
Link copied to clipboard
Handle property changes.
Link copied to clipboard
Run calculator with realistic speed - just about as fast as the original.
Link copied to clipboard
val Row_Numeric: Int = 1
Numeric / Lower Row.
Link copied to clipboard
val Row_Steps: Int = 2
The 4 Steps charactersConvenience and performance constants — so we don't have to go though the enum for constant access<
Link copied to clipboard
val Row_Text: Int = 0
Text / Upper RowConvenience and performance constants — so we don't have to go though the enum for constant access<
Link copied to clipboard
open var RS232: Serial
A simulated serial Interface
Link copied to clipboard
private open var Serial: Serial
A simulated RS232
Link copied to clipboard
private open var Service: IService
Canvas class where we display our result or get our keycodes
Link copied to clipboard
val Stack_Count: Int = 20
deeps of the program stack.
Link copied to clipboard
val STATUS_CHANGED: String = "Status_Changed"
Program or program counter where changes where changed.
Link copied to clipboard
val STEP_CHANGED: String = "Step_Changed"
Program or program counter where changes where changed.
Link copied to clipboard
private val Steps: Array<Short>
Calculator Program Memory
Link copied to clipboard
private val Steps_Between_IO: Int = 35
Link copied to clipboard
Amount of Steps.
Link copied to clipboard
private open var Steps_Text: Array<Short>
The text to display in the steps field.
Link copied to clipboard
private val TAG: String
class Logger tag.
Link copied to clipboard
Active plane:
0
Keyboard_Normal
1
$2B: Memory + 20, Fix instead of RND
2
$2C: Memory + 40
3
$2D: Memory + 60
4
$2F: Memory + 80
5
$EA: P1_
6
$EB: ExFn Plane
Link copied to clipboard
The memory from 0 ..
Link copied to clipboard
The memory from 0 ..

Functions

Link copied to clipboard
fun A(Register: AlphaRegisterType): A_Register
The A Register contains the Keyboard_Alpha data of the display.
Link copied to clipboard
open fun A_Active(Row: Calculator.Row_Type): AlphaRegisterType
open fun A_Active(Row: Calculator.Row_Type, A: AlphaRegisterType)
Active A register for row.
Link copied to clipboard
private open fun A_Text_To_Display(): Array<Short>
A_Text to be displayed.
Link copied to clipboard
private open fun Add_Debug_Info(Position: Int, Retval: Array<Short>)
Link copied to clipboard
private open fun Add_Steps(Steps: Int)
Add step count to text field
Link copied to clipboard
Add a PropertyChangeListener to the listener list.
open fun addPropertyChangeListener(propertyName: String, listener: PropertyChangeListener)
Add a PropertyChangeListener for a specific property.
Link copied to clipboard
open fun Alpha_Mode(Alpha_Mode: Boolean)
Checks if the calculator is in Alpha mode by checking merged operation (when execution programms the alpha indicator is not set).
Link copied to clipboard
Link copied to clipboard
activate or deactivate base n mode.
Link copied to clipboard
open fun Clear(AC: Boolean)
Clean Calculator
Link copied to clipboard
protected open fun clone(): Any
Link copied to clipboard
fun Constant_Mode(Constant_Mode: Boolean)
Current mode
Link copied to clipboard
Link copied to clipboard
Decrement where to store the next merged operations.
Link copied to clipboard
open fun Display_A(Row: Calculator.Row_Type, Register: AlphaRegisterType)
Display A register in given row
Link copied to clipboard
private open fun Display_Error(Text: Array<Short>)
Display an error message until C or AC is pressed.
Link copied to clipboard
private open fun Display_Fatal(Text: Array<Short>)
Display an error message until C or AC is pressed.
Link copied to clipboard
private open fun Display_Message(Text_0: Array<Short>, Text_1: Array<Short>)
Display text as message
Link copied to clipboard
private fun Display_Program()
Display program overview
Link copied to clipboard
Display program overview
Link copied to clipboard
private open fun Display_Steps()
Display Program Steps
Link copied to clipboard
open fun displayClear()
Clear all alpha register.
Link copied to clipboard
open fun displayFormatted(text: Array<Short>)
Display value as formatted text
Link copied to clipboard
open fun displayKey(text: Array<Short>)
* Display Key merge info.
Link copied to clipboard
open fun displayL()
Reset current value Display
Link copied to clipboard
open fun displayMessage(text: Array<Short>)
Display texts as dual line message
Link copied to clipboard
open fun Enable_BaseN()
enable Bin Mode
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
private open fun Error_Reset()
Brings the calculator into a defined state after an error condition.
Link copied to clipboard
open fun Execute_Key(Opcode: Short)
Execute keyboard ob code
Link copied to clipboard
private open fun Execute_Mode_IO()
Handles the program I/O.
Link copied to clipboard
private open fun Execute_Mode_Pcl()
Handles the program clear, save and load.
Link copied to clipboard
open fun Execute_Mode_Run()
Handles running the calculator
Link copied to clipboard
private open fun Execute_Mode_Wrt()
Handles the program editing
Link copied to clipboard
fun FA6(): Tape
A simulated cassette Interface
Link copied to clipboard
protected open fun finalize()
Link copied to clipboard
open fun forceIO(resetKeyTime: Boolean)
Force IO Handling next round.
Link copied to clipboard
open fun Form(Form: ICalculatorCanvas)
Set Canvas to display result read keyboard
Link copied to clipboard
fun FP40(): Printer
A simulated cassette Printer
Link copied to clipboard
Add total amount of free steps to text;
Link copied to clipboard
private open fun Get_Program_Text(For_Debug: Boolean): Array<Short>
Display Program Steps
Link copied to clipboard
steps text
Link copied to clipboard
fun getClass(): Class<out Any>
Link copied to clipboard
open fun getDisplayMode(): DisplayType
Current display mode
Display_Alpha
Displays the content of the Alpha register.
Display_L
Displays the content of the L0 aka X register.
Display_Formatted
Displays the content of the L0 aka X register inside an alpha
open fun getDisplayMode(Row: Calculator.Row_Type): DisplayType
Current display mode
Display_Alpha
Displays the content of the Alpha register.
Display_L
Displays the content of the L0 aka X register.
Display_Formmated
Displays the content of the L0 aka X register inside an alpha
Link copied to clipboard
Link copied to clipboard
open fun getLastStep(): Int
locate the last step to display the free steps or for debugging.
Link copied to clipboard
open fun getStackPointer(): Int
return current stack pointer
Link copied to clipboard
fun Half_Circle(Half_Circle: Number)
convert an angle to Deg/Rad/Grad
Link copied to clipboard
open fun Handle_IO()
Display result and read keyboard
Link copied to clipboard
private open fun Handle_IO_HLT(Text: Array<Array<Short>>): Array<Array<Short>>
Handles I/O for HLT and PAUSE mode
Link copied to clipboard
private open fun Handle_IO_Mode_IO()
Handles the IO in I/O mode
Link copied to clipboard
private open fun Handle_IO_Mode_Pcl()
Handles the IO in program-clear mode
Link copied to clipboard
private open fun Handle_IO_Mode_Wrt()
Handles I/O for program-write mode
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun Hlt_Position(): Int
open fun Hlt_Position(Hlt_Position: Int)
Return Position for HLT Mode.
Link copied to clipboard
Increment Current Program counter.
Link copied to clipboard
Increment Current Program counter.
Link copied to clipboard
Increment where to store the next merged operations.
Link copied to clipboard
open fun Init_A()
Clears A-register
Link copied to clipboard
open fun Init_Keycodes()
Setup the keyboard
Link copied to clipboard
open fun Init_L()
Clears L-register
Link copied to clipboard
open fun Init_M()
Clears M-register.
Link copied to clipboard
open fun Init_MF()
Clears MF-register.
Link copied to clipboard
open fun Init_Opcodes()
Clears internal Memory
Link copied to clipboard
private open fun Init_Program_Stack()
init the GSB stack
Link copied to clipboard
open fun Init_Steps()
Clears Programm Steps
Link copied to clipboard
open fun Is_2nd_Mode(): Boolean
2ndF Mode?
Link copied to clipboard
open fun Is_Alpha(Step_Nr: Int): Boolean
check if Step "Nr" is an Alpha character
Link copied to clipboard
open fun Is_Alpha_Mode(): Boolean
Alpha Mode?
Link copied to clipboard
open fun Is_BaseN(): Boolean
Bin Mode?
Link copied to clipboard
open fun Is_BaseN_B(): Boolean
Bin Mode?
Link copied to clipboard
open fun Is_BaseN_D(): Boolean
Decimal Mode?
Link copied to clipboard
open fun Is_BaseN_H(): Boolean
Hex Mode?
Link copied to clipboard
open fun Is_BaseN_O(): Boolean
Oct Mode?
Link copied to clipboard
fun Is_End_Program(Position: Int): Boolean
check for end of program
Link copied to clipboard
private open fun Is_Executing_Program(): Boolean
checks if we are running a program
Link copied to clipboard
private open fun Is_HLT_Pause(Step_Nr: Int): Boolean
check if Step "Nr" is an Alpha character
Link copied to clipboard
open fun Is_Mode(): Boolean
check if mode switch is active
Link copied to clipboard
Program stack used for GSB commands .
Link copied to clipboard
Program stack used for GSB commands .
Link copied to clipboard
open fun Is_Shift_Mode(): Boolean
Shift Mode?
Link copied to clipboard
Calculator is not running - needed for end program.
Link copied to clipboard
open fun isIndirect(): Boolean
Link copied to clipboard
open fun isRunning(): Boolean
Calculator is running - needed for power saving.
Link copied to clipboard
open fun isWaiting(): Boolean
is waiting in interactive mode for user input.
Link copied to clipboard
Get current Keyboard mode
open fun Keyboard_Mode(Keyboard_Mode: Calculator.Keyboard_Mode)
set input mode
Link copied to clipboard
fun L(Register: Int): L_Register
Link copied to clipboard
the last comp mode used.
Link copied to clipboard
Link copied to clipboard
open fun load(filename: String)
Load the current status of the system
Link copied to clipboard
private open fun Load_Status()
Load the current status of the system
Link copied to clipboard
fun M(Register: Int): Number
fun M(Register: Int, M: Number)
The M-Register are used for general data storage.
Link copied to clipboard
open fun Merge_Key(): Keyboard
open fun Merge_Key(Merge_Key: Keyboard)
Key Operations which currently merged to a Calculator operation.
Link copied to clipboard
open fun Merge_Token(Merge_Token: IProgrammable_Operation)
Multi Keystroke Operation like Alpha, Degree, Eng, Save, Load in progress
Link copied to clipboard
Operations as they executed by the calculator.
Link copied to clipboard
fun MF(Register: Int): Number
fun MF(Register: Int, MF: Number)
The MF-Register are used for special data storage.
Link copied to clipboard
fun notify()
Link copied to clipboard
fun notifyAll()
Link copied to clipboard
open fun Pop_L()
open fun Pop_L(Operation: L_Register.Operation_Type)
Pop values from stack by triggering an calculation run up the the level Operation
Link copied to clipboard
open fun Pop_Program_Stack(): Int
Program stack used for GSB commands .
Link copied to clipboard
open fun Previous_Step(Step_Nr: Int): Short
get the previous step to a given step number or 255 when there is none.
Link copied to clipboard
open fun Program_Counter(): Int
Get current Program counter.
open fun Program_Counter(Program_Counter: Int)
Set Current Program counter.
Link copied to clipboard
Return step-position of given program
Link copied to clipboard
open fun Program_Store(): Int
get where to store the next merged operations.
open fun Program_Store(Program_Store: Int)
Set where to store the next merged operations.
Link copied to clipboard
private open fun Push_L()
Push stack one down.
open fun Push_L(Operation: L_Register.Operation_Type)
Push value and given operation to stack.
Link copied to clipboard
open fun Push_Program_Stack(Program_Counter: Int)
Program stack used for GSB commands .
Link copied to clipboard
private open fun Remove_Steps()
Remove step count from text field
Link copied to clipboard
Remove a PropertyChangeListener from the listener list.
Remove a PropertyChangeListener for a specific property.
Link copied to clipboard
open fun reset()
Total Reset calculator.
Link copied to clipboard
fun RS232(): Serial
A simulated cassette Interface
Link copied to clipboard
fun run()
Start Calculator
Link copied to clipboard
open fun Save_Status()
Save the current status of the system
Link copied to clipboard
open fun SecondF(): Boolean
check if 2ndF mode is active
Link copied to clipboard
open fun Service(Service: IService)
Set Canvas to display result read keyboard
Link copied to clipboard
Set Current program to programm at program counter
Link copied to clipboard
reset shift indicators
Link copied to clipboard
open fun Set_Mode(activate: Boolean)
activate or deactivate mode switch
Link copied to clipboard
open fun setDisplayMode(displayMode: DisplayType)
open fun setDisplayMode(Row: Calculator.Row_Type, Display_Mode: DisplayType)
Current display mode
Display_Alpha
Displays the content of the Alpha register.
Display_L
Displays the content of the L0 aka X register.
Display_Formatted
Displays the content of the L0 aka X register inside an alpha
Link copied to clipboard
open fun setExecutionMode(Execution_Mode: Calculator.Execution_Type)
Set new Execution mode
Link copied to clipboard
open fun setIndirect(indirect: Boolean)
Link copied to clipboard
open fun SHIFT(): Boolean
check is shift mode is active
Link copied to clipboard
fun Steps(Step: Int): Short
fun Steps(Step: Int, Value: Short)
Calculator Program Memory
Link copied to clipboard
fun Steps_Delete(Start: Int, End: Int, Skip: Int)
Calculator Program Memory
Link copied to clipboard
open fun stop()
Link copied to clipboard
open fun Stop_Execution()
Stop calculator executing an reset interactive mode.
Link copied to clipboard
open fun Store_Operation(Opcode: Short)
Store an operation at into calculator memory
Link copied to clipboard
Text to be displayed.
Link copied to clipboard
Active plane:
0
Keyboard_Normal
1
$2B: Memory + 20, Fix instead of RND
2
$2C: Memory + 40
3
$2D: Memory + 60
4
$2F: Memory + 80
5
$EA: P1_
6
$EB: ExFn Plane
Active plane:
0
Keyboard_Normal
1
Memory + 20, Fix instead of RND
2
Memory + 40
3
Memory + 60
4
Memory + 80
Programm + 10
ExFn
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
fun wait()
Link copied to clipboard
open fun Write_Steps()
Writes program steps to simulated cassette interface.
Link copied to clipboard
open fun Wrt_Is_Alpha(For_Debug: Boolean): Boolean
check if - in wrt mode - we are currently in alpha mode.