JPH0594310A - Machine language code preparing method - Google Patents
Machine language code preparing methodInfo
- Publication number
- JPH0594310A JPH0594310A JP25615391A JP25615391A JPH0594310A JP H0594310 A JPH0594310 A JP H0594310A JP 25615391 A JP25615391 A JP 25615391A JP 25615391 A JP25615391 A JP 25615391A JP H0594310 A JPH0594310 A JP H0594310A
- Authority
- JP
- Japan
- Prior art keywords
- machine language
- language code
- user
- rule
- data area
- 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
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000003068 static effect Effects 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 2
- 238000010348 incorporation Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は機械語コード生成方法に
関し、特に、コンパイラが機械語コードに変換する際の
規則を、利用者が任意に変更/追加することを可能とす
る機械語コード生成方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a machine language code generation method, and more particularly to a machine language code generation that allows a user to arbitrarily change / add rules for converting a machine language code by a compiler. Regarding the method.
【0002】[0002]
【従来の技術】従来のコンパイラの生成する機械語コー
ドの生成規則は、コンパイラの内部に組み込まれた機械
語コード生成規則と、その規則から機械語コードを生成
する手段により構成され、利用者がコンパイラを提供さ
れた時点で生成規則は変更不可能である。2. Description of the Related Art A conventional machine language code generation rule generated by a compiler is composed of a machine language code generation rule incorporated in the compiler and a means for generating a machine language code from the rule. The production rules cannot be changed when the compiler is provided.
【0003】[0003]
【発明が解決しようとする課題】上述した従来の機械語
コード生成方法では、コンパイラを開発する時点で設計
された機械語コードの生成規則を静的データ領域に配置
し機械語コードを生成する手段が利用者の書いた手続き
に対応する規則を静的データ領域から探し機械語コード
を生成しているため、利用者の期待する機械語コードが
生成されない場合があるという欠点がある。また、コン
パイラが利用者に提供された後に、機械語の生成に関す
る規則に矛盾が生じていた場合に、利用者が直接矛盾し
ている規則を修正できないという欠点がある。In the above-described conventional machine language code generation method, means for generating a machine language code by arranging a machine language code generation rule designed at the time of developing a compiler in a static data area. Has generated a machine language code by searching the static data area for a rule corresponding to the procedure written by the user, so that the machine language code expected by the user may not be generated. In addition, after the compiler is provided to the user, if there is a contradiction in the rules for generating the machine language, the user cannot directly correct the inconsistent rule.
【0004】[0004]
【課題を解決するための手段】本発明の機械語コード生
成方法は、内部に組み込まれたプログラミング言語の機
械語コード生成規則を記憶する手段と、外部から機械語
コード生成の規則を読み込み内部に組み込む手段と、前
記機械語コード生成規則から機械語コードを生成する手
段とを実行することを特徴とする。A machine language code generation method according to the present invention comprises means for storing a machine language code generation rule of a programming language incorporated therein, and a machine language code generation rule read from the outside. It is characterized in that the means for incorporating and the means for generating a machine language code from the machine language code generation rule are executed.
【0005】[0005]
【実施例】次に、本発明について図面を参照して説明す
る。DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.
【0006】図2は本発明の一実施例を適用する装置の
構成図である。この装置は、外部から機械語コード生成
の規則を読み込み内部に組み込む外部規則組み込み手段
11と、機械語コード生成規則から機械語コードを生成
する機械語コード生成手段12と、ユーザが記述した機
械語コード生成の規則を記憶する利用者定義機械語コー
ド生成規則記憶領域13と、外部から読み込んだ規則を
配置する動的データ領域14と、機械語コード生成手段
が持つ既存の規則が配置されている静的データ領域15
と、利用者が記述した手続きを記憶する利用者記述手続
き記憶領域16と、機械語コード生成手段が出力する機
械語コード記憶領域17とを具備する。FIG. 2 is a block diagram of an apparatus to which an embodiment of the present invention is applied. This apparatus reads externally a machine language code generation rule and incorporates it into an external rule incorporation means 11, a machine language code generation means 12 that generates a machine language code from the machine language code generation rule, and a machine language written by a user. A user-defined machine language code generation rule storage area 13 for storing code generation rules, a dynamic data area 14 for arranging rules read from the outside, and existing rules of the machine language code generation means are arranged. Static data area 15
And a user written procedure storage area 16 for storing the procedure described by the user, and a machine language code storage area 17 output by the machine language code generation means.
【0007】図1は本発明の一実施例の動作を示す流れ
図である。外部規則組み込み手段11は、利用者が記述
した機械語コード生成規則13の有無を確認し(ステッ
プ21)、規則が存在する場合、規則を動的データ領域
14へ読み込む(ステップ22)。機械語コード生成手
段12は、外部規則組み込み手段11から、動的データ
領域に規則が読み込まれているかどうかを動的データ領
域の場所を通知されることにより知り(ステップ2
5)、動的データ領域14,静的データ領域15の順に
参照し(ステップ26,27)、利用者が記述した手続
きを機械語コードに変換する(ステップ28)。FIG. 1 is a flow chart showing the operation of one embodiment of the present invention. The external rule embedding means 11 confirms the presence or absence of the machine code generation rule 13 described by the user (step 21), and if the rule exists, reads the rule into the dynamic data area 14 (step 22). The machine language code generation means 12 knows from the external rule incorporation means 11 whether or not a rule is read in the dynamic data area by being notified of the location of the dynamic data area (step 2).
5) Referring to the dynamic data area 14 and the static data area 15 in this order (steps 26 and 27), the procedure described by the user is converted into a machine language code (step 28).
【0008】次に、この機械語コード生成方法におい
て、従来例の場合と、この実施例の場合との具体的な比
較例を図3(a) ,図3(b) に示す。利用者の記述した手
続きの一部がブロック31内に表されるような形式で記
述されていた場合に、従来例では、機械語コード32が
生成される。このとき利用者は、機械語コード32に示
す割算命令よりも高速な右シフト命令を生成したいとす
る。従来例であれば、利用者の記述した手続きを変更
し、期待に沿った機械語コードを出力するまでブロック
31内の内容自体を変更し続けるか、現状の機械語コー
ド32で満足するかのどちらかである。Next, in this machine language code generation method, a concrete comparison example between the case of the conventional example and the case of this embodiment is shown in FIGS. 3 (a) and 3 (b). When a part of the procedure described by the user is described in the format shown in the block 31, the machine language code 32 is generated in the conventional example. At this time, the user wants to generate a right shift instruction that is faster than the division instruction shown in the machine language code 32. In the case of the conventional example, whether the procedure described by the user is changed and the content itself in the block 31 is continuously changed until the expected machine language code is output, or the current machine language code 32 is satisfied. Either.
【0009】しかし、この実施例では、ブロック31内
に示す手続きに対応し、機械語コード33を出力すると
いう規則を、利用者定義機械語コード生成規則記憶領域
13に記述すれば、利用者が記述した手続きに含まれ
る、ブロック31内の意味を持つすべての記述が、機械
語コード33に変換される。However, in this embodiment, if the rule for outputting the machine language code 33 corresponding to the procedure shown in the block 31 is described in the user-defined machine language code generation rule storage area 13, the user can All the descriptions having the meaning in the block 31 included in the described procedure are converted into the machine language code 33.
【0010】[0010]
【発明の効果】以上説明したように、本発明によれば、
コンパイラに、機械語生成規則を外部から読み込み、機
械語コードを生成する機構を導入することで、コンパイ
ラが、利用者の記述した手続きから機械語コードを生成
したとき、その生成結果が期待した機械語コードでなか
った場合、利用者がコンパイラに新たな規則を追加する
ことにより、利用者の期待する機械語コードをコンパイ
ラが生成できる。つまり、利用者は、記述した手続きを
修正することなく、期待した機械語コードを得ることが
できる。また、利用者は、コンパイラの矛盾した規則
を、直接、変更/追加し、修正することができる。As described above, according to the present invention,
By introducing a machine language generation rule into the compiler to generate a machine language code from the outside, when the compiler generates a machine language code from the procedure described by the user, the generated machine expects the machine language code. If it is not a language code, the user can add a new rule to the compiler so that the compiler can generate the machine language code expected by the user. That is, the user can obtain the expected machine language code without modifying the described procedure. Also, the user can directly change / add and modify the conflicting rules of the compiler.
【図1】本発明の一実施例の動作を示す流れ図である。FIG. 1 is a flow chart showing the operation of an embodiment of the present invention.
【図2】本発明の一実施例を適用する装置の構成図であ
る。FIG. 2 is a configuration diagram of an apparatus to which an embodiment of the present invention is applied.
【図3】分図(a) ,(b) は、利用者が記述した手続き
と、従来例による生成の結果意味と、本発明の一実施例
により利用者が期待する機械語コードの意味を例示する
図である。3A and 3B show a procedure described by a user, a meaning of a result generated by a conventional example, and a meaning of a machine language code expected by the user according to an embodiment of the present invention. It is a figure which illustrates.
21 利用者が定義した規則があるかの判断ステップ 22 利用者が定義した機械語コード生成規則を読み
込むステップ 23 動的データ領域に書き込むステップ 24 動的データ領域に書き込んだ生成規則の先頭の
アドレスを記憶するステップ 25 動的データ領域に書き込まれているかの判断ス
テップ 26 動的データ領域の規則を参照するステップ 27 静的データ領域の規則を参照するステップ 28 機械語コードの生成を行なうステップ 11 外部規則組み込み手段 12 機械語コード生成手段 13 利用者定義機械語コード生成規則記憶領域 14 動的データ領域 15 静的データ領域 16 利用者記述手続き記憶領域 17 機械語コード記憶領域21 Step of judging whether there is a rule defined by the user 22 Step of reading the machine language code generation rule defined by the user 23 Step of writing in the dynamic data area 24 Set the start address of the generation rule written in the dynamic data area Step of storing 25 Step of judging whether it is written in dynamic data area 26 Step of referring to rule of dynamic data area 27 Step of referring to rule of static data area 28 Step of generating machine language code 11 External rule Embedding means 12 Machine language code generation means 13 User defined machine language code generation rule storage area 14 Dynamic data area 15 Static data area 16 User description procedure storage area 17 Machine language code storage area
Claims (1)
の機械語コード生成規則を記憶する手段と、外部から機
械語コード生成の規則を読み込み内部に組み込む手段
と、前記機械語コード生成規則から機械語コードを生成
する手段とを実行することを特徴とする機械語コード生
成方法。1. A means for storing a machine language code generation rule of a programming language incorporated therein, a means for reading a machine language code generation rule from the outside and incorporating it inside, and a machine language code from the machine language code generation rule. And a means for generating a machine language code generating method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25615391A JPH0594310A (en) | 1991-10-03 | 1991-10-03 | Machine language code preparing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25615391A JPH0594310A (en) | 1991-10-03 | 1991-10-03 | Machine language code preparing method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0594310A true JPH0594310A (en) | 1993-04-16 |
Family
ID=17288646
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP25615391A Pending JPH0594310A (en) | 1991-10-03 | 1991-10-03 | Machine language code preparing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0594310A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7284241B2 (en) | 2002-08-02 | 2007-10-16 | Matsushita Electric Industrial Co., Ltd. | Compiler, compiler apparatus and compilation method |
-
1991
- 1991-10-03 JP JP25615391A patent/JPH0594310A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7284241B2 (en) | 2002-08-02 | 2007-10-16 | Matsushita Electric Industrial Co., Ltd. | Compiler, compiler apparatus and compilation method |
| US8151254B2 (en) | 2002-08-02 | 2012-04-03 | Panasonic Corporation | Compiler, compiler apparatus and compilation method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH10240746A5 (en) | Method for creating multimedia titles and multimedia title system | |
| WO2017148057A1 (en) | Software version generation method and apparatus | |
| JPH0594310A (en) | Machine language code preparing method | |
| JP4971096B2 (en) | Coding support device | |
| JPH11338519A (en) | Programmable controller, program creation support device, and program creation support method | |
| KR100846203B1 (en) | Recording medium recording method of generating mobile application and program for implementing same | |
| KR102046250B1 (en) | e-Book Reader and Operating Method for Programming Language Learning, Recording Medium for Performing the Method | |
| CN110716746B (en) | Method and device for converting RN style code into applet style code | |
| KR20080038351A (en) | Method and apparatus for controlling playback of an optical disc program | |
| JPH09114653A (en) | Record definition related source code automatic generator | |
| JP2007058808A (en) | Method and device for supporting html data generation program | |
| JP2001338004A (en) | High-level synthesis system, high-level synthesis method, and computer-readable recording medium storing high-level synthesis method execution program | |
| JPH04330526A (en) | Relocatable assembler | |
| JPH0667949A (en) | File record generation system | |
| JPS62197825A (en) | Automatic program generator | |
| JPH0612506A (en) | Microprocessor | |
| JPH04263318A (en) | General-purpose software generator | |
| JP2000089946A (en) | Method for customizing message text and help text, and recording medium storing program for implementing the customizing method | |
| JPH05100865A (en) | Compiling system | |
| JPH0449421A (en) | File editing system | |
| JPH01243119A (en) | Method and device for data definition processing | |
| JPS62198928A (en) | Attribute tree control system | |
| JPH05143257A (en) | Document design system | |
| JPH0496178A (en) | Change method for cad operation characteristic | |
| JPH03186933A (en) | Symbol processing system for language processing system |