JPH05303497A - Object code output system for language processing program - Google Patents

Object code output system for language processing program

Info

Publication number
JPH05303497A
JPH05303497A JP13197092A JP13197092A JPH05303497A JP H05303497 A JPH05303497 A JP H05303497A JP 13197092 A JP13197092 A JP 13197092A JP 13197092 A JP13197092 A JP 13197092A JP H05303497 A JPH05303497 A JP H05303497A
Authority
JP
Japan
Prior art keywords
object code
instruction
program
read
memory
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
JP13197092A
Other languages
Japanese (ja)
Inventor
Tomoko Kano
知子 狩野
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 Corp
Original Assignee
NEC Corp
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 Corp filed Critical NEC Corp
Priority to JP13197092A priority Critical patent/JPH05303497A/en
Publication of JPH05303497A publication Critical patent/JPH05303497A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To prevent the generation of operation counter to a program designer's purpose when a microcomputer system adopting a memory inhibited to read out the same data again once reading out data by prereading executes an object program. CONSTITUTION:When an instruction for reading memory exists (step 110) in a source program and an interruption enabled state is held (step 111) in a system for reading out a source program and converting the read program into an object code for loading the program to a microcomputer, after an interruption inhibiting object code is outputted, then the object code of the (memory reading) instruction is outputted.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、言語処理プログラムの
オブジェクト・コード出力方式に関し、特にマイクロコ
ンピュータ・システムに実装するオブジェクト・コード
の命令セットを得るのに用いられるオブジェクト・コー
ド出力方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an object code output system for a language processing program, and more particularly to an object code output system used to obtain an instruction set of an object code to be mounted on a microcomputer system.

【0002】[0002]

【従来の技術】図3は、マイクロコンピュータ・システ
ムに実装するプログラムを開発する際に用いられる、言
語処理プログラムの走行するホスト・マシンの構成図で
ある。ホスト・マシン301は、ユーザの入力する言語
処理プログラムの操作コマンドを受け付け、コンソール
302に処理結果を表示する。演算装置303は、外部
記憶装置304に格納されている、ユーザの作成したソ
ース・プログラムを入力し、ソース・プログラムを解析
し、オブジェクト・コードを生成し、生成したオブジェ
クト・コードを外部記憶装置304に格納する。こうし
て得られたオブジェクト・コードは例えばマイクロコン
ピュータに組み込むROMに焼き付けられ、ユーザの応
用機器において用いられる。
2. Description of the Related Art FIG. 3 is a block diagram of a host machine on which a language processing program runs, which is used when developing a program to be mounted on a microcomputer system. The host machine 301 receives the operation command of the language processing program input by the user, and displays the processing result on the console 302. The arithmetic unit 303 inputs the source program created by the user and stored in the external storage device 304, analyzes the source program, generates an object code, and stores the generated object code in the external storage device 304. To store. The object code thus obtained is burned in a ROM incorporated in a microcomputer, for example, and is used in a user's application device.

【0003】図4は、図3のホスト・マシンにより実行
される従来の言語処理プログラムのオブジェクト・コー
ド出力方式を示す流れ図である。始めに、ソース・プロ
グラムをオープンし(ステップ401)、ソース・プロ
グラムの行の管理をするために、変数nに初期値として
0を代入しておく(ステップ402)。nの値を増加す
る(ステップ403)とnは1となる。1番目の命令を
入力し(ステップ404)、オブジェクト・コードを出
力する(ステップ405)。
FIG. 4 is a flow chart showing an object code output method of a conventional language processing program executed by the host machine of FIG. First, the source program is opened (step 401), and 0 is assigned to the variable n as an initial value in order to manage the lines of the source program (step 402). When the value of n is increased (step 403), n becomes 1. The first command is input (step 404) and the object code is output (step 405).

【0004】次に、ソース・プログラムの最後かどうか
を判断する(ステップ406)。ソース・プログラムが
最後の場合、ソース・プログラムをクローズする(ステ
ップ407)。ソース・プログラムが最後ではない場
合、ソース・プログラムの最後になるまで、nの値を1
増加し(ステップ403)、次の命令を入力し(ステッ
プ404)、オブジェクト・コードを出力する(ステッ
プ405)。
Next, it is determined whether the source program is the last (step 406). If the source program is the last one, the source program is closed (step 407). If the source program is not the last, the value of n is set to 1 until the end of the source program is reached.
The number is incremented (step 403), the next command is input (step 404), and the object code is output (step 405).

【0005】[0005]

【発明が解決しようとする課題】上述した従来方式によ
り出力されたオブジェクト・コードでは、このオブジェ
クト・コードが実装されるマイクロコンピュータ・シス
テムがデータの先読みを行うものであり、そして一度メ
モリ・リードを行ったら同じデータはリードできないメ
モリを採用していた場合、以下の不都合が生じる。図5
は、一度リードされたデータは再度リードすることがで
きないメモリとしてのFIFOメモリのメモリ状態を示
す図である。メモリは、データA、B、C、Dがこの順
に入力されたものとすると(a)に示す状態にある。こ
こでメモリの内容を1度リードすると、Aがリードされ
メモリの内容は(b)に示す状態となる。
In the object code output by the above-mentioned conventional method, the microcomputer system in which this object code is implemented performs prefetching of data, and once the memory read is performed. If a memory that cannot read the same data is used, the following problems will occur. Figure 5
FIG. 4 is a diagram showing a memory state of a FIFO memory as a memory in which data that has been read once cannot be read again. The memory is in the state shown in (a), assuming that data A, B, C, and D are input in this order. Here, if the contents of the memory are read once, A is read and the contents of the memory become the state shown in (b).

【0006】マイクロコンピュータがプログラム実行中
に割り込み可能状態でメモリ・リードを行う命令があ
り、この命令の直前に割り込みが発生したとする。マイ
クロコンピュータが命令を先読みするマイクロコンピュ
ータ・システムでは、メモリ・リードを行う命令を実行
する前に、メモリ・リードを行う命令に従って、メモリ
のデータを先読みする。図5のメモリの場合、一番最初
に読み込まれたデータAがリードされる。次に、割り込
みが発生したためメモリ・リードを行う命令を実行せ
ず、割り込み処理を行った後、メモリ・リードを行う命
令に戻る。割り込みが発生する前に先読みしたメモリの
データAは消えてしまっているが、メモリ・リードを行
う命令を実行するために、再度メモリのデータをリード
する。本来はデータAをリードすべきであるが、図5の
例の場合、メモリの内容からデータBをリードしてしま
う。そのため、プログラム作成者の意図に反したプログ
ラム動作を引き起こす。
It is assumed that there is an instruction for reading a memory in a state where the microcomputer is in an interruptable state during execution of a program, and an interrupt occurs immediately before this instruction. In a microcomputer system in which a microcomputer prefetches an instruction, data in the memory is prefetched in accordance with the instruction for memory read before executing the instruction for memory read. In the case of the memory shown in FIG. 5, the first read data A is read. Next, since an interrupt has occurred, the memory read instruction is not executed, the interrupt process is performed, and then the operation returns to the memory read instruction. The data A in the memory that has been read in advance before the interrupt occurs is erased, but the data in the memory is read again in order to execute the instruction for memory read. Originally, the data A should be read, but in the example of FIG. 5, the data B is read from the contents of the memory. Therefore, it causes a program operation contrary to the intention of the program creator.

【0007】また、例えば、応用機器がFAXである場
合、受信中に割り込みが提起されると、上述の理由によ
り受信機は誤動作を起こし送信機側にエラーメッセージ
を送信する。エラーメッセージを受けた送信機側は受信
機側へデータを再送信するために送信待ちの状態に入
る。以上の動作を繰り返すことになるため、送受信に時
間がかかりさらにその間FAX回線を占有してしまうた
め、他のFAXが送信しようとしても送信できないとい
う問題も生じる。
Further, for example, when the applied device is a FAX, if an interrupt is raised during reception, the receiver malfunctions due to the above reason and sends an error message to the transmitter side. Upon receiving the error message, the transmitter side enters a transmission waiting state in order to retransmit the data to the receiver side. Since the above operation is repeated, it takes a long time for transmission and reception, and the FAX line is occupied during that time, which causes a problem that another FAX cannot transmit even if it tries to transmit.

【0008】[0008]

【課題を解決するための手段】本発明の言語処理プログ
ラムのオブジェクト・コード出力方式は、ソース・プロ
グラムを読み出しこれを解析して、マイクロコンピュー
タ・システムのためのオブジェクト・コードを出力する
ものであって、ソース・プログラム中において、割り込
み可能状態でデータ・リードを行う命令があったとき
は、データ・リードを行う命令の前に割り込み禁止命令
を挿入し、これをオブジェクト・コード上に出力するこ
とを特徴としている。
According to the object code output method of a language processing program of the present invention, a source program is read and analyzed to output an object code for a microcomputer system. In the source program, if there is an instruction to read data in the interrupt enable state, insert an interrupt prohibition instruction before the instruction to read data and output it to the object code. Is characterized by.

【0009】[0009]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。図1は、本発明の第1の実施例の言語処理
プログラムのオブジェクト・コード出力方式を示す流れ
図である。この言語処理プログラムの走行するホスト・
マシンの構成は図3に示されている。即ち、ユーザの作
成したソース・プログラムは外部記憶装置304に格納
されており、演算装置303はこれを読み出し解析し、
オブジェクト・コードを生成する。生成されたオブジェ
クト・コードは一旦演算装置303内に格納されるが、
後に外部記憶装置304へ転送される。
Embodiments of the present invention will now be described with reference to the drawings. FIG. 1 is a flow chart showing an object code output system of a language processing program according to a first embodiment of the present invention. The host on which this language processing program runs
The configuration of the machine is shown in FIG. That is, the source program created by the user is stored in the external storage device 304, and the arithmetic device 303 reads and analyzes it.
Generate object code. The generated object code is temporarily stored in the arithmetic unit 303,
It is later transferred to the external storage device 304.

【0010】図1に示すように、初めに、ソース・プロ
グラムをオープンし(ステップ101)、ソース・プロ
グラムの行の管理をするための変数nに初期値0を代入
し、割り込み禁止状態か否かを管理するための変数ei
に初期値1を代入しておく(ステップ102)。eiが
1のときは割り込み可能状態、eiが0のときは割り込
み禁止状態とする。また、ソース・プログラム中にEI
命令があったら割り込み可能状態にし、DI命令があっ
たら割り込み禁止状態にする。ソース・プログラム中に
EI命令もDI命令も指定されなかった場合は、割り込
み可能状態であるとする。
As shown in FIG. 1, first, a source program is opened (step 101), and an initial value 0 is assigned to a variable n for managing the lines of the source program to determine whether an interrupt is prohibited. Variable ei for managing
The initial value 1 is substituted into (step 102). When ei is 1, interrupts are enabled, and when ei is 0, interrupts are disabled. Also, in the source program, EI
If there is an instruction, the interrupt is enabled, and if there is a DI instruction, the interrupt is disabled. When neither the EI instruction nor the DI instruction is specified in the source program, it is considered as an interruptable state.

【0011】次に、nの値を1増加し(ステップ10
3)(nは1となる)、n(1)番目の命令を入力する
(ステップ104)。n番目の命令がDI命令であるか
否かを判断し(ステップ106)、DI命令であればe
i=0とし(ステップ107)、またn番目の命令がE
I命令である否かを判断し(ステップ108)、EI命
令であればei=1とする(ステップ109)。
Next, the value of n is incremented by 1 (step 10
3) Input n (1) th instruction (n becomes 1) (step 104). It is determined whether or not the nth instruction is a DI instruction (step 106). If it is a DI instruction, e
i = 0 (step 107), and the nth instruction is E
It is judged whether or not it is the I command (step 108), and if it is the EI command, ei = 1 is set (step 109).

【0012】次に、n番目の命令がメモリ・リードを行
う命令であるか否かを判断し(ステップ110)、ei
=1であるか否かを判断する(ステップ111)。n番
目の命令がメモリ・リードを行う命令でないとき、およ
びメモリ・リードを行う命令であってもei=1でない
とき(即ち、割り込み禁止状態のとき)は、n番目のオ
ブジェクト・コードを出力する。(ステップ114)。
n番目の命令がメモリ・リードを行う命令でかつei=
1のとき(即ち、割り込み可能状態のとき)、DI命令
のオブジェクト・コードを出力し(ステップ112)、
n番目のオブジェクト・コードを出力し(ステップ11
3)、EI命令のオブジェクト・コードを出力し(ステ
ップ115)、割り込み可能状態を管理するためにei
を1に戻す(ステップ116)。
Next, it is judged whether or not the nth instruction is a memory read instruction (step 110), and ei
It is determined whether or not = 1 (step 111). The nth object code is output when the nth instruction is not a memory read instruction and when the memory read instruction is not ei = 1 (that is, in the interrupt disabled state). .. (Step 114).
The n-th instruction is a memory read instruction and ei =
When it is 1 (that is, in the interrupt enable state), the object code of the DI instruction is output (step 112),
Output the nth object code (step 11
3) output the object code of the EI instruction (step 115), and ei to manage the interrupt enable state.
Is returned to 1 (step 116).

【0013】次に、ソース・プログラムの最後かどうか
を判断する(ステップ117)。ソース・プログラムの
最後であれば、ソース・プログラムをクローズする(ス
テップ118)。ソース・プログラムの最後出力ないと
きは、ステップ103に戻り、ソース・プログラムの最
後になるまで、上記の動作を繰り返す。
Next, it is judged whether or not the source program is the last (step 117). If it is the end of the source program, the source program is closed (step 118). When the last output of the source program is not made, the process returns to step 103 and the above operation is repeated until the end of the source program.

【0014】このようにして得られたオブジェクト・コ
ードを実装したマイクロコンピュータ・システムでは、
メモリ・リードを行う命令が実行されるときには、割り
込みが禁止された状態となっているので、命令を先読み
するマイクロコンピュータシステムで、一度データをリ
ードしたら同じデータを再度読み出すことのできないメ
モリ、I/Oを採用していても、データ・リード命令の
直前に割り込みが実行されることがなくなり、先読みさ
れたデータが消えてしまう不都合が生じることはなく、
誤ったデータを読み出すことによって起こされる誤動作
は防止される。
In the microcomputer system in which the object code thus obtained is mounted,
When a memory read instruction is executed, interrupts are disabled, so a microcomputer system that prefetches an instruction cannot read the same data again after reading the same data. Even if O is adopted, the interrupt is not executed immediately before the data read instruction, and there is no inconvenience that the prefetched data is erased.
Malfunctions caused by reading erroneous data are prevented.

【0015】図2は、本発明の第2の実施例を示す流れ
図である。本実施例は、アセンブル・リストを出力する
場合の例に関する。通常、アセンブル・リストには、行
番号、ソース・コード、ソース・コードに対応したオブ
ジェクト・コードが一組のデータとして出力される。ア
センブル・リストは、コンソールやプリンターに出力さ
れ、ディバグやメンテナンスのために用いられる。
FIG. 2 is a flow chart showing the second embodiment of the present invention. The present embodiment relates to an example of outputting an assemble list. Normally, a line number, a source code, and an object code corresponding to the source code are output to the assemble list as a set of data. The assemble list is output to the console or printer and used for debugging and maintenance.

【0016】本実施例の図1に示した先の実施例と相違
する点は、ステップ112乃至ステップ115に対応す
るステップ212乃至ステップ215において、オブジ
ェクト・コードとともにこれと対をなすソース・コード
を出力している点と、ステップ212とステップ215
では“印”を付けて出力している点である。
The difference of this embodiment from the previous embodiment shown in FIG. 1 is that in step 212 to step 215 corresponding to step 112 to step 115, the object code and the source code paired therewith are stored. Output points and step 212 and step 215
The point is that the mark is added to the output.

【0017】“印”付きというのは、例えば、行番号の
先頭に*などのような記号を付けることである。記号を
付けることにより、アセンブル・リストをプリンターな
どに出力したときに言語処理プログラムが挿入した命令
であることがわかり、ディバグやメンテナンスが容易に
なる。
"With mark" means that a symbol such as * is added to the head of the line number, for example. By adding a symbol, it can be understood that the instruction is the instruction inserted by the language processing program when the assemble list is output to a printer or the like, which facilitates debugging and maintenance.

【0018】[0018]

【発明の効果】以上説明したように、本発明の言語処理
プログラムのオブジェクト・コード出力方式により得ら
れたオブジェクト・コードを実装したマイクロコンピュ
ータ・システムでは、メモリ・リードを行う命令の実行
直前に割り込みは発生しなくなるので、データを先読み
するマイクロコンピュータ・システムが一度データを読
み出したら再び同一データを読み出すことのできないメ
モリ、I/Oを採用していても、先読みされたデータが
消えてしまうことによって起こされるプログラム処理の
誤動作を防止することができる。
As described above, in the microcomputer system in which the object code obtained by the object code output method of the language processing program of the present invention is mounted, the interrupt is performed immediately before the execution of the memory read instruction. Will not occur, so even if a microcomputer system that reads data in advance reads data once and the memory and I / O that cannot read the same data again are used, the data read in advance will disappear. It is possible to prevent malfunction of the program processing that is caused.

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

【図1】本発明の第1の実施例を示す流れ図。FIG. 1 is a flowchart showing a first embodiment of the present invention.

【図2】本発明の第2の実施例を示す流れ図。FIG. 2 is a flow chart showing a second embodiment of the present invention.

【図3】本発明の実施例および従来例の言語処理プログ
ラムが走行するホスト・マシンの構成図。
FIG. 3 is a configuration diagram of a host machine on which a language processing program according to an embodiment of the present invention and a conventional example run.

【図4】従来例の流れ図。FIG. 4 is a flowchart of a conventional example.

【図5】FIFOメモリの状態を示す図。FIG. 5 is a diagram showing a state of a FIFO memory.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ソース・プログラムを入力し、これを解
析してマイクロコンピュータ・システムに対するオブジ
ェクト・コードを出力する言語処理プログラムのオブジ
ェクト・コード出力方式において、 ソース・プログラム中、割り込み可能状態でデータ・リ
ードを行う命令があったら、データ・リードを行う命令
の前に割り込み禁止命令を挿入し、そのオブジェクト・
コードを出力することを特徴とする言語処理プログラム
のオブジェクト・コード出力方式。
1. In an object code output method of a language processing program, which inputs a source program, analyzes it, and outputs an object code to a microcomputer system, in a source program, data in an interruptible state in a source program. If there is an instruction to read, insert an interrupt disable instruction before the instruction to read the data, and
An object code output method for language processing programs characterized by outputting a code.
JP13197092A 1992-04-24 1992-04-24 Object code output system for language processing program Pending JPH05303497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13197092A JPH05303497A (en) 1992-04-24 1992-04-24 Object code output system for language processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13197092A JPH05303497A (en) 1992-04-24 1992-04-24 Object code output system for language processing program

Publications (1)

Publication Number Publication Date
JPH05303497A true JPH05303497A (en) 1993-11-16

Family

ID=15070488

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13197092A Pending JPH05303497A (en) 1992-04-24 1992-04-24 Object code output system for language processing program

Country Status (1)

Country Link
JP (1) JPH05303497A (en)

Similar Documents

Publication Publication Date Title
US4409654A (en) Data processor adapted for interruption to an instruction stream
JP4911022B2 (en) Counter control circuit, dynamic reconfiguration circuit, and loop processing control method
KR20130137591A (en) Illegal mode change handling
KR940011669B1 (en) Data processor
KR930016880A (en) Electronic device and its fixing information
KR100267410B1 (en) Information processing device and generating method of interrupt signal thereof
US7325113B2 (en) Memory protection apparatus
US5930470A (en) Debugging system and debugging method
US5938758A (en) Microprocessor having function of prefetching instruction
JPH05303497A (en) Object code output system for language processing program
JP3055999B2 (en) Microprogram control device group
US20040015876A1 (en) Method and structure of implementing a safe pointer
KR100237642B1 (en) Processor having pipe line stop signal
JP3462245B2 (en) Central processing unit
JP3014682B2 (en) Program control method and device
JP2701799B2 (en) Microcomputer
KR20080044652A (en) Method for debugging by using stack of cpu
KR20010106421A (en) A programmable controller
JP2000029508A (en) Programmable controller
US5524221A (en) Next instruction pointer calculation system for a microcomputer
GB2243701A (en) Controlling access to computer system features
KR950005523B1 (en) Step-run processing method of programmable logic controller
JP3366235B2 (en) Data read control device
JP2002244864A (en) Device and method for controlling interruption
JPH0667917A (en) Diagnostic system for memory access controller