JPS62219126A - Program control system - Google Patents

Program control system

Info

Publication number
JPS62219126A
JPS62219126A JP61060962A JP6096286A JPS62219126A JP S62219126 A JPS62219126 A JP S62219126A JP 61060962 A JP61060962 A JP 61060962A JP 6096286 A JP6096286 A JP 6096286A JP S62219126 A JPS62219126 A JP S62219126A
Authority
JP
Japan
Prior art keywords
program
address
changed
control memory
register
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.)
Pending
Application number
JP61060962A
Other languages
Japanese (ja)
Inventor
Hiroyuki Kaneda
裕之 金田
Toshio Sakurai
利男 櫻井
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP61060962A priority Critical patent/JPS62219126A/en
Publication of JPS62219126A publication Critical patent/JPS62219126A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To easily debug while a program is compared by eliminating the need for changing and correcting the program which comes to be an origin at the time of a part of the program is changed, and selecting whether or not the changed program is effective, only by setting a flag. CONSTITUTION:A program counter 2 outputs the address of a control memory 1 storing a program step to branch to the changed program stored in an address register 3. Then, a comparator 5 generates a coincident output. When the flag output of a flag register 4 to show that the changed program is effective exists, the special address of the control memory 1 to store the head address of the program changed from the program counter 2 by the coincident output is outputted. By executing such a control, the changed program is successively executed in which the address stored in the special address of the control memory is a head address.

Description

【発明の詳細な説明】 〔概 要〕 制御メモリに記憶されているプログラムをプログラムカ
ウンタからのアドレスによって逐次読出して処理を実行
するプログラム逐次実行方式の処理装置において、変更
されたプログラムの先頭アドレスを上記制御メモリの特
定のアドレスに格納し、プログラムカウンタからのアド
レスがこの変更されたプログラムに分岐すべきアドレス
と一致したときにこの変更されたプログラムが有効であ
れば上記制御メモリの特定のアドレスを上記プログラム
カウンタに設定するようにした。
[Detailed Description of the Invention] [Summary] In a processing device using a program sequential execution method in which a program stored in a control memory is sequentially read out and executed according to an address from a program counter, the starting address of a changed program is Store at a specific address in the above control memory and if this modified program is valid when the address from the program counter matches the address that should branch to this modified program. The above program counter is now set.

〔産業上の利用分野〕[Industrial application field]

プログラムの1ステツプを処理するごとに1つづつ加算
されるプログラムカウンタにより1旨定されるアドレス
により制御メモリからプログラムを逐次読出して処理を
実行するプログラム逐次処理方式において、特にプログ
ラムカウンタなどの際に有効なプログラム制御装置を提
供するものである。
In the program sequential processing method in which the program is sequentially read from the control memory and executed at an address determined by a program counter that is incremented by one each time one step of the program is processed, especially when the program counter is It provides an effective program control device.

〔従来の技術〕[Conventional technology]

プログラム逐次実行方式の情報処理装置においては、そ
の処理すべきプログラムが一次元配置の制御メモリ上に
置かれるため、プログラムの一部を変更する際に変更前
のプログラムより長いプログラムを使用しようとすると
大きな記憶領域を必要とするばかりでなく、後続するプ
ログラムのアドレスを変更する必要が生じて分岐命令の
行先アドレスなどの本来修正を要しないステップについ
ても修正を必要とするなどの欠点があった。
In an information processing device that uses program sequential execution, the program to be processed is stored in a one-dimensional control memory, so if you try to use a longer program than the original program when changing part of the program, Not only does it require a large storage area, but it also requires modification of steps that do not originally require modification, such as the destination address of a branch instruction, as it becomes necessary to change the address of the subsequent program.

また、この欠点を除く一つの方法として、更新すべきプ
ログラムを制御メモリ内の空き領域に書き込み、この更
新されたプログラムのアドレスを行先とした命令を元の
プログラムに書込んでおくことによりプログラムを分岐
させることが行なわれていたが、変更前のプログラムを
再度実行する必要がある場合には元のプログラムに戻す
ためのプログラムが必要になる。
Also, one way to eliminate this drawback is to write the program to be updated into a free area in the control memory, and write an instruction with the address of this updated program as the destination in the original program. Branching has been done, but if it is necessary to re-execute the program before the change, a program is needed to return to the original program.

更に、これらのプログラムがリードオンリメモリ (以
下、ROM、という)上にある場合にはそのままでは修
正が不可能なためにこのROMの内容を一部ランダムア
クセスメモリ (以下、RAM、という)に移してデバ
ッグを行なっていたが、プログラム制御をROMからR
AMに切換える手段が必要であった。
Furthermore, if these programs are on read-only memory (hereinafter referred to as ROM), it is impossible to modify them as they are, so some of the contents of this ROM are moved to random access memory (hereinafter referred to as RAM). I was debugging the program from ROM to R.
A means to switch to AM was required.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

本発明は上記のような従来技術の欠点を除去し、変更さ
れたプログラムへの分岐およびこの変更されたプログラ
ムを使用せずに元のプログラムへ復帰することを容易に
したプログラム制御装置を得ようとするものである。
The present invention eliminates the drawbacks of the prior art as described above and provides a program control device that facilitates branching to a modified program and returning to the original program without using this modified program. That is.

〔問題点を解決するための手段〕[Means for solving problems]

第1図の原理図に示すように変更されたプログラムの先
頭アドレスを制御メモリ (1)の特定のアドレスにス
トアしておくとともに、更新されたプログラムが有効で
あることを示すフラグをストアするフラグレジスタ(4
)、および元のプログラム中の変更されたプログラムの
先頭アドレスをストアするアドレスレジスタ(3)と、
プログラムカウンタ(2)からのアドレスと上記アドレ
スレジスタからのアドレスとを比較する比較器(5)と
、この比較器により上記両アドレスの一致が検出された
ときに上記フラグが存在することを條件として上記プロ
グラムカウンタ(2)に変更されたプログラムの先頭ア
ドレスをストアしている上記制御メモリ (1)の特定
アドレスを設定するようにした。
As shown in the principle diagram in Figure 1, the start address of the changed program is stored at a specific address in the control memory (1), and a flag is stored that indicates that the updated program is valid. Register (4
), and an address register (3) for storing the start address of the changed program in the original program;
A comparator (5) that compares the address from the program counter (2) with the address from the address register, and the condition that the flag exists when the comparator detects a match between the two addresses. The program counter (2) is set to a specific address in the control memory (1) that stores the start address of the changed program.

〔作 用〕[For production]

プログラムカウンタ(2)がアドレスレジスタ(3)に
記憶されている変更されたプログラムへ分岐するプログ
ラムステップを格納している制御メモリ (1)のアド
レスを出力すると、比較器(5)は一致出力を発生し、
この変更されたプログ゛ ラムが有効であることを示す
フラグレジスタ(4)のフラグ出力が存在していれば、
上記一致出力によってプログラムカウンタ(2)から変
更されたプログラムの先頭番地をストアしている制御メ
モリ (1)の特定アドレスを出力するように設定する
ようにした。
When the program counter (2) outputs the address of the control memory (1) containing the program step that branches to the modified program stored in the address register (3), the comparator (5) outputs a match. occurs,
If there is a flag output from the flag register (4) indicating that this modified program is valid,
The program counter (2) is set to output a specific address in the control memory (1) that stores the starting address of the program changed by the matching output.

このような制御を行なうことによって、制御メモリの特
定番地にストアされているアドレスを先頭アドレスとす
る、変更されたプログラムが逐次実行される。
By performing such control, the modified program is sequentially executed with the address stored at a specific address in the control memory as the start address.

また、フラグレジスタ(4)のフラグを、変更されたプ
ログラムが無効であることを示すようにセットすること
によって、元のプログラムによる処理を行なわせること
ができる。
Further, by setting the flag in the flag register (4) to indicate that the changed program is invalid, it is possible to cause the original program to perform processing.

なお、複数の変更されたプログラムを使用する場合には
、アドレスレジスタ(3)がこの複数の変更されたプロ
グラムへ分岐する先頭のアドレスを夫々格納し得るよう
にすると共に、比較器(5)ではどの分岐アドレスとプ
ログラムカウンタ(2)からのアドレスとが一致したか
を識別、出力するようにして、この分岐アドレスに応じ
てこの分岐アドレスに対応した変更されたプログラムの
先頭アドレスを格納している制御メモリ (1)のアド
レスを上記プログラムカウンタに設置しておけばよい。
In addition, when using a plurality of modified programs, the address register (3) is made to be able to store the first address of branching to the plurality of modified programs, and the comparator (5) It identifies and outputs which branch address matches the address from the program counter (2), and stores the start address of the changed program corresponding to this branch address in accordance with this branch address. The address of control memory (1) may be set in the program counter.

また、元のプログラムに復帰する必要がある場合には、
変更されたプログラムの最後のステップに元のプログラ
ムの次に実行すべき命令のアドレスを含む分岐命令を付
加しておけばよい。
Also, if you need to return to the original program,
A branch instruction containing the address of the next instruction to be executed in the original program may be added to the last step of the changed program.

〔実施例〕〔Example〕

第2図は本発明の実施例を示すもので、制御メモリ1の
読出しアドレスを指定するプログラムカウンタ2はプロ
グラムを1ステップ読出すごとにプログラム逐次実行制
御回路11によりその計数値が1加算されて制御メモリ
l内のプログラムを逐次読出して処理を実行させる。
FIG. 2 shows an embodiment of the present invention, in which the program counter 2 that specifies the read address of the control memory 1 has its counted value incremented by 1 by the program sequential execution control circuit 11 every time one step of the program is read. The programs in the control memory 1 are sequentially read out and executed.

第3図に示す制御メモリのアドレスマツプにおいて、プ
ログラムAは元のプログラムであってアドレス$000
0から$1000の記憶領域に記憶されているものとし
、通常は上記のプログラムカウンタ2からのアドレスに
より$0000から$1000まで逐次読出し実行され
る。
In the control memory address map shown in FIG. 3, program A is the original program at address $000.
It is assumed that the data is stored in a storage area from $0 to $1000, and normally read out sequentially from $0000 to $1000 according to the address from the program counter 2 mentioned above.

制御メモリ中のプログラムAのアドレス$0A00ない
し$0AFFの領域に格納されているプログラムステッ
プXを変更する場合には、制御メモリの空き領域に変更
されたプログラムX′を格納し、この図ではその格納領
域を$EOOOないし$EFFFとして示しである。
When changing the program step X stored in the area of address $0A00 to $0AFF of program A in the control memory, the changed program The storage area is shown as $EOOO to $EFFF.

同時にアドレスレジスタ3には、この変更されたプログ
ラムX′へ分岐するプログラムAの変更領域Xの先頭ア
ドレス$0AOOをストアし、アドレス$FFFOには
変更されたプログラムX′の先頭アドレス$E000へ
の分岐命令をストアしておく。
At the same time, the address register 3 stores the start address $0AOO of the changed area X of program A that branches to this changed program X', and the address $FFFO stores the start address $E000 of the changed program X'. Store branch instructions.

今プログラムカウンタ2からのアドレスがアドレスレジ
スタ3がストアしているアドレス$0A00と一致する
と比較器5は一致出力を生じ、フラグレスシタ4にこの
変更されたプログラムX′が有効であることを示すフラ
グがセットされていると、アンドゲート12はプログラ
ム逐次実行制御回路11に出力を供給してプログラムカ
ウンタ2が$FFFOのアドレス出力を送出するように
設定する。
When the address from the program counter 2 now matches the address $0A00 stored in the address register 3, the comparator 5 produces a match output, and a flag is set in the flagless register 4 indicating that this modified program X' is valid. When set, the AND gate 12 supplies an output to the program sequential execution control circuit 11 and sets the program counter 2 to send out the address output of $FFFO.

これにより、制御メモリからは変更されたプログラムX
′の先頭アドレス$EO00への分岐命令が読出され、
プログラムカウンタ2は以後このプログラムのステップ
を読出すごとに+1されるのでこの変更されたプログラ
ムX′による処理が実行される。
As a result, the modified program X is stored in the control memory.
A branch instruction to the start address $EO00 of ' is read,
Since the program counter 2 is subsequently incremented by 1 each time a step of this program is read, processing according to this modified program X' is executed.

この変更されたプログラムX′の最後のステップである
アドレス$EFFFにアドレス$0BOOへの分岐命令
を書込んでおけば、プログラムAの変更されたプログラ
ムXの次の命令がこの$0B00のアドレスから読出さ
れ、以後は再びプログラムAが実行されるのでプログラ
ムAの一部Xを変更されたプログラムX′によって置換
えた処理が実行されることになる。
If a branch instruction to address $0BOO is written to address $EFFF, which is the last step of this modified program Since the program A is read out and thereafter executed again, a process is executed in which part X of the program A is replaced by the modified program X'.

上記の動作において、フラグレジスタ4のフラグがこの
変更されたプログラムX′が無効であることを示すよう
にセットされていればアンドゲート12は出力を生ぜず
、したがってプログラムカウンタ2はプログラム逐次実
行制御回路11による+1加算によって$ 0AFFか
ら$0BOOのアドレスを出力し、プログラムAは変更
されないまま実行される。
In the above operation, if the flag in flag register 4 is set to indicate that this modified program The +1 addition by the circuit 11 outputs the address from $0AFF to $0BOO, and program A is executed without being changed.

若し、この制御メモリの$0EOOないし$0EOQな
いし$0EFFに格納されているプログラムYも変更す
るのならば、この変更されたプログラムY′を例えば$
DOOOないし$DOFFに格納するとともに$FFF
1に$DOOOへの分岐命令を格納し、アドレスレジス
タ3、フラグレジスタ4、比較器5およびアンドゲート
12に相当するアドレスレジスタ31、フラグレジスタ
41、比較器51およびアンドゲート13からなる装置
を設け、このアンドゲート13の出力によってプログラ
ム逐次実行制御回路11がプログラムカウンタ(2)か
らアドレス$FFF1を出力するように制御させれば、
プログラムXとX′との置換えについて説明したと同様
にプログラムAの一部変更を行なうことができる。
If you also want to change the program Y stored in $0EOO, $0EOQ, and $0EFF of this control memory, you can change this changed program Y' to, for example, $0EOO to $0EOQ to $0EFF.
Store in DOOO or $DOFF and $FFF
1 stores a branch instruction to $DOOO, and is provided with a device consisting of an address register 31, a flag register 41, a comparator 51, and an AND gate 13, which correspond to an address register 3, a flag register 4, a comparator 5, and an AND gate 12. , if the program sequential execution control circuit 11 is controlled to output the address $FFF1 from the program counter (2) by the output of the AND gate 13, then
Part of program A can be changed in the same way as described for the replacement of programs X and X'.

また、プログラムXとX′、およびプログラムYとY′
の置換えのいずれか一方のみを行なうのであれば、変更
されたプログラムの先頭アドレスをストアする制御メモ
リ2のアドレス$FFFOの分岐先アドレスのみを$E
O00と$DO00とに書換えればよく、これは変更さ
れた命令がいくつあっても同様なことは明らかであろう
Also, programs X and X', and programs Y and Y'
If only one of the replacements is to be performed, only the branch destination address of the address $FFFO in control memory 2 that stores the start address of the changed program is replaced with $E.
It is only necessary to rewrite them to O00 and $DO00, and it is clear that this is the same no matter how many instructions are changed.

〔発明の効果〕〔Effect of the invention〕

プログラムの一部変更を行なう場合に元になるプログラ
ムを変更・修正する必要がな(、また、その変更したプ
ログラムを有効とするか否かをフラグの設定のみで選択
し得るので、プログラムを比較しながらデバッグするこ
とが容易である。
When making a partial change to a program, there is no need to change or modify the original program (also, you can select whether or not to make the changed program valid just by setting a flag, so you can compare programs. It is easy to debug while doing so.

また、複数の変更されたプログラムを選択して実行させ
ることも上記フラグの設定あるいは分岐先アドレスの書
換えにより可能であるので、その利用範囲は著しく大き
い。
Further, since it is possible to select and execute a plurality of changed programs by setting the above-mentioned flags or rewriting the branch destination address, the scope of its use is extremely wide.

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

第1図は本発明の原理図、第2図は本発明の実施例、第
3図は制御メモリのメモリマツプの一例を示す。 ■・・・制御メモリ、2・・・プログラムカウンタ、3
・・・アドレスレジスタ、4・・・フラグレジスタ、5
・・・比較器、6・・・プログラムカウンタのセント手
段である。
FIG. 1 shows a principle of the present invention, FIG. 2 shows an embodiment of the invention, and FIG. 3 shows an example of a memory map of a control memory. ■...Control memory, 2...Program counter, 3
...Address register, 4...Flag register, 5
. . . Comparator, 6 . . . Program counter cent means.

Claims (1)

【特許請求の範囲】 制御メモリ(1)からプログラムカウンタ(2)により
指示されたアドレスによって命令を逐次読出して実行す
るプログラム制御装置において、変更されたプログラム
の先頭アドレスをストアするアドレスレジスタ(3)と
、 変更されたプログラムが有効であるか否かを示すフラグ
をストアするフラグレジスタ(4)と、上記プログラム
カウンタ(2)からのアドレスと上記アドレスレジスタ
(3)からのアドレスとを比較する比較器(5)と、 この比較器の一致出力によって変更されたプログラムの
先頭番地がストアされている制御メモリ(1)のアドレ
スを上記プログラムカウンタ(2)にセットする手段(
6)とを備えることを特徴とするプログラム制御装置。
[Claims] In a program control device that sequentially reads and executes instructions from a control memory (1) according to an address indicated by a program counter (2), an address register (3) stores the start address of a changed program. and a flag register (4) that stores a flag indicating whether the modified program is valid or not, and a comparison that compares the address from the program counter (2) with the address from the address register (3). means (5) for setting the program counter (2) to the address of the control memory (1) in which the starting address of the program changed by the matching output of the comparator is stored;
6) A program control device comprising:
JP61060962A 1986-03-20 1986-03-20 Program control system Pending JPS62219126A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61060962A JPS62219126A (en) 1986-03-20 1986-03-20 Program control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61060962A JPS62219126A (en) 1986-03-20 1986-03-20 Program control system

Publications (1)

Publication Number Publication Date
JPS62219126A true JPS62219126A (en) 1987-09-26

Family

ID=13157540

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61060962A Pending JPS62219126A (en) 1986-03-20 1986-03-20 Program control system

Country Status (1)

Country Link
JP (1) JPS62219126A (en)

Similar Documents

Publication Publication Date Title
JP2685245B2 (en) Programmable controller
JPS62219126A (en) Program control system
JPH05297911A (en) Sequence control circuit for sequence controller
JPH082727Y2 (en) Programmable sequencer
JPH03288906A (en) Instruction executing system for pc
JPS588011B2 (en) Microprogram Seigiyohoshiki
JPS62254237A (en) Inter-printer type branch instruction executing system
JPH0261724A (en) Program correcting system
JPH0423147A (en) Bank switching system
JPS60126731A (en) Program control method
JPH0695868A (en) Software management system
JPS62271003A (en) Programmable controller
JPS61213928A (en) Alteration system for program
JPS62196745A (en) Register writing system
JPS6041133A (en) Correcting method of control program
JPH04205144A (en) Microprocessor
JPS63217433A (en) Control system for execution of program
JPS63276629A (en) Sorting system for record in file
JPS6346858B2 (en)
JPH01250143A (en) Program correction system
JPH0883188A (en) Multitask processing computer
JPH0359727A (en) Saving/restoring system in microprocessor
JPH0480841A (en) File updating system
JPH04138534A (en) Debugging system for program
JPH0844570A (en) System and method for program execution