JP2719277B2 - Automatic program analyzer - Google Patents

Automatic program analyzer

Info

Publication number
JP2719277B2
JP2719277B2 JP4209177A JP20917792A JP2719277B2 JP 2719277 B2 JP2719277 B2 JP 2719277B2 JP 4209177 A JP4209177 A JP 4209177A JP 20917792 A JP20917792 A JP 20917792A JP 2719277 B2 JP2719277 B2 JP 2719277B2
Authority
JP
Japan
Prior art keywords
program
flowchart
instruction
converted
expression
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 - Fee Related
Application number
JP4209177A
Other languages
Japanese (ja)
Other versions
JPH0675762A (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.)
Denso Ten Ltd
Original Assignee
Denso Ten 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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP4209177A priority Critical patent/JP2719277B2/en
Publication of JPH0675762A publication Critical patent/JPH0675762A/en
Application granted granted Critical
Publication of JP2719277B2 publication Critical patent/JP2719277B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、アセンブラ言語のプロ
グラムに基づいてフローチャートを作成するプログラム
自動解析装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic program analyzer for creating a flowchart based on an assembler language program.

【0002】[0002]

【従来の技術】従来から、コンピュータ装置の動作は特
定のプログラム言語によって記述し、その動作の解析は
フローチャートなどを作成して行うようにしている。コ
ンピュータ装置の動作は、予め定める規則に従って複数
の命令を実行することの積重ねとして実現されるけれど
も、プログラム全体の理解のためには、一定の範囲の命
令間の関係が図形的に表されている方が判りやすいから
である。特に、コンピュータ装置の機械語にほぼ1対1
に対応しているアセンブラ言語によって記述されたプロ
グラムは、命令のステップ数が多く、ソースプログラム
のみを見ただけでは、プログラムを全体的に解析して内
容を理解することが困難である。プログラムの解析が困
難であると、プログラムが実現しようするアルゴリズム
が正しく表現されているか否かなどの判断が困難とな
り、正確に動作するプログラムを迅速かつ効率的に作成
することが困難となる。特に、大規模なプログラムは複
数のプログラム作成者によって分割されて作成された後
で1つのプログラムとしてまとめられるけれども、その
ようにして作成されたプログラムの検証作業において
は、フローチャートなどを作成して全体的な動作の流れ
を確認することが必要である。またこのようなプログラ
ム作成の準備段階では、いわゆるトップダウン方式で、
全体的なプログラムの流れをフローチャートなどによっ
て表現しておき、それに基づいてプログラム言語を用い
たコード作成を行うことも多い。そのような場合は、完
成したプログラムから作成されるフローチャートと、元
のフローチャートとを比較することによって、プログラ
ムの検証を行うことが容易となる。
2. Description of the Related Art Conventionally, the operation of a computer device is described in a specific program language, and the operation is analyzed by creating a flowchart or the like. Although the operation of the computer device is realized as a stack of executing a plurality of instructions according to a predetermined rule, a relation between a certain range of instructions is represented graphically for understanding the entire program. It is easier to understand. In particular, the machine language of a computer device is almost one-to-one.
A program written in an assembler language that supports the language has a large number of instruction steps, and it is difficult to analyze the program as a whole and understand the contents only by looking at the source program. If it is difficult to analyze a program, it is difficult to determine whether or not an algorithm to be realized by the program is correctly expressed, and it is difficult to quickly and efficiently create a program that operates correctly. In particular, a large-scale program is divided and created by a plurality of program creators and then put together as one program. However, in the verification work of the program created in this way, a flowchart or the like is created and the entire program is created. It is necessary to confirm the general flow of operation. In the preparation stage of such program creation, a so-called top-down method is used.
In many cases, the overall program flow is represented by a flowchart or the like, and a code is created using a programming language based on the flowchart. In such a case, it is easy to verify the program by comparing the flowchart created from the completed program with the original flowchart.

【0003】プログラムの内容把握や、プログラムの検
証のためのフローチャートは、恣意的な判断の入る余地
をなくすため、自動的に作成されることが望ましい。従
来から、FORTRAN、BASICあるいはCなどの
高級言語で記述されたプログラムをフローチャートとし
て表示する装置やプログラムなどは実用化されている。
このような高級言語では、1つの命令が人間の理解が容
易な程度までまとまりがある実行内容を表現する。実際
には、コンパイラやインタプリタなどの翻訳プログラム
が、予め定める規則に従って複数の機械語に翻訳し、実
行時には翻訳された複数の機械語が順次的に実行され
る。このように高級言語では1つの命令である程度まと
まりのある実行内容が表現されるので、個々の命令を単
位として図形的に表現したものを理解することは比較的
容易である。フローチャートとしては、いわゆる流れ図
の他に、PAD図などの表現様式も考えられている。
It is desirable that a flowchart for comprehending the contents of a program and for verifying the program be automatically created in order to eliminate the possibility of arbitrary judgment. 2. Description of the Related Art Conventionally, devices and programs for displaying a program described in a high-level language such as FORTRAN, BASIC or C as a flowchart have been put to practical use.
In such a high-level language, one instruction expresses a coherent execution content to such an extent that human understanding is easy. Actually, a translation program such as a compiler or an interpreter translates into a plurality of machine languages in accordance with a predetermined rule, and at execution, the translated machine languages are sequentially executed. As described above, in a high-level language, a single instruction expresses a coherent execution content to some extent, and it is relatively easy to understand what is expressed graphically in units of individual instructions. As a flowchart, an expression style such as a PAD diagram is considered in addition to a so-called flow chart.

【0004】一方、アセンブラ言語によるプログラムに
おいては、個々の命令は機械語にほぼ対応し、1つのま
とまった動作内容を実現するのに複数の命令を必要とす
る。このため、フローチャートにおいても、1つのまと
まりのある複数の命令群を1つのブロックとしてフロー
チャート上に表現することが好ましい。そのような1ま
とまりのブロックは、たとえば1つのサブルーチンや、
プログラムのジャンプや分岐先となっている命令から次
のジャンプや分岐命令があるまでの範囲として区画する
ことができる。また、本件出願人は、特開平3−519
26号公報で、フラグの変化に着目してブロックを分け
る方法を開示している。
On the other hand, in an assembler language program, each instruction substantially corresponds to a machine language, and a plurality of instructions are required to realize one set of operation contents. For this reason, in the flowchart, it is preferable to express a group of a plurality of instructions as one block in the flowchart. Such a block is, for example, a subroutine or
It can be divided as a range from an instruction that is a jump or branch destination of a program to a next jump or branch instruction. In addition, the applicant of the present application discloses Japanese Patent Application Laid-Open No. 3-519.
No. 26 discloses a method of dividing blocks by focusing on changes in flags.

【0005】[0005]

【発明が解決しようとする課題】従来からのアセンブラ
言語によるプログラムの自動解析装置においては、ブロ
ック化された命令群間の関係をフローチャートによって
表現するようにしている。ブロック内の動作について
は、元のアセンブラ言語による記述のままであるので、
その理解は困難である。
In a conventional automatic analyzer of a program in an assembler language, the relation between a group of instruction groups is represented by a flowchart. Since the operation in the block is still described in the original assembler language,
Its understanding is difficult.

【0006】本発明の目的は、1つのまとまりのある実
行動作を表すプログラムのブロック毎に、アセンブラ言
語による命令を人間が理解しやすい表現となるようにま
とめて表現することができるプログラム自動解析装置を
提供することである。
SUMMARY OF THE INVENTION An object of the present invention is to provide an automatic program analyzing apparatus capable of collectively expressing instructions in an assembler language so as to be easily understood by humans, for each block of a program representing a united execution operation. It is to provide.

【0007】[0007]

【課題を解決するための手段】本発明は、アセンブラ言
語のプログラムをプログラムの動作を表すフローチャー
トとして出力するプログラム自動解析装置において、ア
センブラ言語の各命令を、予め設定されるフローチャー
ト上の表現に変換するとともに、該命令が所定の値を記
憶する処理対象に所定の値を記憶させる処理を行う命令
の場合は、該処理対象名とその記憶内容とをフローチャ
ート上の表現に変換する変換手段と、前記命令により所
定の値を記憶された処理対象の処理対象名が、すでに変
換されているフローチャート上の表現の記憶内容に含ま
れているか否かを判断する判断手段と、該判断手段によ
り処理対象名が含まれていると判断された場合は、すで
に変換されているフローチャート上の表現の記憶内容に
含まれている処理対象名をその処理対象の記憶内容に置
換える処理手段とを含むことを特徴とするプログラム自
動解析装置である。
According to the present invention, there is provided an automatic program analyzing apparatus for outputting a program in an assembler language as a flowchart representing the operation of the program, in which each instruction in the assembler language is converted into an expression in a preset flowchart. And if the instruction is an instruction for performing a process of storing a predetermined value in a processing object that stores a predetermined value, a conversion unit that converts the processing target name and its storage content into an expression on a flowchart, Determining means for determining whether or not the processing target name of the processing target having the predetermined value stored by the instruction is included in the stored contents of the expression on the flowchart which has already been converted; If it is determined that the name is included, the processing included in the stored contents of the expression on the flowchart that has already been converted A program automatic analysis apparatus which comprises a processing means for replacing the elephant name in the storage contents of the processing object.

【0008】[0008]

【作用】本発明に従えば、プログラム自動解析装置は、
変換手段と、判断手段と、処理手段とを含む。変換手段
は、アセンブラ言語の各命令を、予め設定されるフロー
チャート上の表現に変換する。該命令が所定の値を記憶
する処理対象に所定の値を記憶させる処理を行う命令の
場合は、該処理対象名とその記憶内容とをフローチャー
ト上の表現に変換する。その命令によって所定の値を記
憶された処理対象の処理対象名については、すでに変換
されているフローチャート上の表現に含まれているか否
かが判断手段によって判断される。処理対象は、たとえ
ばメモリの特定のアドレスの記憶内容や、特定のレジス
タであり、それぞれ処理対象名によって区別される。処
理対象名がすでに変換されているフローチャート上の表
現に含まれているときには、処理手段はすでに変換され
ているフローチャート上の表現の記憶内容に含まれてい
る処理対象名をその処理対象の記憶内容に置換える。同
一の処理対象に対する命令が置換えられて表現されるの
で、プログラムの実行内容の把握が容易となる。
According to the present invention, the automatic program analysis device comprises:
It includes a conversion unit, a determination unit, and a processing unit. The conversion means converts each instruction of the assembler language into an expression on a flowchart set in advance. If the instruction is an instruction for performing a process of storing a predetermined value in a processing object storing a predetermined value, the processing target name and its storage content are converted into an expression on a flowchart. The determination unit determines whether or not the processing target name for which the predetermined value is stored by the instruction is included in the already converted expression on the flowchart. The processing target is, for example, the storage content of a specific address in a memory or a specific register, and is distinguished by a processing target name. When the processing target name is included in the expression on the converted flowchart, the processing means replaces the processing target name included in the storage content of the expression on the converted flowchart with the storage content of the processing target. Replace with Since instructions for the same processing target are replaced and expressed, it is easy to grasp the execution contents of the program.

【0009】[0009]

【実施例】図1は、本発明の一実施例によるプログラム
自動解析装置の概略的な電気的構成を示す。プログラム
自動解析装置は、ワークステーション1のプログラム動
作によって実現される。ワークステーション1には、磁
気ディスクや磁気テープ装置などの外部記憶装置2が接
続される。ワークステーション1には、通信回線などを
介してホストコンピュータ3も接続可能である。ワーク
ステーション1がプログラムを自動解析した結果は、プ
リンタ4に出力される。プリンタ4としては、レーザビ
ームプリンタ(略称「LBP」)などのページプリンタ
が好適に使用される。
FIG. 1 shows a schematic electrical configuration of an automatic program analyzer according to one embodiment of the present invention. The automatic program analyzer is realized by a program operation of the workstation 1. An external storage device 2 such as a magnetic disk or a magnetic tape device is connected to the workstation 1. A host computer 3 can also be connected to the workstation 1 via a communication line or the like. The result of the workstation 1 automatically analyzing the program is output to the printer 4. As the printer 4, a page printer such as a laser beam printer (abbreviated as "LBP") is preferably used.

【0010】ワークステーション1内には、中央演算処
理装置(以下「CPU」と略称する)5や、メモリ6
や、陰極線管(略称「CRT」)などの表示装置7など
が含まれる。メモリ6には、外部記憶装置2から、プロ
グラム自動解析装置として動作するための制御プログラ
ムが読込まれる。また、アセンブラ言語の各命令毎にフ
ローチャート上の表現を対応づけるルールベースもデー
タとして外部記憶装置2からメモリ6に読込まれる。こ
れによって、メモリ6は、アセンブラ言語の各命令を、
予め設定されるフローチャート上の表現に変換する変換
手段として動作する。処理手段であるCPU5は、外部
記憶装置2またはホストコンピュータ3から供給される
アセンブラ言語のソースプログラムを、予め定めるブロ
ック毎に区分し、各ブロック毎にフローチャート上の表
現に変換し、表示手段7によって表示する。ワークステ
ーション1は、変換されたフローチャートを、プリンタ
4によって印字したり、外部記憶装置2に記憶させたり
することもできる。
In the workstation 1, a central processing unit (hereinafter abbreviated as "CPU") 5 and a memory 6
And a display device 7 such as a cathode ray tube (abbreviated as “CRT”). A control program for operating as an automatic program analyzer is read from the external storage device 2 into the memory 6. Further, a rule base for associating expressions on the flowchart with each instruction of the assembler language is also read from the external storage device 2 to the memory 6 as data. Thereby, the memory 6 stores each instruction of the assembler language,
It operates as a conversion means for converting into an expression on a flowchart set in advance. The CPU 5 serving as a processing unit divides an assembler language source program supplied from the external storage device 2 or the host computer 3 into predetermined blocks, converts each block into an expression on a flowchart, and indicate. The workstation 1 can print the converted flowchart by the printer 4 or store the flowchart in the external storage device 2.

【0011】図2は、図1図示のワークステーション1
によるプログラム自動解析動作を示す。ステップa1で
は、ソースプログラムの先頭からフローチャートへの変
換を開始する。ステップa2では、ソースプログラムが
終了しているか否かが判断される。終了していないとき
はステップa3に移り、ソースプログラムを1つのまと
まりのある命令毎に区分するためのブロックが検出され
る。次にステップa4で、各ブロック内の変換が行わ
れ、ステップa5でフローチャートとして出力され、ス
テップa2に戻って次のソースプログラムに移る。ステ
ップa2でソースプログラムが終了すると判断されると
きには、ステップa6で処理を終了する。
FIG. 2 shows a workstation 1 shown in FIG.
Shows the automatic program analysis operation by In step a1, conversion from the beginning of the source program to a flowchart is started. At step a2, it is determined whether or not the source program has been completed. If the processing has not been completed, the process proceeds to step a3, in which a block for dividing the source program into one set of instructions is detected. Next, in step a4, the conversion within each block is performed, and in step a5, the result is output as a flowchart. If it is determined in step a2 that the source program ends, the process ends in step a6.

【0012】図3は、図2図示のステップa4における
変換動作を示す。ステップb1から処理が開始され、ス
テップb2では変換の対象となる命令を含むソースプロ
グラムの行ポインタpがブロックの最終行に初期化され
る。ステップb3ではポインタpの示すソースプログラ
ム1行分が読込まれる。次のステップb4では、読込ま
れた1行に含まれる命令がフローチャート上の表現に変
換される。
FIG. 3 shows the conversion operation in step a4 shown in FIG. The process starts from step b1, and in step b2, the line pointer p of the source program including the instruction to be converted is initialized to the last line of the block. At step b3, one line of the source program indicated by the pointer p is read. In the next step b4, the instructions contained in the read one line are converted into expressions on the flowchart.

【0013】ステップb5では、変換された命令が合成
可能な命令であるか否かが判断される。合成可能な命令
であると判断されるときには、ステップb6で、オペラ
ンドとして記述されるレジスタやメモリの特定のアドレ
スである処理対象が、すでに変換された表現に使用済み
であるか否かが判断される。使用済みであるときにはス
テップb7で、変換結果をすでに使用されている表現に
合成する。ステップb5で合成可能でないと判断される
とき、またはステップb6で処理対象が使用済みでない
と判断されるときにはステップb8で変換結果がそのま
ま出力される。
At step b5, it is determined whether or not the converted instruction is a synthesizable instruction. If it is determined that the instruction is a synthesizable instruction, it is determined in step b6 whether a processing target that is a specific address of a register or a memory described as an operand is already used in a converted expression. You. If it has been used, in step b7, the conversion result is combined with the already used expression. If it is determined in step b5 that the combination is not possible, or if it is determined in step b6 that the processing target is not used, the conversion result is output as it is in step b8.

【0014】ステップb7またはステップb8が終了す
ると、ステップb9に移り、ポインタpの値が1だけ減
少される。ステップb10では、ポインタpがブロック
の先頭行に達しているか否かが判断される。先頭行に達
していないときにはステップb3に戻り、以下ステップ
b9までの1行毎の変換を繰返す。ステップb10でポ
インタpが先頭行に達すると判断されるときには、ステ
ップb11で処理を終了する。
When step b7 or step b8 is completed, the process proceeds to step b9, where the value of the pointer p is decreased by one. At step b10, it is determined whether or not the pointer p has reached the first line of the block. If the first row has not been reached, the process returns to step b3, and thereafter, the conversion for each row up to step b9 is repeated. If it is determined in step b10 that the pointer p has reached the first line, the process ends in step b11.

【0015】アセンブラ言語によるプログラムは、一般
に命令が記述されている行の順序に従って実行される。
図3図示の動作は、プログラムの実行の順序とは逆の順
序で命令をフローチャート上の表現に変換していること
になる。図4および図5は、このように命令を逆の順序
で変換する過程と、その効果を示す。
A program in assembler language is generally executed in the order of lines in which instructions are described.
In the operation shown in FIG. 3, the instructions are converted into the expressions on the flowchart in the reverse order of the execution order of the program. FIGS. 4 and 5 show the process of converting the instructions in the reverse order and the effect thereof.

【0016】図4は、アセンブラ言語のソースプログラ
ムの一例と、本実施例によって変換されたフローチャー
ト上の表現とを示す。図4(1)は、ある特定のコンピ
ュータについてのアセンブラ言語のソースプログラムの
一例を示す。図4(2)は、図4(1)図示のソースプ
ログラムを本実施例によって変換したフローチャートを
示す。ソースプログラムの各行は、「ラベル 命令 オ
ペランド」または「命令 オペランド」の形式で記述さ
れている。
FIG. 4 shows an example of an assembler language source program and an expression on a flowchart converted by the present embodiment. FIG. 4A shows an example of an assembler language source program for a specific computer. FIG. 4B shows a flowchart obtained by converting the source program shown in FIG. 4A according to the present embodiment. Each line of the source program is described in the form of "label instruction operand" or "instruction operand".

【0017】図4(1)において、空白行を無視すれ
ば、プログラムは第1行〜第15行にわって記述されて
いる。このうち、第1行目の「BNE」および第13行
目の「BGT」は条件分岐命令である。第2行目および
第3行目の「CALL」は、サブルーチン呼出命令であ
る。第4行目および第15行目の「BRA」命令は、無
条件分岐命令である。第5行目〜第12行目までが、分
岐命令間に挟まれて1つのブロック10としてまとめら
れる。第1行目の分岐先「IADC30」は、第3行目
のラベルとして定義されている。第13行目の分岐先
「IADC60」は、第15行目のラベルとして定義さ
れている。第2行目および第3行目のサブルーチン呼出
しの対象「ISKSPS」および「SADWAIT」
は、図4(1)図示のソースプログラム上では定義され
ていない。第4行目および第15行目の分岐先「IAD
CX」も同様に定義されていない。
In FIG. 4A, if a blank line is ignored, the program is described on the first to fifteenth lines. Of these, "BNE" on the first line and "BGT" on the thirteenth line are conditional branch instructions. “CALL” on the second and third lines is a subroutine call instruction. The “BRA” instructions on the fourth and fifteenth lines are unconditional branch instructions. The fifth to twelfth lines are grouped as one block 10 sandwiched between branch instructions. The branch destination “IADC30” in the first row is defined as a label in the third row. The branch destination “IADC60” on the thirteenth line is defined as a label on the fifteenth line. The target "ISKSPS" and "SADWAIT" of the subroutine call on the second and third lines
Is not defined on the source program shown in FIG. In the fourth and fifteenth lines, the branch destination "IAD
"CX" is not similarly defined.

【0018】図4(2)のフローチャート上では、プロ
グラムの先頭に参照記号11が付加される。「p14
3」は、たとえばソースプログラムの第143頁である
ことを示す。第1行目の命令は、判断記号12によって
表現される。第2行目および第3行目のサブルーチン呼
出は、サブルーチン呼出記号13,14によってそれぞ
れ表示される。第1行目の条件成立時の分岐先は3行目
となるので、サブルーチン呼出記号13および14の中
間に分岐する。第4行目は図4(1)図示のソースプロ
グラム外に分岐するので、参照記号15によって表現す
る。「10e」は、次に継続すべきフローチャートが存
在する位置の情報を示す。
In the flowchart of FIG. 4B, a reference symbol 11 is added to the beginning of the program. "P14
"3" indicates, for example, page 143 of the source program. The instruction on the first line is represented by a decision symbol 12. The subroutine calls on the second and third lines are indicated by subroutine call symbols 13 and 14, respectively. Since the branch destination when the condition of the first line is satisfied is the third line, the process branches to the middle of the subroutine call symbols 13 and 14. The fourth line branches out of the source program shown in FIG. “10e” indicates information of a position where a flowchart to be continued next exists.

【0019】図4(1)図示の第5行目には、ラベル
「IADC40」が定義されている。元のソースプログ
ラム中で、このラベルに分岐するプログラムに対応する
部分が、たとえば「10d」で表示されるフローチャー
トの部分に表現されているときは、参照記号16が付さ
れる。ブロック10は、ブロック処理記号17のように
表現される。このブロック処理記号17内の変換につい
ては後述する。図4(1)図示の第13行目について
は、分岐先が定義済みであるので、図4(2)の判断記
号18のように処理される。第14行目は、1つの命令
だけで処理記号19のように表示される。第15行目
は、4行目と同様に、参照記号20を用いて表示され
る。
On the fifth line in FIG. 4A, a label "IADC40" is defined. In the original source program, when a portion corresponding to the program branching to this label is represented in, for example, a portion of a flowchart indicated by “10d”, a reference symbol 16 is added. The block 10 is represented as a block processing symbol 17. The conversion within the block processing symbol 17 will be described later. Since the branch destination is already defined for the 13th line shown in FIG. 4A, the processing is performed as indicated by the judgment symbol 18 in FIG. The 14th line is displayed as a processing symbol 19 with only one instruction. The fifteenth line is displayed using the reference symbol 20 similarly to the fourth line.

【0020】図5は、図4(1)図示のブロック10内
のソースプログラムが、図4(2)内のブロック処理記
号17内のように変換される過程を示す。図5(1)で
は、ブロック内の最終行である第12行目の「CMP」
命令が変換されて、で示すようになる。「CMP」は
比較命令を示し、オペランドには2つの処理対象があ
る。最初の処理対象である「CWDT」はメモリの特定
のアドレスを示す。もう1つの処理対象である「#10
0/4.096」は10進数の100を、4.096で
徐算してその結果を整数で表すべきことを示す。この結
果が10進数で24であり、図5では16進数として1
8で示している。次に第11行目および第10行目は、
およびに示すようにそれぞれ変換される。アセンブ
ラ言語のソースプログラムでは、ローマ字は大文字で表
示されているけれども、フローチャート上は小文字に変
換する。第11行目の命令は、「irqll」で表され
るビットデータをセットする命令であり、第10行目の
命令は割込みを不許可にする命令である。このような命
令の内容は、図5(1)のおよびのように表示する
ことによって判りやすくなる。図4(1)の第9行目お
よび第8行目は、図5(1)のおよびのように変換
される。これらの命令にはレジスタAおよびYが含まれ
るので、図5(1)では「Ra」や「Ry」などのよう
にしてレジスタであることを表す。
FIG. 5 shows a process in which the source program in the block 10 shown in FIG. 4A is converted as in the block processing symbol 17 in FIG. 4B. In FIG. 5A, “CMP” on the twelfth row, which is the last row in the block,
The instruction is converted, as shown by. “CMP” indicates a comparison instruction, and the operand has two processing targets. “CWDT” to be processed first indicates a specific address of the memory. Another processing target "# 10
"0 / 4.096" indicates that the decimal number 100 should be reduced by 4.096 and the result should be expressed as an integer. The result is 24 in decimal, and in FIG.
The reference numeral 8 is used. Next, the eleventh and tenth lines are
And are converted as shown in and. In the assembler language source program, Roman letters are displayed in uppercase, but are converted to lowercase in the flowchart. The instruction on the eleventh line is an instruction for setting bit data represented by “irqll”, and the instruction on the tenth line is an instruction for disabling an interrupt. The content of such an instruction can be easily understood by displaying it as shown in FIG. The ninth and eighth lines in FIG. 4A are converted as shown in FIG. 5A. Since these instructions include the registers A and Y, in FIG. 5A, they are registers such as "Ra" and "Ry".

【0021】第8行目の「ADD」命令をのように変
換した後で、〜までの変換結果を参照すると、Yレ
ジスタはすでに使用されていることが判明する。このた
め、図5(1)図示のの表現をの表現に図5(2)
に示すように合成する。この合成は、図5(1)のの
右辺の「Ry」に、の右辺の「(Ry+Ra)」を置
換えて行う。なお、〜は図5(1)と同一である。
After the conversion of the "ADD" instruction in the eighth line as shown in the following, referring to the conversion results up to, it is found that the Y register has already been used. For this reason, the expression shown in FIG.
Are synthesized as shown in FIG. This synthesis is performed by replacing “(Ry + Ra)” on the right side of “Ry” on the right side of FIG. Are the same as in FIG. 5 (1).

【0022】図4(1)の第7行目の命令は、図5
(3)ののように変換される。〜については、図
5(2)と同一である。図4(1)図示の第6行目の表
現は図5(3)ののような表現に変換される。この命
令は、Aレジスタの記憶内容とSIDで表されるメモリ
の記憶内容との論理積の演算を行い、その演算結果をレ
ジスタAに記憶する演算である。レジスタAは、図5
(2)で示すようにの表現に使用されているので、図
5(4)に示すように、の表現に図5(3)のの表
現を合成する。〜はそのままである。次に図5
(4)のに示すように、図4(1)の第5行目の命令
が変換される。第5行目の命令は、レジスタB2SSD
で表されるメモリのストア内容をロードする命令であ
る。このようにして〜のように変換されると図4
(1)のブロック10内の命令はすべて変換されること
になる。図2のステップa5のフローチャート出力で
は、図5(4)のように変換された内容を、変換の順序
とは逆に〜のようにして出力し、図4(2)のブロ
ック処理記号17内のように表示する。
The instruction on the seventh line in FIG.
It is converted as shown in (3). Are the same as those in FIG. 5 (2). The expression in the sixth row shown in FIG. 4A is converted into an expression as shown in FIG. This instruction is an operation for performing a logical AND operation between the storage content of the A register and the storage content of the memory represented by the SID, and storing the calculation result in the register A. Register A is shown in FIG.
Since it is used in the expression as shown in (2), the expression in FIG. 5 (3) is combined with the expression as shown in FIG. 5 (4). Is as it is. Next, FIG.
As shown in (4), the instruction on the fifth line in FIG. 4 (1) is converted. The instruction on the fifth line is the register B2SSD
Is an instruction to load the contents stored in the memory represented by. In this way, when converted as shown in FIG.
All the instructions in block 10 of (1) will be translated. In the flowchart output of step a5 in FIG. 2, the contents converted as shown in FIG. 5 (4) are output in the reverse order of the conversion as shown in FIG. Is displayed as follows.

【0023】以上の実施例では、特定のコンピュータに
対するアセンブラ言語のソースプログラムをフローチャ
ートに変換しているけれども、他のコンピュータのアセ
ンブラ言語であっても同様に変換することができること
は勿論である。
In the above embodiment, the source program in the assembler language for a specific computer is converted into a flowchart. However, it is needless to say that the assembler language of another computer can be similarly converted.

【0024】[0024]

【発明の効果】以上のように本発明によれば、アセンブ
ラ言語のプログラムとして記述された命令をフローチャ
ート上の表現に変換する際に、命令が所定の値を記憶す
る処理対象に所定の値を記憶させる処理を行う命令の場
合は、前記処理対象名とその記憶内容とをフローチャー
ト上の表現に変換し、所定の値を記憶された処理対象の
処理対象名がすでに変換されているフローチャート上の
表現の記憶内容に含まれておれば、すでに変換されてい
るフローチャート上の表現の記憶内容に含まれている処
理対象名をその処理対象の記憶内容に置換えるため、処
理対象がその記憶内容を示す形に置換わり、ブロックの
動作内容の理解が容易になる。
As described above, according to the present invention, when an instruction described as an assembler language program is converted into an expression on a flowchart, the instruction stores a predetermined value in a processing object storing a predetermined value. In the case of an instruction for performing processing to be stored, the processing target name and its storage content are converted into an expression on a flowchart, and the processing target name of a processing target having a predetermined value stored therein is already converted. If the processing target is included in the storage contents of the expression, the processing target name included in the storage contents of the expression on the flowchart already converted is replaced with the storage contents of the processing target. This is replaced with the form shown, making it easier to understand the operation contents of the block.

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

【図1】本発明の一実施例の概略的内な電気的構成を示
すブロック図である。
FIG. 1 is a block diagram showing a schematic electrical configuration of an embodiment of the present invention.

【図2】図1図示の動作を示すフローチャートである。FIG. 2 is a flowchart showing the operation shown in FIG.

【図3】図1図示の実施例の動作を示すフローチャート
である。
FIG. 3 is a flowchart showing the operation of the embodiment shown in FIG. 1;

【図4】図1図示の実施例によって変換されるソースプ
ログラムとフローチャートを示す図である。
FIG. 4 is a diagram showing a source program converted by the embodiment shown in FIG. 1 and a flowchart.

【図5】図1図示の実施例によるブロック内の命令変換
過程を示す図である。
FIG. 5 is a diagram illustrating a process of converting an instruction in a block according to the embodiment shown in FIG. 1;

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

1 ワークステーション 2 外部記憶装置 3 ホストコンピュータ 4 プリンタ 5 CPU 6 メモリ 7 表示装置 10 ブロック 12,18 判断記号 13,14 サブルーチン呼出記号 17 ブロック処理記号 Reference Signs List 1 workstation 2 external storage device 3 host computer 4 printer 5 CPU 6 memory 7 display device 10 block 12, 18 decision symbol 13, 14 subroutine call symbol 17 block processing symbol

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−216129(JP,A) 特開 平4−199424(JP,A) 特開 平4−199435(JP,A) 特開 平4−177427(JP,A) 特開 平3−51926(JP,A) ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-4-216129 (JP, A) JP-A-4-199424 (JP, A) JP-A-4-199435 (JP, A) JP-A-4-199435 177427 (JP, A) JP-A-3-51926 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 アセンブラ言語のプログラムをプログラ
ムの動作を表すフローチャートとして出力するプログラ
ム自動解析装置において、 アセンブラ言語の各命令を、予め設定されるフローチャ
ート上の表現に変換するとともに、該命令が所定の値を
記憶する処理対象に所定の値を記憶させる処理を行う命
令の場合は、該処理対象名とその記憶内容とをフローチ
ャート上の表現に変換する変換手段と、 前記命令により所定の値を記憶された処理対象の処理対
象名が、すでに変換されているフローチャート上の表現
の記憶内容に含まれているか否かを判断する判断手段
と、 該判断手段により処理対象名が含まれていると判断され
た場合は、すでに変換されているフローチャート上の表
現の記憶内容に含まれている処理対象名をその処理対象
の記憶内容に置換える処理手段とを含むことを特徴とす
るプログラム自動解析装置。
1. An automatic program analyzer for outputting a program in an assembler language as a flowchart representing the operation of a program. In the case of an instruction for performing processing for storing a predetermined value in a processing object for storing a value, a conversion unit for converting the processing target name and its storage content into an expression on a flowchart; Determining means for determining whether or not the processing target name of the converted processing target is included in the stored contents of the expression on the flowchart already converted; and determining that the processing target name is included by the determining means If the processing target name is included in the stored contents of the expression on the flowchart already converted, An automatic program analyzing apparatus, comprising: processing means for replacing the contents with memory contents.
JP4209177A 1992-08-05 1992-08-05 Automatic program analyzer Expired - Fee Related JP2719277B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4209177A JP2719277B2 (en) 1992-08-05 1992-08-05 Automatic program analyzer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4209177A JP2719277B2 (en) 1992-08-05 1992-08-05 Automatic program analyzer

Publications (2)

Publication Number Publication Date
JPH0675762A JPH0675762A (en) 1994-03-18
JP2719277B2 true JP2719277B2 (en) 1998-02-25

Family

ID=16568612

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4209177A Expired - Fee Related JP2719277B2 (en) 1992-08-05 1992-08-05 Automatic program analyzer

Country Status (1)

Country Link
JP (1) JP2719277B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0346025A (en) * 1989-07-14 1991-02-27 Toshiba Corp System for describing work item

Also Published As

Publication number Publication date
JPH0675762A (en) 1994-03-18

Similar Documents

Publication Publication Date Title
US6138271A (en) Operating system for embedded computers
JP4766540B2 (en) Method and apparatus for performing verification of program code conversion
US6954204B2 (en) Programmable graphics system and method using flexible, high-precision data formats
US6142682A (en) Simulation of computer processor
JP2765423B2 (en) Programmable controller and control method thereof
US20070261038A1 (en) Code Translation and Pipeline Optimization
EP0370274A2 (en) Personal computer/host emulation system for handling host data with personal computer application programs at personal computers
US20040098709A1 (en) Method, apparatus, and computer program for generating SIMD instruction sequence
EP0817003B1 (en) Format conversion of graphical image data words
JPH07105385A (en) System and method for performing program-cord conversion for effective picture-element processing
US20040177346A1 (en) Direct instructions rendering emulation computer technique
JP2719277B2 (en) Automatic program analyzer
JPS62226231A (en) Processor
US20210373859A1 (en) Instruction translation support method and information processing apparatus
JPH08286896A (en) Software development method and software development system
JP4692579B2 (en) Image processing system and image processing method
JP3077627B2 (en) Debugging method and recording medium for recording debug program
US7155709B2 (en) Displaying user readable information during linking
JP2653880B2 (en) Program content analyzer
JPH0792771B2 (en) Program execution status display system
JP2000122895A (en) Method and device for analyzing stack size
JPH06242933A (en) Program document maintenance device
JPS59225449A (en) Sentence number converting system
JPH0423102A (en) Programming device for programmable controller
JP2532621B2 (en) Digital processor

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: 19971028

LAPS Cancellation because of no payment of annual fees