JPH0535499A - Data processing device and method - Google Patents

Data processing device and method

Info

Publication number
JPH0535499A
JPH0535499A JP18864591A JP18864591A JPH0535499A JP H0535499 A JPH0535499 A JP H0535499A JP 18864591 A JP18864591 A JP 18864591A JP 18864591 A JP18864591 A JP 18864591A JP H0535499 A JPH0535499 A JP H0535499A
Authority
JP
Japan
Prior art keywords
instruction
interrupt
data processing
command
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.)
Withdrawn
Application number
JP18864591A
Other languages
Japanese (ja)
Inventor
Kosuke Yamamoto
浩介 山本
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.)
Fujitsu Ltd
Fujitsu Electronics Inc
Original Assignee
Fujitsu Ltd
Fujitsu Electronics Inc
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 Fujitsu Ltd, Fujitsu Electronics Inc filed Critical Fujitsu Ltd
Priority to JP18864591A priority Critical patent/JPH0535499A/en
Publication of JPH0535499A publication Critical patent/JPH0535499A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To easily identify the presence or absence of the generation of a software interruption without executing twice the saving operation of an address concerned with a trap command, and the command code, and to reduce an inconsistency with a hardware break processing even at the time of executing the break processing by the software interruption, as for the improvement of a device which executes the software interruption especially during the execution of a program. CONSTITUTION:This device is provided with a command decoding part 11 which decodes a command CMD, command executing part 12 which executes an arithmetic operation based on the command CMD, and interruption control part 13 which controls the interruption requested during the execution of the command CMD And also the device is provided with a judging part 14 which judges control information TB indicating the 'truth' or 'false' of the interruption. Then, the control information TB is allocated to the specific bit of an (n) bit command code CDC decoded by the command decoding part 11.

Description

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

【0001】〔目 次〕 産業上の利用分野 従来の技術(図6) 発明が解決しようとする課題 課題を解決するための手段(図1,2) 作用 実施例(図3〜図5) 発明の効果[Table of Contents] Industrial applications Conventional technology (Fig. 6) Problems to be Solved by the Invention Means for Solving the Problems (FIGS. 1 and 2) Action Example (FIGS. 3 to 5) The invention's effect

【0002】[0002]

【産業上の利用分野】本発明は、データ処理装置及びデ
ータ処理方法に関するものであり、更に詳しく言えば、
プログラムの実行中にソフトウエア割込みを実行する装
置及びその割込み発生方法の改善に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device and a data processing method, and more specifically,
The present invention relates to an apparatus for executing a software interrupt during execution of a program and an improvement in the interrupt generation method.

【0003】近年、ソフトウエア開発の際のデバッグ処
理やハードウエアによる計算機の模倣(エミュレーショ
ン)等において、ブレークポイントとしてマイクロプロ
セッサ等が有するトラップ命令の埋め込みよるソフトウ
エア割込み処理を取り入れたデータ処理装置が使用され
ている。
In recent years, a data processor incorporating a software interrupt process by embedding a trap instruction of a microprocessor or the like as a breakpoint in a debug process during software development or a computer emulation (emulation) by hardware. It is used.

【0004】これによれば、ソフトウエア割込みであっ
て、トラップ命令に係る命令コードの埋め込み処理を実
行する場合、その埋め込もうとするトラップ命令に係る
アドレスの命令コードを読出し、その後、そのアドレス
と命令コードとを退避している。
According to this, when executing the embedding process of the instruction code related to the trap instruction, which is a software interrupt, the instruction code of the address related to the trap instruction to be embedded is read, and then the address is read. And the instruction code are saved.

【0005】このため、ソフトウエア割込みを発生させ
るアドレスと共にそのアドレスの命令コードを記憶しな
ければならない。また、該命令コードは、他のコードと
区別をするため、その全く異なったトラップ命令のコー
ドとしなければならない。さらに、エミュレータのソフ
トウエア割込みを利用してブレーク処理をする場合等
に、ソフトウエア割込みが発生した時点において、トラ
ップ命令を埋め込んだアドレスが即時に実行されていな
い。
For this reason, the instruction code of the address must be stored together with the address that causes the software interrupt. Also, the instruction code must be a code of a completely different trap instruction in order to distinguish it from other codes. Furthermore, in the case where break processing is performed using the software interrupt of the emulator, the address in which the trap instruction is embedded is not immediately executed when the software interrupt occurs.

【0006】そこで、トラップ命令に係るアドレスとそ
の命令コードとの退避動作を二度実行することなく、ソ
フトウエア割込み発生の有無を容易に識別し、ソフトウ
エア割込みによりブレーク処理を実行する場合であって
も、ハードウエアブレーク処理との矛盾を無くすことが
できる装置及び方法が望まれている。
Therefore, there is a case where the presence or absence of a software interrupt is easily identified and the break processing is executed by the software interrupt without executing the save operation of the address related to the trap instruction and its instruction code twice. However, there is a demand for an apparatus and method that can eliminate the conflict with the hardware break processing.

【0007】[0007]

【従来の技術】図5,6は、従来例に係る説明図をそれ
ぞれ示している。図5(a),(b)は、従来例に係る
データ処理装置の構成図及び割込み時の説明図をそれぞ
れ示している。例えば、エミュレータ等のマイクロプロ
セッサは、図5(a)において、内部バス6に接続され
た命令解読部1,命令実行部2,割込み制御部3及びメ
モリ部5,データ入出力部7と、これ等のタイミング制
御をする制御部4から成る。
2. Description of the Related Art FIGS. 5 and 6 are explanatory views of a conventional example. 5A and 5B respectively show a block diagram of a data processing device according to a conventional example and an explanatory diagram at the time of interruption. For example, a microprocessor such as an emulator, in FIG. 5A, includes an instruction decoding unit 1, an instruction execution unit 2, an interrupt control unit 3, a memory unit 5, a data input / output unit 7, which are connected to an internal bus 6. The control unit 4 controls the timing of the above.

【0008】当該プロセッサの機能は、ある命令CMDが
命令解読部1により解読されると、該命令CMDに基づい
てデータが命令実行部2により演算実行される。なお、
その演算結果データがメモリ部5やデータ入出力部7に
転送される。また、命令CMDの実行中に割込みが要求さ
れると、割込み制御部3により制御される。
With respect to the function of the processor, when a certain command CMD is decoded by the command decoding unit 1, data is arithmetically executed by the command executing unit 2 based on the command CMD. In addition,
The calculation result data is transferred to the memory unit 5 and the data input / output unit 7. If an interrupt is requested during execution of the instruction CMD, the interrupt control unit 3 controls the interrupt.

【0009】図6は、従来例に係るマイクロプロセッサ
の割込み時の処理フローチャートを示している。例え
ば、メインルーチンからサブルーチンに移行するトラッ
プ命令を図5(b)に示すようなメモリ空間に埋め込む
ことによりソフトウエア割込み処理をする場合、図6に
おいて、まず、ステップP1でトラップ命令に係る埋め
込みアドレスの命令コードの読出し処理をする。
FIG. 6 shows a processing flowchart at the time of interruption of the microprocessor according to the conventional example. For example, when a software interrupt process is performed by embedding a trap instruction for shifting from a main routine to a subroutine in a memory space as shown in FIG. 5B, first, in FIG. 6, an embedded address related to the trap instruction in step P1. Read the instruction code of.

【0010】次に、ステップP2でトラップ命令に係る
埋め込みアドレスの記憶処理をする。この際に、メモリ
空間のデバッグモニタ領域に埋め込みアドレスが退避さ
れる。その後、ステップP3でトラップ命令に係る命令
コードの記憶処理をする。この際にも、該デバッグモニ
タ領域に命令コードが退避される。次いで、ステップP
4でソフトウエア割込み命令の埋め込み処理をする。
Next, in step P2, a process of storing the embedded address related to the trap instruction is performed. At this time, the embedded address is saved in the debug monitor area of the memory space. Then, in step P3, the instruction code storage process for the trap instruction is performed. Also at this time, the instruction code is saved in the debug monitor area. Then, step P
In step 4, the software interrupt instruction is embedded.

【0011】これにより、ソフトウエア開発の際のデバ
ッグ処理やエミュレーション等におけるブレークポイン
トとしてトラップ命令の埋め込み処理が実行される。
As a result, the trap command embedding process is executed as a breakpoint in the debug process or emulation when developing software.

【0012】[0012]

【発明が解決しようとする課題】ところで従来例のソフ
トウエア割込みによれば、図6に示すようにトラップ命
令に係る命令コードの埋め込み処理を実行する場合、ス
テップP1で埋め込もうとするトラップ命令に係るアド
レスの命令コードを読出し、ステップP2,P3でその
アドレスと命令コードとをスタックポインタ等に退避し
ている。
By the way, according to the conventional software interrupt, when the instruction code embedding process relating to the trap instruction is executed as shown in FIG. 6, the trap instruction to be embedded in step P1 is executed. The instruction code of the address related to is read, and the address and the instruction code are saved in the stack pointer or the like in steps P2 and P3.

【0013】このため、次のような問題が生ずる。 ソフトウエア割込みを発生させるアドレスと共にそ
のアドレスの命令コードを記憶しなければならない。こ
れにより、図5(b)に示すようなメモリ空間のデバッ
グモニタ領域において、1つのトラップ命令のポイント
に対してデータ退避領域が2領域必要となる。
Therefore, the following problems occur. The instruction code at that address must be stored along with the address that caused the software interrupt. As a result, two data save areas are required for one trap instruction point in the debug monitor area of the memory space as shown in FIG. 5B.

【0014】 ソフトウエア割込みを発生させるアド
レスの命令コードは、他のコードと区別をするため、そ
の全く異なったトラップ命令のコードとしなければなら
ない。これにより、読出し,退避,書込み等の処理動作
が命令コード毎に必要となり、命令コードの書換えの手
順が多くなる。
The instruction code of the address which generates the software interrupt must be a code of a completely different trap instruction in order to distinguish it from other codes. As a result, processing operations such as reading, saving, and writing are required for each instruction code, and the procedure for rewriting the instruction code increases.

【0015】 エミュレータのソフトウエア割込みを
利用してブレーク処理をする場合等に、ソフトウエア割
込みが発生した時点において、トラップ命令を埋め込ん
だアドレスが即時に実行されていない。
When a break process is performed using a software interrupt of the emulator, the address in which the trap instruction is embedded is not immediately executed when the software interrupt occurs.

【0016】これにより、外部のコンパレータ等を使用
したハードウエアブレーク処理では、当該アドレスの命
令実行後にブレークが発生するのに対して、ソフトウエ
ア割込みを利用したブレークでは,例えば1003番地にブ
レークポイントが設定された場合に、当該アドレス実行
前の1002番地の命令実行後にブレークポイントが発生す
るという矛盾が生ずることがある。
As a result, in the hardware break processing using an external comparator or the like, a break occurs after the instruction at the address is executed, whereas in the break using the software interrupt, a break point is found at address 1003, for example. If set, a contradiction may occur in which a breakpoint occurs after execution of the instruction at address 1002 before execution of the address.

【0017】このことから、データ処理の高速化の妨げ
となったり、メモリ領域を効率良く使用することができ
なくなる。本発明は、かかる従来例の問題点に鑑み創作
されたものであり、トラップ命令に係るアドレスとその
命令コードとの退避動作を二度実行することなく、ソフ
トウエア割込み発生の有無を容易に識別し、ソフトウエ
ア割込みによりブレーク処理を実行する場合であって
も、ハードウエアに係るブレーク処理との矛盾を無くす
ことが可能となるデータ処理装置及びデータ処理方法の
提供を目的とする。
As a result, the speeding up of data processing is hindered and the memory area cannot be used efficiently. The present invention was created in view of the problems of the conventional example, and easily identifies the occurrence of a software interrupt without executing the save operation of the address related to the trap instruction and its instruction code twice. However, it is an object of the present invention to provide a data processing device and a data processing method capable of eliminating a contradiction with break processing related to hardware even when the break processing is executed by a software interrupt.

【0018】[0018]

【課題を解決するための手段】図1(a)〜(c)は、
本発明に係るデータ処理装置及びデータ処理方法の原理
図をそれぞれ示している。
[Means for Solving the Problems] FIGS.
3A and 3B respectively show principle diagrams of a data processing device and a data processing method according to the present invention.

【0019】本発明のデータ処理装置は、図1(a)に
示すように命令CMDを解読する命令解読部11と、前記
命令CMDに基づいて演算を実行する命令実行部12と、
前記命令CMDの実行中に要求された割込みを制御する割
込み制御部13とを具備し、前記割込みの「真」又は
「偽」を示す制御情報TBを判定する判定部14が設け
られることを特徴とする。
As shown in FIG. 1A, the data processing apparatus of the present invention comprises an instruction decoding section 11 for decoding an instruction CMD, an instruction execution section 12 for executing an operation based on the instruction CMD,
An interrupt control unit 13 that controls an interrupt requested during execution of the command CMD, and a determination unit 14 that determines control information TB indicating “true” or “false” of the interrupt is provided. And

【0020】なお、前記データ処理装置において、前記
制御情報TBが命令解読部11で解読処理されたnビッ
トの命令コードCDCの特定のビットに割り当てられるこ
とを特徴とする。
In the data processor, the control information TB is assigned to a specific bit of the n-bit instruction code CDC decoded by the instruction decoding unit 11.

【0021】また、本発明のデータ処理方法は、図1
(b)に示すように、全ての命令コードCDCにソフトウ
エア割込みの「真」又は「偽」を示す制御情報TBの設
定処理をし、前記制御情報TBの判定処理に基づいてソ
フトウエア割込みを発生させることを特徴とする。
The data processing method of the present invention is shown in FIG.
As shown in (b), the control information TB indicating the software interrupt "true" or "false" is set in all instruction codes CDC, and the software interrupt is generated based on the determination processing of the control information TB. It is characterized by generating.

【0022】なお、前記データ処理方法において、前記
ソフトウエア割込みは、図1(c)に示すように命令コ
ードCDCに設定処理された制御情報TBの「真」又は
「偽」を判定した後に発生することを特徴とし、上記目
的を達成する。
In the data processing method, the software interrupt is generated after determining "true" or "false" of the control information TB set to the instruction code CDC as shown in FIG. 1 (c). The above object is achieved.

【0023】[0023]

【作 用】本発明のデータ処理装置によれば、図1
(a)に示すように命令解読部11,命令実行部12,
割込み制御部13が具備され、割込みの「真」又は
「偽」を示す制御情報TBを判定する判定部14が設け
られる。
[Operation] According to the data processing device of the present invention, FIG.
As shown in (a), the instruction decoding unit 11, the instruction execution unit 12,
The interrupt control unit 13 is provided, and the determination unit 14 that determines the control information TB indicating “true” or “false” of the interrupt is provided.

【0024】例えば、命令解読部11により命令CMDが
解読されると、該命令CMDに基づく演算が命令実行部1
2により実行される。この際に、命令解読部11で解読
処理されたnビットの命令コードCDCの特定のビット,
例えば、その最下位ビットに制御情報TBが割り当てら
れる。また、命令CMDの実行中に割込みが要求される
と、割込みの「真」又は「偽」を示す制御情報TBが判
定部14により判定される。
For example, when the instruction decoding unit 11 decodes the instruction CMD, an operation based on the instruction CMD is executed by the instruction execution unit 1.
2 is executed. At this time, a specific bit of the n-bit instruction code CDC decoded by the instruction decoding unit 11,
For example, control information TB is assigned to the least significant bit. Further, when an interrupt is requested during execution of the instruction CMD, the determining unit 14 determines the control information TB indicating “true” or “false” of the interrupt.

【0025】このため、ソフトウエア割込みの発生,未
発生は命令コードCDCの最下位の1ビットのみに注目す
れば良い。このことで、ソフトウエア割込み発生の有無
を容易に識別することが可能となる。また、従来例のよ
うなソフトウエア割込みを発生させるアドレスと共にそ
のアドレスの命令コードを退避する必要が無くなる。
Therefore, for the occurrence or non-occurrence of the software interrupt, it suffices to focus only on the least significant 1 bit of the instruction code CDC. This makes it possible to easily identify whether or not a software interrupt has occurred. Further, it is not necessary to save the instruction code of the address together with the address which causes the software interrupt as in the conventional example.

【0026】これにより、1つのトラップ命令のブレー
クポイントに対して退避するデータ領域を1領域に削減
することが可能となる。このことから、当該データ処理
装置のメモリ領域を効率良く使用することが可能とな
る。
As a result, it becomes possible to reduce the data area saved for the breakpoint of one trap instruction to one area. Therefore, the memory area of the data processing device can be efficiently used.

【0027】また、本発明のデータ処理方法によれば、
図1(b)に示すように、全ての命令コードCDCにソフ
トウエア割込みの「真」又は「偽」を示す制御情報TB
の設定処理をし、該制御情報TBの判定処理に基づいて
ソフトウエア割込みを発生させている。
According to the data processing method of the present invention,
As shown in FIG. 1 (b), control information TB indicating "true" or "false" of the software interrupt for all instruction codes CDC
Is set, and a software interrupt is generated based on the determination process of the control information TB.

【0028】このため、従来例のようにソフトウエア割
込みを発生させるアドレスの命令コードは、その全く異
なるトラップ命令の命令コードとして埋め込まれること
なく、制御情報に「真」,「偽」が設定されるのみであ
る。このことで、論理積演算(AND)命令又は論理和
演算(OR)命令等の実行により簡単に命令コードの書
換え処をすることが可能となる。
Therefore, unlike the conventional example, the instruction code of the address which causes the software interrupt is not embedded as the instruction code of the completely different trap instruction, and "true" and "false" are set in the control information. Only As a result, it becomes possible to easily rewrite the instruction code by executing a logical product operation (AND) instruction or a logical sum operation (OR) instruction.

【0029】これにより、読出し,退避,書込みといっ
た動作が不要となり、命令コードの書換えの手順を削減
することが可能となる。また、エミュレータのソフトウ
エア割込みを利用してブレークポイントの設定処理をす
る場合に、ソフトウエア割込みが発生した時点にトラッ
プ命令を埋め込んだアドレスが実行される。すなわち、
図1(c)に示すような命令コードCDCの最下位ビット
に設定された制御情報TBの「真」又は「偽」を判定し
た後に、そのブレーク処理が実行される。
As a result, operations such as reading, saving, and writing become unnecessary, and the procedure of rewriting the instruction code can be reduced. When the breakpoint setting process is performed using the software interrupt of the emulator, the address in which the trap instruction is embedded is executed when the software interrupt occurs. That is,
After determining "true" or "false" of the control information TB set in the least significant bit of the instruction code CDC as shown in FIG. 1C, the break processing is executed.

【0030】このため、外部のコンパレータ等を使用し
たハードウエアに係るブレーク処理に比較して、ソフト
ウエア割込みを使用したブレーク処理の場合であっても
当該アドレス実行後に、それが実行されることから、従
来例のようなデータ処理上の矛盾を回避することが可能
となる。すなわち、ハードウエアに係るブレーク処理に
おいて、例えば、1003番地にブレークポイントが設定さ
れるような場合に、ソフトウエア割込みを使用したブレ
ーク処理をする場合でも従来例のように当該アドレス実
行前の1002番地の命令実行後にブレークポイントが発生
するという矛盾が生じない。
Therefore, as compared with the break processing related to the hardware using the external comparator, even in the case of the break processing using the software interrupt, it is executed after the execution of the address. It is possible to avoid the contradiction in data processing as in the conventional example. That is, in the break processing related to the hardware, for example, when a break point is set at the address 1003, even if the break processing using the software interrupt is performed, the address 1002 before the execution of the address as in the conventional example is executed. There is no contradiction that a breakpoint will occur after execution of the instruction.

【0031】これにより、ハードウエア及びソフトウエ
アの区別なくトラップ命令に係るデータ処理を併用する
ことが可能となる。
As a result, it is possible to use the data processing related to the trap instruction together without distinguishing between hardware and software.

【0032】[0032]

【実施例】次に、図を参照しながら本発明の実施例につ
いて説明をする。図2〜図4は、本発明の実施例に係る
データ処理装置及びデータ処理方法を説明する図であ
り、図2(a)は、本発明の実施例に係るマイクロプロ
セッサの構成図であり、図2(b)は、命令コードのフ
ォーマット例をそれぞれ示している。
Embodiments of the present invention will now be described with reference to the drawings. 2 to 4 are diagrams for explaining the data processing device and the data processing method according to the embodiment of the present invention, and FIG. 2A is a configuration diagram of the microprocessor according to the embodiment of the present invention. FIG. 2B shows a format example of the instruction code.

【0033】例えば、エミュレータ等に適用可能なマイ
クロプロセッサは、図2(a)において、内部バス16
に接続された命令解読部11,命令実行部12,割込み
制御部13,判定部14,レジスタ群15A及びI/Oポ
ート部15Bと、これ等のタイミング制御をするタイミン
グ発生/制御部15Cから成る。
For example, a microprocessor applicable to an emulator or the like is shown in FIG.
An instruction decoding unit 11, an instruction execution unit 12, an interrupt control unit 13, a determination unit 14, a register group 15A and an I / O port unit 15B, and a timing generation / control unit 15C for timing control of these units. .

【0034】すなわち、命令解読部11はレジスタ11A
及び命令デコード部11Bから成り、命令CMDを解読する
ものである。命令実行部12はアキュームレータ12A,
レジスタ12B及び算術演算ユニット(以下単にALUと
いう)12Cから成り、命令CMDに基づいて演算を実行す
るものである。割込み制御部13は命令CMDの実行中に
要求された割込みを制御するものである。
That is, the instruction decoding unit 11 registers the register 11A.
And an instruction decoding unit 11B for decoding the instruction CMD. The instruction execution unit 12 includes an accumulator 12A,
It is composed of a register 12B and an arithmetic operation unit (hereinafter simply referred to as ALU) 12C, and executes an operation based on an instruction CMD. The interrupt controller 13 controls the interrupt requested during the execution of the instruction CMD.

【0035】これまでは従来例と同様な構成であるが、
本発明の実施例では判定部14が設けられる。判定部1
4はレジスタ14A及び判定ゲート部14から成り、割込み
の「真」又は「偽」を示す制御情報TBの一例となるト
ラップビットを判定するものである。また、トラップビ
ットTBは命令解読部11で解読処理された,例えば、
8ビットの命令コードCDCの最下位の1ビットに割り当
てられる(図2(b))。
Up to now, the structure is similar to that of the conventional example,
The determination unit 14 is provided in the embodiment of the present invention. Judgment unit 1
Reference numeral 4 is composed of a register 14A and a judgment gate unit 14, and judges a trap bit which is an example of control information TB indicating "true" or "false" of an interrupt. Further, the trap bit TB is decoded by the instruction decoding unit 11, for example,
It is assigned to the least significant 1 bit of the 8-bit instruction code CDC (FIG. 2 (b)).

【0036】なお、表1はソフトウエア割込みを発生さ
せないコードAとソフトウエア割込みを発生させるコー
ドBとを示している。
Table 1 shows a code A that does not generate a software interrupt and a code B that generates a software interrupt.

【0037】[0037]

【表1】 [Table 1]

【0038】表1において、ソフトウエア割込みを発生
させないコードAには、各命令(ニーモニック)に対す
る命令コードCDCの最下位ビットに「偽」を示す「0」
が書き込まれ、ソフトウエア割込みを発生させるコード
Bには、その命令コードCDCの最下位ビットに「真」又
は「偽」を示す「1」が書き込まれる。
In Table 1, the code A that does not generate a software interrupt is "0" indicating "false" in the least significant bit of the instruction code CDC for each instruction (mnemonic).
Is written to the code B for generating a software interrupt, and "1" indicating "true" or "false" is written in the least significant bit of the instruction code CDC.

【0039】レジスタ群15AはデータDATA や命令コー
ドCDC等を一時記憶するものであり、I/Oポート部15
Bは、データDATA やアドレスADDの入出力をするもの
である。また、タイミング発生/制御部15Cは、命令デ
コード部11Bから出力される信号及び基準クロックCLK
に基づいて命令実行部12,割込み制御部13,判定部
14,レジスタ群15A及びI/Oポート部15Bのタイミ
ング制御をするものである。
The register group 15A temporarily stores data DATA, instruction code CDC, etc., and the I / O port section 15
B inputs and outputs data DATA and address ADD. In addition, the timing generation / control unit 15C uses the signal output from the instruction decoding unit 11B and the reference clock CLK.
The timing of the instruction execution unit 12, the interrupt control unit 13, the determination unit 14, the register group 15A and the I / O port unit 15B is controlled based on the above.

【0040】このようにして、本発明の実施例に係るマ
イクロプロセッサによれば、図2に示すように命令解読
部11,命令実行部12,割込み制御部13が具備さ
れ、割込みの「真」又は「偽」を示すトラップビットT
B=「1」又は「0」を判定する判定部14が設けられ
る。
In this way, the microprocessor according to the embodiment of the present invention is provided with the instruction decoding unit 11, the instruction execution unit 12, and the interrupt control unit 13 as shown in FIG. Or a trap bit T indicating "false"
A determination unit 14 that determines B = “1” or “0” is provided.

【0041】例えば、命令解読部11により命令CMDが
解読されると、該命令CMDに基づく演算が命令実行部1
2により実行される。この際に、命令解読部11で解読
処理された8ビットの命令コードCDCの最下位1ビット
にトラップビットTB=「1」又は「0」が割り当てら
れる。また、命令CMDの実行中に割込みが要求される
と、割込みの「真」又は「偽」を示すトラップビットT
B=「1」又は「0」が判定部14により判定される。
For example, when the command decoding unit 11 decodes the command CMD, the operation based on the command CMD is executed by the command execution unit 1.
2 is executed. At this time, the trap bit TB = “1” or “0” is assigned to the least significant 1 bit of the 8-bit instruction code CDC decoded by the instruction decoding unit 11. Also, if an interrupt is requested during execution of the instruction CMD, a trap bit T indicating "true" or "false" of the interrupt
The determination unit 14 determines B = “1” or “0”.

【0042】このため、ソフトウエア割込みの発生,未
発生は命令コードCDCの最下位1ビットのみに注目すれ
ば良い。このことで、ソフトウエア割込み発生の有無を
容易に識別することが可能となる。また、従来例のよう
なソフトウエア割込みを発生させるアドレスと共にその
アドレスの命令コードCDCを退避する必要が無くなる。
Therefore, it is sufficient to pay attention only to the least significant 1 bit of the instruction code CDC for the occurrence or non-occurrence of the software interrupt. This makes it possible to easily identify whether or not a software interrupt has occurred. Further, it is not necessary to save the instruction code CDC of the address together with the address for generating the software interrupt as in the conventional example.

【0043】これにより、1つのトラップ命令のブレー
クポイントに対して退避するデータ領域を1領域に削減
することが可能となる。このことから、当該マイクロプ
ロセッサのメモリ領域を効率良く使用することが可能と
なる。
As a result, the data area saved for the breakpoint of one trap instruction can be reduced to one area. Therefore, the memory area of the microprocessor can be used efficiently.

【0044】次に、本発明の実施例に係るデータ処理方
法について当該マイクロプロセッサの動作を補足しなが
ら説明をする。図3は、本発明の実施例に係るマイクロ
プロセッサのデータ処理のフローチャートであり、図4
はその補足説明図をそれぞれを示している。例えば、エ
ミュレータにおいて、表2に示されるような命令により
プログラムのデバッグ処理を実行する場合、図3におい
て、まず、ステップP1でプログラムリード処理をす
る。ここで、表2は当該マイクロプロセッサの命令体系
の一例を示している。
Next, a data processing method according to the embodiment of the present invention will be described while supplementing the operation of the microprocessor. FIG. 3 is a flowchart of data processing of the microprocessor according to the embodiment of the present invention.
Shows respective supplementary explanatory views thereof. For example, in the emulator, when the program debug process is executed by the instruction as shown in Table 2, the program read process is first performed in step P1 in FIG. Here, Table 2 shows an example of the instruction system of the microprocessor.

【0045】[0045]

【表2】 [Table 2]

【0046】この際に、例えば、アドレス=「0000」,
命令コードCDC=「8000」の動作命令(以下MOVとい
う)により、レジスタに数字#=「0」をリードし、順
次、アドレス=「0001」,「0002」,「0003」,「000
4」,命令コードCDC=「00」,「B0」,「12」,「3
4」でメモリの1番地から4番地に数字#=「0」を格
納する(図4参照)。なお、命令解読部11のレジスタ
11Aに命令CMDが入力されると、該命令CMDが命令デコ
ード部11Bにより解読される。また、命令実行部12の
アキュームレータ12A,レジスタ12B及びALU12Cに
より、命令コードCDCに基づいて演算が実行される。
At this time, for example, address = “0000”,
By the operation instruction of instruction code CDC = “8000” (hereinafter referred to as MOV), the number # = “0” is read to the register, and the address = “0001”, “0002”, “0003”, “000” in order.
4 ”, instruction code CDC =“ 00 ”,“ B0 ”,“ 12 ”,“ 3 ”
The number # = “0” is stored at addresses 1 to 4 of the memory at “4” (see FIG. 4). The register of the instruction decoding unit 11
When the command CMD is input to 11A, the command CMD is decoded by the command decoding unit 11B. Further, the accumulator 12A, the register 12B and the ALU 12C of the instruction execution unit 12 execute the operation based on the instruction code CDC.

【0047】次いで、ステップP2でデータライト処理
をする。この際に、メモリの2番地から4番地に書き込
まれた数字#=「0」が読み出される。また、アドレス
=「0005」でレジスタの値がインクリメント(以下IN
Cという)され、最終的に演算が終了(FF)するまで
プログラムのリード及びデータのリードが繰り返され
る。
Then, in step P2, data write processing is performed. At this time, the number # = "0" written at addresses 2 to 4 of the memory is read. In addition, the register value is incremented when the address = “0005” (hereinafter, IN
C), and the program read and data read are repeated until the operation is finally completed (FF).

【0048】従って、データのリード/ライトが順次繰
り返されて、ステップP3のプログラムリード処理から
ステップP10のプログラム( 割込み)処理に至ると、該
ステップP10において、トラップビットTB=「1」の
判定処理に基づいてソフトウエア割込みが発生される。
この際に、ソフトウエア割込みは、表2に示すようにア
ドレス0011, 命令コードCDC=OD2000に設定処理された
トラップビットTBの「1」を判定した後に発生する。
なお、判定部14のレジスタ14A及び判定ゲート部14に
より、割込みの「真」又は「偽」を示すトラップビット
TB=「1」又は「0」が判定され、割込み制御部13
により命令CMDの実行中に要求された割込みが制御され
る。
Therefore, when the data read / write is sequentially repeated to reach the program (interruption) process of step P3 from the program read process of step P3, the determination process of trap bit TB = "1" is executed in step P10. A software interrupt is generated based on
At this time, the software interrupt is generated after determining "1" of the trap bit TB set to the address 0011 and the instruction code CDC = OD2000 as shown in Table 2.
It should be noted that the register 14A and the judgment gate unit 14 of the judgment unit 14 judge the trap bit TB = “1” or “0” indicating “true” or “false” of the interrupt, and the interrupt control unit 13
Controls the interrupt requested during execution of the instruction CMD.

【0049】これにより、ソフトウエア割込みが掛か
り、本来のブランチ命令(BRA)の実行に変えて、ア
ドレスFF00, 命令コードCDC=3000にジャンプする。次
いで、ステップP11でトラップベクタリード処理をす
る。この際に、アドレス=「FF01」,命令コードCDC=
「00」でトラップ命令を実行するためのトラップベクタ
リード処理をする。
As a result, a software interrupt is generated, and instead of executing the original branch instruction (BRA), the address FF00 and instruction code CDC = 3000 are jumped to. Then, in step P11, a trap vector read process is performed. At this time, address = “FF01”, instruction code CDC =
At "00", the trap vector read processing for executing the trap instruction is performed.

【0050】その後、ステップP12でスタックポインタ
退避処理をする。ここでは、アドレス=「8000」,命令
コードCDC=「2000」でソフトウエア割込み前のブラン
チ命令(BRA)の実行に係るアドレスがスタックポイ
ンタに退避される。
Then, in step P12, stack pointer save processing is performed. Here, with the address = “8000” and the instruction code CDC = “2000”, the address related to the execution of the branch instruction (BRA) before the software interrupt is saved in the stack pointer.

【0051】さらに、ステップP13でトラップ命令に係
るプログラムリード処理をする。この際に、アドレス=
「3000」,命令コードCDC=「00」でトラップ命令を実
行するためのプログラムが読み出され、例えば、アドレ
ス=「3001」,命令コード=「00」でメモリ領域の3001
番地にそのプログラムデータが記憶される。
Further, in step P13, program read processing relating to the trap instruction is performed. At this time, the address =
The program for executing the trap instruction is read with "3000" and the instruction code CDC = "00". For example, if the address = "3001", the instruction code = "00", the memory area 3001
The program data is stored in the address.

【0052】なお、ステップP14でソフトウエア割込み
の復帰処理をし、その後、ステップP15でその他の処理
をする。このようにして、本発明の実施例に係るマイク
ロプロセッサのデータ処理方法によれば、表1に示すよ
うに、全ての命令コードCDCにソフトウエア割込みの
「真」又は「偽」を示すトラップビットTB=「1」又
は「0」の設定処理をし、図3の処理フローチャートに
示すように該トラップビットTB=「1」の判定処理に
基づいてソフトウエア割込みを発生させている。
In step P14, a software interrupt recovery process is performed, and then in step P15, other processes are performed. Thus, according to the data processing method of the microprocessor according to the embodiment of the present invention, as shown in Table 1, all the instruction codes CDC are trap bits indicating "true" or "false" of the software interrupt. TB = “1” or “0” is set, and a software interrupt is generated based on the determination process of the trap bit TB = “1” as shown in the processing flowchart of FIG.

【0053】このため、従来例のようにソフトウエア割
込みを発生させるアドレスの命令コードCDCは、その全
く異なるトラップ命令の命令コードCDCとしてデータメ
モリ領域に埋め込まれることなく、そのトラップビット
TBに「真」,「偽」を示す「1」又は「0」が設定さ
れるのみである。このことで、AND命令又はOR命令
等の実行により簡単に命令コードCDCの書換えが可能と
なる。
Therefore, unlike the conventional example, the instruction code CDC of the address which causes the software interrupt is not embedded in the data memory area as the instruction code CDC of the completely different trap instruction, and the trap bit TB is "true". , "1" or "0" indicating "false" is only set. As a result, the instruction code CDC can be easily rewritten by executing the AND instruction or the OR instruction.

【0054】これにより、読出し,退避,書込み等の処
理動作が不要となり、命令コードCDCの書換えの手順を
削減することが可能となる。また、エミュレータのソフ
トウエア割込みを利用してブレークポイントの設定処理
をする場合に、ソフトウエア割込みが発生した時点にト
ラップ命令を埋め込んだアドレスが実行される。すなわ
ち、図3の処理フローチャートのステップP10のデータ
リード処理で、図4に示すようなアドレス=「0011」,
命令コードCDC=「0D」の最下位ビットに設定されたト
ラップビットTBの「1」を判定した後に、そのブレー
ク処理が実行される。
This eliminates the need for processing operations such as reading, saving, writing, etc., and makes it possible to reduce the procedure for rewriting the instruction code CDC. When the breakpoint setting process is performed using the software interrupt of the emulator, the address in which the trap instruction is embedded is executed when the software interrupt occurs. That is, in the data read process of step P10 in the process flowchart of FIG. 3, the address = “0011”, as shown in FIG.
After determining "1" of the trap bit TB set to the least significant bit of the instruction code CDC = "0D", the break processing is executed.

【0055】このため、外部のコンパレータ等を使用し
たハードウエアに係るブレーク処理に比較して、ソフト
ウエア割込みを使用したブレーク処理の場合であっても
当該アドレス実行後に、それがステップP11で実行され
ることから、従来例のようなデータ処理上の矛盾を回避
することが可能となる。すなわち、ハードウエアに係る
ブレーク処理において、例えば、1003番地にブレークポ
イントが設定されるような場合に、ソフトウエア割込み
を使用したブレーク処理をする場合でも従来例のように
当該アドレス実行前の1002番地にブレークポイントが設
定されるという矛盾が生じない。
Therefore, in comparison with the break processing related to the hardware using the external comparator or the like, even in the case of the break processing using the software interrupt, it is executed in step P11 after the execution of the address. Therefore, it becomes possible to avoid the contradiction in data processing as in the conventional example. That is, in the break processing related to the hardware, for example, when a break point is set at the address 1003, even if the break processing using the software interrupt is performed, the address 1002 before the execution of the address as in the conventional example is executed. There is no contradiction that a breakpoint will be set in.

【0056】これにより、ハードウエア及びソフトウエ
アの区別なくトラップ命令に係るデータ処理を併用する
ことが可能となる。
As a result, it is possible to use the data processing relating to the trap instruction together without distinguishing between hardware and software.

【0057】[0057]

【発明の効果】以上説明したように、本発明のデータ処
理装置によれば命令解読部,命令実行部,割込み制御部
が具備され、割込みの「真」又は「偽」を示す制御情報
を判定する判定部が設けられる。
As described above, according to the data processing apparatus of the present invention, the instruction decoding unit, the instruction execution unit, and the interrupt control unit are provided, and the control information indicating the "true" or "false" of the interrupt is determined. A determination unit is provided.

【0058】このため、ソフトウエア割込みの発生,未
発生は命令解読部で解読処理されたnビットの命令コー
ドの制御情報に注目すれば良い。このことで、ソフトウ
エア割込み発生の有無を容易に識別することが可能とな
る。また、1つのトラップ命令のブレークポイントに対
して退避するデータ領域を1領域に削減することが可能
となる。
For this reason, whether the software interrupt has occurred or not has to be focused on the control information of the n-bit instruction code decoded by the instruction decoding unit. This makes it possible to easily identify whether or not a software interrupt has occurred. Further, the data area saved for the breakpoint of one trap instruction can be reduced to one area.

【0059】また、本発明のデータ処理方法によれば、
全ての命令コードにソフトウエア割込みの「真」又は
「偽」を示す制御情報の設定処理をし、該制御情報の判
定処理に基づいてソフトウエア割込みを発生させてい
る。
According to the data processing method of the present invention,
The control information indicating "true" or "false" of the software interrupt is set for all the instruction codes, and the software interrupt is generated based on the control information determination process.

【0060】このため、従来例のようにソフトウエア割
込みを発生させるアドレスの命令コードを簡単に書換え
ることが可能となる。このことで、読出し,退避,書込
み等の処理動作が不要となり、命令の書換えの手順を削
減することが可能となる。
Therefore, it becomes possible to easily rewrite the instruction code of the address for generating the software interrupt as in the conventional example. This eliminates the need for processing operations such as reading, saving, and writing, and reduces the procedure for rewriting instructions.

【0061】また、エミュレータのソフトウエア割込み
を利用してブレークポイントの設定処理をする場合であ
っても、命令コードの最下位ビットに設定された制御情
報の「真」又は「偽」を判定した後に、そのブレーク処
理が実行される。
Even when the breakpoint setting process is performed using the software interrupt of the emulator, it is determined whether the control information set in the least significant bit of the instruction code is "true" or "false". After that, the break processing is executed.

【0062】このため、ハードウエアに係るブレーク処
理とソフトウエア割込みに係るブレーク処理との従来例
のような矛盾を回避することが可能となる。このこと
で、ハードウエア及びソフトウエアの区別なくトラップ
命令に係るデータ処理を併用することが可能となる。
Therefore, it is possible to avoid the contradiction between the break processing related to hardware and the break processing related to software interrupt as in the conventional example. As a result, it is possible to use the data processing related to the trap instruction together without distinguishing between hardware and software.

【0063】これにより、デバッグ処理や仮想計算処理
によりソフトウエア開発をするマイクロプロセッサ等の
データ処理装置の提供に寄与するところが大きい。
This largely contributes to the provision of a data processing device such as a microprocessor for software development by debug processing or virtual calculation processing.

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

【図1】本発明に係るデータ処理装置及びデータ処理方
法の原理図である。
FIG. 1 is a principle diagram of a data processing device and a data processing method according to the present invention.

【図2】本発明の実施例に係るマイクロプロセッサの構
成図である。
FIG. 2 is a configuration diagram of a microprocessor according to an embodiment of the present invention.

【図3】本発明の実施例に係るマイクロプロセッサのデ
ータ処理のフローチャートである。
FIG. 3 is a flowchart of data processing of the microprocessor according to the embodiment of the present invention.

【図4】本発明の実施例に係るフローチャートの補足説
明図である。
FIG. 4 is a supplementary explanatory diagram of the flowchart according to the embodiment of the present invention.

【図5】従来例に係るマイクロプロセッサの構成図及び
割込み処理の説明図である。
FIG. 5 is a configuration diagram of a microprocessor according to a conventional example and an explanatory diagram of interrupt processing.

【図6】従来例に係るマイクロプロセッサの割込み時の
データ処理のフローチャートである。
FIG. 6 is a flowchart of data processing at the time of interruption of the microprocessor according to the conventional example.

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

11…命令解読部、 12…命令実行部、 13…割込み制御部、 14…判定部、 TB…制御情報、 CMD…命令、 CDC…命令コード。 11 ... Instruction decoding unit, 12 ... Instruction execution unit, 13 ... Interrupt control unit, 14 ... Judgment unit, TB ... control information, CMD ... command, CDC ... instruction code.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 命令(CMD)を解読する命令解読部(1
1)と、前記命令(CMD)に基づいて演算を実行する命
令実行部(12)と、前記命令(CMD)の実行中に要求
された割込みを制御する割込み制御部(13)とを具備
し、前記割込みの「真」又は「偽」を示す制御情報(T
B)を判定する判定部(14)が設けられることを特徴
とするデータ処理装置。
1. An instruction decoding unit (1) for decoding an instruction (CMD).
1), an instruction execution unit (12) that executes an operation based on the instruction (CMD), and an interrupt control unit (13) that controls an interrupt requested during execution of the instruction (CMD). , Control information (T) indicating "true" or "false" of the interrupt.
A data processing device comprising a determination unit (14) for determining B).
【請求項2】 請求項1記載のデータ処理装置におい
て、前記制御情報(TB)が命令解読部(11)で解読
処理されたnビットの命令コード(CDC)の特定のビッ
トに割り当てられることを特徴とするデータ処理装置。
2. The data processing device according to claim 1, wherein the control information (TB) is assigned to a specific bit of an n-bit instruction code (CDC) decoded by an instruction decoding unit (11). Characteristic data processing device.
【請求項3】 全ての命令コード(CDC)にソフトウエ
ア割込みの「真」又は「偽」を示す制御情報(TB)の
設定処理をし、前記制御情報(TB)の判定処理に基づ
いてソフトウエア割込みを発生させることを特徴とする
データ処理方法。
3. A control information (TB) setting process that indicates “true” or “false” of a software interrupt is set for all instruction codes (CDC), and software is executed based on the determination process of the control information (TB). A data processing method characterized by generating a wear interrupt.
【請求項4】 請求項3記載のデータ処理方法におい
て、前記ソフトウエア割込みは、命令コード(CDC)に
設定処理された制御情報(TB)の「真」又は「偽」を
判定した後に発生することを特徴とするデータ処理方
法。
4. The data processing method according to claim 3, wherein the software interrupt is generated after determining “true” or “false” of the control information (TB) set and processed in the instruction code (CDC). A data processing method characterized by the above.
JP18864591A 1991-07-29 1991-07-29 Data processing device and method Withdrawn JPH0535499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18864591A JPH0535499A (en) 1991-07-29 1991-07-29 Data processing device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18864591A JPH0535499A (en) 1991-07-29 1991-07-29 Data processing device and method

Publications (1)

Publication Number Publication Date
JPH0535499A true JPH0535499A (en) 1993-02-12

Family

ID=16227345

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18864591A Withdrawn JPH0535499A (en) 1991-07-29 1991-07-29 Data processing device and method

Country Status (1)

Country Link
JP (1) JPH0535499A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5822848B2 (en) * 2010-12-20 2015-11-25 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Exception control method, system and program
US9710270B2 (en) 2010-12-20 2017-07-18 International Business Machines Corporation Exception control method, system, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5822848B2 (en) * 2010-12-20 2015-11-25 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Exception control method, system and program
US9710270B2 (en) 2010-12-20 2017-07-18 International Business Machines Corporation Exception control method, system, and program

Similar Documents

Publication Publication Date Title
JP2005317023A (en) Breakpoint logic unit, debug logic, and breakpoint method for data processing apparatus
JPH0348537B2 (en)
US20020099922A1 (en) Data processing apparatus including a plurality of pipeline processing mechanisms in which memory access instructions are carried out in a memory access pipeline
JPH07120338B2 (en) Method for a data processor to coordinate the execution of instructions by a coprocessor and the data processor
JPS593642A (en) Control register processing system
US5390306A (en) Pipeline processing system and microprocessor using the system
JPH0810437B2 (en) Guest execution control method for virtual machine system
JP2002312162A (en) Processor and processor system
JPH0535499A (en) Data processing device and method
US6233675B1 (en) Facility to allow fast execution of and, or, and test instructions
JP2553200B2 (en) Information processing device
US5813039A (en) Guest execution control system, method and computer process for a virtual machine system
JPS60129839A (en) Information processor
JPH056281A (en) Information processor
JP2525492B2 (en) Programmable controller
US20050216708A1 (en) Processor for performing context switching, a method for performing context switching, a computer program for perform context switching
JPH06324861A (en) System and method for controlling cpu
US6289439B1 (en) Method, device and microprocessor for performing an XOR clear without executing an XOR instruction
KR20080044652A (en) Method for debugging by using stack of cpu
JPH0954694A (en) Pipeline processor and its processing method
JPH04338825A (en) Arithmetic processor
JP3130421B2 (en) Program analysis method and apparatus
JPH0795288B2 (en) Microcomputer
JPS5955546A (en) Firmware processor
JPH05250161A (en) Microcomputer device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19981008