Calculator

abstract class Calculator

HP-45 Calculator Engine

Author

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

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val a: Array<Byte>
register a, general purpose
Link copied to clipboard
val b: Array<Byte>
register b, general purpose
Link copied to clipboard
val c: Array<Byte>
register c, X
Link copied to clipboard
private open var Calculator_Running: Boolean
Calculator is running - needed for power saving which was not there in the original
Link copied to clipboard
private open var Calculator_Shutdown: Boolean
Calculator is not running - needed for end program.
Link copied to clipboard
open var carry: Byte
carry
Link copied to clipboard
val d: Array<Byte>
register d, Y
Link copied to clipboard
open var del_grp: Int
Link copied to clipboard
open var del_rom: Int
Link copied to clipboard
val DISPLAY_TEXT_CHANGED: String = "Display_Text_Changed"
Link copied to clipboard
Display enable - used to switch off the display so that intermediate result are not shown to the user.
Link copied to clipboard
private open var displayText: String
currently displayed text.
Link copied to clipboard
private open var do_op_clear_reg: IOperation
clear register operations
Link copied to clipboard
private open var do_op_clear_s: IOperation
clear s register operation
Link copied to clipboard
val e: Array<Byte>
register e, Z
Link copied to clipboard
private val EXPONENT_CHAR: Array<Char>
⁰ SUPERSCRIPT ZERO Unicode: U+2070, UTF-8: E2 81 B0
Link copied to clipboard
private val EXPONENT_SIGN: Int = 2
location of the +/- sign of the exponent inside a register or memory.
Link copied to clipboard
val f: Array<Byte>
register f, T
Link copied to clipboard
open var form: ICalculatorCanvas
Canvas class where we display our result or get our keycodes
Link copied to clipboard
private open var Group_Read: Int
Group address read from file
Link copied to clipboard
val HP45_LST: String = "/rpn-45.lst"
Link copied to clipboard
open var IO_Count: Int
Number of virtual CPU cycles until next IO run.
Link copied to clipboard
private val IO_SPEED: Int = 50
Larger numbers reduce the amount of IO performed so the system has more time to run the actual calculator.
Link copied to clipboard
private open var Key_Flag: Int
Key event processing status
Key_Flag_Idle
Calculator is idle and ready to receive the next button from the key buffer
Key_Flag_Pressed
Calculator is processing the pressed event
Key_Flag_Wait
Waiting for the calculator to process the event
Key_Flag_Depressed
Calculator is processing the de-pressed event
Link copied to clipboard
private val Key_Flag_Depressed: Int = 2
Key event processing status
Key_Flag_Idle
Calculator is idle and ready to receive the next button from the key buffer
Key_Flag_Pressed
Calculator is processing the pressed event
Key_Flag_Wait
Waiting for the calcuator to process the event
Key_Flag_Depressed
Calculator is processing the de-pressed event
Link copied to clipboard
private val Key_Flag_Idle: Int = 0
Key event processing status
Key_Flag_Idle
Calculator is idle and ready to receive the next button from the key buffer
Key_Flag_Pressed
Calculator is processing the pressed event
Key_Flag_Wait
Waiting for the calcuator to process the event
Key_Flag_Depressed
Calculator is processing the de-pressed event
Link copied to clipboard
private val Key_Flag_Pressed: Int = 1
Key event processing status
Key_Flag_Idle
Calculator is idle and ready to receive the next button from the key buffer
Key_Flag_Pressed
Calculator is processing the pressed event
Key_Flag_Wait
Waiting for the calcuator to process the event
Key_Flag_Depressed
Calculator is processing the de-pressed event
Link copied to clipboard
private val Key_Flag_Wait: Int = 3
Key event processing status
Key_Flag_Idle
Calculator is idle and ready to receive the next button from the key buffer
Key_Flag_Pressed
Calculator is processing the pressed event
Key_Flag_Wait
Waiting for the calcuator to process the event
Key_Flag_Depressed
Calculator is processing the de-pressed event
Link copied to clipboard
private open var Key_Time: Long
System time when last Key was clicked.
Link copied to clipboard
private val Logger: Logger
Class logger instance.
Link copied to clipboard
val m: Array<Byte>
register m, scratch pad.
Link copied to clipboard
val Max_Group: Int = 2
ROM Groups
Link copied to clipboard
val Max_Ram: Int = 100
RAM Size
Link copied to clipboard
val Max_Rom: Int = 8
ROMs per group
Link copied to clipboard
private open var op_fcn: Array<IOperation>
array of all operator functions.
Link copied to clipboard
private open var Opcode_Read: Int
Opcode read from file
Link copied to clipboard
val Opcode_Size: Int = 1024
maximum amount of opcodes
Link copied to clipboard
open var p: Int
Link copied to clipboard
private open var Pointer_Read: Int
address read from file
Link copied to clipboard
open var Previous_Carry: Byte
previous carry
Link copied to clipboard
open var Program_Counter: Int
Link copied to clipboard
open var Program_Group: Int
Link copied to clipboard
open var Program_Rom: Int
Link copied to clipboard
Handle property changes.
Link copied to clipboard
Calculator RAM.
Link copied to clipboard
open var ram_addr: Int
ram address
Link copied to clipboard
names of all registers
Link copied to clipboard
Link copied to clipboard
private open var Rom_Read: Int
Rom address read from file
Link copied to clipboard
val Rom_Size: Int = 256
Size of each ROM
Link copied to clipboard
val s: Array<Byte>
register s
Link copied to clipboard
val S_Size: Int = 12
s register size
Link copied to clipboard
private val TAG: String
Class logger tag.
Link copied to clipboard
All Rom modules
Link copied to clipboard
val Word_Size: Int = 14
Size of one register.

Functions

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
protected open fun clone(): Any
Link copied to clipboard
open fun do_add(x: Byte, y: Byte): Byte
add support operation
Link copied to clipboard
open fun do_sub(x: Byte, y: Byte): Byte
subtract support operation
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
protected open fun finalize()
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_Formmated
Displays the content of the L0 aka X register inside an alpha
Link copied to clipboard
open fun getDisplayText(): String
returns the currently displayed text
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 getReadKey(): Int
get the last key read from the keyboard buffer
Link copied to clipboard
protected open fun Handle_IO()
Display result and read keyboard
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun Init_Opcodes()
Initialise Opcodes
Link copied to clipboard
open fun Is_Shutdown(): Boolean
Calculator is not running - needed for end program.
Link copied to clipboard
open fun isRunning(): Boolean
Link copied to clipboard
open fun isWaiting(): Boolean
is waiting in interactive mode for user input.
Link copied to clipboard
open fun load(Data_In: DataInputStream)
Link copied to clipboard
open fun memoryToString(register: Array<Byte>): String
open fun memoryToString(address: Int): String
Link copied to clipboard
fun notify()
Link copied to clipboard
fun notifyAll()
Link copied to clipboard
private open fun Parse_Address(oct: String): Boolean
Parse address field
Link copied to clipboard
private open fun Parse_Opcode(bin: CharSequence): Boolean
Parse
Link copied to clipboard
open fun Read_Listing_File(fileName: String)
This reads a zip file that is expected to contain one entry which is the HP-45 firmware listing.
Link copied to clipboard
open fun registerToString(register: Array<Byte>): String
open fun registerToString(address: Int): String
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()
Reset the calculator
Link copied to clipboard
open fun resetAll()
performs a full reset by deleting ram and the cache file as well a reloading the cache file.
Link copied to clipboard
fun run()
Start virtual CPU
Link copied to clipboard
open fun save(Data_Out: DataOutputStream)
Link copied to clipboard
open fun setDisplayMode(displayMode: 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 setDisplayText(displayText: String)
changes the currently displayed text
Link copied to clipboard
open fun setForm(value: ICalculatorCanvas)
Set Canvas to display result read keyboard
Link copied to clipboard
open fun stop()
Stop virtual CPU
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
fun wait()