JPH012138A - Underflow processing method - Google Patents

Underflow processing method

Info

Publication number
JPH012138A
JPH012138A JP62-157208A JP15720887A JPH012138A JP H012138 A JPH012138 A JP H012138A JP 15720887 A JP15720887 A JP 15720887A JP H012138 A JPH012138 A JP H012138A
Authority
JP
Japan
Prior art keywords
underflow
mode
processing
program
check
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
JP62-157208A
Other languages
Japanese (ja)
Other versions
JPS642138A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP62157208A priority Critical patent/JPS642138A/en
Priority claimed from JP62157208A external-priority patent/JPS642138A/en
Publication of JPH012138A publication Critical patent/JPH012138A/en
Publication of JPS642138A publication Critical patent/JPS642138A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は計算機内の演算処理過程において生じるアン
ダフローに対する処理を行なうアンダフロー処理方式に
関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an underflow processing method for processing underflow that occurs during arithmetic processing within a computer.

〔従来の技術〕[Conventional technology]

第2図は従来のアンダフロー処理方式の動作を説明する
ためのフローチャートである。アンダフローとは、指数
下位けたあふれをいい、表現(記憶)することができる
最小桁の量よりも小さいある量が計算の結果として得ら
れた場合に生ずる状態であり、浮動小数点数の場合には
表現することができない大きな負の指数はこの下位桁あ
ぶれを生ずる。図において、1は演算処理などに必要な
情報を格納するメインメモリを示し、このメインメモリ
1にはユーザの要求に対する処理を行なうタメノユーザ
プログラム1aと、プログラムの実行制御や入出力制御
などを行なうオペレーティングシステム1dとが設けら
れている。ユーザプログラムla内のlb、lcは連続
する実行文を示す。また、2は所定の演算などを行なう
中央処理装置(CPU機構)を示し、2aはこの中央処
理装置2の演算処理機構を示す。
FIG. 2 is a flowchart for explaining the operation of the conventional underflow processing method. Underflow refers to overflow of the lower digits of an exponent, and is a condition that occurs when a certain amount smaller than the minimum digit that can be represented (memorized) is obtained as a result of calculation, and in the case of floating point numbers. A large negative exponent that cannot be expressed will cause this lower digit confusion. In the figure, 1 indicates a main memory that stores information necessary for arithmetic processing, etc. This main memory 1 contains a Tameno user program 1a that performs processing in response to user requests, as well as program execution control, input/output control, etc. An operating system 1d is provided. lb and lc in the user program la indicate consecutive executable statements. Further, 2 indicates a central processing unit (CPU mechanism) that performs predetermined calculations, etc., and 2a indicates an arithmetic processing mechanism of this central processing unit 2.

次に動作について説明する。ユーザプログラム1aの各
実行文1b、lcを順次中央処理装置2において処理し
ていくとする。実行文1bの内容r c = a / 
b Jを中央処理装置2により処理する場合、まずra
/bJの処理が中央処理装置2内部の演算処理機構2a
により実行される。その実行結果がアンダフロー、つま
り計算機内のデータ表現では表現できない小さい値とな
った場合、ユーザプログラム1aをチェックするプログ
ラムチェック処理に移り、メインメモリla側のオペレ
ーティングシステム1dに制御を渡し、プログラムチェ
ック処理ルーチンを起動させ、ユーザプログラム1aを
異常終了させるプログラム停止処理を行なう。
Next, the operation will be explained. It is assumed that each executable statement 1b, lc of the user program 1a is sequentially processed by the central processing unit 2. Contents of executable statement 1b r c = a /
b When processing J by the central processing unit 2, first ra
/bJ processing is performed by the arithmetic processing mechanism 2a inside the central processing unit 2.
Executed by If the execution result is an underflow, that is, a small value that cannot be represented by the data representation in the computer, the process moves to a program check process that checks the user program 1a, passes control to the operating system 1d on the main memory la side, and performs a program check. A processing routine is activated and a program stop process is performed to abnormally terminate the user program 1a.

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

ところが、このような従来のアンダフロー処理方式では
上述したようにアンダフローが生じてプログラムが停止
すると、停止後のプログラムの再実行ができないので、
アンデフロー後の処理結果が得られなかった。このため
、プログラマはアンダフローが発生しないように演算前
に遂時演算データをチェックする点に留意しながらプロ
グラムを作成しなければならず、これによりプログラム
の開発時の大きな負担となり、また、このようなチェッ
クロジックをプログラム作成時に入れ゛ることでプログ
ラムの生産性を低下させるという問題点があった。
However, in such conventional underflow processing methods, when an underflow occurs and the program stops as described above, the program cannot be re-executed after the stop.
No processing results were obtained after undefflow. For this reason, the programmer must create a program while paying attention to checking the final calculation data before the calculation to prevent underflow from occurring, which places a heavy burden on program development. There was a problem in that the productivity of the program was reduced by including such check logic when creating the program.

この発明は上記のような問題点を解消するためになされ
たもので、演算処理の結果、アンダフローが発生しても
プログラムチェック処理とせずに処理を続行可能とし、
これによりプログラム開発時のプログラマの負担を軽減
し、プログラムの生産性の向上を図れるアンダフロー処
理方式を提供することを目的とする。
This invention was made to solve the above-mentioned problems, and even if an underflow occurs as a result of arithmetic processing, it is possible to continue processing without performing program check processing.
The purpose of this invention is to provide an underflow processing method that can reduce the burden on programmers during program development and improve program productivity.

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

この発明に係るアンダフロー処理方式は、計算機内の演
算処理過程においてアンダフローが生じると、計算機か
らの指定モードがそのアンダフローを回避して継続処理
する第1モードであるか、プログラム1aのチェックの
ために停止処理する第2モードであるかを判定しくアン
ダフロー処理機構2bの処理S2)、第1モードである
と判定すると演算結果に所定の最小値をセットしくアン
ダフロー処理機構2bの処理S3)、アンダフローを回
避してアンダフローが生じた直後の処理を継続処理し、
第2モードであると判定するとプログラムチェック処理
ルーチンを起動させプログラム1aを停止させることを
特徴とするものである。
In the underflow processing method according to the present invention, when an underflow occurs in the arithmetic processing process in the computer, the program 1a checks whether the specified mode from the computer is the first mode that avoids the underflow and continues processing. The process S2) of the underflow processing mechanism 2b determines whether the mode is the second mode in which the stop processing is performed, and if it is determined that the mode is the first mode, the process of the underflow processing mechanism 2b sets a predetermined minimum value to the calculation result. S3), avoiding the underflow and continuing the processing immediately after the underflow occurs;
If it is determined that the second mode is selected, a program check processing routine is started and the program 1a is stopped.

〔作用〕[Effect]

プログラム1aが順次実行され、演算処理が行なわれ、
アンダフローが生じると、指定モードが第1モードであ
るか第2モードであるかが判定され、第1モードである
とき最小値が演算結果にセットされ、これによりアンダ
フローが回避される。
The program 1a is executed sequentially, arithmetic processing is performed,
When an underflow occurs, it is determined whether the designated mode is the first mode or the second mode, and when the designated mode is the first mode, the minimum value is set as the calculation result, thereby avoiding the underflow.

したがってアンダフローが生じた直後の処理が継続処理
される。また、第2モードであるときプログラムチェッ
ク処理ルーチンが起動され、プログラム1aが停止する
Therefore, the processing immediately after the underflow occurs is continued. Further, in the second mode, a program check processing routine is activated and the program 1a is stopped.

〔発明の実施例〕[Embodiments of the invention]

以下、この発明の一実施例を図面に基づいて説明する。 Hereinafter, one embodiment of the present invention will be described based on the drawings.

第1図はこの発明の実施例に係るアンダフロー処理方弐
を説明するためのフローチャートである。第1図におい
て、第2図に示す構成要素に対応するものには同一の参
照符を付し、その説明を省略する。第1図において、2
bは中央処理装置2内に設けられたアンダフロー処理機
構を示し、この処理機構2bの処理S1はアンダフロー
であるか否かを判定する処理、処理S2は指定モードは
何かを判定する処理、処理S3は演算結果に最小値をセ
ットする処理を示す。
FIG. 1 is a flowchart for explaining the second underflow processing method according to the embodiment of the present invention. In FIG. 1, components corresponding to those shown in FIG. 2 are given the same reference numerals, and their explanations will be omitted. In Figure 1, 2
b indicates an underflow processing mechanism provided in the central processing unit 2, processing S1 of this processing mechanism 2b is a process for determining whether or not there is an underflow, and process S2 is a process for determining what the designated mode is. , Process S3 indicates a process of setting a minimum value to the calculation result.

次に動作について説明する。まず、予めユーザにより計
算機の処理システムの生成時にアンダフロー発生時の第
1モード又は第2モードの指定が行なわれる。これらの
モード指定は、システム生成時に任意に可能である。第
1モードとはアンダフローを回避して継続処理を行なう
モードをいい、第2モードとはプログラムのチェックの
ために停止処理を行なうモードをいう。これらの第1.
第2モード情報は中央処理装置2に記憶され、演算毎に
参照が可能である。このようにモードが指定された状態
で、ユーザプログラム1aが順次中央処理装置2におい
て処理されている時に、ユーザプログラム1aの実行文
1bの内容r c = a / b Jが中央処理袋W
2内部の演算処理機構2aにより実行され、その結果が
アンダフロー処理機構2bに与えられる(ステップNl
)。アンダフロー処理機構2bでは処理S1により上記
結果にアンダフローが生じているか否かを判定し、生じ
ていないときはユーザプログラム1aの実行文ICの内
容rWRITE (CI Jに戻って処理を継続する(
ステップN2)。
Next, the operation will be explained. First, the user specifies in advance the first mode or the second mode when an underflow occurs when a computer processing system is generated. These modes can be specified arbitrarily at the time of system generation. The first mode refers to a mode in which underflow is avoided and continuation processing is performed, and the second mode refers to a mode in which stop processing is performed to check the program. The first of these.
The second mode information is stored in the central processing unit 2 and can be referenced for each calculation. With the mode specified in this way, when the user program 1a is sequentially processed in the central processing unit 2, the content r c = a / b J of the executable statement 1b of the user program 1a is stored in the central processing bag W.
2, and the result is given to the underflow processing mechanism 2b (step Nl).
). The underflow processing mechanism 2b determines whether an underflow has occurred in the above result in process S1, and if no underflow has occurred, the content of the executable statement IC of the user program 1a rWRITE (returns to CI J and continues the process)
Step N2).

もし、アンダフローが生じたときは処理S1から処理S
2に移り (ステップN3)、システムで指定されたモ
ードが継続処理を示す第1モードであるか停止処理を示
す第2モードであるかを判定し、第1モードであると判
定すると(ステップN4)、処理S3で演算結果に所定
の最小値(c = O)をセントし、アンダフローを回
避してアンダフローが生じた直後の処理、すなわちユー
ザプログラムlaの実行文ICの処理を継続処理する(
ステップN5)。また、処理S2において第2モードで
あると判定すると(ステップN6)、処理S2からオペ
レーティングシステム1dの制御に移り、プログラムチ
ェック処理ルーチンが起動され従来方式と同様にプログ
ラムチェック処理が行なわれ、ユーザプログラム1aを
停止させるプログラム停止処理を行なう(ステップN7
)。
If an underflow occurs, from process S1 to process S
2 (Step N3), it is determined whether the mode specified by the system is the first mode indicating continued processing or the second mode indicating stop processing, and if it is determined to be the first mode (Step N4 ), a predetermined minimum value (c = O) is added to the calculation result in step S3, and the underflow is avoided and the processing immediately after the underflow occurs, that is, the processing of the executable statement IC of the user program la is continued. (
Step N5). Further, if it is determined that the second mode is selected in the process S2 (step N6), the process moves from process S2 to the control of the operating system 1d, a program check process routine is started, a program check process is performed in the same way as in the conventional system, and the user program 1a is executed (step N7).
).

なお、上記実施例では除算におけるアンダフローの場合
を示したが、その他、乗算や指数などの関数演算であっ
てもよく、この場合も同様の効果を奏する。また、上記
実施例ではアンダフロー処理を中央処理装置により行な
ったが、オペレーティングシステムのプログラムチェッ
ク処理ルーチンにより行なってもよい。
Note that although the above embodiment shows the case of underflow in division, other functional operations such as multiplication and exponents may be used, and the same effect can be achieved in this case as well. Further, in the above embodiment, the underflow processing is performed by the central processing unit, but it may be performed by the program check processing routine of the operating system.

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

以上のように本発明によれば、演算処理過程においてア
ンダフローが生じると、継続処理する第1モードである
か、停止処理する第2モードであるかを判定し、第1モ
ードであると判定すると演算結果に所定の最小値をセッ
トしアンダフローを回避してアンダフローが生じた直後
の処理を継続処理し、第2モードであると判定するとプ
ログラムチェック処理ルーチンを起動させプログラムを
停止させるようにしたので、プログラム実行中にアンダ
フローを生じた場合に必要に応じて¥a続処理または停
止処理を選択することができ、これにより継続処理を指
定した場合にはアンダフローを意識せずにプログラムを
作成でき、したがってプログラムはプログラム開発時の
負担が軽減され、プログラムの生産性の向上を図ること
ができるという効果が得られる。
As described above, according to the present invention, when an underflow occurs in the arithmetic processing process, it is determined whether the mode is the first mode for continuing processing or the second mode for stopping processing, and it is determined that the mode is the first mode. Then, a predetermined minimum value is set for the calculation result to avoid underflow and continue processing immediately after the underflow occurs, and when it is determined that the second mode is selected, a program check processing routine is started and the program is stopped. As a result, if an underflow occurs during program execution, you can select ¥a continuation processing or stop processing as necessary, and this allows you to select continuation processing or stop processing without being aware of the underflow. It is possible to create a program, thereby reducing the burden during program development and improving the productivity of the program.

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

第1図はこの発明の一実施例に係るアンダフロー処理方
式の動作を説明するためのフローチャート、第2図は従
来のアンダフロー処理方式の動作を説明するためのフロ
ーチャートである。 1a・・・・・・ユーザプログラム、2b・・・・・・
アンダフロー処理機構。 代理人  大君 増雄(ほか2名) 高1図
FIG. 1 is a flowchart for explaining the operation of an underflow processing method according to an embodiment of the present invention, and FIG. 2 is a flowchart for explaining the operation of a conventional underflow processing method. 1a...User program, 2b...
Underflow processing mechanism. Agent Masuo Ookimi (and 2 others) 1st year high school student

Claims (1)

【特許請求の範囲】[Claims] 計算機内の演算処理過程においてアンダフローが生じる
と、計算機からの指定モードがそのアンダフローを回避
して継続処理する第1モードであるか、プログラムのチ
ェックのために停止処理する第2モードであるかを判定
し、第1モードであると判定すると演算結果に所定の最
小値をセットし、アンダフローを回避してアンダフロー
が生じた直後の処理を継続処理し、第2モードであると
判定するとプログラムチェック処理ルーチンを起動させ
プログラムを停止させることを特徴とするアンダフロー
処理方式。
When an underflow occurs in the arithmetic processing process within the computer, the mode specified by the computer is the first mode, which avoids the underflow and continues processing, or the second mode, which halts the program to check the program. If it is determined that the mode is the first mode, a predetermined minimum value is set in the calculation result, the underflow is avoided and the process immediately after the underflow is continued, and the mode is determined to be the second mode. Then, the underflow processing method starts a program check processing routine and stops the program.
JP62157208A 1987-06-24 1987-06-24 Underflow processing system Pending JPS642138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62157208A JPS642138A (en) 1987-06-24 1987-06-24 Underflow processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62157208A JPS642138A (en) 1987-06-24 1987-06-24 Underflow processing system

Publications (2)

Publication Number Publication Date
JPH012138A true JPH012138A (en) 1989-01-06
JPS642138A JPS642138A (en) 1989-01-06

Family

ID=15644570

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62157208A Pending JPS642138A (en) 1987-06-24 1987-06-24 Underflow processing system

Country Status (1)

Country Link
JP (1) JPS642138A (en)

Similar Documents

Publication Publication Date Title
US4879676A (en) Method and apparatus for precise floating point exceptions
JPS5960652A (en) Data processing device
JPH0792739B2 (en) Floating point data normalization method
US6216222B1 (en) Handling exceptions in a pipelined data processing apparatus
JPH0769783B2 (en) Exception handling method
JP2633475B2 (en) Selective save method and system
JPS58182754A (en) arithmetic processing unit
JPS63279328A (en) Control system for guest execution of virtual computer system
CN109683984A (en) Data hot loading method and device, electronic equipment and computer readable storage medium
JP3114909B2 (en) Calculation error processing method of programmable controller
JPS63111535A (en) Data processor
JP2562838B2 (en) Processor and store buffer control method
JPS5839347A (en) Processor
JPS60142747A (en) Instruction execution control system
JPS6149695B2 (en)
JPS623345A (en) Interruption system
JP3168663B2 (en) Information processing device
JPH04106652A (en) Exceptional treatment system
JP2591211B2 (en) High-speed interrupt processing device
JPS5922147A (en) Checking system of retrial processing
JP2000035875A (en) Method and device for expanding dynamic range of register
JP3110072B2 (en) Pre-normalization circuit
JPS5913060B2 (en) Main storage storage capacity detection method
JPH0133856B2 (en)
JPH076038A (en) Information processing equipment