Abstract:
A system for controlling a display panel in an electronic programmable calculator or the like determines whether a printer is connected thereto. If the printer is connected for operation, data or instructions are transmitted to the printer for printing. Otherwise, data or instructions are displayed on the calculator display.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to a method for controlling a display panel of an electronic programmable calculator and a personal computer. 
     A personal computer is generally equipped with a cathode ray tube (this is referred to as &#34;CRT&#34; hereinafter) so that data or a plurality of programs may be displayed at one time, while an electronic programmable calculator is generally capable of displaying no more than one line of data or program. 
     With a programmable calculator having a printer connected thereto, programs or data in locations as specified by the programs may be completely displayed on the printer without the need to interrupt execution of program steps. However, in the absence of a printer connected thereto, the programs or the data as specified by the programs need be displayed from line to line and execution of the programs need be interrupted during display. 
     Furthermore, the personal computer with a CRT is not always capable of displaying all of the program or data. In the absence of the printer connected thereto, it is preferred that execution of the program be interrupted when the program or data are displayed on the CRT in a manner similar to the programmable calculator. 
     In any case, which of the displays, the CRT or the printer, is employed in displaying the programs or data is determined by instructions. This leads to complexity of the instructions and it is therefore desirable that a single instruction be of use for all of the output operations and selection of which output device is to be used dependent upon whether the printer is connected. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is an object of the present invention to provide a new display method by which data or programs are displayed on a printer when the printer is connected to the data processing device and displayed on a display panel or CRT in the absence of the printer. A specific embodiment of the present invention will now be described by reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a perspective view of an electronic type programmable calculator having a printer connected thereto; 
     FIG. 2 is a schematic block diagram of the programmable calculator; 
     FIG. 3 is an enlarged view of a signal connector; 
     FIG. 4 is a schematic block diagram of a central processing unit; 
     FIG. 5 is a flow chart of the procedure by which data as specified by a program instruction is printed or displayed; and 
     FIG. 6 is a flow chart of the procedure by which programs are printed or displayed. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 is a perspective view of an electronic programmable calculator embodying the present invention, which generally includes a programmable calculator body (1), a printer (2) and a cable (3) for connection between the programmable calculator (1) and the printer (2). 
     FIG. 2 is a schematic block diagram showing the programmable calculator (1) in further detail. The calculator includes a central processing unit (this referred to as &#34;CPU&#34; hereinafter) for executing input and output controls and various arithmetic operations, a read only memory (this referred to as &#34;ROM&#34; hereinafter) (5) for containing operational sequences such as a monitor and an interpreter, a random access memory (this is referred to as &#34;RAM&#34; hereinafter (6) consisting of an input buffer, a program memory and one or more data memories, a keyboard (7) for introduction of input signals indicative of letters, numerals or symbols, a display memory and output buffer (8), a display panel (9) capable of displaying only one line of data or program, a signal connector (10) for connection with the printer (2), an address but (1) for specifying the address of the ROM (5), the RAM (6), the memories and the output buffer (8) for read and write operations and a data bus (12) for reading and writing data on the address as specified by the address bus (11). A read/write signal (this is referred to as &#34;R/W&#34; hereinafter) is developed for selection of read or write operation. 
     FIG. 3 is an enlarged view of the signal connector (10) which is constituted by terminals (D 0 ), (D 1 ) ... (D 7 ) for transmission of function codes such as codes of characters to be printed and carriage return codes to the printer, a terminal (5) for transmission of strobe signals, a terminal (A) for receipt of a response signal from the printer, a terminal (P) for receipt of a signal indicative of whether the printer is in connected relationship, and a ground terminal (GND). 
     The signal indicative of whether the priner is in connecting relationship bears a logic &#34;1&#34; level in the presence of the printer connected thereto and a logic &#34;0&#34; level in the absence of the printer. 
     FIG. 4 is a schematic block diagram of the CPU (4) which includes a data buffer (14) leading to the data bus (12), an instruction register (15), a register (17), and accumulator (19), a temporary register (20), an arithmetic circuit (21), a strobe signal buffer (23), a key signal buffer (24), a buffer (25) for holding output signals to the printer and a buffer (26) for holding signals from the printer, all of which (except the data buffer) are connected to the data buffer (14) via an internal data bus (27). The CPU further includes an address buffer (18) connected between the register (17) and the address buffer (11), a decoder (16) for decoding the contents of the instruction register (15) and a carry circuit (22) connected to the arithmetic circuit (21). The register (17) includes a flag (PRT) for indicating whether the program steps have been interrupted after the data or program steps were displayed on the display panel, a flag (CUR) for indicating a cursor, a register (OBTM) for indicating the last address of the program contained in the RAM (6). 
     When the flag (CUR) is &#34;1&#34;, the cursor is present on the display panel and a key input is loaded at a position as designated by the cursor while the cursor is moving to the right. On the other hand, when the flag (CUR) is &#34;0&#34;, no cursor is present on the display panel and the previous contents of the display panel are cleared for introduction of a new input introduced via the keyboard. 
     The flag (PRT) at a &#34;1&#34; level indicates that the calculator has interrupted execution of the program steps and if the program steps are to be re-executed, then an ENTER key is actuated to reset the flag (PRT) to &#34;0&#34; and make the calculator ready to re-execute the program steps. 
     A flow chart of FIG. 5 depicts the procedure by which data as identified by an instruction during execution of the program steps are printed by the printer (2) or displayed on the display panel (9). In other words, after the instruction PRINT has been decoded, it is determined whether an input to the terminal (P) is &#34;1&#34; or &#34;0&#34; is decided. If the input is &#34;1&#34;, then the data are outputted via the priner (2) and then the calculator proceeds with execution of a next instruction statement. 
     If &#34;O&#34;, the data are outputted via the display panel (9) and the flag (PRT) is placed into &#34;1&#34; position to interrupt execution of the program steps. Then, the flag (CUR) is reset to &#34;0&#34; and the calculator proceeds with a routine for decoding an input via the keyboard (7). 
     When continuation of execution of the program steps is desirable, all that is necessary is to actuate the ENTER key to reset the flag (PRT) to &#34;0.&#34; 
     In the event that error, such as missing data at the specified address, occurs during printing or displaying, the calculator proceeds with a routine for correcting error without executing displaying or printing. Furthermore, when the data are of a length exceeding the capacity of the display panel (9), the display panel is driven to display the portion of the data beginning with the first address and ending with the final location where the display panel is capable of displaying. 
     The procedure by which the program steps are printed on the printer (2) or displayed on the display panel (9) is conducted as shown in a flow chart of FIG. 6. 
     After fetching an instruction LIST, the leading address (TEXT) of the program memory within the RAM (6) is compared with the final address (OBTM) of the program to decide whether any program is contained within the program memory. When TEXT = OBTM, no program is contained within the program memory so that only &#34;&gt;&#34; (prompt) is displayed and the flag (CUR) is reset to &#34;0&#34; to initiate the key input routine. 
     When TEXT ≠ OBTM, because of the program contained within the memory, it is determined whether the key actuated following the LIST instruction is ENTER. If other keys are actuated, the key codes following the LIST instruction are used as data identifying the line where a program is present and the program line in agreement with that key code is located and displayed. It is noted that the key codes are used as the data directly or after execution of required operations. If the display panel cannot display all of the program lines, it is first necessary to display the portion of the program from the first line to the last line where the display panel is able to display. In the event that no corresponding program line is found, the calculator proceeds with an error routine, skipping the display operation. 
     In the case where the ENTER key is actuated after the LIST instruction, it is determined whether the flag (P) is &#34;0&#34; or &#34;1&#34;. When it is &#34;1&#34;, all of the program steps are printed and &#34;&gt;&#34; is displayed and then the flag (CUR) is reset to &#34;0&#34; for the key input procedure. When it is &#34;0&#34;, the first line of the program is displayed at its maximum permissible length and the flag (CUR) is reset to &#34;0&#34; for the key input procedure. 
     Although the foregoing has described and illustrated an embodiment for use with an electronic programmable calculator, it is obvious that the invention is equally applicable to a personal computer, a detailed description of such being omitted. 
     As stated previously, pursuant to the concept of the present invention, whether the data or program is to be displayed on a printer or the display panel built in the calculator or computer is determined by whether the printer is connected thereto. Furthermore, execution of the program steps may be interrupted for displaying the data or program steps.