Canola
0.8.D001
|
#include <calculator.h>
The calculator class is used to represent the interface to a general state of the 1614p emulation. It isn't necessarily a Gnome widget.
Definition at line 43 of file calculator.h.
typedef boost::shared_ptr<debugger> calculator::debugger_pointer [protected] |
Definition at line 422 of file calculator.h.
typedef boost::shared_ptr<calculator> calculator::pointer |
Definition at line 46 of file calculator.h.
typedef std::map<std::string, std::string> calculator::properties_t [private] |
Definition at line 886 of file calculator.h.
enum calculator::clock_tick_mode_t [private] |
clock_tick_mode_disabled | |
clock_tick_mode_running | |
clock_tick_mode_entry | |
clock_tick_mode_sj | |
clock_tick_mode_ej |
Definition at line 693 of file calculator.h.
enum calculator::deferred_action_t [private] |
Definition at line 655 of file calculator.h.
enum calculator::mstate_t [private] |
The mstate_t type is used to describe the state machine used to digit keys and arithmetic keys. The state machine implementation can be found in the on_opcode_ope method.
mstate_reset |
This is the state the calculator is in when it is reset. It is also the state entered after a [+=] or [-=] key. As such, this state does not imply that x_register or y_register are zero (they could be, but don't assume they are). |
mstate_lhs_digits_before_dot | |
mstate_lhs_digits_after_dot | |
mstate_lhs_complete | |
mstate_mul | |
mstate_mul_digits_before_dot | |
mstate_mul_digits_after_dot | |
mstate_mul_complete |
Definition at line 511 of file calculator.h.
The Program Mode Switch controls how the calculator interprets key strokes, either storing a program, or operating as a calculator, or running a program.
See the 1614P Instruction Manual, p. 13.
Definition at line 146 of file calculator.h.
The Program Selector Switch controls the portion of the calculator's program memory to be used.
See the 1614P Instruction Manual, p. 13.
"When storing a program, executing a program calculation, and checking or clearing a program, program ranges are selected by this switch"
Definition at line 208 of file calculator.h.
calculator::~calculator | ( | ) | [virtual] |
The destructor.
Definition at line 31 of file calculator.cc.
calculator::calculator | ( | ) | [protected] |
The default constructor. For use by derived classes only.
Definition at line 36 of file calculator.cc.
calculator::calculator | ( | const calculator & | ) | [private] |
The copy constructor. Do not use.
bool calculator::accumulate_mode_get | ( | void | ) | const [private] |
The accumulate_mode_get method may be used to obtain the state of the accumulate_mode instance variable.
Definition at line 490 of file calculator.cc.
void calculator::accumulate_mode_set | ( | bool | value | ) |
The accumulate_mode_set method may be used to change the state of the accumulate_mode instance variable.
value | The new accumulate mode setting. |
Definition at line 498 of file calculator.cc.
void calculator::calculate_display_lrn | ( | display & | disp, |
int | addr, | ||
int | op | ||
) | [private] |
The calculate_display_lrn method is used to calculate what would be displayed and/or printed for the given opcodes.
disp | The retiurned constructed display value. |
addr | The address of the opcode (1..240) |
op | The opcode of interest (0..127) |
Definition at line 44 of file update_display.cc.
void calculator::clear_program | ( | void | ) |
The clear_program method is used to remove the program from the selected bank.
Definition at line 23 of file load_program.cc.
void calculator::clock_tick_event | ( | void | ) | [protected] |
The clock_tick_event method is used to inform the claculator that a clock tick has occurred. This is used to run the program steps, when in Program Mode OPE and the user has pressed the Start button. Unexpected clock tick events will be discarded.
Use the clock_tick_expected method if you need to know whether or not to re-trigger the clock tick from your callback handler.
Definition at line 406 of file calculator.cc.
bool calculator::clock_tick_expected | ( | void | ) | const [protected] |
The clock_tick_expected method may be used to determine whether or not the calculator thinks the instruction clock is ticking.
Definition at line 451 of file calculator.cc.
virtual void calculator::clock_tick_start_running | ( | void | ) | [protected, pure virtual] |
The clock_tick_start_running method is called by the calculator to inform the derived class that it should kick off a clock tick idle handler. This will happen when opcode_extended_start is seen, for example. Derived classes should not assume when clocks stop and start, instend they will be explicitly informed via this method.
Implemented in calculator_gnome, calculator_asm, calculator_test, and calculator_proxy.
void calculator::constant_mode_eval | ( | bool | neg | ) | [private] |
The constant_mode_eval method is used to evaluate a += or -= key, when the [K] constant key is down.
neg | false if +=, true if -= |
Definition at line 41 of file on_opcode_ope.cc.
void calculator::constant_mode_set | ( | bool | value | ) |
The consatant_mode_set method is used to select the constant mode setting, to reflect the state of the [K] key.
Instruction Manual, p. 10
"This key is for constant multiplication and division. When it is depressed, it locks and function state is attained.
"Internal calculation is performed in the normal procedure. Thereafter constant multiplication and division can be made by operating the numeric and [+=] keys.
"In the case of multiplication, the multiplicant is a constant, and in the case of division, the divisor is a constant.
"This key is also used in involutions. The "n"th power of a figure is obtain by depressing the [+=] key (n-1) times. Thus, a [x] [+=] [+=] [+=] [+=] gives a5.
Definition at line 505 of file calculator.cc.
virtual void calculator::derived_feed | ( | void | ) | [private, pure virtual] |
The derived_feed method is used to implement the FD opcode, in the cases where it is valid.
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
virtual void calculator::derived_off | ( | void | ) | [private, pure virtual] |
The derived_off method is used to implement the OFF key.
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
virtual void calculator::derived_print | ( | const display & | value | ) | [private, pure virtual] |
The derived_print method is used to implement the PRINT opcode, in the cases where it is valid.
value | The value to be printed. |
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
virtual void calculator::derived_update_display | ( | const display & | value | ) | [private, pure virtual] |
The derived_update_display method is used when interpreting opcodes to indicate that the display needs to be updated to track the calculator's internal state.
value | The value to be displayed by the calculator display. |
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
void calculator::eval | ( | bool | neg | ) | [private] |
The eval method is used to evaluate a += or -= key press.
neg | false if +=, true if -= |
Definition at line 91 of file on_opcode_ope.cc.
void calculator::eval_mul | ( | bool | neg | ) | [private] |
The eval_mul method is used to evaluate a multiplication or division, in response to a += or -= key press.
neg | false if +=, true if -= |
Definition at line 101 of file on_opcode_ope.cc.
void calculator::execute_one_instruction | ( | void | ) | [private] |
The execute_one_instruction method is used by clock_tick_event and on_opcode_ope_che to execute the next instruction.
"[ENT] Entry Key
"This program key is used to store a temporary stop program instruction when programming in manual LRN. During execution of program at this instruction the program stops and the ENTRY lamp lights.
"It is used for the following: 1) Entry instruction to put the calculator in stand-by state for entry. 2) Temporary stop instruction for reading calculation results."
"[SJ] Sense Jump Key
"This program key is used for both manual program storage [LRN] and executing a program [OPE].
1) When storing a program: If this key is manually depressed, a sense jump instruction SJ is stored in the program, 2) When executing a program: If this key is manually depressed at the SJ instruction in the program, the program will jump to the specified program step. If the [START] key is depressed the program will proceed to the following step. The ENTRY lamp lights at this instruction."
"[EJ] Entry Jump Key
"Like MJ and UJ instructions, this key is used for manual program storage.
"When this key is depressed with the Program Mode Switch in LRN position, an entry jump instruction EJ is stored in the program.
"During execution of a program at this instruction, the program stops to await entry of data and the ENTRY lamp lights. When an entry is made and the [START] key is depressed, a jump is accomplished to the specified program step; when the [START] key is depressed without entry, the program proceeds without jumping."
"[MJ] Minus Jump Key
"Used for manual storing of programs. When this key is depressed, a minus jump instruction MJ is stored in the program.
"Minus jump instruction automatically judges the calculation results at the step immediately before this instructon is programmed; if the value is zero or positive it proceeds as it is, and if it is negative, it jumps to the specified program step."
"[UJ] Unconditional Jump Key
"This key is used to store a manual program and to execute programmed calculation.
1) Storing program: With the program mode switch set to LRN, depressing this key during manual operation stores the unconditional jump (UJ) instruction in the program.
2) Executing programmed calculation: With the program mode switch set to OPE, pushing UJ n (entry keys [0] to [9]) causes a jump to the jump destination specified in the FJ n step instruction. This key isused for program subdivision and in programs involving a relatively large number of decisions. Refer to information on decision functions for details."
"[FJ] Flag Jump Key
"This key is used in manual storing of programs in combination with [SJ], [EJ], [MJ], and [UJ] keys.
"If this key is depressed with Program Mode Switch set in LRN position, a flag for jump instruction is given, and a jump destination specifying instruction FJ is stored in the program. Each FJ instruction and the corresponding SJ, EJ, MJ or UJ instruction are accompanied by an identical flag code."
Note: actually, the flag value can be almost anything. Digits are merely very convenient, and not as confusuing as other alternatives.
Definition at line 25 of file execute_one_instruction.cc.
unsigned calculator::find_flag_jump | ( | unsigned char | label | ) | [private] |
The find_flag_jump method is used to scan the address space, looking for the given flag label (i.e. opcode_fj followed by this value).
label | The flag jump label to look for |
Definition at line 280 of file calculator.cc.
unsigned calculator::find_subroutine_flag_jump | ( | unsigned char | label | ) | [private] |
The find_subroutine_flag_jump method is used to scan the address space, looking for the given subroutine flag label (i.e. opcode_sfj followed by this value).
label | The subroutine flag jump label to look for |
Definition at line 359 of file calculator.cc.
bool calculator::get_bool_property | ( | const std::string & | name, |
bool | dflt = false |
||
) | const [private] |
The get_bool_property method is used to obtain a specific named boolean property from the set of properties.
name | The name of the property |
dflt | The value ot be used if the property is not available. |
Definition at line 479 of file program_card_visit.cc.
std::string calculator::get_property | ( | const std::string & | name, |
const std::string & | dflt = "" |
||
) | const [private] |
The get_property method is used to obtain a specific named property from the set of properties.
name | The name of the property |
dflt | The value ot be used if the property is not available. |
Definition at line 468 of file program_card_visit.cc.
bool calculator::get_step | ( | int | addr, |
unsigned char & | op, | ||
location::pointer & | where | ||
) | const [protected] |
The get_step method is used to obtain a particular step of the program.
addr | The address of interest. |
op | (Output) the opcode at he given location. |
where | (Output) the source file location of the opcode. |
Definition at line 23 of file get_step.cc.
bool calculator::have_property | ( | const std::string & | name | ) | const [private] |
The have_property method is used to determine whether or not the named property is available.
name | The name of the property |
Definition at line 459 of file program_card_visit.cc.
bool calculator::load_program | ( | const std::string & | filename, |
bool | binary | ||
) |
The load_program method may be used by derived classes to load a program (actually, an opcode stream) from a file. Errors are reported via the on_error method.
filename | The file to load the programme from. |
binary | Whether or not the file is binary (true) or text (false). |
Definition at line 53 of file load_program.cc.
void calculator::maybe_accumulate | ( | void | ) | [private] |
The maybe_accumulate method is used to implement the [AM1] mode behaviour. Addition or subtraction are automagically added to M1 on [+=] or [-=]. However, multiplication and division do NOT change M1 on [+=] or [-=].
Definition at line 23 of file on_opcode_ope.cc.
const char * calculator::mstate_name | ( | mstate_t | s | ) | [static, private] |
Definition at line 66 of file calculator.cc.
location::pointer calculator::next_location | ( | void | ) | const [private] |
The next_location method is used to obtain the location corresponding to the next programme location to be executaed (see address). The return value could be NULL, meaning no information is available.
Definition at line 269 of file calculator.cc.
unsigned char calculator::next_opcode | ( | void | ) | [private] |
The next_opcode method is used to fetch the next opcode from programme and then advance the address by one, wrapping as required.
Definition at line 257 of file calculator.cc.
void calculator::non_constant_mode_eval | ( | bool | neg | ) | [private] |
The non_constant_mode_eval method is used to evaluate a += or -= key, when the [K] constant key is NOT down.
neg | false if +=, true if -= |
Definition at line 81 of file on_opcode_ope.cc.
void calculator::on_error | ( | const char * | fmt, |
... | |||
) |
The on_error method is used to present an error to the user. The original 1614P did not have this facility, but it sure makes some stuff much easier.
The default implementation prints the error on the standard output. Derived classes may choose to overload it.
fmt | The format of the error message. It controls the number and types of arguments following; see printf(3) for more information. |
Definition at line 168 of file calculator.cc.
virtual void calculator::on_error_v | ( | const char * | fmt, |
va_list | ap | ||
) | [pure virtual] |
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
void calculator::on_opcode | ( | opcode_t | op, |
const location::pointer & | where | ||
) | [virtual] |
The on_opcode method is used to process a key that corresponds to an opcode. This is most of the keys on the keyboard, but none of the controls above the keys.
The actual interpretation of the key depends on several different state paramaters withing the calculator, including: operation mode (LRN, OPE, etc) whether there is a tilde key pending, etc.
op | The opcode to be processed |
where | The source code location of the opcode (or NULL if not available) |
Reimplemented in calculator_test.
Definition at line 222 of file calculator.cc.
void calculator::on_opcode_lrn | ( | opcode_t | op, |
const location::pointer & | where | ||
) |
The on_opcode_lrn method is used by the on_opcode method to process opcodes when in Program Mode LRN.
op | The opcode to be processed |
where | The source code location of the opcode (or NULL if not available) |
Definition at line 24 of file on_opcode_lrn.cc.
void calculator::on_opcode_ope | ( | opcode_t | op, |
const location::pointer & | where | ||
) |
The on_opcode_ope method is used by the on_opcode method to process opcodes when in Program Mode OPE.
op | The opcode to be processed |
where | The source code location of the opcode (or NULL if not available) |
Definition at line 174 of file on_opcode_ope.cc.
void calculator::on_opcode_ope_che | ( | opcode_t | op, |
const location::pointer & | where | ||
) |
The on_opcode_ope_che method is used by the on_opcode method to process opcodes when in Program Mode OPE CHE.
op | The opcode to be processed |
where | The source code location of the opcode (or NULL if not available) |
Definition at line 22 of file on_opcode_ope_che.cc.
void calculator::on_opcode_pro_che | ( | opcode_t | op, |
const location::pointer & | where | ||
) |
The on_opcode_pro_che method is used by the on_opcode method to process opcodes when in Program Mode PRO_CHE.
op | The opcode to be processed |
where | The source code location of the opcode (or NULL if not available) |
Definition at line 22 of file on_opcode_pro_che.cc.
calculator& calculator::operator= | ( | const calculator & | ) | [private] |
The assignment operator. Do not use.
const precision_and_rounding & calculator::precision_and_rounding_get | ( | void | ) | const |
The precision_and_rounding_get mewthod is used to obtain the current precision and rounding settings, for application to user widgets.
Definition at line 467 of file calculator.cc.
void calculator::precision_and_rounding_set | ( | const precision_and_rounding & | value | ) |
The precision_and_rounding_set method is used to change the precision and rounding in response to the user widgets.
value | The new value to be set. |
Definition at line 459 of file calculator.cc.
void calculator::printer_finished_event | ( | void | ) | [protected] |
The printer_finished_event method is used to inform the calculator that the printer is ready to print again. Unexpected printer fisnished events will be discarded.
Definition at line 483 of file calculator.cc.
bool calculator::printer_finished_event_expected | ( | void | ) | const [protected] |
The printer_finished_event_expected method is used to determine whether or not a printer_finished_event is expected.
Definition at line 475 of file calculator.cc.
virtual void calculator::printer_timer_start_running | ( | void | ) | [private, pure virtual] |
The printer_timer_start_running method is called by the calculator to inform the derived class that it should kick off a printer delay 420ms timer. This will happen when opcode_print or opcode_feed opcode is seen. Derived classes should not assume when printer delays stop and start, instend they will be explicitly informed via this method.
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
void calculator::program_card_walk | ( | program_card_functor & | f | ) | const |
The program_card_walk method is used to call the given functor once for each program card in the stored programme.
f | The functor to invoke for each card. |
Definition at line 37 of file program_card_visit.cc.
The program_mode_get method may be used to obtain the current setting of the calculator's Program Mode Switch.
Definition at line 215 of file calculator.cc.
const char * calculator::program_mode_name | ( | program_mode_t | pm | ) | [static] |
The program_mode_name method may be used to obtain a human readable description of the program mode value.
pm | The program mode to be described. |
Definition at line 101 of file calculator.cc.
void calculator::program_mode_set | ( | program_mode_t | pm | ) |
The program_mode_set method may be used to change the setting of the calculator's Program Mode Switch.
pm | the new program mode |
Definition at line 178 of file calculator.cc.
void calculator::program_print | ( | void | ) | [private] |
The program_print method is used to print a program listing on the printer.
Definition at line 22 of file program_print.cc.
calculator::program_selector_t calculator::program_selector_get | ( | void | ) | const |
The program_selector_get method may be used to obtain the current setting of the calculator's Program Selector Switch.
Definition at line 124 of file calculator.cc.
The program_selector_set method may be used to change the setting of the calculator's Program Selector Switch.
ps | the new program selector |
Definition at line 132 of file calculator.cc.
void calculator::property | ( | const std::string & | name, |
const std::string & | value | ||
) | [virtual] |
The property method is used by the lexer to pass along a property from the program text.
name | The name of the property. |
value | The value of the property. |
Definition at line 529 of file calculator.cc.
virtual void calculator::run | ( | void | ) | [pure virtual] |
The run method is used to run the calculator, from interactive input, via the GUI, or equivalent.
Implemented in calculator_gnome, calculator_proxy, calculator_asm, and calculator_test.
bool calculator::save_memories_as_program | ( | const std::string & | filename | ) |
The save_memories_as_program method is used to save the calculators data memories as a program.
filename | The name of the text file to be written with the assembler of the program that would reproduce the data memory values. |
Definition at line 27 of file save_memories_as_program.cc.
void calculator::save_program_as | ( | const std::string & | filename, |
bool | binary | ||
) |
The save_program_as method may be used bu derived classes to save the calculator's stored programme to a file, as binary. Errros are reported via the on_error method.
filename | The file to receive the programme. |
binary | Whether or not the file is binary (true) or text (false). |
Definition at line 86 of file save_program_as.cc.
void calculator::set_address | ( | int | n | ) | [protected] |
The set_address method is used by derived classes when the user, usually through some sort of GUI, updates the address.
Definition at line 44 of file update_debugger.cc.
bool calculator::strict_memory_number_checking_required | ( | void | ) | const |
The strict_memory_number_checking_required method is used to determine whether or not the number keys following M3~ keys (et al) must be followed by a digit key (true) or any key (false). The actual 1614P silently permits any key, and uses only the lower 4 bits.
Definition at line 536 of file calculator.cc.
void calculator::strict_memory_number_checking_set | ( | bool | value | ) |
The strict_memory_number_checking_set method is used to change the strict memory number checking preference.
Definition at line 544 of file calculator.cc.
void calculator::update_debugger | ( | debugger & | where | ) | [protected] |
The update_debugger method si used to ask the calculator to pass on its state to the given debugger instance (usually a Gnome, window, but not necessarily).
where | Where to display the debugging information. |
Definition at line 23 of file update_debugger.cc.
void calculator::update_display | ( | void | ) | [protected] |
The update_display method calculates the appropriate display value, and then calls derived_update_display to cause the derived class to display the approriate value.
Definition at line 22 of file update_display.cc.
void calculator::update_display_lamps | ( | display & | value | ) | [private] |
The update_display_lamps method is used to consistently set the appropriate lamps for the user interface.
Definition at line 72 of file update_display.cc.
void calculator::update_display_lrn | ( | void | ) | [private] |
The update_display_lrn method is used to re-draw the display when in LRN mode.
Definition at line 95 of file update_display.cc.
void calculator::update_display_ope | ( | void | ) | [private] |
The update_display_ope method is used to re-draw the display when in OPE mode.
Definition at line 108 of file update_display.cc.
unsigned calculator::wrap_address | ( | unsigned | addr | ) | const [private] |
The wrap_address method is used to calculate the appropriate wrapped value for this given address, taking into account program_selector value.
addr | The address to be checks, and wrapped if necessary. |
Definition at line 231 of file calculator.cc.
bool calculator::accumulate_mode [private] |
The accumulate_mode instance variable is used to remember the state of the AM1 key.
See the Instruction Manual, p. 9
"[AM1] Accumulative Memory 1 Key
"For automatic accumulation. Used in sums and differences of products and quotients. By depressing the [+=] key or [-=] key, the displayed data is added to or subtracted from Memory 1. This is a lock key for Memory 1. (Not used in programming.)"
Definition at line 779 of file calculator.h.
unsigned char calculator::address [private] |
The address instance variable is used to remember where the next opcode to be accessed is, relative to the start of the programme array.
The 1614P used an antiquated notion of address space, being from 1..240 (rathe rthen a more moder zero-based approach). By using an array larger than that, we can accommodate this, without constant resort to subracting one.
Definition at line 630 of file calculator.h.
std::list<unsigned> calculator::call_stack [private] |
The call_stack instance variable is used to remember the returned addresses for called subroutines. It is not clear if the 1614P was even capable of more than one level of calls (although it may explain the last 5 bytes in the programme space).
Definition at line 788 of file calculator.h.
clock_tick_mode_t calculator::clock_tick_mode [private] |
The clock_tick_mode instance vareiable is used to remember whether or not the calculator thinks the clock is running. This will be true when in Program Mode OPE, and the user has pressed the Start key (or UJ n).
Definition at line 708 of file calculator.h.
bool calculator::constant_mode [private] |
The constant_mode instance variable is used to remember the state of the [K] key, and adjust multiplication and division accordingly.
Instruction Manual, p. 10
"This key is for constant multiplication and division. When it is depressed, it locks and function state is attained.
"Internal calculation is performed in the normal procedure. Thereafter constant multiplication and division can be made by operating the numeric and [+=] keys.
"In the case of multiplication, the multiplicant is a constant, and in the case of division, the divisor is a constant.
"This key is also used in involutions. The "n"th power of a figure is obtain by depressing the [+=] key (n-1) times. Thus, a [x] [+=] [+=] [+=] [+=] gives a5.
Definition at line 833 of file calculator.h.
The constant_mode_action instance variable is used to remember the appropriate operation (multiplication or division) to apply when the [+=] or [-=] key is used when in constanht mode (when the [K] key is locked down).
Definition at line 841 of file calculator.h.
number calculator::constant_mode_rhs [private] |
The constant_mode_rhs instance variable is used to remember the right hand side of the repeated multiplication or division to be performed when the [+=] or [-=] key is pressed when in constant mode (when the [K] key is locked down).
Definition at line 849 of file calculator.h.
deferred_action_t calculator::deferred_action [private] |
The deferred_action instance variable is used to remember the previous arithmetic operation key.
Definition at line 666 of file calculator.h.
interpose::pointer calculator::interpose_by_program_mode[4] [private] |
Definition at line 653 of file calculator.h.
number calculator::memory[16] [private] |
Definition at line 551 of file calculator.h.
mstate_t calculator::mstate [private] |
Definition at line 531 of file calculator.h.
int calculator::number_of_keys_since_ej [private] |
The number_of_keys_since_ej instance variable is used to remember how many keys have been pressed since the EJ opcode occurred, to decive which way to branch. It is also used to know whether or not the ENT opcode should also print.
Definition at line 948 of file calculator.h.
The precro_current instance variable is used to remember the number of decimal places and rounding. This is usually the same as precro_front_panel instance variable, except after the opcode_round_up, opcode_round_off and opcode_round_down opcodes.
Definition at line 545 of file calculator.h.
The precro_front_panel instance variable is used to remember the setting selected by the user for the number of decimal places.
Definition at line 537 of file calculator.h.
bool calculator::printer_delay_active [private] |
The printer_delay_active method instance variable is used to remember whether or not a printer delay is active. This is used to pause instruction execution until the printer finishes printing a line.
Definition at line 716 of file calculator.h.
program_mode_t calculator::program_mode [private] |
The program_mode instance variable is used to remeber the calculator's current program mode.
Definition at line 651 of file calculator.h.
The program_selector instance variable is used to remember the addressing mode in use. This controls how the program space is segmented.
"Program Selector Switch
"When storing a program, executing a program calculation, and checking or clearing a program, program ranges are selected by this switch.
1) Program storage
(i) When two independent programs are stored at the same time, a program within 120 steps is stored on side I and a program within 120 steps is stored on side II.
(ii) When one program of over 120 steps is stored, the switch is set in the I+II position.
(iii) When the respective programs at I and II positions exceed 120 steps and 120 steps respectiveIy, the excess is stored automatically in II or I.
2) Execution of a program
The program is also classified by the changeover among I + II, I and II in the case of program calculation execution in accordance with the stored program.
(i) To execute a program by using the contents of program A, set the switch in I + II or I position.
(ii) To execute a program by using the contents of program B, set the switch in II position.
(iii) When the two programs are stored and they are used as required, execute program A with the switch set to I position, and execute program B with the switch set in II position.
3) Check of program contents
Checking of a particular stored program is also accomplished by selecting I+II, I or II.
(i) When checking program A, set the selector to either I+II or I.
(ii) When checking program B, set the selector to II.
(iii) When checking a dual program, set the selector at I for A and II for B.
4) Clearing contents of program
When clearing a program, the range to be cleared is determined by the changeover among I+II, I and II.
(i) To clear I+II range, steps 1 through 240, set the switch in I+II position.
(ii) To clear I range, steps 1 through 120, set the switch in I position.
(iii) To clear II range, steps 121 through 240, set the switch in II position.
Definition at line 618 of file calculator.h.
unsigned char calculator::programme[256] [private] |
The programme instance variable is used to remember the store programme of the calculator. The array is acrually larger then the original ,machine, but than means we don't have to constantly subtract one all the time.
Definition at line 638 of file calculator.h.
The programme_location instance variable is used to remember the source file location of each of the opcodes in the programme instance variable.
Definition at line 645 of file calculator.h.
properties_t calculator::properties [private] |
The properties instance variable is used to remember the properties of the program card set.
Definition at line 892 of file calculator.h.
bool calculator::strict_memory_number_checking [private] |
The strict_memory_number_checking instance variable is used to remember whether or not the key following M3~, SM3~, RM3~ and CM3~ must be a numeric key (true) or is permitted to be any key, of which the lower 4 bits will be used.
Definition at line 940 of file calculator.h.
number calculator::x_register [private] |
Definition at line 547 of file calculator.h.
number calculator::y_register [private] |
Definition at line 549 of file calculator.h.