JP2977951B2 - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JP2977951B2
JP2977951B2 JP3146143A JP14614391A JP2977951B2 JP 2977951 B2 JP2977951 B2 JP 2977951B2 JP 3146143 A JP3146143 A JP 3146143A JP 14614391 A JP14614391 A JP 14614391A JP 2977951 B2 JP2977951 B2 JP 2977951B2
Authority
JP
Japan
Prior art keywords
instruction
skip
operand
satisfied
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 - Lifetime
Application number
JP3146143A
Other languages
Japanese (ja)
Other versions
JPH04369727A (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.)
Efu Efu Shii Kk
Fuji Electric Co Ltd
Original Assignee
Efu Efu Shii Kk
Fuji Electric 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 Efu Efu Shii Kk, Fuji Electric Co Ltd filed Critical Efu Efu Shii Kk
Priority to JP3146143A priority Critical patent/JP2977951B2/en
Publication of JPH04369727A publication Critical patent/JPH04369727A/en
Application granted granted Critical
Publication of JP2977951B2 publication Critical patent/JP2977951B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、命令のオペランドで指
定されるビット条件に基づいて特定の命令間の処理をス
キップする命令を有する演算装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic unit having an instruction for skipping processing between specific instructions based on a bit condition specified by an operand of the instruction.

【0002】[0002]

【従来の技術】従来、スキップ命令とスキップEND命
令とを有し、スキップ命令のオペランドで指定される特
定のビット条件が成立しないときには、次のアドレスの
命令を実行し、ビット条件が成立したときには、スキッ
プEND命令の次のアドレスの命令を実行する演算装置
がある。
2. Description of the Related Art Conventionally, a skip instruction and a skip END instruction are provided. When a specific bit condition specified by an operand of the skip instruction is not satisfied, an instruction at the next address is executed. , There is an arithmetic unit that executes the instruction at the address next to the skip END instruction.

【0003】この種の演算装置では、プログラムの実行
時に、スキップ命令のビット条件が成立した場合には、
プログラムの格納領域にあるスキップ命令以降の命令を
1命令づつ検索し、検索した命令がスキップEND命令
でなければ何も処理を実行せず次の命令を検索し、スキ
ップEND命令を検出したなら、その次の命令から処理
を実行するようになっている。
In this type of arithmetic device, when a bit condition of a skip instruction is satisfied during execution of a program,
If the instruction after the skip instruction in the program storage area is searched one instruction at a time, and if the searched instruction is not the skip END instruction, no processing is executed and the next instruction is searched, and if the skip END instruction is detected, The processing is executed from the next instruction.

【0004】[0004]

【発明が解決しようとする課題】上述した従来の演算装
置では、スキップ命令のオペランドで指定されるビット
条件が成立し、スキップEND命令に進む場合に、プロ
グラム格納領域にあるスキップ命令以降の命令を1命令
づつ検索していくので、処理に時間がかかるという問題
点があった。
In the above-described conventional arithmetic device, when the bit condition specified by the operand of the skip instruction is satisfied and the process proceeds to the skip END instruction, the instructions following the skip instruction in the program storage area are deleted. There is a problem that the processing is time-consuming because the search is performed one instruction at a time.

【0005】本発明の目的は、スキップ命令などの処理
時間を短縮することである。
An object of the present invention is to reduce the processing time of a skip instruction or the like.

【0006】[0006]

【課題を解決するための手段】図1は、本発明の原理説
明図である。オペランドで指定されるビット条件が成立
したとき又は成立しないとき、特定の命令間の処理をス
キップする命令を有する演算装置において、命令検出手
段1は、格納されたプログラムを検索して特定命令とこ
の特定命令の終了を示す命令とを検出する。
FIG. 1 is a diagram illustrating the principle of the present invention. When the bit condition specified by the operand is satisfied or not satisfied, in an arithmetic device having an instruction for skipping processing between specific instructions, the instruction detecting means 1 searches a stored program for a specific instruction.
And an instruction indicating the end of the specific instruction .

【0007】算出手段2は、上記命令検出手段1で検出
された特定命令とこの特定命令の終了を示す命令との
のステップ数を算出する。設定手段3は、算出手段2で
算出されたステップ数を、ビット条件が設定されている
命令のオペランドに設定する。
The calculating means 2 calculates the number of steps between the specific instruction detected by the instruction detecting means 1 and an instruction indicating the end of the specific instruction . The setting unit 3 sets the number of steps calculated by the calculating unit 2 as an operand of an instruction for which a bit condition is set.

【0008】これにより、例えばスキップ命令とスキッ
プEND命令とを有する演算装置では、スキップ命令の
オペランドにスキップEND命令までのステップ数が書
き込まれる。
Thus, for example, in an arithmetic unit having a skip instruction and a skip END instruction, the number of steps up to the skip END instruction is written in the operand of the skip instruction.

【0009】[0009]

【作用】上記のようにして演算装置のプログラム格納領
域に格納されているプログラムを実行する場合に、例え
ばスキップ命令の実行時にビット条件が成立したときに
は、プログラムカウンタにスキップ命令のオペランドで
指定されるステップ数が加算される。
When a program stored in the program storage area of the arithmetic unit is executed as described above, for example, when a bit condition is satisfied at the time of execution of a skip instruction, the program counter is designated by the operand of the skip instruction. The number of steps is added.

【0010】これにより、スキップ命令の次のアドレス
として直接スキップEND命令のアドレスが指定される
ので、従来のようにスキップ命令とスキップEND命令
との間の命令を1命令づつ取り出してスキップEND命
令を検索する必要がなくなり、処理時間を大幅に短縮す
ることができる。
As a result, the address of the skip END instruction is directly specified as the next address of the skip instruction. Therefore, the instructions between the skip instruction and the skip END instruction are fetched one by one and the skip END instruction is extracted as in the related art. There is no need to search, and the processing time can be greatly reduced.

【0011】[0011]

【実施例】以下、本発明の実施例を図面を参照しながら
説明する。この実施例は、各種の電子機器のシーケンシ
ャル制御に利用されるプログラマブルコントローラに関
するものである。
Embodiments of the present invention will be described below with reference to the drawings. This embodiment relates to a programmable controller used for sequential control of various electronic devices.

【0012】図2は、プログラマブルコントローラ上で
のユーザプログラムの表示の一例を示す図である。同図
において、B0、B1等は、I/O装置のシンボルを示
している。
FIG. 2 is a diagram showing an example of a display of the user program on the programmable controller. In the figure, B0, B1, etc. indicate symbols of the I / O device.

【0013】ここで、スキップ命令(SKIP)とスキ
ップEND命令(SEND)とを含むプログラムを、プ
ログラマブルコントローラのプログラム格納領域に格納
する場合の処理を説明する。
Here, a process for storing a program including a skip instruction (SKIP) and a skip END instruction (SEND) in a program storage area of a programmable controller will be described.

【0014】図3は、プログラマブルコントローラのプ
ログラム格納領域に格納される制御内部命令を示してお
り、同図(a) は従来の制御内部命令、同図(b) は本発明
の制御内部命令を示している。
FIG. 3 shows control internal instructions stored in the program storage area of the programmable controller. FIG. 3 (a) shows conventional control internal instructions, and FIG. 3 (b) shows control internal instructions of the present invention. Is shown.

【0015】従来は、スキップ命令は、1つのオペラン
ドしか持っておらず、そのオペランドには、ユーザが設
定するビット条件が記憶される。これに対して、実施例
の演算装置では、スキップ命令は2つのオペランドを有
しており、ビット条件と、スキップ命令とスキップEN
D命令との間の相対アドレス(ステップ数)が記憶され
る。なお、ビット条件はユーザが設定するが、ステップ
数は、後述する処理により演算装置内部で設定される。
Conventionally, a skip instruction has only one operand, and the operand stores a bit condition set by the user. On the other hand, in the arithmetic unit of the embodiment, the skip instruction has two operands, and the bit condition, the skip instruction and the skip EN
The relative address (the number of steps) with the D instruction is stored. The bit condition is set by the user, and the number of steps is set inside the arithmetic unit by the processing described later.

【0016】ここで、スキップ命令のオペランドにステ
ップ数を書き込む処理について図4のフローチャートを
参照して説明する。ユーザが作成したプログラムをプロ
グラム格納領域に格納する段階では、スキップEND命
令がどのアドレスに割り付けられるか分からないので、
スキップ命令には、スキップEND命令との相対ステッ
プ数を格納する領域だけが設けられ、実際のステップ数
は書き込まれない。
Here, the process of writing the number of steps in the operand of the skip instruction will be described with reference to the flowchart of FIG. At the stage of storing the program created by the user in the program storage area, since it is not known to which address the skip END instruction is assigned,
The skip instruction has only an area for storing the relative number of steps with respect to the skip END instruction, and does not write the actual number of steps.

【0017】この状態で、先ず、スキップ命令の格納ア
ドレスを記憶するスキップ命令アドレス記憶領域をクリ
アする(図4、S1)。次に、プログラム格納領域の先
頭アドレスをプログラムカウンタにセットする(S
2)。そして、プログラムカウンタの値が最終アドレス
に達したか否かを判別する(S3)。
In this state, first, a skip instruction address storage area for storing the storage address of the skip instruction is cleared (S1, FIG. 4). Next, the start address of the program storage area is set in the program counter (S
2). Then, it is determined whether or not the value of the program counter has reached the final address (S3).

【0018】最終アドレスでなければ、現在のアドレス
の命令を解読してスキップ命令か否かを判別する(S
4)。スキップ命令であれば、ステップ5に進み現在の
アドレスをスキップ命令アドレス記憶領域に書き込む。
その後、ステップ6に進みプログラムカウンタの値をイ
ンクリメントしてステップ3に戻り上述した処理を繰り
返す。
If it is not the last address, the instruction at the current address is decoded to determine whether it is a skip instruction (S
4). If the instruction is a skip instruction, the process proceeds to step 5 and the current address is written in the skip instruction address storage area.
Thereafter, the process proceeds to step 6 where the value of the program counter is incremented, and returns to step 3 to repeat the above-described processing.

【0019】また、ステップ4の判別で解読した命令が
スキップ命令でなければ、次のステップ7で解読した命
令がスキップEND命令か否かを判別する。スキップE
ND命令でなければ、ステップ6に進みプログラムカウ
ンタをインクリメントしてステップ3に戻り上述した処
理を繰り返す。
If it is determined in step 4 that the decoded instruction is not a skip instruction, it is determined in step 7 whether the decoded instruction is a skip END instruction. Skip E
If it is not an ND instruction, the process proceeds to step 6 where the program counter is incremented and returns to step 3 to repeat the above-described processing.

【0020】一方、解読した命令がスキップEND命令
であったときには、スキップ命令アドレス記憶領域に記
憶されているアドレスと現在のアドレスとから両命令間
のステップ数を算出する(S8)。さらに、その算出し
たステップ数(スキップ数)をスキップ命令のオペラン
ドに書き込む(S9)。
On the other hand, if the decoded instruction is a skip END instruction, the number of steps between the two instructions is calculated from the address stored in the skip instruction address storage area and the current address (S8). Further, the calculated step number (skip number) is written to the operand of the skip instruction (S9).

【0021】これらの処理によりプログラム格納領域の
スキップ命令のオペランドには、ビット条件に続いてス
キップEND命令との間のステップ数が設定される。そ
して、プログラムの実行時には、検出された命令がスキ
ップ命令でかつ、ビット条件が成立している場合には、
そのオペランドで指定されるステップ数がプログラムカ
ウンタに加算される。さらに、そのプログラムカウンタ
の値がインクリメントされて、スキップEND命令の次
のアドレスがネクストアドレスとして指示される。すな
わち、スキップ命令のビット条件が成立した場合には、
アドレスを直接スキップEND命令の次のアドレスに進
めることができる。
By these processes, the number of steps between the bit condition and the skip END instruction are set in the operand of the skip instruction in the program storage area. Then, when the program is executed, if the detected instruction is a skip instruction and the bit condition is satisfied,
The number of steps specified by the operand is added to the program counter. Further, the value of the program counter is incremented, and the next address of the skip END instruction is designated as the next address. That is, when the bit condition of the skip instruction is satisfied,
The address can be advanced directly to the next address of the skip END instruction.

【0022】従って、従来のようにスキップEND命令
を検出するまで、命令を1命令づつ検索する必要がない
ので、スキップ命令の処理時間を大幅に短縮できる。ま
た、この場合、スキップ先アドレスは、演算装置内部で
自動的に算出され、条件付分岐命令などのようにラベル
等によりユーザが設定するアドレスではないので、アド
レス変換のテーブル等を設ける必要がない。
Accordingly, since it is not necessary to search for instructions one by one until a skip END instruction is detected as in the prior art, the processing time of the skip instruction can be greatly reduced. Further, in this case, the skip destination address is automatically calculated inside the arithmetic unit, and is not an address set by the user with a label or the like as in a conditional branch instruction, so that there is no need to provide an address conversion table or the like. .

【0023】[0023]

【発明の効果】本発明によれば、ユーザが作成したプロ
グラムが演算装置のプログラム格納領域に格納された
後、例えばスキップ命令のオペランドにスキップ先アド
レスまでのステップ数が書き込まれる。これにより、プ
ログラムの実行時にビット条件が成立したときには、ス
キップ命令の次のアドレスとして、直接スキップEND
命令の次のアドレスを指定することができ、命令の処理
時間を大幅に短縮することができる。
According to the present invention, after the program created by the user is stored in the program storage area of the arithmetic unit, the number of steps up to the skip destination address is written to, for example, the operand of the skip instruction. Thus, when the bit condition is satisfied during the execution of the program, the skip address is directly set as the next address of the skip instruction.
The address next to the instruction can be specified, and the processing time of the instruction can be greatly reduced.

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

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】実施例のプログラムの一例を示す図である。FIG. 2 is a diagram illustrating an example of a program according to an embodiment.

【図3】制御内部命令の説明図である。FIG. 3 is an explanatory diagram of a control internal command.

【図4】実施例のフローチャートである。FIG. 4 is a flowchart of the embodiment.

【符号の説明】[Explanation of symbols]

1 命令検出手段 2 算出手段 3 設定手段 1 instruction detecting means 2 calculating means 3 setting means

フロントページの続き (56)参考文献 特開 昭52−27332(JP,A) 特開 昭62−66332(JP,A) 特開 昭60−160439(JP,A) 特開 昭60−243703(JP,A) 「Cマガジン」,第2巻第1号,日本 ソフトバンク,1990年1月1日,p. 121−122 「Cマガジン」,第1巻第3号,日本 ソフトバンク,1989年12月1日,p. 113−114 「PC−9801 マシン語入門」,株式 会社アスキー,1985年7月15日,p.81 (58)調査した分野(Int.Cl.6,DB名) G06F 9/30 - 9/355 G06F 9/40 - 9/42 Continuation of front page (56) References JP-A-52-27332 (JP, A) JP-A-62-66332 (JP, A) JP-A-60-160439 (JP, A) JP-A-60-243703 (JP, A) , A) "C Magazine", Vol. 2, No. 1, Softbank Japan, January 1, 1990, pp. 121-122, "C Magazine", Vol. 1, No. 3, Softbank Japan, December 1, 1989 113-114 "PC-9801 Introduction to Machine Language", ASCII Corporation, July 15, 1985, p. 81 (58) Fields surveyed (Int.Cl. 6 , DB name) G06F 9/30-9/355 G06F 9/40-9/42

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】命令のオペランドで指定されるビット条件
が成立したとき又は成立しなかったとき、特定の命令間
の処理をスキップする命令を有する演算装置において、 前記演算装置のプログラム格納領域に格納されたプログ
ラムを検索して特定命令と該特定命令の終了を示す命令
を検出する命令検出手段と、 この命令検出手段で検出された特定命令と該特定命令の
終了を示す命令との間のステップ数を算出する算出手段
と、 この算出手段で算出されたステップ数を、前記ビット条
件が設定されている命令のオペランドに設定する設定手
段とを備えることを特徴とする演算装置。
An arithmetic unit having an instruction for skipping processing between specific instructions when a bit condition specified by an operand of an instruction is satisfied or not satisfied, wherein the instruction is stored in a program storage area of the arithmetic device. Instructions for searching for a specified program and indicating the end of the specific instructions
An instruction detecting means for detecting the bets, the specific instruction and said special instruction detected by the instruction detecting means
Calculating means for calculating the number of steps between the instruction indicating the end, and setting means for setting the number of steps calculated by the calculating means to an operand of the instruction in which the bit condition is set. An arithmetic device.
【請求項2】スキップ命令のオペランドで指定されるビ
ット条件が成立したとき又は成立しなかったとき、実行
アドレスをスキップEND命令の次のアドレスに変更す
る命令を有する演算装置において、 前記命令検出手段は、演算装置のプログラム格納領域を
検索してスキップ命令とスキップEND命令とを検出
し、 前記演算手段は、スキップ命令とスキップEND命令間
のステップ数を算出し、 前記設定手段は、前記算出手段で算出されたステップ数
を、スキップ命令のオペランドに設定し、 プログラム実行時にスキップ命令のビット条件が成立し
たとき又は成立しなかったときには、スキップ命令のオ
ペランドで指定されるステップ数をプログラムカウンタ
に加算した値を実行アドレスとすることを特徴とする請
求項1記載の演算装置。
2. An arithmetic unit having an instruction for changing an execution address to an address next to a skip END instruction when a bit condition specified by an operand of a skip instruction is satisfied or not satisfied, Searches a program storage area of an arithmetic device to detect a skip instruction and a skip END instruction, wherein the arithmetic means calculates the number of steps between the skip instruction and the skip END instruction, and wherein the setting means includes: Is set to the operand of the skip instruction, and if the bit condition of the skip instruction is satisfied or not satisfied during program execution, the number of steps specified by the operand of the skip instruction is added to the program counter 2. The arithmetic unit according to claim 1, wherein the calculated value is used as an execution address. .
JP3146143A 1991-06-18 1991-06-18 Arithmetic unit Expired - Lifetime JP2977951B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3146143A JP2977951B2 (en) 1991-06-18 1991-06-18 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3146143A JP2977951B2 (en) 1991-06-18 1991-06-18 Arithmetic unit

Publications (2)

Publication Number Publication Date
JPH04369727A JPH04369727A (en) 1992-12-22
JP2977951B2 true JP2977951B2 (en) 1999-11-15

Family

ID=15401116

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3146143A Expired - Lifetime JP2977951B2 (en) 1991-06-18 1991-06-18 Arithmetic unit

Country Status (1)

Country Link
JP (1) JP2977951B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW530262B (en) 1999-02-08 2003-05-01 Matsushita Electric Ind Co Ltd Control method for procedure execution

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
「Cマガジン」,第1巻第3号,日本ソフトバンク,1989年12月1日,p.113−114
「Cマガジン」,第2巻第1号,日本ソフトバンク,1990年1月1日,p.121−122
「PC−9801 マシン語入門」,株式会社アスキー,1985年7月15日,p.81

Also Published As

Publication number Publication date
JPH04369727A (en) 1992-12-22

Similar Documents

Publication Publication Date Title
JP2977951B2 (en) Arithmetic unit
JP2978260B2 (en) Programming method and apparatus for programmable controller
US5819081A (en) Method of executing a branch instruction of jumping to a subroutine in a pipeline control system
JPH02151908A (en) Numerical controller with simulation function
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JP2887488B2 (en) Multi-process processing equipment
JPS63288357A (en) Data editing system
JPH07200350A (en) Software debugger
JPH06124206A (en) Branching instruction estimation processor and processing method therefor
JPH0540654A (en) Optional instruction tracing system
JP2751423B2 (en) Program debug processing method
JP3414579B2 (en) Programmable controller
JPH10133866A (en) Method for shift conversion processing
JPH04367029A (en) Programming device for programmable controller
JPH08297569A (en) Source program correction supporting device
JP2815270B2 (en) CAD system with dimension line editing function
JP3012618B1 (en) Debugging method of inspected program and its debugging method
JP2745500B2 (en) String search device
JP2003058373A (en) Software tool for supporting program creation
JPH05241913A (en) Automatic abort retrieval processing system
JPS63163543A (en) Information processor
JPH07295814A (en) Data input address management method
JPH05342052A (en) Debugging system
JPH03282635A (en) Break controller and trace controller for prefetch type processor
JPH04332085A (en) Algorithm for retrieving and registering master

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990831