Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPS6161417B2 - - Google Patents
[go: Go Back, main page]

JPS6161417B2 - - Google Patents

Info

Publication number
JPS6161417B2
JPS6161417B2 JP55069395A JP6939580A JPS6161417B2 JP S6161417 B2 JPS6161417 B2 JP S6161417B2 JP 55069395 A JP55069395 A JP 55069395A JP 6939580 A JP6939580 A JP 6939580A JP S6161417 B2 JPS6161417 B2 JP S6161417B2
Authority
JP
Japan
Prior art keywords
program
return
instruction
stack
counter
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
JP55069395A
Other languages
Japanese (ja)
Other versions
JPS56166555A (en
Inventor
Osamu Nishijima
Kyoto Oota
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP6939580A priority Critical patent/JPS56166555A/en
Publication of JPS56166555A publication Critical patent/JPS56166555A/en
Publication of JPS6161417B2 publication Critical patent/JPS6161417B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 本発明は、マイクロコンピユータ方式の制御が
実行される制御回路に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a control circuit in which microcomputer-based control is executed.

マイクロコンピユータ方式の制御が実行される
制御回路は、第1図に示すようにインストラクシ
ヨンメモリ1、プログラムカウンタ2、サブルー
チンスタツク3、スタツクポインタ4および制御
部5を含む構成となつている。かかる制御回路に
おいて、たとえば2レベルのサブルーチンを用い
た場合のプログラムの流れと、この流れに対応し
たサブルーチンスタツク(以下スタツクと記す)
3とスタツクポインタ(以下SPと記す)4の変
化を第2図のフローチヤートと第3図のスタツク
ならびにSPの状態図を用いて説明する。なお、
図中△△△は任意のインストラクシヨン、aおよ
びbはサブルーチンからのリターンアドレス、□
はスタツク、→はSPをそれぞれ示す。
The control circuit in which microcomputer-based control is executed includes an instruction memory 1, a program counter 2, a subroutine stack 3, a stack pointer 4, and a control section 5, as shown in FIG. . In such a control circuit, for example, the flow of a program when two-level subroutines are used, and the subroutine stack (hereinafter referred to as stack) corresponding to this flow.
3 and the stack pointer (hereinafter referred to as SP) 4 will be explained using the flowchart of FIG. 2 and the state diagram of the stack and SP of FIG. 3. In addition,
In the figure, △△△ is an arbitrary instruction, a and b are return addresses from the subroutine, □
indicates stack, and → indicates SP.

メインプログラムを実行中にサブルーチンコー
ル命令CALL1によつてサブルーチンレベル1が
コールされる。この時、スタツクにはCALL1に
対するリターンアドレスaが記入され、SPはこ
のリターンアドレスaを指定している。
While the main program is being executed, subroutine level 1 is called by subroutine call instruction CALL1. At this time, return address a for CALL1 is written in the stack, and SP specifies this return address a.

次に、のプログラムを実行する。最後にサブ
ルーチンコール命令CALL2によつてサブルーチ
ンレベル2がコールされる。この時、スタツクに
はCALL2に対応するリターンアドレスbが記入
され、また、SPは1が加えられリターンアドレ
スbを指定している。そしてのプログラムが実
行されると、最後のリターン命令RETURN2に
よりSPの指定しているアドレスbにリターンす
る。SPは1が減じられアドレスaを指定する。
次いでのプログラムが実行されると、最後のリ
ターン命令RETURN1によつてSPの指定してい
るアドレスaにリターンし、メインプログラムを
実行する。この時、SPは1が減じられる。
Next, run the program. Finally, subroutine level 2 is called by subroutine call instruction CALL2. At this time, return address b corresponding to CALL2 is written in the stack, and 1 is added to SP to specify return address b. When the program is executed, the last return instruction RETURN2 returns to address b specified by SP. SP is decremented by 1 and specifies address a.
When the next program is executed, the last return instruction RETURN1 returns to address a specified by SP, and the main program is executed. At this time, 1 is subtracted from SP.

以上の説明から明らかなように、サブルーチン
の制御はスタツクとSPの組み合わせによつてな
されている。なお、かかるサブルーチンの制御に
際して大切なことは、リターン命令に対しては、
これに対応するコール命令が必ず存在しているこ
とであり、コール命令が存在しなければプログラ
ムの意味をなさない。
As is clear from the above explanation, subroutine control is performed by a combination of stack and SP. It is important to note that when controlling such subroutines, for return commands,
There must be a call instruction corresponding to this, and if the call instruction does not exist, the program has no meaning.

第1図で示した既知の制御回路では、上記のよ
うにしてサブルーチンの制御がなされるものの、
雑音の影響などによつてリターン命令とこれに対
応するコール命令との対応関係の原則がくずれた
場合、プログラムが無限のループに入り制御機能
の失われる不都合がある。
In the known control circuit shown in FIG. 1, although the subroutine is controlled as described above,
If the principle of correspondence between a return instruction and its corresponding call instruction is disrupted due to the influence of noise, the program enters an infinite loop and the control function is lost.

以下に第4図に示すフローチヤート、第5図に
示すスタツクとSPの状態図ならびに第6図に示
す無限ループに入つた状態図を参照して上記の不
都合の発生状況について説明する。
The situation in which the above-mentioned problem occurs will be explained below with reference to the flowchart shown in FIG. 4, the state diagram of the stack and SP shown in FIG. 5, and the state diagram showing an infinite loop entered in FIG.

第4図で示すように、例えば、のプログラム
を実行中に雑音が入り、プログラムカウンタの内
容が変化したとすると、点線で示す正規のプログ
ラムの流れからはずれ、実線で示すプログラムの
流れに移り、他のプログラム′に飛び込む。
As shown in Fig. 4, for example, if a noise occurs during the execution of the program and the contents of the program counter change, the program deviates from the normal program flow shown by the dotted line and shifts to the program flow shown by the solid line. Jump into other programs.

第5図は、このような状態に陥つたときのスタ
ツクとSPの状態を説明する図である。すなわ
ち、コール命令CALL1によつてアドレスaをス
タツクに記入し、のプログラムが実行され、次
にコール命令CALL3によつてアドレスbをスタ
ツク記入しのプログラムの実行が開始される。
ところで、のプログラムの実行中に雑音が入る
と′の経路で別のプログラムを実行する。次い
でコール命令CALL4に基く命令が実行される
と、メインプログラムへのリターンアドレスの記
入されていたスタツクにリターンアドレスcが記
入され、このため、メインプログラムへのリター
ンアドレスの情報が消失する。したがつて、の
プログラムを実行し、リターン命令RETURN4
によつてアドレスcへリターンする。
FIG. 5 is a diagram illustrating the state of the stack and SP when such a situation occurs. That is, the call instruction CALL1 writes address a on the stack and the program is executed, and then the call instruction CALL3 writes address b on the stack and starts executing the program.
By the way, if noise occurs during the execution of the program, another program will be executed along the route '. Next, when the instruction based on the call instruction CALL4 is executed, the return address c is written in the stack where the return address to the main program was written, and therefore the information about the return address to the main program is lost. Therefore, execute the program and return command RETURN4
The process returns to address c.

次にのプログラムを実行し、最後にリターン
命令RETURN2を実行する。この時、SPはリタ
ーンアドレスbを指定しているため、リターン命
令RETURN2によつて制御がbに移り、SPは1
が減じられ、リターンアドレスcを指定する。次
にプログラムを実行すると、リターン命令
RETURN1があらわれる。この時、SPはリター
ンアドレスcを指定しているため制御がcに移
り、SPは1が減じられ、リターンアドレスbを
指定する。ここで再度のプログラムを実行し、
リターン命令RETURN2があらわれる。
The next program is executed, and finally the return instruction RETURN2 is executed. At this time, since SP specifies return address b, control is transferred to b by the return instruction RETURN2, and SP
is subtracted, specifying the return address c. Next time you run the program, the return instruction
RETURN1 appears. At this time, since SP specifies return address c, control is transferred to c, SP is decremented by 1, and specifies return address b. Now run the program again,
A return command RETURN2 appears.

このような動作により、第6図で示すように、
b−RETURN1−c−RETURN2−bのループ
で無限ループが形成される。
Due to this operation, as shown in Figure 6,
An infinite loop is formed by the loop of b-RETURN1-c-RETURN2-b.

第7図〜第9図はサブルーチン3レベルのもつ
とも一般的な場合を示す図であり、リターン命令
ならびにコール命令のみに着目すると、コール命
令がなくリターン命令がくり返される状態で無限
ループが形成される。すなわち、第7図のフロー
チヤートにおいて、のプログラムを実行してい
るときに雑音が入り、プログラムカウンタの内容
が変化した場合、実線で示すプログラムの流れに
移り、他のプログラムにとび込むことによつて
最終的に上記の無限ループが形成される。ところ
で、このような無限ループの発生は、プログラム
の特殊性によるものではなく、プログラムカウン
タ、スタツクならびにSPからなる構成そのもの
に起因している。
Figures 7 to 9 are diagrams showing the most common cases of three levels of subroutines, and if we focus only on return instructions and call instructions, an infinite loop will be formed in a state where there is no call instruction and the return instruction is repeated. Ru. In other words, in the flowchart shown in Figure 7, if noise occurs while the program is being executed and the contents of the program counter change, the program moves to the flow shown by the solid line and is interrupted by jumping into another program. Finally, the above infinite loop is formed. Incidentally, the occurrence of such an infinite loop is not due to the special characteristics of the program, but is due to the configuration itself consisting of the program counter, stack, and SP.

一般に、サブルーチンのコール、リターンが実
行される場合には2つの操作、すなわち、SPを
移動すること(SP±1→SP)とプログラムカウ
ンタ(PC)とスタツク(STACK)との間のデー
タの授受(PC→STACK、STACK→PC)がなさ
れることの2つの操作が必要である。また、マイ
クロコンピユータなどの制御回路では、ハードウ
エアを節約するために、上記の2つの操作を全く
同一のタイミングで実行させることを止め、第1
0図ならびに第11図に示すように、時系列的に
コール命令とリターン命令との2つの操作を実行
させ、ハードウエアの節約をはかる場合が多い。
しかしながら、上記のように2種の異るタイミン
グで1つの命令を実行させた場合、雑音などの影
響により命令の半分だけが実行される可能性があ
る。たとえば、コール命令の実行時において、
SPを移動する(SP+1→SP)命令の前半を実行
直後に雑音が発生した場合、プログラムカウンタ
とスタツクとの間のデータの授受(PC→
STACK)を行う後半の命令が実行されなくな
る。
Generally, when a subroutine call or return is executed, two operations are performed: moving SP (SP ± 1 → SP) and passing data between the program counter (PC) and the stack (STACK). Two operations are required: (PC→STACK, STACK→PC). In addition, in control circuits such as microcomputers, in order to save hardware, the two operations described above are not executed at exactly the same timing, and the first
As shown in FIGS. 0 and 11, two operations, a call instruction and a return instruction, are often executed in chronological order to save hardware.
However, when one instruction is executed at two different timings as described above, there is a possibility that only half of the instruction is executed due to the influence of noise and the like. For example, when executing a call instruction,
If noise occurs immediately after executing the first half of the instruction to move the SP (SP+1→SP), data transfer between the program counter and the stack (PC→
The latter half of the instruction that performs STACK) will not be executed.

第12図および第13図は上記の不都合の発生
状態を示すフローチヤートと、スタツクならびに
SPの状態図である。すなわち、第12図のプロ
グラムにおいて、のプログラムまでを実行し、
CALL3命令のうちSP+1→SPを実行した直後
に雑音が入り、SPには1が加えられたものの、
制御のプログラムに移らなかつたものと仮定す
る。この場合には、引き続き、のプログラム、
CALL4、のプログラム、RETURN4、の
プログラム、RETURN1を実行する。ところ
で、CALL3ではSPに1が加えられているため
にスタツクの位置が狂つている。したがつて、
RETURN1を実行すると、第13図で示すよう
に、SPで指定されているリターンアドレスbに
制御が移り、このため、さらにのプログラム、
CALL3、のプログラム、RETURN3、の
プログラム、CALL4、のプログラム、
RETURN4、のプログラムならびにRETURN
1が実行される。しかしながら、第13図で示さ
れるように、のプログラムの時点では、スタツ
クにはd,dと記入されているため、RETURN
1の命令の実行により、dに制御が移る。
FIGS. 12 and 13 are flowcharts showing how the above-mentioned problems occur, and the stack and
It is a state diagram of SP. That is, in the program of FIG. 12, execute the program up to
Immediately after executing SP+1→SP among CALL3 instructions, noise occurred, and although 1 was added to SP,
Assume that the program does not proceed to the control program. In this case, the program continues,
Execute the CALL4 program, RETURN4 program, and RETURN1. By the way, in CALL 3, 1 is added to SP, so the stack position is out of order. Therefore,
When RETURN1 is executed, control is transferred to the return address b specified by SP, as shown in Figure 13, and therefore the further program,
CALL3 program, RETURN3 program, CALL4 program,
RETURN4, program and RETURN
1 is executed. However, as shown in Figure 13, at the time of the program, d and d are written in the stack, so RETURN is
By executing the instruction 1, control is transferred to d.

したがつて、RETURN1と直前のコール命令
に対するリターンアドレスdとの間、すなわち、
d−RETURN1との間で無限ループに入つてし
まう。
Therefore, between RETURN1 and the return address d for the immediately previous call instruction, that is,
It goes into an infinite loop with d-RETURN1.

第14図および第15図は、サブルーチン3レ
ベルの場合を例示する図で、CALL4命令を実行
中、SPに1が加えられた時点で雑音の影響を受
け、プログラムカウンタにコールアドレスがロー
ドされなかつた場合を示している。
Figures 14 and 15 are diagrams illustrating the case of the subroutine 3 level. During execution of the CALL4 instruction, when 1 is added to SP, it is affected by noise and the call address is not loaded into the program counter. The case is shown below.

この場合には、のプログラム以後〓のプログ
ラムまでを実行し、h→RETURN1→i→
RETURN8の間で無限のループに入る。
In this case, execute the program after 〓 program, h→RETURN1→i→
Enters an infinite loop during RETURN8.

これらの場合も、サブルーチンコール命令とリ
ターン命令のみに着目すると、コール命令なしに
リターン命令がくり返される状態によつて無限ル
ープが形成される。
In these cases, if we focus only on the subroutine call instruction and the return instruction, an infinite loop is formed due to the return instruction being repeated without the call instruction.

以上、いくつかの例を挙げて説明したように、
インストラクシヨンメモリ、プログラムカウン
タ、サブルーチンスタツクならびにスタツクポイ
ンタによつて構成される第1図で示す制御回路で
は、プログラムとは関係なく、雑音によつてリタ
ーン命令と関連する無限ループに入るおそれがあ
る。また、一度無限ループに入ると再度正常状態
へ復帰することができなくなる。さらに、上記の
無限ループは、フローチヤートで示すように、ネ
ステイング(nesting)の行われている部分で発
生するため、1つのプログラム内の多数の部分で
発生する可能性があり、これを防ぐための対策を
プログラム上で施すことは殆んど不可能であつ
た。
As explained above with some examples,
In the control circuit shown in Figure 1, which is composed of an instruction memory, a program counter, a subroutine stack, and a stack pointer, there is a risk of entering an infinite loop associated with a return instruction due to noise, regardless of the program. There is. Furthermore, once the system enters an infinite loop, it is no longer possible to return to the normal state. Furthermore, as shown in the flowchart, the infinite loop described above occurs in a part where nesting is performed, so it can occur in many parts within one program.To prevent this, It was almost impossible to implement countermeasures for this problem in a program.

本発明は、以上説明して来たように、制御回路
が無限ループに突入した場合であつても、無限ル
ープから脱出することが可能な制御回路を実現す
るものであり、以下に本発明の制御回路について
図面を参照して説明する。
As explained above, the present invention realizes a control circuit that can escape from an infinite loop even when the control circuit enters an infinite loop. The control circuit will be explained with reference to the drawings.

第16図は、本発明の制御回路の構成を示すブ
ロツク図であり、基本部分がインストラクシヨン
メモリ1、プログラムカウンタ2、サブルーチン
スタツク3、スタツクポインタ4ならびに制御部
5で構成されている点では従来の制御回路と同じ
であるが、さらに、サブルーチンからのリターン
命令で1が加えられ、コール命令でクリアされる
カウンタ(リターンカウンタ)6が付加されてい
る点で従来の制御回路と相違している。そして、
このカウンタ6のカウントが所定値に達すること
によつて発生する出力(Cout)でプログラムカ
ウンタ2に一定番地をロードし、ロードされた一
定番地からプログラムの実行が開始する構成とな
つている。
FIG. 16 is a block diagram showing the configuration of the control circuit of the present invention, the basic part of which is composed of an instruction memory 1, a program counter 2, a subroutine stack 3, a stack pointer 4, and a control section 5. It is the same as a conventional control circuit in this respect, but it differs from a conventional control circuit in that it has an additional counter (return counter) 6 that is incremented by 1 when a return instruction from a subroutine is issued and cleared by a call instruction. are doing. and,
The output (Cout) generated when the count of the counter 6 reaches a predetermined value is used to load a certain location into the program counter 2, and execution of the program is started from the loaded certain location.

ところで、リターンカウンタ6は、上記のよう
にリターン命令で1が加えられ、コール命令でク
リアされるものであるため、コール命令なしにリ
ターン命令が実行された場合のみ1をカウントア
ツプする。この状態は、制御回路が無限ループに
入つた場合に発生し、リターンカウンタ6は無限
にカウントアツプされる。したがつて、制御回路
が無限のループに入つたか否かの検出は、リター
ンカウンタ6が制御回路にとつて可能なネステイ
ング数以上までカウントアツプされたか否かを検
出することによつてなすことができる。
By the way, since the return counter 6 is incremented by 1 by a return instruction and cleared by a call instruction as described above, it counts up by 1 only when a return instruction is executed without a call instruction. This state occurs when the control circuit enters an infinite loop, and the return counter 6 is counted up indefinitely. Therefore, it is possible to detect whether the control circuit has entered into an infinite loop by detecting whether the return counter 6 has counted up to the number of nestings that are possible for the control circuit or more. I can do it.

プログラムカウンタ2に付設した端子7は、リ
ターンカウンタ6に無限ループに入つたことを検
知する出力(Cout)が発生したことに基いて一
定番地をロードするための端子である。そして、
一定番地から例えば制御回路を無限ループから脱
出させるためのエラー処理プログラムを記入する
こと、あるいは、特定のプログラムを設けること
なく、一定番地でプログラムの初期値化ルーチン
を指定することなどの方法によつて制御回路系を
正常に復帰させる。
A terminal 7 attached to the program counter 2 is a terminal for loading a certain address based on the occurrence of an output (Cout) in the return counter 6 that detects that the program has entered an infinite loop. and,
For example, by writing an error handling program to escape a control circuit from an infinite loop from a single location, or by specifying a program initialization routine at a single location without creating a specific program. This will restore the control circuit system to normal.

なお、プログラムカウンタ2に一定番地をロー
ドする方法としては、直接プログラムカウンタに
ロードする方法あるいは制御回路のクリア回路を
起動することにより実質的に一定の値をロードす
る方法のいずれを採用してもよい。
Note that as a method of loading a constant value into the program counter 2, either a method of directly loading the program counter or a method of loading a substantially constant value by activating the clear circuit of the control circuit may be adopted. good.

以下にサブルーチン2レベルの場合を例に説明
する。
The case of subroutine level 2 will be explained below as an example.

第16図に示した制御回路において、リターン
カウンタ6の設定カウント数が3、一定番地が4
番地、また、4番地からはエラー処理ルーチンが
記入されているものと仮定する。この条件設定が
なされた制御回路の動作が正常であるときには、
サブルーチンネステイングが2レベルであるため
リターン命令を3回以上続けて実行することはな
い。
In the control circuit shown in FIG. 16, the set count number of the return counter 6 is 3, and the fixed location is 4.
It is also assumed that an error handling routine is written starting from address 4. When the control circuit with this condition setting is operating normally,
Since the subroutine nesting is at two levels, the return instruction is never executed three or more times in a row.

すなわち、リターンカウンタ6はコール命令で
クリアされ、3以上の数にはならない。ところ
で、第4図のプログラムチヤートで示した経過で
制御回路が無限のループに入つた場合、すでに説
明したようにコール命令なしにリターン命令がく
り返される。
That is, the return counter 6 is cleared by a call instruction and does not reach a number of 3 or more. By the way, if the control circuit enters an infinite loop as shown in the program chart of FIG. 4, the return command is repeated without the call command, as already explained.

第17図は、制御回路が無限ループに入つたと
きのリターンカウンタ6とプログラムカウンタ2
の状態を示す図である。図示するようにCALL4
命令を実行したときにリターンカウンタはクリア
され0になるが、この後、のプログラム、
RETURN4、のプログラム、RETURN2、
のプログラムそしてRETURN1が実行されるこ
とにより、リターンカウンタの内容は3となり、
ここで、設定カウント数3が検出される。この検
出に基いてプログラムカウンタに4番地がロード
され、エラー処理ルーチンを実行して無限ループ
から脱出する。
Figure 17 shows the return counter 6 and program counter 2 when the control circuit enters an infinite loop.
FIG. CALL4 as shown
When the instruction is executed, the return counter is cleared and becomes 0, but after this, the program
RETURN4, program, RETURN2,
By executing the program and RETURN1, the content of the return counter becomes 3,
Here, the set count number 3 is detected. Based on this detection, address 4 is loaded into the program counter, an error handling routine is executed, and the infinite loop is exited.

このように、本発明の制御回路では、雑音の影
響で一度無限ループに入つても、このループから
脱出することができる。なお、サブルーチンのネ
ステイング数が多い場合であつても、これに対応
させてリターンカウンタのカウント数を設定する
ことにより、同様にして無限ループからの脱出が
可能である。また、本発明の制御回路では、可能
なネステイングレベル以上のサブルーチンを誤つ
て使用した場合、これを検出することのできる効
果も奏される。
In this manner, the control circuit of the present invention can escape from the infinite loop even if it once enters the infinite loop due to the influence of noise. Note that even if the number of nested subroutines is large, it is possible to escape from the infinite loop in the same way by setting the count number of the return counter accordingly. Furthermore, the control circuit of the present invention has the advantage of being able to detect if a subroutine with a nesting level higher than the possible nesting level is erroneously used.

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

第1図は従来の制御回路の構成を示す図、第2
図および第3図は2レベルのサブルーチンを用い
た場合のプログラムの流れおよびこれに対応する
スタツクとスタツクポインタの状態を示す図、第
4図〜第6図は無限ループに入る状態を説明する
ための図、第7図〜第9図はサブルーチン3レベ
ルの下で無限ループに入る状態を示す図、第10
図、第11図はコール命令とリターン命令の実行
状態を示す図、第12図および第13図は時系列
的な命令実行の下で生じる不都合を説明するため
の図、第14図、第15図はサブルーチン3レベ
ルの下でコールアドレスがロードされなかつた場
合に無限ループに入る状態を説明するための図、
第16図は本発明の制御回路の構成を示すブロツ
ク図、第17図は本発明の制御回路が無限ループ
に入つたときのリターンカウンタならびにプログ
ラムカウンタの状態を示す図である。 1……インストラクシヨンメモリ、2……プロ
グラムカウンタ、3……サブルーチンスタツク、
4……スタツクポインタ、5……制御部、6……
リターンカウンタ、7……一定番地ロード用の端
子。
Figure 1 shows the configuration of a conventional control circuit, Figure 2 shows the configuration of a conventional control circuit.
Figures 4 and 3 are diagrams showing the flow of a program when a two-level subroutine is used and the corresponding states of the stack and stack pointer, and Figures 4 to 6 explain the state of entering an infinite loop. Figures 7 to 9 are diagrams showing the state of entering an infinite loop under the subroutine 3 level, Figure 10
11 is a diagram showing the execution state of a call instruction and a return instruction, FIGS. 12 and 13 are diagrams for explaining inconveniences that occur under chronological instruction execution, and FIGS. 14 and 15. The figure is a diagram to explain the state in which an infinite loop occurs when the call address is not loaded under the subroutine 3 level.
FIG. 16 is a block diagram showing the configuration of the control circuit of the present invention, and FIG. 17 is a diagram showing the states of the return counter and program counter when the control circuit of the present invention enters an infinite loop. 1... Instruction memory, 2... Program counter, 3... Subroutine stack,
4...Stack pointer, 5...Control unit, 6...
Return counter, 7...Terminal for loading to a certain location.

Claims (1)

【特許請求の範囲】[Claims] 1 インストラクシヨンメモリ、プログラムカウ
ンタ、サブルーチンスタツク、スタツクポインタ
および制御部を備え、前記サブルーチンスタツ
ク、スタツクポインタおよびプログラムカウンタ
でサブルーチン制御をなし、前記プログラムカウ
ンタの出力で前記インストラクシヨンメモリをア
ドレスし、さらに同アドレスのメモリ内容を制御
部へ入力して全体の制御をなす制御回路に、コー
ル命令でクリアされ、一方、リターン命令でカウ
ント動作を行うカウンタを付加してなり、前記カ
ウンタの計数値が所定値に達したとき、前記プロ
グラムカウンタに一定のアドレスをロードするこ
とを特徴とする制御回路。
1 comprises an instruction memory, a program counter, a subroutine stack, a stack pointer, and a control section, the subroutine is controlled by the subroutine stack, the stack pointer, and the program counter, and the instruction memory is controlled by the output of the program counter. A counter that is cleared by a call instruction and counts by a return instruction is added to a control circuit that performs overall control by addressing the memory contents at the same address and inputting the memory contents at the same address to the control unit. A control circuit, characterized in that when a count value of reaches a predetermined value, a predetermined address is loaded into the program counter.
JP6939580A 1980-05-23 1980-05-23 Controlling circuit Granted JPS56166555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6939580A JPS56166555A (en) 1980-05-23 1980-05-23 Controlling circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6939580A JPS56166555A (en) 1980-05-23 1980-05-23 Controlling circuit

Publications (2)

Publication Number Publication Date
JPS56166555A JPS56166555A (en) 1981-12-21
JPS6161417B2 true JPS6161417B2 (en) 1986-12-25

Family

ID=13401366

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6939580A Granted JPS56166555A (en) 1980-05-23 1980-05-23 Controlling circuit

Country Status (1)

Country Link
JP (1) JPS56166555A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02306121A (en) * 1989-05-19 1990-12-19 Tokico Ltd mass flow meter

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6363855U (en) * 1986-10-15 1988-04-27

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02306121A (en) * 1989-05-19 1990-12-19 Tokico Ltd mass flow meter

Also Published As

Publication number Publication date
JPS56166555A (en) 1981-12-21

Similar Documents

Publication Publication Date Title
US4945510A (en) Register device
US5987258A (en) Register reservation method for fast context switching in microprocessors
KR101249693B1 (en) Selecting subroutine return mechanisms
US5995752A (en) Use of language instructions and functions across multiple processing sub-environments
JPS6161417B2 (en)
KR100280590B1 (en) Electronic device
JPS6052454B2 (en) control circuit
JPH03278135A (en) Stack tracing device
JPS6136665B2 (en)
JPS644212B2 (en)
JPS61202234A (en) Address control circuit
JP2625272B2 (en) Microcomputer program debugging device
JPH0319574B2 (en)
JP2675506B2 (en) Microprocessor device
WO1990005951A1 (en) Method of handling unintended software interrupt exceptions
JPS6168645A (en) Control system for instruction retrial
JPH01116833A (en) Interruption processing system
JPH05127895A (en) Write protection system for general-purpose register
JPH0610793B2 (en) Program runaway detection method
JPH0410137A (en) Fault backup system
JPS59121678A (en) Controlling method of write/read in/from stack
JPS61160146A (en) Control system of address stack pointer device
JPS6053887B2 (en) information processing system
JPH0290238A (en) High load verification method
JPS63278147A (en) Control system for preventing erroneous use of register