Abstract:
A programmable electronic computer is provided with a program storage having address locations for storing a program sequence, an address memory for storing an address of the program sequence to be executed, a program read out circuit connected to the address memory and program storage and adapted to read out a program step stored in an address location in the program storage addressed by the address memory. Circuitry is provided for determining, whether or not the contents of the program step read out by the read out circuit is an instruction. A controller is connected to the determination circuitry and is adapted to cause the program sequence stored in the program storage to be executed from the address stored in the address memory when the determination circuitry identifies the contents of the program step as an instruction, and to replace the address stored in the address memory with another address when the determination circuitry does not identify the contents of the program step as an instruction.

Description:
This application is a continuation of application Ser. No. 154,870 filed May 30, 1980, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to an improvement on a programmable electronic computer (hereinafter called programmable computer) which is capable of storing instructions, calculating equations, etc., for example through key operations on a keyboard. 
     2. Description of the Prior Art 
     In the conventional programmable computer, the instructions, calculating equations, etc., which are stored in a program storage, for example, from a keyboard, are coded into uniquely corresponding one-step instruction codes, which are read afterwards for the execution of such instructions. In recent years, however, the development of large-scale programmable computers of higher performance have resulted in the use of a more complicated instruction scheme in which one instruction cannot sometimes by represented by a one-step instruction code but is represented by plural steps, so that the instructions of one, two or more steps are mixedly stored in the memory. However, in such system of storing instructions of different lengths, it becomes difficult to simply determine the top address of an instruction represented by plural steps, as in the case of the simple memory address system involving one or two-step instructions alone, and a careless addressing of the program sequences leads to the read out or execution of a code erroneously recognized as an instruction instead of a non-instruction part, thus resulting in an erroneous operation or calculation. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide a programmable computer not associated with the above-mentioned drawback of the conventional programmable computers but allowing correct program read out or execution from any program address. 
     Another object of the present invention is to provide a programmable computer capable, in case a program address indicated by the input device is not directed to an appropriate program location, of searching an appropriate program location and executing the program in its correct form. 
     Still other objects of the present invention will be made apparent from the following description of the preferred embodiments thereof to be taken in conjunction with the attached drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The attached drawings illustrate an embodiment of the present invention, wherein: 
     FIG. 1 is a schematic block diagram showing an embodiment of a programmable computer in accordance with the present invention; 
     FIG. 2 is a detailed schematic diagram useful in understanding the program read out operations; and 
     FIG. 3 is a chart showing an example of the operations of the program according to the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The present invention will now be explained in detail by means of an embodiment thereof shown in the attached drawings. 
     FIG. 1 shows the computer in accordance with the present invention in a block diagram, in which an arithmetic unit 1 performs the control of the functions of the various units to be explained later, the program execution and the arithmetic calculations. 
     Units 2 and 3 are arranged for storing program sequences entered from a keyboard to be explained later and reading the program sequences according to the instructions from arithmetic unit 1. Unit 2 is a program read/write circuit and 3 is a program storage. A display circuit 4 has a display unit for displaying numeric or character information in response to the commands from the arithmetic unit 1. A printer unit 5 has a print control and is adapted for printing numeric or character information in response to the commands from the arithmetic unit 1. A keyboard 6 is used for entering numeric or character information and instructions for controlling the arithmetic unit 1. A data storage 7 stores the numeric and character information. A power source 8 supplies electric power to the foregoing various units of the system. 
     FIG. 2 is a detailed view useful in understanding the program read out operations of the program storage in the circuit of FIG. 1. An address register (X) 12 stores address information instructed by the arithmetic unit 1. An adjacent address register (Y) 13 stores the information of an address location adjacent to that stored in address register (X). A program read out circuit 14 supplies the address information stored in registers 12, 13 to a program storage 3 to read the program sequences (as appropriate) location therefrom. A program register (A) 16 stores the program sequences directed to the address information stored in the register 12, having its most significant bit 18. A program register (B) 17 stores the program sequences directed to the address information stored in the register 13, having its most significant bit 19. 
     A determination circuit 20 determines combinations of the states &#34;1&#34; and &#34;1&#34;, &#34;1&#34; and &#34;0&#34;, &#34;0&#34; and &#34;0&#34;, or &#34;0&#34; and &#34;1&#34; of the uppermost locations of bits 18, 19 to identify whether or not the contents of the register 16 are an instruction, and accordingly to produce instruction determination information or non-instruction determination information. The program information from the register 16 and the instruction and non-instruction determination information are supplied to the arithmetic unit 1. 
     FIG. 3 shows an example of the program sequence embodying the present invention stored in a part of the program storage 3, in which the addresses and the instruction codes respectively correspond to the contents of registers 12, 13 and to the contents of registers 16, 17. Also the column &#34;MSB of instruction code&#34; indicates the information of the most significant bits 18, 19 of those registers, and the column &#34;Classification of instruction function&#34; indicates the instruction or non-instruction determination information obtained from the determination circuit 20. 
     Operations of the embodiment in accordance with the present invention will now be explained with reference to FIGS. 1, 2 and 3. 
     The structure of the programmable computer of the present invention is shown in FIG. 1, in which the function of the keyboard, printer etc., will not be discussed further in detail as it is not different from that in the conventional programmable computers. 
     In FIG. 3, the words used in the column Instruction of Function represent the following meanings: 
     [I→ACC] is a one-step instruction composed of an instruction part for placing a number &#34;1&#34; in the accumulating register ACC; 
     [ACC→MEMORY, (05)] is a two-step instruction composed of an instruction part for storing the content &#34;1&#34; of the accumulator ACC into an address location 05 of the memory, and of an address part; 
     [COMMENCE PRINTING, (A), (B), END PRINTING] is a four-step instruction composed of an instruction part, a character part, another character part and an instruction part for printing the characters &#34;A&#34; and &#34;B&#34;; and 
     [ACC→PRINT] is a one-step instruction composed of an instruction part for printing the content &#34;1&#34; of the accumulator ACC. 
     Also the column &#34;Instruction code&#34; indicates each 8-bit instruction code of which the most significant bit is indicated in the column &#34;MSB of instruction code&#34;, and the column &#34;Classification of instruction&#34; indicates the classified function of the instruction, etc. 
     In the program of the present embodiment composed of one-step and multi-step instructions, the instruction part has an instruction code starting with the most significant bit &#34;1&#34;, while the address or character part has an instruction code starting with the most significant bit &#34;0&#34;. 
     Thus the states of the most significant bits of each step and an immediately preceding step change in the following manner: 
     
         ______________________________________            MSB of pre-Step  MSB of step            ceding step  Instruction step______________________________________0     1          x            [1 → ACC]1     1          1            [ACC → MEMORY]2     0          1            Address (05)3     1          0            [COMMENCE PRINT]4     0          1            Character (A)5     0          0            Character (B)6     1          0            [END PRINT]7     1          1            [ACC → PRINT]______________________________________ 
    
     The comparison of the foregoing table with FIG. 3 will demonstrate that a step with the most significant digit &#34;1&#34; is the first step of a multi-step instruction, while a step with the most significant digit &#34;0&#34; and with the most significant digit &#34;1&#34; in the preceding step is an address part so that the correct execution of the program sequence should be commenced from the preceding step. 
     Also a step with the most significant bit &#34;0&#34; and with the most significant bit &#34;0&#34; in the preceding step is a character part, so that the correct execution of the program sequence can be started either from that step or from a third preceding step which is the top step of a multi-step instruction. 
     Going back to such third preceding step can be achieved by identifying a step with the most significant bit &#34;1&#34;. 
     The instruction code of each step is represented in the column &#34;Instruction code&#34; in FIG. 3. In the present embodiment the steps [1→ACC], [ACC→MEMORY], [COMMENCE PRINT], [END PRINT] and [ACC→PRINT] are respectively represented by instruction codes &#34;81&#34;, &#34;91&#34;, &#34;A1&#34;, &#34;A2&#34; and &#34;B1&#34;. Also the characters &#34;A&#34; and &#34;B&#34; are respectively represented by instruction codes &#34;21&#34; and &#34;22&#34;. Now the operations of the present embodiment will be discussed in detail while making reference to FIG. 2. 
     The address register 12 storing the address information of a step and the address register 13 storing the address information of an immediately preceding step instruct the read out of the data of corresponding addresses from the program storage 3. In case the step 1 is executed, address registers X, Y respectively store &#34;1&#34; and &#34;0&#34; to read the data &#34;91&#34; and &#34;81&#34; from the program storage 3, the data being respectively stored in the program register 16 storing the program content of that present step and in the program register 17 storing the program content of the immediately preceding step. Thus the registers 16(A) and 17(B) respectively store &#34;91&#34; and &#34;81&#34;. In this state the most significant bits 18, 19 of registers 16(A), 16(B) are both &#34;1&#34;. Upon receipt of this information the determination circuit 20 identifies, from the most significant bit &#34;1&#34; of that step, that step is an instruction, so that the arithmetic unit 1 can execute the program sequence from that step. In the case of the step 2, the most significant bits 18, 19 are &#34;0&#34; and &#34;1&#34; as shown in the foregoing table, so that the determination circuit 20, identifying that step as a non-instruction step, produces a non-instruction determination signal, in response to which the arithmetic unit 1 subtracts 1 from the address information for returning to the step 1 in the program sequence. At the step 1 the most significant bits 18, 19 become &#34;1&#34; and &#34;1&#34; as explained before, whereby information indicating that step is an instruction step, obtained in the above-explained manner, is supplied to the arithmetic unit 1 to enable the execution of the program from that step. Also in case the program sequence is set at any of the steps 3 to 7, the arithmetic unit 1, automatically identifying the instruction and non-instruction steps, corrects the starting step of the program sequence and executes the sequence from a step containing an instruction part. 
     By the addition of a simple circuit to the conventional programmable computer for identifying whether a program step is an instruction part or an information part other than an instruction, the present invention permits execution of the program sequence in the correct manner regardless of the initial read out address location and without affecting the execution time, thus facilitating the execution, editing and correction of the program.