[go: up one dir, main page]

JPH06119263A - Processing function calling system - Google Patents

Processing function calling system

Info

Publication number
JPH06119263A
JPH06119263A JP4266973A JP26697392A JPH06119263A JP H06119263 A JPH06119263 A JP H06119263A JP 4266973 A JP4266973 A JP 4266973A JP 26697392 A JP26697392 A JP 26697392A JP H06119263 A JPH06119263 A JP H06119263A
Authority
JP
Japan
Prior art keywords
function
processing
state
calling
transition table
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.)
Withdrawn
Application number
JP4266973A
Other languages
Japanese (ja)
Inventor
Masao Uchino
雅央 内野
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.)
NEC Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP4266973A priority Critical patent/JPH06119263A/en
Publication of JPH06119263A publication Critical patent/JPH06119263A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

PURPOSE:To provide the processing function calling system in which a program is short and the memory occupancy quantity is small by increasing a processing speed at the time of calling the respective determined functions (programs) in accordance with a state variation in a communication control firmware. CONSTITUTION:The system is provided with a state transition table consisting of a two-dimensional matrix in which a state value 101 and an event number 102 are matrix elements, a retrieving means for retrieving this state transition table and obtaining function pointers 103, 104 and 105, and a function calling means for calling the corresponding functions 106, 107 and 108. In the function pointer in the state transition table, the function pointer the function to be called is stored as an initialized value in advance at the time of compiling. It is unnecessary to repeat a processing of plural steps by using a switch sentence, and a function call can be executed directly by only retrieving the table, therefore, the processing speed is improved, and the program is also shortened.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は処理関数呼出方式に関
し、特に通信制御ファームウェアにおける処理関数呼出
方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processing function calling system, and more particularly to a processing function calling system in communication control firmware.

【0002】[0002]

【従来の技術】従来、通信制御ファームウェア内におけ
る状態変化に対応してそれぞれ決められた処理関数(プ
ログラム)を呼び出す方式としては、例えば、C言語等
の高級言語での実現手段としてswitch文等を使用
し、現在の状態が存在し得る多くの状態の中のどれに該
当するかを判断し、その結果に基づき関数コールを行っ
ていた。
2. Description of the Related Art Conventionally, as a method of calling a processing function (program) determined corresponding to a state change in communication control firmware, for example, a switch statement or the like is used as a means for realizing in a high-level language such as C language. It was used to determine which of the many possible states the current state might be in and make a function call based on the result.

【0003】図3は、従来の処理関数呼出方式の処理手
順を示すフローチャートである。ステップ301は、通
信制御ファームウェア内における現在の状態値を判断す
る処理で、switch文により処理される。ステップ
302は、発生したイベントを判断するための処理であ
り、これもswitch文により処理される。ステップ
303は関数コール文により処理関数を呼び出す処理で
ある。
FIG. 3 is a flow chart showing a processing procedure of a conventional processing function calling method. Step 301 is a process of determining the current state value in the communication control firmware, which is processed by a switch statement. Step 302 is a process for determining the event that has occurred, and this is also processed by the switch statement. Step 303 is processing for calling a processing function by a function call statement.

【0004】現在の状態値をA状態とすると、ステップ
301でswitch文の判断によりA状態の経路を選
定した後、ステップ302において再びswitch文
による判定を行う。この判定により発生したイベントの
番号「0」と一致する経路を判定し、はじめてステップ
303に進み関数をコールすることができる。
Assuming that the current state value is the A state, the route in the A state is selected by the determination of the switch statement in step 301, and then the determination by the switch statement is performed again in step 302. By this determination, it is possible to determine the route that matches the event number "0" that has occurred, and proceed to step 303 for the first time to call the function.

【0005】switch文の処理効率を考えると、s
witch文中に現れるcase文の要素が整数型であ
った場合、又は文字型であってもその文字をコードに置
き換えた場合に、すべてのcase要素が連続した数で
表せるならば、switch文はswitchテーブル
(1次元)を作成することにより処理効率を上げること
が可能であるが、連続した数でないときには一致するま
でcase要素の数だけ判定を繰り返すことになる。
Considering the processing efficiency of the switch statement, s
If all the case elements can be represented by a continuous number when the elements of the case statement appearing in the watch statement are integer types, or even if they are character types and that character is replaced with a code, the switch statement is a switch statement. Although it is possible to improve the processing efficiency by creating a table (one-dimensional), if the numbers are not consecutive, the determination is repeated by the number of case elements until they match.

【0006】[0006]

【発明が解決しようとする課題】上述した従来の処理関
数呼出方式では、ステップ301とステップ302とで
switch文による判断を2回行わなければならず、
処理効率が悪くなってしまう。又、各switch文の
処理においては、通信制御ファームウェア内の状態値や
イベントの数は一般に比較的大きな数となるため、sw
itch文内に現れるcase要素が多くなり処理に時
間がかかる。特に、判定された状態値またはイベントが
case文の終わりの方に記述されていた場合には、そ
のcase文の実行に移るまでに多くの時間がかかって
しまう。従って、比較的発生する回数の多いcase要
素を始めの方に記述するなどの対策を行っているが、デ
ータ通信制御という処理速度を重視する場合には、ca
se要素が多くswitch文の処理に時間がかかるこ
とは大きな問題となっている。
In the above-mentioned conventional processing function calling method, the judgment by the switch statement must be made twice in step 301 and step 302,
The processing efficiency becomes poor. Further, in the processing of each switch statement, the number of state values and events in the communication control firmware are generally relatively large, so sw
Since there are many case elements that appear in the "itch" sentence, the processing takes time. In particular, when the determined state value or event is described near the end of the case statement, it takes a long time to move to execution of the case statement. Therefore, although measures are taken such as describing the case element that occurs relatively frequently in the beginning, if the processing speed of data communication control is important,
It is a big problem that there are many se elements and it takes time to process a switch statement.

【0007】又、switch文の記述が多くなるた
め、処理ステップが多くなり処理時間がかかるほか、プ
ログラムが占有するメモリ量も多くなるという欠点があ
る。
Further, since the description of the switch statement is increased, there are disadvantages that the number of processing steps is increased, the processing time is increased, and the memory amount occupied by the program is increased.

【0008】本発明の目的は、処理速度が速く、プログ
ラムも短くてメモリ占有量も少ない処理関数呼出方式を
提供することにある。
An object of the present invention is to provide a processing function calling system which has a high processing speed, a short program, and a small memory occupation amount.

【0009】[0009]

【課題を解決するための手段】請求項1の処理関数呼出
方式は、通信制御ファームウェア内部の処理の実行状態
を示す状態値と通信制御ファームウェア内部の処理の起
動要因となるイベントとを行列要素とする二次元マトリ
ックスの各要素に処理すべきプログラムの格納場所を示
す関数ポインタを格納した状態遷移テーブルと、前記状
態値およびイベントを指定して前記状態遷移テーブルを
検索し該当する関数ポインタを取得する検索手段と、取
得した関数ポインタで該当するプログラムを呼び出す関
数呼出手段とを備えて構成されている。
According to a first aspect of the present invention, there is provided a processing function calling method in which a matrix element is provided with a state value indicating an execution state of a process inside the communication control firmware and an event which is a factor for starting the process inside the communication control firmware. The state transition table storing the function pointer indicating the storage location of the program to be processed in each element of the two-dimensional matrix, and the state transition table by designating the state value and the event are searched to obtain the corresponding function pointer. It comprises a searching means and a function calling means for calling a corresponding program with the acquired function pointer.

【0010】請求項2の処理関数呼出方式は、請求項1
の各手段に加え前記通信制御ファームウェアの内部にあ
らかじめ定められた条件のとき前記状態遷移テーブルに
設定された関数ポインタを動的に変更する設定変更手段
を備えて構成されている。
According to a second aspect of the present invention, there is provided the processing function calling system according to the first aspect.
In addition to the respective means, the setting control means for dynamically changing the function pointer set in the state transition table under a predetermined condition inside the communication control firmware is configured.

【0011】[0011]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0012】図1は本発明に用いられる状態遷移テーブ
ルの一例を示す説明図である。
FIG. 1 is an explanatory diagram showing an example of a state transition table used in the present invention.

【0013】図1に示す状態遷移テーブルは、状態値1
01とイベント番号102とを行列要素とする二次元マ
トリックスを構成しており、この二次元マトリックス中
の各要素には通信制御ファームウェア内の複数のプログ
ラム(関数)中の1プログラムの格納場所を示す関数ポ
インタ103,104,105が記憶されている。各関
数ポインタ103,104,105に対応する関数10
6,107,108のプログラムは、その状態値にある
時にそのイベントが発生した場合に処理すべき内容が記
述されたものである。なお、状態遷移テーブル内の関数
ポインタには、あらかじめコンパイル時に、コールすべ
き関数の関数ポインタを初期設定値として格納してお
く。
The state transition table shown in FIG.
A two-dimensional matrix having 01 and the event number 102 as matrix elements is configured, and each element in this two-dimensional matrix indicates a storage location of one program in a plurality of programs (functions) in the communication control firmware. Function pointers 103, 104 and 105 are stored. Function 10 corresponding to each function pointer 103, 104, 105
The programs 6, 107, and 108 describe the contents to be processed when the event occurs at the state value. Note that the function pointer of the function to be called is stored as an initial setting value in advance in the function pointer in the state transition table during compilation.

【0014】図2は本発明の一実施例の動作を示すフロ
ーチャートである。ステップ201は、図1の状態遷移
テーブルから関数ポインタを取り出す処理である。この
処理は任意のイベントの発生時に起動される。ステップ
202は、状態遷移テーブルから取り出した関数ポイン
タが示す関数をコールする処理である。
FIG. 2 is a flow chart showing the operation of one embodiment of the present invention. Step 201 is a process of extracting a function pointer from the state transition table of FIG. This process is activated when any event occurs. Step 202 is a process of calling the function indicated by the function pointer extracted from the state transition table.

【0015】次に、本発明の特徴的な動作について具体
的に説明する。いま、状態値101がA状態のとき、イ
ベント番号102が「0」のイベントで起動された場合
を考える。前述したようにステップ201が起動され、
状態遷移テーブルを参照し、状態値101が状態A、イ
ベント番号102が「0」のテーブル内要素から関数ポ
インタ103を取り出してくる。
Next, the characteristic operation of the present invention will be specifically described. Now, let us consider a case where the state value 101 is the A state and the event number 102 is activated by the event of “0”. As described above, step 201 is started,
With reference to the state transition table, the function pointer 103 is fetched from the in-table element having the state value 101 of state A and the event number 102 of "0".

【0016】ここで得られた関数ポインタ103は、前
述したように処理すべき関数の格納場所を示しているの
で、この値を利用してステップ202で関数106をダ
イレクトにコールすることができ、容易に関数106の
実行が可能となる。
Since the function pointer 103 obtained here indicates the storage location of the function to be processed as described above, it is possible to directly call the function 106 in step 202 by using this value. The function 106 can be easily executed.

【0017】同様にして、状態値101がB状態でイベ
ント番号102が「3」のイベントが発生したときには
関数107が、状態値101がF状態でイベント番号1
02が「3」のイベントが発生したときには関数108
の処理が実行される。
Similarly, when the state value 101 is the B state and the event with the event number 102 of "3" occurs, the function 107 outputs the event, and the state value 101 is the F state with the event number 1
When the event in which 02 is “3” occurs, the function 108
The process of is executed.

【0018】上述の説明では、状態遷移テーブルには初
期設定値として関数ポインタが格納されるように述べた
が、同じ状態値で同じイベントが発生しても、処理の経
過に従って複数の処理を選択する必要がある場合や、開
始条件によって処理内容を変更する必要が生じる場合が
ある。このような場合には、あらかじめコンパイル時に
初期値としてセットしておくだけでなく、通信制御ファ
ームウェア自身がその条件を検出し、必要なタイミング
で状態遷移テーブルの関数ポインタを動的に変更してセ
ットし直すように構成することができる。このようにす
ると、開始条件の相違あるいは処理が進むに従って、同
一の状態値およびイベントの組み合わせであっても異な
る処理を実行させるようにすることができる。
In the above description, the function pointer is stored as the initial setting value in the state transition table, but even if the same event occurs with the same state value, a plurality of processes are selected according to the progress of the process. It may be necessary to change the processing content depending on the start condition. In such a case, in addition to setting it as an initial value in advance at compile time, the communication control firmware itself detects the condition and dynamically changes the function pointer of the state transition table at the required timing and sets it. It can be configured to start over. By doing so, it is possible to execute different processes even with the same combination of state value and event as the start conditions differ or the process progresses.

【0019】[0019]

【発明の効果】以上説明したように、本発明の処理関数
呼出方式は、状態遷移テーブル内に関数ポインタをセッ
トしておくことにより、関数ポインタが示す処理関数を
ダイレクトにコールすることができるため、従来までの
方式に比べはるかに処理スピードの向上ができる。
As described above, in the processing function calling method of the present invention, the processing function indicated by the function pointer can be directly called by setting the function pointer in the state transition table. , The processing speed can be improved much more than the conventional method.

【0020】又、プログラムのステップ数が数行で記述
できるため実行オブジェクトがコンパクトにでき、プロ
グラムの占有するメモリが少なくて済む。以上二つの面
で効率の良い処理が実現できるという効果がある。
Since the number of steps of the program can be described in several lines, the execution object can be made compact and the memory occupied by the program can be reduced. There is an effect that efficient processing can be realized in the above two aspects.

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

【図1】本発明に用いられる状態遷移テーブルの説明図
である。
FIG. 1 is an explanatory diagram of a state transition table used in the present invention.

【図2】本発明の一実施例の動作を示すフローチャート
である。
FIG. 2 is a flowchart showing the operation of the embodiment of the present invention.

【図3】従来の処理関数呼出方式の動作を示すフローチ
ャートである。
FIG. 3 is a flowchart showing an operation of a conventional processing function calling method.

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

101 状態値 102 イベント番号 103,104,105 関数ポインタ 106,107,108 関数 101 status value 102 event number 103, 104, 105 function pointer 106, 107, 108 function

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 通信制御ファームウェア内部の処理の実
行状態を示す状態値と通信制御ファームウェア内部の処
理の起動要因となるイベントとを行列要素とする二次元
マトリックスの各要素に処理すべきプログラムの格納場
所を示す関数ポインタを格納した状態遷移テーブルと、
前記状態値およびイベントを指定して前記状態遷移テー
ブルを検索し該当する関数ポインタを取得する検索手段
と、取得した関数ポインタで該当するプログラムを呼び
出す関数呼出手段とを備えたことを特徴とする処理関数
呼出方式。
1. A program to be processed is stored in each element of a two-dimensional matrix having, as matrix elements, a state value indicating an execution state of processing inside the communication control firmware and an event that is a trigger factor of processing inside the communication control firmware. A state transition table that stores a function pointer indicating the location,
A process comprising a search means for searching the state transition table by designating the state value and the event and acquiring a corresponding function pointer, and a function calling means for calling a corresponding program with the acquired function pointer. Function call method.
【請求項2】 前記通信制御ファームウェアの内部にあ
らかじめ定められた条件のとき前記状態遷移テーブルに
設定された関数ポインタを動的に変更する設定変更手段
を備えたことを特徴とする請求項1記載の処理関数呼出
方式。
2. The setting control means for dynamically changing the function pointer set in the state transition table when a predetermined condition is set inside the communication control firmware. Processing function call method of.
JP4266973A 1992-10-06 1992-10-06 Processing function calling system Withdrawn JPH06119263A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4266973A JPH06119263A (en) 1992-10-06 1992-10-06 Processing function calling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4266973A JPH06119263A (en) 1992-10-06 1992-10-06 Processing function calling system

Publications (1)

Publication Number Publication Date
JPH06119263A true JPH06119263A (en) 1994-04-28

Family

ID=17438287

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4266973A Withdrawn JPH06119263A (en) 1992-10-06 1992-10-06 Processing function calling system

Country Status (1)

Country Link
JP (1) JPH06119263A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7542826B2 (en) 2005-02-02 2009-06-02 Denso Corporation Control apparatus for automobile
JP2009176326A (en) * 2009-05-08 2009-08-06 Intec Netcore Inc Calculation apparatus, calculation program, and calculation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7542826B2 (en) 2005-02-02 2009-06-02 Denso Corporation Control apparatus for automobile
JP2009176326A (en) * 2009-05-08 2009-08-06 Intec Netcore Inc Calculation apparatus, calculation program, and calculation method

Similar Documents

Publication Publication Date Title
US4807126A (en) Method for converting a source program having a loop including a control statement into an object program
JPH06119263A (en) Processing function calling system
US20030035582A1 (en) Dynamic scanner
JP2006185380A (en) Character processor with prediction function, method, recording medium and program
JPS6347839A (en) Inference control system
JP3120443B2 (en) Command processing unit
JP3018579B2 (en) Name search processor
JPH04287134A (en) Simplified trace information acquisition system
JPH04241672A (en) Character string retrieving system
JP3021697B2 (en) Exception handling in programming languages
JPS63141131A (en) Pipeline control system
JPH11327887A (en) Compiler system with automatic parts converting function and recording medium
JP2000347878A (en) Method and device for memory reduction
JPH07141156A (en) Information processor and its program combining method
JPH0338745A (en) Data batch processing system
JPH04148366A (en) Learning system for dictionary
JPH0588866A (en) Automatic source code generator
JP2006215623A (en) Computer system and timer control method
JPS6113258B2 (en)
JPH03154931A (en) Alphabetical translation system
JPH05346854A (en) Operation processor
JPH07141195A (en) Literal optimizing system in compiler
JPH09311792A (en) Register allocation method
JPH0540655A (en) Program retrieval system
JPS6190262A (en) Kana-kanji conversion device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20000104