JPS61206049A - Programming method for computer - Google Patents
Programming method for computerInfo
- Publication number
- JPS61206049A JPS61206049A JP60047812A JP4781285A JPS61206049A JP S61206049 A JPS61206049 A JP S61206049A JP 60047812 A JP60047812 A JP 60047812A JP 4781285 A JP4781285 A JP 4781285A JP S61206049 A JPS61206049 A JP S61206049A
- Authority
- JP
- Japan
- Prior art keywords
- error
- program
- time
- detected
- 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.)
- Pending
Links
Landscapes
- Debugging And Monitoring (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
この発明は、コンピュータのプログラミング方法に関す
るもので、特に、プログラム中に誤りがあった場合の処
理に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a computer programming method, and particularly to processing when an error occurs in a program.
この発明は、コンピュータのプログラミング実行方法に
おいて、プログラムの誤りを全て表示し、実行命令が入
力された場合にはこのプログラムを実行させ、アバ。フ
グを容易にし、未完成のプログラムについても実行でき
るようにしたものである。The present invention is a computer programming execution method that displays all errors in the program, executes the program when an execution command is input, and executes the program. This makes blowfish easy to use and allows unfinished programs to be executed.
プログラミングの処理方式には、インタプリタ方式とコ
ンパイラ方式とがある。インタプリタ方式は、高級言語
例えばBAS I Cで書かれたソースプログラムを一
行毎に解釈し、順次実行していくものである。このよう
に、ソースプログラムを解釈しながら実行するものであ
るから、インタプリタ方式は1.対話型機能を必要とす
るものに適している。インタプリタ方式では、プログラ
ミングに誤りがあると、実行の途中で誤りの行番号とエ
ラーコードが表示され、実行が中止される。この誤りの
部分を対話的に修正すれば、再実行させることができる
、しかしながら、−行毎の解釈の時間が必要であり、処
理時間が長い。Programming processing methods include an interpreter method and a compiler method. In the interpreter method, a source program written in a high-level language such as BASIC is interpreted line by line and sequentially executed. In this way, since the source program is executed while being interpreted, the interpreter method is 1. Suitable for things that require interactive functionality. In the interpreter method, if there is a programming error, the erroneous line number and error code will be displayed during execution, and execution will be aborted. If the erroneous part is corrected interactively, it can be re-executed, but - line-by-line interpretation time is required and processing time is long.
コンパイラ方式は、ソースプログラムを一度機械語の実
行形式のオブジェクトプログラムに翻訳し、このオブジ
ェクトプログラムにより実行させるものである。例えば
、テキストエディタでディスク上にソースプログラムを
作成し、コンパイラでこのソースプログラムをリロケー
タブルオブジェクトプログラムに変換し、ランクイムル
ーチンとこのリロケータブルオブジェクトプログラムを
、リンカ−で結合編集し、実行形式のオブジェクト。In the compiler method, a source program is once translated into an executable object program in machine language, and then executed by this object program. For example, you can create a source program on a disk using a text editor, convert this source program into a relocatable object program using a compiler, combine and edit the rank im routine and this relocatable object program using a linker, and create an executable object.
プログラムを生成し、この実行形式のオブジェクトプロ
グラムにより実行させる。A program is generated and executed by this executable object program.
°コンパイラ方式では、機械語のオブジェクトプログラ
ムを直接実行するものであるから、処理速度が速い、し
かし、コンパイラ方式は、例えば特開昭59−2214
0号公報に示されるように対話型の機能を持たせること
が難しい、コンパイラ方式では、プログラミングに誤り
があると、コンパイラ及びリンカ−の夫々から誤りが全
て表示され、プログラムの実行は行われない。°The compiler method directly executes the object program in machine language, so the processing speed is fast. However, the compiler method is
As shown in Publication No. 0, it is difficult to provide an interactive function using the compiler system. If there is a programming error, the compiler and linker will display all the errors and the program will not be executed. .
プログラム開発時には、デバッグが効率よく行えること
が望ましい、インタプリタ方式では、プログラムの誤り
は、構文誤りについてはプログラム入力時に行われ、誤
りの表示は、実行の途中で誤った個所に来たときに初め
て表示される。このため、プログラムの誤りの訂正は、
実行を行うことによってのみ可能である。When developing a program, it is desirable to be able to debug it efficiently.In the interpreter method, errors in the program are detected when syntax errors are input, and errors are only displayed when an incorrect location is reached during execution. Is displayed. For this reason, correcting program errors requires
It is possible only by doing.
コンパイラ方式では、誤りはコンパイラ及びリンカ−に
より全て表示される。しかし、誤りがあると、プログラ
ムは一切実行しない、このため、ある一部のルーチンに
だけ誤りがあり、他のルーチンについては正しくプログ
ラミングさている略々完成したプログラムについても、
実行不可能となる。In the compiler approach, all errors are displayed by the compiler and linker. However, if there is an error, the program will not run at all. Therefore, even if the program is almost completed and only some routines have errors and other routines are programmed correctly,
becomes unfeasible.
従ワて、この発明の目的は、プログラムの誤りを全て表
示でき、誤りを含んでいるが略々完成したプログラムに
ついても実行可能な、デバッグの効率のよいコンピュー
タのプログラミング方法を提供することにある。SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a computer programming method that is capable of displaying all errors in a program, is executable even on a nearly completed program that contains errors, and is highly efficient in debugging. .
この発明は、所定単位毎に高級言語で記述されたソース
プログラムを機械語で記述されたオブジェクトプログラ
ムにコンパイルして実行せしめるようにしたコンピュー
タのプログラミング実行方法でありて、ソースプログラ
ムからオブジェクトプログラムへのコンパイル時にソー
スプログラムの構文誤りを検出して表示すると共に、オ
ブジェクトプログラムと変数をリンクして実行する際に
リンク上の誤りを検出して表示し更に、実行命令が入力
された場合にはこのプログラムを実行させるようにした
コンピュータのプログラミング方法である。The present invention is a computer programming execution method that compiles and executes a source program written in a high-level language into an object program written in machine language for each predetermined unit, and which converts a source program into an object program. It detects and displays syntax errors in the source program during compilation, detects and displays link errors when linking and executing object programs and variables, and furthermore, when an execution command is input, this program This is a method of programming a computer to execute it.
コンパイル時に構文誤りを検出し、リンク時にリンク上
の誤りを検出する。検出した誤りは、CRTディスプレ
イ上に全て表示される。実行命令が入力された際には、
プログラム中に誤りが含まれていても実行される。Detect syntax errors at compile time and link errors at link time. All detected errors are displayed on the CRT display. When an execution command is input,
The program will be executed even if there is an error in the program.
(実施例)
以下、この発明の一実施例について、図面を参照して説
明する。第1図において、lがコンパイラ、2がキーボ
ード、3がCRTディスプレイ、4がメモリである。コ
ンパイラ1は、インクリメンタリ−型のコンパイラで、
所定単位、例えばソースプログラムの一行毎に順次コン
パイルを行う。(Example) Hereinafter, an example of the present invention will be described with reference to the drawings. In FIG. 1, 1 is a compiler, 2 is a keyboard, 3 is a CRT display, and 4 is a memory. Compiler 1 is an incremental compiler,
Compilation is performed sequentially in predetermined units, for example, each line of the source program.
コンパイラ1は、コンパイル機能のみならず、エディツ
ト機能も有している。コンパイラ1とメモリ4とは、双
方向に結ばれている。The compiler 1 has not only a compiling function but also an editing function. The compiler 1 and memory 4 are bidirectionally connected.
キーボード2からコンパイラ1にソースプログラムが与
えられる。ソースプログラムの言語としては、例えばB
ASIGが用いられる。入力されたソースプログラムは
、コンパイラ1で順次オブジェクトプログラムにコンパ
イルされる。ソーステログラムは、メモリ4上のメモリ
領域4Aに順次格納される。コンパイルされたオブジェ
クトプログラムは、実行順に編集され、メモリ4上のメ
モリ領域4Bに順次格納される。A source program is given to the compiler 1 from the keyboard 2. For example, the language of the source program is B.
ASIG is used. The input source program is sequentially compiled into an object program by a compiler 1. The source telograms are sequentially stored in the memory area 4A on the memory 4. The compiled object programs are edited in the order of execution and sequentially stored in the memory area 4B on the memory 4.
メモリ4上には、変数とその変数に関する情報のシンボ
ルテーブルを形成するためのメモリ領域4Cが設けられ
ている。変数に関するシンボルテーブルに記録する情報
は、変数の使われている行番号、変数の型(整数、実数
、倍精度実数、文字配列のいずれか)、配列の場合には
その次元数と要素数、アドレス参照番号等である。変数
の値の内部表現としては、数値については2進表現が用
いられている。A memory area 4C is provided on the memory 4 for forming a symbol table of variables and information regarding the variables. Information recorded in the symbol table regarding variables includes the line number where the variable is used, the type of the variable (integer, real number, double-precision real number, or character array), the number of dimensions and number of elements in the case of an array, Address reference number, etc. As the internal representation of the value of a variable, binary representation is used for numerical values.
プログラムの修正、変更は、対話的に行える。Modifications and changes to programs can be made interactively.
つまり、ソースプログラムの一部が変更されたときには
、コンパイラ1で変更を受けたソースプログラムが翻訳
し直され、オブジェクトプログラムが書換られる。従っ
て、ソースプログラム全体を修正し直すことなく、オブ
ジェクトプログラムを修正できる。That is, when a part of the source program is changed, the changed source program is retranslated by the compiler 1, and the object program is rewritten. Therefore, the object program can be modified without modifying the entire source program.
実行時に変数のシンボルテーブルの変数に関する情報を
基に、変数の用いられている行番号が決定され、オブジ
ェクトプログラムに変数がリンクさる。このオブジェク
トプログラムにより実行がなされる。During execution, the line number where the variable is used is determined based on information about the variable in the variable symbol table, and the variable is linked to the object program. Execution is performed by this object program.
実行は、メモリ領域4Bに格納されているオブジェクト
プログラムにより行われるので、インタプリタ方式に比
べて処理速度が速い。Since the execution is performed by the object program stored in the memory area 4B, the processing speed is faster than the interpreter method.
プログラミングに誤りがあった場合の処理について、説
明する。This section explains what to do if there is a programming error.
構文誤りについては、コンパイル時にコンパイラ1によ
り検出できる。リンク上の誤りについては、リンク時に
検出できる。即ち、第2図にフローチャートで示すよう
に、分岐命令、例えば“GOTo”″が与えられた場合
、飛び先のアドレスを検索し、このアドレスの有能を検
出する。アドレスが検出できた場合には、リンク時のエ
ラーはない、この時には、正しいアドレスをリンクする
。Syntax errors can be detected by the compiler 1 during compilation. Errors in links can be detected at the time of linking. That is, as shown in the flowchart in Fig. 2, when a branch instruction such as "GOTo" is given, the destination address is searched and the availability of this address is detected.If the address is detected, There is no link-time error, this time it links the correct address.
アドレスが検出できない場合には、リンク時のエラーが
ある。この時、エラー表示を行う。If the address cannot be found, there is a link-time error. At this time, an error is displayed.
エラーがあった場合には、その誤りの種類、及び誤りの
行が全て表示される0例えば以下に示すようにプログラ
ム中に“FOR−NEXT″コマンドに誤りがあったと
する。If there is an error, the type of error and all erroneous lines are displayed.For example, suppose there is an error in the "FOR-NEXT" command in the program as shown below.
30 FORT−I To 10100
NEXT 1
この時、誤りがCRTディスプレイ3に以下のように表
示される。30 FORT-I To 10100
NEXT 1 At this time, the error is displayed on the CRT display 3 as shown below.
FORwithout NEXT at 3ON
EXT without FORatlooExe
cute ? (YES/No)’ Execut
e ? (YES/No)は、実行を続けるか続け
ないかを選択させる表示である。FOR WITHOUT NEXT at 3ON
EXT without FORatlooExe
Cute? (YES/No)' Execute
e? (YES/No) is a display that allows you to select whether to continue execution or not.
実行しない場合には、”No’″と入力する。この時、
プログラムは最初から実行されない、実行を続ける場合
には、“YES”と入力する。この時、プログラムは、
エラールーチンのアドレスとリンクされ、そのまま実行
がなされる。If you do not want to execute it, enter "No'". At this time,
If the program is not executed from the beginning and you wish to continue execution, enter "YES". At this time, the program
It is linked with the address of the error routine and executed as is.
このように、プログラムに誤りがあっても、実行可能な
部分については、実行される。In this way, even if there is an error in the program, executable parts will be executed.
この発明に依れば、ソースプログラムの誤りが全て表示
できる。また、誤りを含んだプログラムについても実効
可能である。従って、デパックの効率がよく、誤りは含
んでいるが、略々完成したプログラムについても実効可
能である。According to this invention, all errors in a source program can be displayed. It is also possible to implement this method even for programs containing errors. Therefore, depacking is efficient and can be carried out even on programs that are almost complete, although they contain errors.
第1図はこの発明の一実施例の構成図、第2図はこの発
明の一実施例の説明に用いるフローチャートである。
図面における主要な符号の説明
1:コンパイラ、 2:キーボード、3:CRTディ
スプレイ、 4:メモリ。
代理人 弁理士 杉 浦 正 知−曳犯例
第1図
吉克明1;用1%5フロー÷臂−卜
第2図FIG. 1 is a block diagram of an embodiment of the present invention, and FIG. 2 is a flowchart used to explain the embodiment of the invention. Explanation of major symbols in the drawings 1: Compiler, 2: Keyboard, 3: CRT display, 4: Memory. Agent Patent Attorney Masato Sugiura Tomo - Criminal Example Figure 1 Katsuaki Yoshi 1; Use 1% 5 Flow ÷ Arm - Figure 2
Claims (1)
機械語で記述されたオブジェクトプログラムにコンパイ
ルして実行せしめるようにしたコンピュータのプログラ
ミング実行方法であって、上記ソースプログラムからオ
ブジェクトプログラムへのコンパイル時に上記ソースプ
ログラムの構文誤りを検出して表示すると共に、上記オ
ブジェクトプログラムと変数をリンクして実行する際に
リンク上の誤りを検出して表示し、更に、実行命令が入
力された場合にはこのプログラムを実行させるようにし
たコンピュータのプログラミング方法。A computer programming execution method that compiles and executes a source program written in a high-level language into an object program written in machine language for each predetermined unit, the method comprising: It detects and displays syntax errors in the source program, detects and displays errors in the link when linking and executing the object program and variables, and also detects and displays errors in the link when an execution command is input. A method of programming a computer to make it execute.
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60047812A JPS61206049A (en) | 1985-03-11 | 1985-03-11 | Programming method for computer |
CA000503426A CA1259138A (en) | 1985-03-11 | 1986-03-06 | Method of compiling high level language statements into low level language instruction sets |
AU54364/86A AU5436486A (en) | 1985-03-11 | 1986-03-06 | Compiling high-level lanuage statements into lower-level language instruction sets |
EP86301648A EP0194822A3 (en) | 1985-03-11 | 1986-03-07 | Methods of and apparatus for compiling high-level language statements into low-level language instruction sets |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60047812A JPS61206049A (en) | 1985-03-11 | 1985-03-11 | Programming method for computer |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS61206049A true JPS61206049A (en) | 1986-09-12 |
Family
ID=12785774
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP60047812A Pending JPS61206049A (en) | 1985-03-11 | 1985-03-11 | Programming method for computer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS61206049A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5530943A (en) * | 1991-09-30 | 1996-06-25 | Siemens Aktiengesellschaft | Method for producing an executable configuration of a system program loadable into a system memory area of a processor system |
-
1985
- 1985-03-11 JP JP60047812A patent/JPS61206049A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5530943A (en) * | 1991-09-30 | 1996-06-25 | Siemens Aktiengesellschaft | Method for producing an executable configuration of a system program loadable into a system memory area of a processor system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR950006619B1 (en) | Improved error reporting for translated code execution | |
US5774728A (en) | Method and system for compiling sections of a computer program for multiple execution environments | |
CN111796831B (en) | Compiling method and device for multi-chip compatibility | |
US20010016941A1 (en) | Method for translating between source and target code with heterogenous register sets | |
US8869126B2 (en) | Method and apparatus enabling multi threaded program execution for a Cobol program including OpenMP directives by utilizing a two-stage compilation process | |
EP0428560A4 (en) | Machine process for translating programs in binary machine language into another binary machine language | |
KR20020070809A (en) | Optimizing Post-Link Code | |
US6314557B1 (en) | Hybrid computer programming environment | |
US6086622A (en) | Method and apparatus for converting an architecture of a program and method, and apparatus for debugging a program by using them | |
US6178547B1 (en) | Method and apparatus for generating non-redundant symbolic debug information in computer programs | |
KR20050028465A (en) | Mcu application program verification system providing source code level debugging using debugging information files in different versions and method thereof | |
JPH0766342B2 (en) | Program test equipment | |
JPS61206049A (en) | Programming method for computer | |
JP2008204023A (en) | Programmable controller system and debug method for programmable controller | |
JP2802128B2 (en) | Program development equipment | |
JPS61206040A (en) | Programming method for computer | |
Hart | The advanced interactive debugging system (AIDS) | |
JPH04155540A (en) | Program correcting system by interactive debugger | |
JPH01273144A (en) | Software development supporting device | |
JPH05120025A (en) | Inline development method for source program | |
Krukov et al. | Debugging DVM programs | |
JPS58169637A (en) | Compile processing system | |
JPH04250530A (en) | Program conversion and translation device | |
JPH1083311A (en) | Simulator | |
JPH04307630A (en) | Compiler with simple debugging option |