JPS5852261B2 - Program processing method - Google Patents

Program processing method

Info

Publication number
JPS5852261B2
JPS5852261B2 JP3280876A JP3280876A JPS5852261B2 JP S5852261 B2 JPS5852261 B2 JP S5852261B2 JP 3280876 A JP3280876 A JP 3280876A JP 3280876 A JP3280876 A JP 3280876A JP S5852261 B2 JPS5852261 B2 JP S5852261B2
Authority
JP
Japan
Prior art keywords
program
circuit
output
subroutine
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP3280876A
Other languages
Japanese (ja)
Other versions
JPS52116036A (en
Inventor
孝夫 内倉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
KASHIO KEISANKI KK
Original Assignee
KASHIO KEISANKI KK
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KASHIO KEISANKI KK filed Critical KASHIO KEISANKI KK
Priority to JP3280876A priority Critical patent/JPS5852261B2/en
Publication of JPS52116036A publication Critical patent/JPS52116036A/en
Publication of JPS5852261B2 publication Critical patent/JPS5852261B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 本発明は例えば小型電子式計算機におけるプログラム処
理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a program processing method in, for example, a small electronic computer.

一般に小型電子式計算機、特に電子式卓上計算機(以下
電卓と略称する)は、予め組み込まれた固定プログラム
により一連の演算処理を実行するのが普通であるが、近
年、より複雑な演算を処理する為に必要に応じて所定の
プログラムを書き込むことの出来る所謂プログラム付電
卓が実用化されつつある。
In general, small electronic calculators, especially electronic desktop calculators (hereinafter referred to as calculators), usually perform a series of calculations using a fixed program installed in advance. For this reason, so-called programmable calculators, in which predetermined programs can be written as needed, are being put into practical use.

しかして、電卓はあまり多くの記憶容量を有していない
のが一般的であり、プログラム付電卓もその例外ではな
い。
However, calculators generally do not have a large storage capacity, and calculators with programs are no exception.

そこで、プログラム付電卓の特にプログラム記憶領域は
効率よく使用する様工夫されなければならない。
Therefore, the program storage area of a programmable calculator must be used efficiently.

しかるに、従来のプログラム付電卓等に於ては一連の演
算を実行する為の所謂メインルーチンと、例えば基本的
な演算を実行する所謂サブルーチンはその機能が明確に
区別され、サブルーチンはメインルーチンの一部として
のみ使われるので、サブルーチンをあたかもメインルー
チンの如く使用することは出来なかった。
However, in conventional programmable calculators, the functions are clearly differentiated between a so-called main routine that executes a series of operations and a so-called subroutine that executes, for example, basic operations, and a subroutine is a part of the main routine. Since subroutines are used only as part of routines, it was not possible to use subroutines as if they were main routines.

即ち、メインルーチンからサブルーチンを呼出して使用
することは出来るが、サブルーチンからメインルーチン
を呼出すことは出来なかった。
That is, although it is possible to call and use a subroutine from a main routine, it is not possible to call a main routine from a subroutine.

この為、サブルーチンをあたかもメインルーチンとして
使用することは出来ず、また、サブルーチンを書き込ん
だ分だけメインルーチンの書き込み領域が減少しプログ
ラム記憶領域を効率良く使用出来ない等種々の欠点があ
った。
For this reason, the subroutine cannot be used as if it were a main routine, and the write area for the main routine decreases by the amount of writing of the subroutine, resulting in various drawbacks such as inability to use the program storage area efficiently.

本発明は、上記の点に鑑みてなされたもので、書き込ま
れた各々のプログラムにメインルーチン及びサブルーチ
ンの固定化された機能を持たすことなく、その倒れにも
使用出来る様にすることによりプログラムに柔軟性を持
たせ、プログラム記憶領域の使用効率を極めて良好にし
たプログラム処理方式を提供することを目的とする。
The present invention has been made in view of the above points, and it does not require fixed functions of main routines and subroutines in each written program, but allows the program to be used even when the main routine and subroutines are changed. It is an object of the present invention to provide a program processing method that is flexible and extremely efficient in using program storage areas.

以下図面を参照して本発明の一実施例を説明する。An embodiment of the present invention will be described below with reference to the drawings.

本発明は第1図に示すようにプログラムメモリにメイン
、サブの区別のない複数のプログラムPrl〜P−r
Nを記憶しており、制御部により指定されたプログラム
がメインルーチン、他のプログラムによって指定される
プログラムがサブルーチンとなる。
As shown in FIG.
The program designated by the control section is the main routine, and the program designated by another program is the subroutine.

また、各プログラムPrl〜PrNが、他のプログラム
の指定によりサブルーチンとなった場合、サブルーチン
指定されたことを記憶するようになっている。
Furthermore, when each of the programs Prl to PrN becomes a subroutine due to the designation of another program, the designation of the subroutine is stored.

そして、単位プログラムの処理を終了した時点でサブル
ーチンとして用いられたか否かの判断を行い、サブルー
チンとして用いられた場合にはメインルーチンにジャン
プバックし、サブルーチンでなければそのプログラムは
メインルーチンの動作を行ったものとして動作を終了す
るようにしたもので、以下その詳細について説明する。
Then, when the processing of a unit program is finished, it is determined whether or not it is used as a subroutine. If it is used as a subroutine, the program jumps back to the main routine, and if it is not a subroutine, the program performs the operation of the main routine. The operation is terminated as if it had been executed, and the details will be explained below.

第2図において1はプログラムメモリで、上記したよう
にメイン、サブの区別のない複数のプログラムを記憶し
ている。
In FIG. 2, reference numeral 1 denotes a program memory, which stores a plurality of programs without distinguishing between main and sub programs as described above.

このプログラムメモリ1はアドレスカウンタ2によりア
ドレス指定され、その指定アドレスにおけるプログラム
の内容がアンド回路3,4を介してバッファレジスタ5
,6に送られる。
This program memory 1 is addressed by an address counter 2, and the contents of the program at the designated address are transferred to a buffer register 5 via AND circuits 3 and 4.
, 6.

上記アンド回路3,4はフリップフロップ7によってゲ
ート制御されるもので、アンド回路3にはフリップフロ
ップ7の出力がインバータ8を介して与えられ、アンド
回路4にはフリップフロップ7の出力が直接与えられる
The AND circuits 3 and 4 are gate-controlled by a flip-flop 7, and the output of the flip-flop 7 is applied to the AND circuit 3 via an inverter 8, and the output of the flip-flop 7 is applied directly to the AND circuit 4. It will be done.

しかして、バッファレジスタ5の出力は、サブルーチン
指定コード5ubNをプログラム指定コードPrNに変
換するコード変換回路9に送られると共にデコーダ10
に送られる。
Thus, the output of the buffer register 5 is sent to a code conversion circuit 9 that converts the subroutine designation code 5ubN into a program designation code PrN, and is also sent to the decoder 10.
sent to.

上記コード変換回路9の出力は、バッフアレシスクロの
出力と共に一致回路11へ送られ、この一致回路11の
出力はアンド回路12の一方の入力端にゲート信号とし
て加えられる。
The output of the code converting circuit 9 is sent to the matching circuit 11 together with the output of the buffer alexisco, and the output of this matching circuit 11 is applied to one input terminal of the AND circuit 12 as a gate signal.

このアンド回路12の他方の入力端には、クロックパル
スφeが与えられており、アンド回路12の出力はフリ
ップフロップ7にリセット信号として送られる。
A clock pulse φe is applied to the other input terminal of the AND circuit 12, and the output of the AND circuit 12 is sent to the flip-flop 7 as a reset signal.

また、上記デコーダ10は制御部(図示せず)より出力
する実行命令により動作しバッファレジスタ5から与え
られるプログラムの内容中に含まれるサブルーチン指定
コードSub、終了コードEND等をデコードするもの
で、Subコードが入力された場合は出力線10aに”
1”信号、ENDコードが入力された場合は出力線10
bに”1″信号を出力する。
Further, the decoder 10 is operated by an execution instruction output from a control section (not shown) and decodes a subroutine designation code Sub, an end code END, etc. included in the contents of the program given from the buffer register 5. If the code is input, it will be sent to output line 10a.
1” signal, output line 10 if END code is input
Outputs a "1" signal to b.

デコーダ10から出力線10aに出力される信号は、ク
ロックパルスφeに同期して動作するフリップフロップ
13に送られ、このフリップフロップ13の出力はフリ
ップフロップI、14のセット端子Sに加えられる。
The signal output from the decoder 10 to the output line 10a is sent to a flip-flop 13 which operates in synchronization with the clock pulse φe, and the output of this flip-flop 13 is applied to the set terminals S of the flip-flops I and 14.

そして、フリップフロップ7の出力は、上記実行命◆と
共にオア回路15を介してアンド回路16の一方の入力
端に加えられる。
The output of the flip-flop 7 is applied to one input terminal of the AND circuit 16 via the OR circuit 15 together with the execution instruction ◆.

このアンド回路16の他方の入力端には、クロックパル
スφeが与えられ、アンド回路16の出力はアドレスカ
ウンタ2にカウントアツプ信号として送られる。
A clock pulse φe is applied to the other input terminal of the AND circuit 16, and the output of the AND circuit 16 is sent to the address counter 2 as a count-up signal.

一方、上記フリップフロップ14の出力は、アンド回路
17に直接加えられると共に、アンド回路18にインパ
ーク19を介して加えられる。
On the other hand, the output of the flip-flop 14 is applied directly to an AND circuit 17 and also to an AND circuit 18 via an impark 19.

また、アンド回路17.18にはデコーダ10から出力
線10bに出力される信号が与えられ、アンド回路18
の出力はプログラム終了信号として上記制御部へ送られ
る。
Further, the AND circuits 17 and 18 are supplied with a signal output from the decoder 10 to the output line 10b, and the AND circuit 18
The output is sent to the control section as a program end signal.

アンド回路17の出力はクロックパルスφeに同期して
動作するフリップフロップ20を介してフリップフロッ
プ14のリセット端子Hに加えられると共に、オア回路
21を介してアドレスカウンタ2に書込み指令信号とし
て送られる。
The output of the AND circuit 17 is applied to the reset terminal H of the flip-flop 14 via a flip-flop 20 operating in synchronization with the clock pulse φe, and is also sent to the address counter 2 as a write command signal via an OR circuit 21.

この書込み指令信号によりアドレスカウンタ2は、アド
レスメモリ22からアンド回路23を介して与えられる
アドレス内容の書込みを行う。
In response to this write command signal, the address counter 2 writes the contents of the address given from the address memory 22 via the AND circuit 23.

また、アドレスカウンタ2の内容は、フリップフロップ
13の出力によりゲート制御されるアンド回路24を介
してアドレスメモリ22に転送される。
Further, the contents of the address counter 2 are transferred to the address memory 22 via an AND circuit 24 gate-controlled by the output of the flip-flop 13.

また、上記フリップフロップ13の出力は、オア回路2
1に加えられると共に、インバータ25を介してアンド
回路23に加えられる。
Further, the output of the flip-flop 13 is output from the OR circuit 2.
1 and is also applied to the AND circuit 23 via the inverter 25.

次に上記のように構成された本発明の動作を第3図に示
すフローチャートを参照して説明する。
Next, the operation of the present invention configured as described above will be explained with reference to the flowchart shown in FIG.

今上記実行命令がオア回路15を介してアンド回路16
に与えられると、そのゲートが開かれてクロックパルス
φeがアドレスカウンタ2に送られてその内容が順次カ
ウントアツプされる。
Now, the above execution command is passed through the OR circuit 15 to the AND circuit 16.
When the clock pulse φe is applied to the address counter 2, its gate is opened and the clock pulse φe is sent to the address counter 2, and its contents are sequentially counted up.

このカウンタ2のカウントアツプに従ってプログラムメ
モリ1からプログラムの内容が順次読出され、アンド回
路3を介してバッファレジスタ5に貯えられる。
As the counter 2 counts up, the contents of the program are sequentially read out from the program memory 1 and stored in the buffer register 5 via the AND circuit 3.

従ってこのバッファレジスタ5に読出した内容を上記制
御部に送って指定されたプログラムナンバーと比較する
ことにより、所望プログラムを指定することができる。
Therefore, a desired program can be designated by sending the contents read into the buffer register 5 to the control section and comparing it with the designated program number.

しかして、今例えば第3図に示すようにプログラムPr
lをメインプログラムとして指定したとすると、オア回
路15を介してアンド回路16に与えられる上記実行命
令に従ってアドレスカウンタ2の内容が順次カウントア
ツプされ、プログラムメモリ1からプログラムの内容が
順次出力されて所定の処理が実行される。
Now, for example, as shown in FIG.
1 is designated as the main program, the contents of the address counter 2 are sequentially counted up according to the execution command given to the AND circuit 16 via the OR circuit 15, and the contents of the program are sequentially output from the program memory 1 to execute a predetermined program. processing is executed.

しかして、プログラムPrlの実行中、あるステップで
他のプログラム例えばPr2がサブプログラム5ub2
として指定されたとすると、まず、この5ub2指定コ
ードはアンド回路3を介してバッファレジスタ6に貯え
られる。
Therefore, during the execution of program Prl, at a certain step, another program, for example Pr2, changes to subprogram 5ub2.
, this 5ub2 designation code is first stored in the buffer register 6 via the AND circuit 3.

このバッファレジスタ5に貯えられた5ub2指定コー
ドは、コード変換回路9に送られてプログラムPr2指
定コードに変換されると共に、デコーダ1oに送られる
The 5ub2 designation code stored in the buffer register 5 is sent to the code conversion circuit 9, converted into a program Pr2 designation code, and sent to the decoder 1o.

このデコーダ10は上記実行命令により動作しSubコ
ードが入力されると出力線10aに”1″信号を出力す
る。
This decoder 10 operates according to the above execution command and outputs a "1" signal to the output line 10a when the sub code is input.

この出力線10aに出力された信号は、次のクロックパ
ルスφeに同期してフリップフロップ13に読込まれ、
■ツー1間遅れたこのフリップフロップ13の出力によ
りフリップフロップ7をセットすると共に、第3図のス
テップAに示すようにフリップフロップ14(S)がセ
ットされる。
The signal output to this output line 10a is read into the flip-flop 13 in synchronization with the next clock pulse φe,
(2) The output of the flip-flop 13 delayed by one period sets the flip-flop 7, and at the same time, the flip-flop 14 (S) is set as shown in step A of FIG.

そして、フリップフロップ7がセットされることにより
アンド回路4のゲートが開かれると共に、インバータ8
の出力が”0”となってアンド回路3のゲートが閉じる
Then, by setting the flip-flop 7, the gate of the AND circuit 4 is opened, and the inverter 8 is opened.
The output of becomes "0" and the gate of the AND circuit 3 is closed.

また、上記フリップフロップ13の出力は、アンド回路
24に印加されアンド回路24を開きアドレスカウンタ
2の内容をアドレスメモリ22に転送する。
Further, the output of the flip-flop 13 is applied to an AND circuit 24 to open the AND circuit 24 and transfer the contents of the address counter 2 to the address memory 22.

この時、アドレスカウンタ2の内容は前記サブルーチン
5ub2を指定したアドレスよりも「1」だけ進んだ状
態となっている。
At this time, the contents of the address counter 2 are advanced by "1" from the address that specified the subroutine 5ub2.

即ち5ub2がデコーダ10に印加された時の上記実行
命令がオア回路15を介してアンド回路16に印加され
、信号線10bに”1”が出力されてフリップフロップ
13に読込まれる時のクロックパルスφeがアドレスカ
ウンタ2に印加されてカウトアップされている。
In other words, when 5ub2 is applied to the decoder 10, the above execution command is applied to the AND circuit 16 via the OR circuit 15, "1" is output to the signal line 10b, and the clock pulse is read into the flip-flop 13. φe is applied to the address counter 2 and is counted up.

従がって、アンド回路24を介してアドレスメモリ22
に転送されるアドレス内容は、サブルーチンを終了した
時のメインルーチンへのジャンプバックアドレスとして
記憶される。
Therefore, the address memory 22 via the AND circuit 24
The contents of the address transferred to is stored as the jump-back address to the main routine when the subroutine ends.

さらに、フリップフロップ13の出力は、オア回路21
を介して、アドレスカウンタ2がアドレスメモリ22の
内容を読込む様指令するが、この時フリップフロップ1
3の出力はインバータ25を介してアンド回路23に印
加されその出力を禁止しているので、アドレスカウンタ
2は′0”を読込むことになり、結局アドレスカウンタ
2はクリアされた状態になる。
Furthermore, the output of the flip-flop 13 is output from the OR circuit 21
The address counter 2 is instructed to read the contents of the address memory 22 via the flip-flop 1.
Since the output of 3 is applied to the AND circuit 23 via the inverter 25 and its output is inhibited, the address counter 2 reads '0', and as a result, the address counter 2 is cleared.

この状態が第3図に示すステップB、Cである。This state is steps B and C shown in FIG.

しかして、上記フリップフロップ7がセットされると、
その出力がオア回路15を介してアンド回路16に加わ
り、そのゲートを開く。
Therefore, when the flip-flop 7 is set,
The output is applied to an AND circuit 16 via an OR circuit 15 to open its gate.

このためクロックパルスφeがアンド回路16を介して
アドレスカウンタ2に加わり、その内容を順次カウント
アツプする。
Therefore, the clock pulse φe is applied to the address counter 2 via the AND circuit 16, and its contents are sequentially counted up.

このためプログラムメモリ1のプログラムの内容が最初
のアドレスから順次読出され、アンド回路4を介してバ
ッファレジスタ6にセットされる。
Therefore, the contents of the program in the program memory 1 are sequentially read out from the first address and set in the buffer register 6 via the AND circuit 4.

しかして、バッファレジスタ6にPr2コードが読出さ
れるまでは一致回路11の一致がとれないので、フリッ
プフロップ7はリセットされず、アドレスカウンタ2の
カウントアツプ動作が続けられる。
Since the matching circuit 11 cannot match until the Pr2 code is read into the buffer register 6, the flip-flop 7 is not reset and the address counter 2 continues counting up.

そして、プログラムメモリ1からバッファレジスタ6に
Pr2コードが読出されると、ステップDにおいてバッ
ファレジスタ5の保持内容5ub2に対してコード変換
回路9から出力されるPr2コードとバッファレジスタ
6の出力が一致し、一致回路11から”1”信号が出力
される。
Then, when the Pr2 code is read from the program memory 1 to the buffer register 6, in step D, the Pr2 code output from the code conversion circuit 9 and the output of the buffer register 6 match with respect to the content 5ub2 held in the buffer register 5. , a "1" signal is output from the matching circuit 11.

すなわち、ステップEに示すプログラムPr2における
ヘッドアドレスの検出が行われる。
That is, detection of the head address in the program Pr2 shown in step E is performed.

上記−数回路9の出力はクロックパルスφeに同期して
アンド回路12から出力され、フリップフロップ7をリ
セットする。
The output of the minus number circuit 9 is output from the AND circuit 12 in synchronization with the clock pulse φe, and resets the flip-flop 7.

フリップフロップ7がリセットされると、アンド回路1
6のゲートが閉じ、アドレスカウンタ2のカウントアツ
ブ動作が停止する。
When flip-flop 7 is reset, AND circuit 1
Gate 6 is closed, and the count-up operation of address counter 2 is stopped.

また、フリップフロップ7がリセットすることによりイ
ンバータ8の出力が”1”となってアンド回路3のゲー
トが開き、以後プログラムメモリ1から読出されるプロ
グラムの内容はアンド回路3を介してバッファレジスタ
5に送られるようになる。
In addition, by resetting the flip-flop 7, the output of the inverter 8 becomes "1" and the gate of the AND circuit 3 is opened. will be sent to.

以上でプログラムPr2に対するサブルーチンの指定を
終了し、以下オア回路15に与えられる実行命令に従っ
てプログラムメモリ1からプログラムPr2の内容が読
出され、その処理が実行される。
This completes the designation of the subroutine for the program Pr2, and the contents of the program Pr2 are then read out from the program memory 1 in accordance with the execution command given to the OR circuit 15, and its processing is executed.

しかして、上記プログラムPr2に対する処理を終了す
ると、プログラムメモリ1からENDコードがバッファ
レジスタ5に読出される。
When the processing for the program Pr2 is completed, the END code is read from the program memory 1 to the buffer register 5.

このENDコードがバッファレジスタ5に読出されると
、デコーダ10は出力線10bに“1”信号を出力する
When this END code is read to the buffer register 5, the decoder 10 outputs a "1" signal to the output line 10b.

この時点で処理を終了したプログラムPr2がサブルー
チンとして使用されたかどうか、つまり、第3図のステ
ップFに示すフリップフロップ14(S)がセットされ
ているか否かの判定を行う。
At this point, it is determined whether the program Pr2 whose processing has ended has been used as a subroutine, that is, whether the flip-flop 14(S) shown in step F in FIG. 3 is set.

この判定の結果フリップフロップ14がセットされてい
なければアンド回路18から終了信号が出力されて全て
の処理が終了したことになるが、この点ではフリップフ
ロップ14(S)がセットされているので、アンド回路
17から1”信号が出力されてステップGに示すアドレ
スメモリ22の内容をアドレスカウンタ2に転送する処
理が行われる。
As a result of this determination, if the flip-flop 14 is not set, a termination signal is output from the AND circuit 18 and all processing is completed, but at this point, since the flip-flop 14 (S) is set, A 1'' signal is output from the AND circuit 17, and the process of transferring the contents of the address memory 22 to the address counter 2 shown in step G is performed.

すなわち、アンド回路17の出力はオア回路21を介し
てアドレスカウンタ2に書込み指令として送られ、また
、この時点で”O”となっているフリップフロップ13
の出力が、インバータ25を介して”1”となってアン
ド回路23に印加されるのでアドレスメモリ22の内容
はアンド回路23を介してアドレスカウンタ2に転送さ
れる。
That is, the output of the AND circuit 17 is sent as a write command to the address counter 2 via the OR circuit 21, and the output of the flip-flop 13, which is at "O" at this point, is sent as a write command to the address counter 2 via the OR circuit 21.
The output becomes "1" and is applied to the AND circuit 23 via the inverter 25, so the contents of the address memory 22 are transferred to the address counter 2 via the AND circuit 23.

また、上記アンド回路17の出力は、クロックパルスφ
eに同期してフリップフロップ20に読込まれ、アドレ
スメモリ22の内容がアドレスカウンタ2に転送され終
えた時点でステップHに示すようにフリップフロップ1
4がリセット(クリア)される。
Further, the output of the AND circuit 17 is the clock pulse φ
e is read into the flip-flop 20 in synchronization with
4 is reset (cleared).

しかして、上記アドレスモリ22からアドレスカウンタ
2に送られたアドレスは、前記したようにメインプログ
ラムPrlのサブルーチン5ub2指定コード記憶アド
レスの次のアドレスを示すもので、以下このアドレスか
らメインプログラムPrlが実行される。
Therefore, the address sent from the address memory 22 to the address counter 2 indicates the next address of the subroutine 5ub2 designated code storage address of the main program Prl, as described above, and the main program Prl is subsequently executed from this address. be done.

そして、上記メインプログラムPrlに対する処理を終
了するとプログラムメモリ1からバッファレジスタ5に
ENDコードが読出され、この結果デコーダ10から出
力線10bに”■”信号が出力される。
When the processing for the main program Prl is completed, the END code is read from the program memory 1 to the buffer register 5, and as a result, the decoder 10 outputs a "■" signal to the output line 10b.

この際処理を終了したプログラムPrlがサブルーチン
として使用されたかどうか、つまりステップ■に示すよ
うにフリップフロップ14(S)がセットされているか
否かの判定が行われる。
At this time, it is determined whether the program Prl whose processing has been completed has been used as a subroutine, that is, whether the flip-flop 14 (S) is set as shown in step (2).

上記プログラムPrlはメインプログラムとして使用さ
れているのでフリップフロップ14((S)はセットさ
れておらず、アンド回路18のゲートが開かれている。
Since the program Prl is used as the main program, the flip-flop 14 (S) is not set and the gate of the AND circuit 18 is open.

従ってデコーダ10から出力線10bに出力される信号
はアンド回路18から終了信号として出力され、上記制
御部へ送られる。
Therefore, the signal outputted from the decoder 10 to the output line 10b is outputted as an end signal from the AND circuit 18 and sent to the control section.

また、プログラムPrlがサブルーチンとして使用され
ていれば、ステップJ、Kに示すように上記ステップG
、Hと同様の処理が行われ、他のプログラムにジャンプ
バックすることになる。
In addition, if the program Prl is used as a subroutine, the step G shown in steps J and K is
, H, and a jump back to another program is performed.

なお、上記実施例では、独立した1つのみのプログラム
をサブルーチンとして用いた場合を示したが、本発明は
これに限られることなく、例えば各々の独立したプログ
ラムに対応してサブルーチンとして用いられたか否かを
記憶する記憶部を設け、またジャンプバックアドレスを
記憶するアドレスメモリもスタックメモリとすることに
よって順次次のレベルに移行するようにしても良いこと
はもちろんであり、その他事発明の要旨を逸脱しない範
囲で種々変形応用出来ることは言うまでもない。
Although the above embodiment shows a case where only one independent program is used as a subroutine, the present invention is not limited to this, and for example, it may be used as a subroutine corresponding to each independent program. Of course, it is also possible to provide a storage section for storing whether or not the jumpback address is set, and to use a stack memory as the address memory for storing the jumpback address so as to sequentially move to the next level. It goes without saying that various modifications can be made without departing from the scope.

以上述べたように本発明によれば書き込まれたプログラ
ムにメインルーチン及びサブルーチンの機能を固定化せ
ず、他のプログラムによって指定されたプログラムをサ
ブルーチンとして動作するようにしたので、各プログラ
ム相互間において他のプログラムを任意に指定でき、プ
ログラムに柔軟性を持たせることが出来ると共に、各々
は独立したプログラムとして書き込まれている為プログ
ラムの書き込み操作あるいは読出し操作に何ら複雑さを
増すことはなく、またプログラム記憶領域の使用効率を
極めて良好に出来るプログラム処理方式を提供すること
が出来る。
As described above, according to the present invention, the functions of the main routine and subroutine are not fixed in the written program, and a program specified by another program is made to operate as a subroutine. Other programs can be specified arbitrarily, giving flexibility to the program, and since each program is written as an independent program, there is no increase in the complexity of program write or read operations. It is possible to provide a program processing method that can use the program storage area extremely efficiently.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の基本的動作を説明するための図、第2
図は本発明の一実施例を示す構成国、第3図は同実施例
の動作を説明するためのフローチャートである。 1・・・・・・プログラムメモリ、2・・・・・・アド
レスカウンタ、5,6・・・・・・バッファレジスタ、
7,13゜14.20・・・・・・フリップフロップ、
9・・・・・・コード変換回路、10・・・・・・デコ
ーダ、11・・・・・・一致回路、22・・・・・・ア
ドレスメモリ。
Figure 1 is a diagram for explaining the basic operation of the present invention, Figure 2 is a diagram for explaining the basic operation of the present invention.
The figure shows a constituent country showing an embodiment of the present invention, and FIG. 3 is a flowchart for explaining the operation of the embodiment. 1...Program memory, 2...Address counter, 5, 6...Buffer register,
7,13゜14.20...Flip-flop,
9... Code conversion circuit, 10... Decoder, 11... Matching circuit, 22... Address memory.

Claims (1)

【特許請求の範囲】[Claims] 1 複数の独立したプログラムを記憶するプログラム記
憶手段と、該プログラム記憶手段に記憶されているプロ
グラムのアドレスを指定するアドレス指定手段と、該ア
ドレス指定手段に順次指定されて読出された前記プログ
ラムの内容が他の前記独立したプログラムをサブルーチ
ンとして使用する内容であることを検出し記憶する検出
記憶手段と、該検出記憶手段により前記独立したプログ
ラムがサブルーチンとして使用されることが検出された
際、復帰すべきアドレスを記憶する復帰アドレス記憶手
段と、前記独立した一つのプログラムの処理が終了する
毎に該プログラムが他の独立したプログラムのサブルー
チンとして使用されたか否かを前記検出記憶手段の記憶
内容により判定する判定手段と、該判定手段により前記
独立したプログラムが他の独立したプログラムのサブル
ーチンとして使用されなかったことが判定された時、前
記独立したプログラムの終了によりその実行を終了し、
且つ前記独立したプログラムが他の独立したプログラム
のサブルーチンとして使用されたことが判定された時、
前記アドレス記憶手段に記憶されているアドレスを前記
アドレス指定手段に転送する手段とを具備したことを特
徴とするプログラム処理方式。
1. Program storage means for storing a plurality of independent programs, addressing means for specifying addresses of programs stored in the program storage means, and contents of the programs sequentially designated and read by the addressing means. a detection storage means for detecting and storing that the independent program is used as a subroutine, and a return function when the detection storage means detects that the independent program is used as a subroutine; return address storage means for storing an address to be returned to, and each time the processing of one independent program is completed, it is determined based on the storage contents of the detection storage means whether the program has been used as a subroutine of another independent program. determining means for determining, when the determining means determines that the independent program is not used as a subroutine of another independent program, terminating the execution by terminating the independent program;
and when it is determined that the independent program is used as a subroutine of another independent program,
A program processing method comprising: means for transferring an address stored in the address storage means to the address specifying means.
JP3280876A 1976-03-25 1976-03-25 Program processing method Expired JPS5852261B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3280876A JPS5852261B2 (en) 1976-03-25 1976-03-25 Program processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3280876A JPS5852261B2 (en) 1976-03-25 1976-03-25 Program processing method

Publications (2)

Publication Number Publication Date
JPS52116036A JPS52116036A (en) 1977-09-29
JPS5852261B2 true JPS5852261B2 (en) 1983-11-21

Family

ID=12369125

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3280876A Expired JPS5852261B2 (en) 1976-03-25 1976-03-25 Program processing method

Country Status (1)

Country Link
JP (1) JPS5852261B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57751A (en) * 1980-05-30 1982-01-05 Sharp Corp Computer with program editing function

Also Published As

Publication number Publication date
JPS52116036A (en) 1977-09-29

Similar Documents

Publication Publication Date Title
EP0062658A4 (en) Stack for a data processor.
US4047245A (en) Indirect memory addressing
EP0388735A2 (en) Microprogram controller having fixed-instruction generator and microprogram memory
JPS59116855A (en) Control memory mechanism
JPS5852261B2 (en) Program processing method
JPS6126979Y2 (en)
JPH0447851B2 (en)
JP2758624B2 (en) Speed control method of micro program
JPS6242301B2 (en)
JP2847863B2 (en) Microprocessor interrupt control method
JPS61143848A (en) Microprogram controller
JPS5935239A (en) Microprogram control system
JPS63163533A (en) Microcomputer
JPS5875250A (en) Digital information processor
JPS6247752A (en) Counter circuit for number of instruction executions of information processor
JPS6218937B2 (en)
JPS6232500B2 (en)
JPS6320631A (en) Register selecting system
JPH03257572A (en) Multiprocessor system
JPH04162150A (en) Watchdog timer control circuit
JPS60193047A (en) Mode checking system of microprogram
JPH0810429B2 (en) Micro program controller
JPS58181156A (en) Storage device of state history
JPS6113612B2 (en)
JPS59105149A (en) Controlling device of microprogram