[go: up one dir, main page]

JPS6318222B2 - - Google Patents

Info

Publication number
JPS6318222B2
JPS6318222B2 JP54157566A JP15756679A JPS6318222B2 JP S6318222 B2 JPS6318222 B2 JP S6318222B2 JP 54157566 A JP54157566 A JP 54157566A JP 15756679 A JP15756679 A JP 15756679A JP S6318222 B2 JPS6318222 B2 JP S6318222B2
Authority
JP
Japan
Prior art keywords
instruction
branch
conditions
preset
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.)
Expired
Application number
JP54157566A
Other languages
Japanese (ja)
Other versions
JPS5680747A (en
Inventor
Masao Kako
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 JP15756679A priority Critical patent/JPS5680747A/en
Publication of JPS5680747A publication Critical patent/JPS5680747A/en
Publication of JPS6318222B2 publication Critical patent/JPS6318222B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】 本発明はマイクロプログラム等によつて制御さ
れるプログラム制御装置における条件分岐方式に
関するものであり、特に複数の条件を判定し、そ
の結果にもとづいて、予定された分岐先に分岐す
る条件分岐方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a conditional branching method in a program control device controlled by a microprogram, etc., and in particular, it determines a plurality of conditions, and based on the results, determines a planned branch destination. This relates to a conditional branching method that branches to .

一般にプログラム制御装置における条件分岐命
令は例えば演算の結果の正、負、零やコンデイシ
ヨンコードの状態、割込み原因等により所定の処
理プログラムが起動されるようそれぞれの分岐先
に分岐するものである。このような条件分岐命令
において、複数の条件を判定した結果予定の分岐
先に分岐する場合、従来一般に行なわれている方
式は直列的に各条件を決定していくものであり、
処理時間がかること、また複数の条件判定の間に
先に判定した条件が変化するような状態が起り得
るため必らずしも分岐する時の瞬時における各条
件に適合した分岐先へ分岐することが保証されな
いという問題があつた。
In general, a conditional branch instruction in a program control device is used to branch to each branch destination so that a predetermined processing program is activated depending on, for example, the positive, negative, or zero result of an operation, the state of a condition code, or the cause of an interrupt. . In such a conditional branch instruction, when branching to a planned branch destination after determining multiple conditions, the conventional method is to determine each condition serially.
Since processing time is required, and a situation may occur in which the previously determined condition changes during multiple condition determinations, it is not always possible to branch to a branch destination that matches each condition at the moment of branching. The problem was that it was not guaranteed.

従つて本発明の目的は複数の条件を判定し、そ
の判定結果にもとずいて予定の分岐先に分岐する
場合、簡単な構成で、同時に複数条件を判定し得
るようにし、前述の問題点を解消せんとするもの
である。
Therefore, an object of the present invention is to make it possible to simultaneously determine multiple conditions with a simple configuration when determining multiple conditions and branching to a planned branch destination based on the determination results, thereby solving the aforementioned problems. The aim is to eliminate the

この目的のため、本発明は、プログラムが格納
されたプログラムメモリと、該プログラムメモリ
より読出された命令を格納する命令レジスタと、 該命令レジスタに読出された命令が条件分岐命
令である時、命令外からの複数の条件に基づいて
分岐先アドレスの少なくとも一部を修飾して、予
定の分岐先アドレスに分岐すべく、分岐先アドレ
スが設定される分岐先アドレスレジスタと、を備
えたプログラム制御装置であつて、 前記条件分岐命令中に、前記複数の条件のうち
少なくとも一部を成立したと見做すプリセツト情
報と、前記複数の条件のうち少なくとも一部を成
立しなかつたものと見做すマスク情報が格納され
ているとともに、前記条件分岐命令中のプリセツ
ト情報に基づいて前記複数の条件をプリセツトす
るプリセツト手段と、前記条件分岐命令中のマス
ク情報に基づいて前記複数の条件をマスクするマ
スク手段を備え、前記プログラムメモリより前記
命令レジスタに読出された命令が、条件分岐命令
であつた場合、前記プリセツト手段と、前記マス
ク手段により定められた条件に従つて分岐先アド
レスを決定し、前記分岐先アドレスレジスタに設
定することを特徴としている。
To this end, the present invention provides a program memory storing a program, an instruction register storing an instruction read from the program memory, and a conditional branch instruction when the instruction read to the instruction register is a conditional branch instruction. A program control device comprising a branch destination address register in which a branch destination address is set in order to modify at least a part of the branch destination address based on a plurality of external conditions and branch to a planned branch destination address. and the conditional branch instruction includes preset information that indicates that at least some of the plurality of conditions are deemed to have been met, and preset information that indicates that at least some of the plurality of conditions are deemed to have not been met. preset means storing mask information and presetting the plurality of conditions based on preset information in the conditional branch instruction; and a mask masking the plurality of conditions based on the mask information in the conditional branch instruction. means for determining a branch destination address according to conditions determined by the presetting means and the masking means when the instruction read from the program memory to the instruction register is a conditional branch instruction; The feature is that it is set in the branch destination address register.

以下図面を参照しつつ本発明を詳細に説明す
る。第1図は従来の条件分岐方式を説明するため
のフローチヤート、第2図は本発明による条件分
岐方式を説明するためのフローチヤート、第3図
は本発明の一実施例を示す図である。
The present invention will be described in detail below with reference to the drawings. FIG. 1 is a flowchart for explaining a conventional conditional branching method, FIG. 2 is a flowchart for explaining a conditional branching method according to the present invention, and FIG. 3 is a diagram showing an embodiment of the present invention. .

複数の条件例えばA、B、C、Dの“1”、
“0”を判定してその結果予定の分岐先に分岐す
る分岐命令の場合従来行なわれている方式は第1
図フローチヤートに示されるように、まず条件A
を判定し、次に条件Bを判定し、更に条件Cを判
定し、最後に条件Dを判定してその結果により予
定の分岐先に分岐するものである。このように直
列的に複数の条件を判定していくため処理的時間
が大になること、また全条件を判定し終るまでの
間先に判定した条件が変化してしまうことがあり
得るため、必らずしもある瞬間での全条件に適合
する分岐先に分岐できる保証がないという問題が
ある。
Multiple conditions, e.g. “1” for A, B, C, D,
In the case of a branch instruction that judges “0” and branches to the planned branch destination, the conventional method is the first method.
As shown in the flowchart, first, condition A
, then condition B is determined, condition C is further determined, and finally condition D is determined, and based on the results, the process branches to the planned branch destination. Because multiple conditions are determined in series in this way, the processing time increases, and the previously determined conditions may change until all conditions have been determined. There is a problem in that there is no guarantee that a branch can be made to a branch destination that meets all the conditions at a certain moment.

第2図は本発明の分岐方式を説明するためのフ
ローチヤートでありA、B、C、Dの4条件を同
時に判定し、それぞれ判定結果の組合せにより予
定の分岐先に分岐するものである。このような同
時判定により前述の従来方式の欠点は全て解消さ
れることとなる。
FIG. 2 is a flowchart for explaining the branching method of the present invention, in which four conditions A, B, C, and D are simultaneously determined, and a branch is made to a scheduled branch destination depending on the combination of the respective determination results. Such simultaneous determination eliminates all the drawbacks of the conventional method described above.

第3図は本発明の分岐方式を実施する一実施例
であり、図中1は命令カウンタ、2は+1回路、
3はプログラムメモリ、4は命令レジスタ、5は
分岐アドレスレジスタ、6はプリセツト手段であ
るオアゲート回路、7はマスク手段であるアンド
ゲート回路、8は種々の条件群を選択するための
マルチプレクサ回路である。
FIG. 3 shows an embodiment of the branching method of the present invention, in which 1 is an instruction counter, 2 is a +1 circuit,
3 is a program memory, 4 is an instruction register, 5 is a branch address register, 6 is an OR gate circuit which is a preset means, 7 is an AND gate circuit which is a mask means, and 8 is a multiplexer circuit for selecting various condition groups. .

通常シーケンシヤルに処理が進められる場合は
よく知られているように命令カウンタ1と+1回
路2により次々とプログラムメモリ3のアドレス
を更新して順次プログラムメモリから命令を読み
出して実行する。条件分岐命令が読み出される
と、条件判定の結果予定された分岐先に分岐する
わけであるが、この分岐命令は一般には命令中
に、指定された条件が満たされたときに分岐すべ
き分岐アドレスが格納されており、これが分岐ア
ドレスレジスタ5から命令カウンタ1に送られて
予定のアドレスに分岐するようにされている。命
令レジスタ4のJADDがこの分岐先アドレス領域
である。PSは本発明により使用されるプリセツ
ト指定領域、MSは同様に本発明により使用され
るマスク指定領域、Sは条件選択指定領域、Jは
分岐命令指定領域である。本発明の条件分岐は以
下のようにして行なわれる。
When processing normally proceeds sequentially, as is well known, the address of the program memory 3 is updated one after another by the instruction counter 1 and the +1 circuit 2, and instructions are sequentially read from the program memory and executed. When a conditional branch instruction is read, it branches to the planned branch destination as a result of the condition judgment, but this branch instruction is generally used during the instruction to specify the branch address to which the branch should be taken when the specified condition is met. is stored, and this is sent from the branch address register 5 to the instruction counter 1 so as to cause a branch to a predetermined address. JADD of instruction register 4 is this branch destination address area. PS is a preset designation area used by the present invention, MS is a mask designation area also used by the invention, S is a condition selection designation area, and J is a branch instruction designation area. Conditional branching according to the present invention is performed as follows.

すなわち、分岐先アドレス領域は例えば12ビツ
ト構成であり、F、0、3(16進)で与えられて
おり、例えばA、B、C、Dの4条件を判定し、
その結果分岐アドレスの一部16進0で与えられて
いる4ビツトを修飾して予定の分岐先に分岐する
ものである。A〜Dの4条件は条件選択指定領域
Sの指定によりマルチプレクサ回路8で選択され
る。ここでは簡単のためにA、B、C、Dの
“1”“0”の状態に従つて分岐アドレスを修飾す
る例を説明する。今、選択された4条件A〜Dが
A=0、B=0、C=1、D=1である場合を考
える。
That is, the branch destination address area has, for example, a 12-bit configuration, and is given as F, 0, and 3 (hexadecimal), and the four conditions, for example, A, B, C, and D are judged,
As a result, part of the branch address is modified with 4 bits given by hexadecimal 0, and the branch is branched to the planned branch destination. The four conditions A to D are selected by the multiplexer circuit 8 according to the specification of the condition selection specification area S. Here, for the sake of simplicity, an example will be described in which branch addresses are modified according to the "1" and "0" states of A, B, C, and D. Now, consider the case where the four selected conditions A to D are A=0, B=0, C=1, and D=1.

プリセツト指定領域PSはオール“0”で、マ
スク領域MSはオール“1”とされており何らの
指定もされていないと仮定すると、マスク手段で
あるアンドゲート回路7ではすべてマスクされず
条件A〜Dはそのまま出力される。またプリセツ
ト手段であるオアゲート回路6でもプリセツトが
なく条件A〜Dはそのまま出力されるため、分岐
アドレスレジスタの4ビツトには0、0、1、1
が入力されF、3、3(16進)が分岐アドレスと
なり命令カウンタ1に格納され、分岐先アドレス
の命令が実行されることとなる。
Assuming that the preset designated area PS is all "0" and the masked area MS is all "1" and no designation is made, the AND gate circuit 7 which is the masking means will not mask all of them, and conditions A~ D is output as is. Also, since there is no preset in the OR gate circuit 6 which is the presetting means and conditions A to D are output as they are, the 4 bits of the branch address register contain 0, 0, 1, 1.
is input, F, 3, 3 (hexadecimal) becomes a branch address and is stored in instruction counter 1, and the instruction at the branch destination address is executed.

ここでプリセツト手段6、マスク手段7の機能
について説明する。プリセツト手段6はプリセツ
ト指定領域PSに任意の条件について指示をする
ことにより該条件を“1”にプリセツトするため
のものであり、例えば前述の条件A=0、B=
0、C=1、D=1の時にAはそのいかんにかか
わらず“1”として扱いたい場合プリセツト指定
領域PSのAに対応するビツトに“1”を指定し
ておけば、プリセツト手段であるオアゲート回路
6でAの状態によらず常に条件Aのビツトは
“1”が出力されるものである。従つてこの場合
最終的には“1011”が分岐アドレスレジスタ5に
入力される。
Here, the functions of the preset means 6 and the mask means 7 will be explained. The preset means 6 is for presetting an arbitrary condition to "1" by instructing the preset designation area PS about the condition. For example, the above-mentioned condition A=0, B=
If you want to treat A as ``1'' regardless of whether 0, C=1, or D=1, specify ``1'' in the bit corresponding to A in the preset specification area PS, and you can use it as a preset means. The OR gate circuit 6 always outputs "1" for the bit under condition A, regardless of the state of A. Therefore, in this case, "1011" is finally input to the branch address register 5.

またマスク手段7はマスク指定領域MSに任意
の条件について指示することにより該条件をマス
クするものである。例えば前述の条件でDはその
いかんにかかわらずマスクしたい場合、マスク指
定領域MSのDに対応するビツトに“0”を指定
しておけば、マスク手段であるアンドゲート回路
7でDの状態によらず常に条件Dのビツトは
“0”が出力される。従つてこの場合はプリセツ
トが指定されていなければ分岐アドレスレジスタ
5には“0010”が入力され、また前述のようなプ
リセツトが合わせて指定されていれば分岐アドレ
スレジスタ5には“1010”が入力されることとな
る。
Further, the masking means 7 masks an arbitrary condition by instructing the mask designation area MS about the condition. For example, if you want to mask D regardless of the above conditions, if you specify "0" to the bit corresponding to D in the mask designation area MS, the AND gate circuit 7 that is the masking means will change to the state of D. The bit of condition D is always output as "0" regardless of the condition. Therefore, in this case, if no preset is specified, "0010" is input to the branch address register 5, and if the above-mentioned preset is also specified, "1010" is input to the branch address register 5. It will be done.

なお分岐命令指定Jは分岐命令では必らず指定
されておりこの指定によりゲート信号Gが発せら
れ図示してはいないが、第3図の分岐実行に必要
な各回路や分岐アドレスを命令カウンタ1に入力
するためのゲートを能動化するものである。
Note that the branch instruction specification J is always specified in a branch instruction, and this specification causes a gate signal G to be issued. This activates the gate for input to.

このようにプリセツト手段6、マスク手段7、
により単に複数の条件の判定結果により分岐する
だけでなく、任意の条件を選択してマスク、プリ
セツトすることが可能である。
In this way, the preset means 6, the mask means 7,
This allows not only branching based on the judgment results of a plurality of conditions, but also masking and presetting by selecting arbitrary conditions.

以上説明したように本発明によれば、複数の条
件を同時に判定し、その結果にもとづいてそれぞ
れ予定された分岐先に分岐するものであるから、
処理時間が短かく、また直列的に複数の条件を判
定していく従来方式でみられる判定処理中の条件
の変化の影響を受けることがないという利点を有
し、また条件判定のために用いられる回路手段も
周知のマルチプレクサ、アンド回路、オア回路等
で簡単に構成できるものであり、極めて有効な分
岐方式を提供できるものである。
As explained above, according to the present invention, a plurality of conditions are determined at the same time, and based on the results, each branch is branched to a scheduled branch destination.
It has the advantage of short processing time and is not affected by changes in conditions during the judgment process, which is the case with conventional methods that judge multiple conditions in series. The circuit means used can be easily constructed using well-known multiplexers, AND circuits, OR circuits, etc., and can provide an extremely effective branching system.

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

第1図は従来の条件分岐方式を説明するための
フローチヤート、第2図は本発明による条件分岐
方式を説明するためのフローチヤート、第3図は
本発明の一実施例を示す図である。 図中1は命令カウンタ、2は+1回路、3はプ
ログラムメモリ、4は命令レジスタ、5は分岐ア
ドレスレジスタ、6はプリセツト手段であるオア
ゲート回路、7はマスク手段であるアンドゲート
回路、8は種々の条件群を選択するためのマルチ
プレクサ回路である。
FIG. 1 is a flowchart for explaining a conventional conditional branching method, FIG. 2 is a flowchart for explaining a conditional branching method according to the present invention, and FIG. 3 is a diagram showing an embodiment of the present invention. . In the figure, 1 is an instruction counter, 2 is a +1 circuit, 3 is a program memory, 4 is an instruction register, 5 is a branch address register, 6 is an OR gate circuit which is a preset means, 7 is an AND gate circuit which is a mask means, and 8 is various types. This is a multiplexer circuit for selecting a group of conditions.

Claims (1)

【特許請求の範囲】 1 プログラムが格納されたプログラムメモリ
と、該プログラムメモリより読出された命令を格
納する命令レジスタと、 該命令レジスタに読出された命令が条件分岐命
令である時、命令外からの複数の条件に基づいて
分岐先アドレスの少なくとも一部を修飾して、予
定の分岐先アドレスに分岐すべく、分岐先アドレ
スが設定される分岐先アドレスレジスタと、 を備えたプログラム制御装置であつて、 前記条件分岐命令中に、前記複数の条件のうち
少なくとも一部を成立したと見做すプリセツト情
報と、前記複数の条件のうち少なくとも一部を成
立しなかつたものと見做すマスク情報が格納され
ているとともに、 前記条件分岐命令中のプリセツト情報に基づい
て前記複数の条件をプリセツトするプリセツト手
段と、 前記条件分岐命令中のマスク情報に基づいて前
記複数の条件をマスクするマスク手段を備え、 前記プログラムメモリより前記命令レジスタに
読出された命令が、条件分岐命令であつた場合、
前記プリセツト手段と、前記マスク手段により定
められた条件に従つて分岐先アドレスを決定し、
前記分岐先アドレスレジスタに設定することを特
徴とするプログラム制御装置における条件分岐方
式。
[Scope of Claims] 1. A program memory in which a program is stored, an instruction register for storing instructions read from the program memory, and when the instruction read into the instruction register is a conditional branch instruction, an instruction from outside the instruction is provided. A program control device comprising: a branch destination address register in which a branch destination address is set; and, in the conditional branch instruction, preset information that assumes that at least some of the plurality of conditions are satisfied, and mask information that assumes that at least some of the plurality of conditions are not satisfied. are stored, and preset means for presetting the plurality of conditions based on preset information in the conditional branch instruction; and masking means for masking the plurality of conditions based on mask information in the conditional branch instruction. If the instruction read from the program memory to the instruction register is a conditional branch instruction,
determining a branch destination address according to conditions determined by the preset means and the mask means;
A conditional branch method in a program control device, characterized in that the branch destination address register is set.
JP15756679A 1979-12-05 1979-12-05 Conditional branching system of program controlling device Granted JPS5680747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15756679A JPS5680747A (en) 1979-12-05 1979-12-05 Conditional branching system of program controlling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15756679A JPS5680747A (en) 1979-12-05 1979-12-05 Conditional branching system of program controlling device

Publications (2)

Publication Number Publication Date
JPS5680747A JPS5680747A (en) 1981-07-02
JPS6318222B2 true JPS6318222B2 (en) 1988-04-18

Family

ID=15652475

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15756679A Granted JPS5680747A (en) 1979-12-05 1979-12-05 Conditional branching system of program controlling device

Country Status (1)

Country Link
JP (1) JPS5680747A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4754393A (en) * 1984-12-21 1988-06-28 Advanced Micro Devices, Inc. Single-chip programmable controller
JPS61195428A (en) * 1985-02-26 1986-08-29 Fujitsu Ltd Multiway restart system
JPH1049368A (en) * 1996-07-30 1998-02-20 Mitsubishi Electric Corp Microporcessor having condition execution instruction

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS49103548A (en) * 1973-02-05 1974-10-01
JPS5412175B2 (en) * 1973-09-25 1979-05-21
JPS51124342A (en) * 1975-04-23 1976-10-29 Toshiba Corp Information processing unit

Also Published As

Publication number Publication date
JPS5680747A (en) 1981-07-02

Similar Documents

Publication Publication Date Title
US5125092A (en) Method and apparatus for providing multiple condition code fields to to allow pipelined instructions contention free access to separate condition codes
US5657484A (en) Method for carrying out a boolean operation between any two bits of any two registers
EP0241001A2 (en) Information processing apparatus having a mask function
JPS6318222B2 (en)
US5124910A (en) Microprogram control apparatus for generating a branch condition signal to be designated by a micro-branch instruction
JPS63142431A (en) Pipeline control system
JP3007923B2 (en) Data transfer method and system
JP2000194556A (en) Instruction look-ahead system and hardware
JPS6148174B2 (en)
US5644745A (en) Apparatus for replacing data availability information for an instruction subsequent to a branch with previous availability information upon branch prediction failure
GB2169118A (en) Digit strobe designation
JPH0381832A (en) Interruption control circuit
JPH01159730A (en) Microprogram control device
JPS62271022A (en) Microprogram controller
JPH06100965B2 (en) Micro program controller
JPS59189407A (en) Sequence control device
JPS6116334A (en) Data processor
JPH03288228A (en) Information processor
SU754420A1 (en) Device for control of retrieval of address of continuation of program
JPS58172753A (en) Microprogram control system
JPH06290044A (en) Sequence control circuit
JPS63106831A (en) Microprocessor system
JPS6373332A (en) Microprogram control system
JPS6120907B2 (en)
JPH0413736B2 (en)