JPH0773049A - Program simulator device - Google Patents

Program simulator device

Info

Publication number
JPH0773049A
JPH0773049A JP5221568A JP22156893A JPH0773049A JP H0773049 A JPH0773049 A JP H0773049A JP 5221568 A JP5221568 A JP 5221568A JP 22156893 A JP22156893 A JP 22156893A JP H0773049 A JPH0773049 A JP H0773049A
Authority
JP
Japan
Prior art keywords
register
instruction
state control
control data
data
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.)
Granted
Application number
JP5221568A
Other languages
Japanese (ja)
Other versions
JP2513142B2 (en
Inventor
Yoshiro Harada
佳郎 原田
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 JP5221568A priority Critical patent/JP2513142B2/en
Publication of JPH0773049A publication Critical patent/JPH0773049A/en
Application granted granted Critical
Publication of JP2513142B2 publication Critical patent/JP2513142B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To find unnecessary register save/restore instructions at the time of simulator execution. CONSTITUTION:This device is provided with a register part 131 which detects an accessed register to generate state control data C1, an interrupt generation part 161 which detects the start and the end of interrupt handling, an instruction discriminating part 143, an interupt level management part 162 which discriminates the interrupt level to generate state control data C4, instruction discriminating parts 141 and 142 which discriminates register save and restore instructions respectively to generate state control data C1 and C2, and a register state detection part 17 which detects save and restore instructions for registers, which are not used in the interrupt processing, and registers, which don't require save and restore because thier contents are not changed when being used in the interrupt processing, out of detected save and restore instructions in response to supply of state control data C1 to C4.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプログラムのシミュレー
タ装置に関し、特に割込処理を含むマイクロコンピュー
タなどのプログラムのシミュレータ装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program simulator device, and more particularly to a program simulator device such as a microcomputer including interrupt processing.

【0002】[0002]

【従来の技術】この種のシミュレータ装置はマイクロコ
ンピュータなどのソフトウェアを効率的に開発するため
の開発ツールとして用いられる。ハードウェアが未完成
の状態でのソフトウェアのデバッグを行うことにより、
ハードウェアと平行してソフトウェアの開発を進めるこ
とができる。
2. Description of the Related Art A simulator device of this type is used as a development tool for efficiently developing software such as a microcomputer. By debugging the software when the hardware is incomplete,
Software development can proceed in parallel with hardware.

【0003】一般に、マイクロコンピュータなどによる
情報処理において、あるプログラムAの処理の進行中
に、それよりも優先度の高いプログラムBの処理要求の
発生により、プログラムBがプログラムAに割込みプロ
グラムAの処理を中断し、プログラムBの処理に移行す
る必要がしばしば発生する。この場合に、割込んだプロ
グラムBの処理が終了すると、再びプログラムAの処理
に戻るが、このプログラムAは中断された所から再開す
ることになる。
Generally, in information processing by a microcomputer or the like, when a processing request of a program B having a higher priority occurs while the processing of a certain program A is in progress, the program B interrupts the program A to process the interrupt program A. It is often necessary to interrupt the process and shift to the processing of program B. In this case, when the processing of the interrupted program B is completed, the processing returns to the processing of the program A, but this program A is restarted from the place where it was interrupted.

【0004】このような割込処理を効率的に行うため
に、一般的には、プログラムAの中断時点における状態
を示す情報として、プログラムステータスワードやプロ
グラムカウンタの内容などとともに各種レジスタの内容
をメモリの退避領域に退避する。
In order to efficiently perform such an interrupt process, generally, as information indicating the state at the time of interruption of the program A, the contents of various registers as well as the contents of the program status word and the program counter are stored in a memory. Save to the save area.

【0005】この退避のとき、次の2つの問題点があ
る。第1の問題点は、各種レジスタの数が多い場合には
これらの退避に要する時間が無視できないということで
ある。第2の問題点は、割込プログラムBで使用しない
レジスタや、使用しても内容を変更しないレジスタを退
避することが無意味であり、処理効率を重視する情報処
理システムでは無視できないということである。
At the time of this saving, there are the following two problems. The first problem is that when the number of various registers is large, the time required to save them cannot be ignored. The second problem is that it is meaningless to save the registers that are not used by the interrupt program B and the registers that do not change the contents even if they are used, and cannot be ignored in an information processing system that places emphasis on processing efficiency. is there.

【0006】第1の問題点を改善するための従来の技術
は、すべてのレジスタを2重、あるいは4重に持ついわ
ゆるレジスタバンクを備えるというものがある。割込処
理時に上記レジスタバンクを選択的に切替えてレジスタ
を使用することにより、レジスタの退避操作を不要とす
る方法である。
A conventional technique for improving the first problem is to provide a so-called register bank having all registers in double or quadruple. This is a method of eliminating the need to save the register by selectively switching the register bank and using the register during interrupt processing.

【0007】第2の問題点を改善するための、特開昭5
7−10960号公報記載の第1の従来の技術は、退避
すべきレジスタのみ退避させるようなハードウェア機構
を設け、このハードウェア機構を専用命令や割込ベクタ
のフイールドで制御することにより所要のレジスタのみ
退避するという方法である。
[0007] To solve the second problem, Japanese Patent Laid-Open No. Sho 5
The first conventional technique disclosed in Japanese Patent Publication No. 7-10960 is provided with a hardware mechanism for saving only the registers to be saved, and the hardware mechanism is controlled by a dedicated instruction or a field of an interrupt vector. This is a method of saving only the registers.

【0008】また、特開昭64−62735号公報記載
の第2の問題点に対する第2の従来の技術は、予め割込
発生時に退避の必要なレジスタの範囲指定用の退避レジ
スタ範囲指定命令をマイクロパログラムに含ませてお
き、割込発生時に上記退避レジスタ範囲指定命令に基ず
きその指定範囲のレジスタのみ退避させるという方法で
ある。
A second conventional technique for the second problem described in Japanese Patent Laid-Open No. 64-62735 is to issue a save register range specification instruction for specifying a range of registers that need to be saved in advance when an interrupt occurs. This is a method in which the registers are included in the microparogram and only the registers in the specified range are saved based on the save register range specification instruction when an interrupt occurs.

【0009】上述のように、レジスタの退避をハードウ
ェア主体に行う方法があるが、そのためには専用のハー
ドウェアが必要であるので、マイクロコンピュータの複
雑化および高価格化などの新たな問題点が発生してい
る。
As described above, there is a method of saving registers mainly by hardware, but since dedicated hardware is required for that purpose, new problems such as complication and cost increase of a microcomputer are created. Is occurring.

【0010】したがって、シミュレータ装置のシミュレ
ーション対象のマイクロコンピュータでは一般的に、割
込処理を高速で実行するために、プログラムステータス
ワードやプログラムカウンタの内容の退避はハードウェ
アで行うが、各種レジスタの退避は、各々のレジスタに
対してソフトウェアのレジスタ退避命令により行う方法
が用いられている。
Therefore, generally, in the microcomputer to be simulated by the simulator device, the contents of the program status word and the program counter are saved by hardware in order to execute the interrupt processing at high speed, but the saving of various registers is performed. Uses a register save instruction of software for each register.

【0011】[0011]

【発明が解決しようとする課題】上述した従来のプログ
ラムのシミュレータ装置は、シミュレーション対象のマ
イクロコンピュータのプログラムにおいて、レジスタの
退避をソフトウェアのレジスタ退避命令により行う方法
を用いているが、上記プログラムの全体の中でのレジス
タの使用内容が必ずしも明確でないため、必要最小限の
レジスタを退避させるようなレジスタ退避命令を有する
プログラムを開発することは非常に困難であるという欠
点があった。
The above-described conventional simulator device for a program uses a method of saving registers in a program of a microcomputer to be simulated by a register saving instruction of software. There is a drawback in that it is very difficult to develop a program having a register saving instruction that saves a minimum necessary number of registers, because the contents of use of the registers are not always clear.

【0012】[0012]

【課題を解決するための手段】本発明のプログラムのシ
ミュレータ装置は、レジスタを備える情報処理装置の割
込処理による前記レジスタの退避および復帰動作が行わ
れる前記情報処理装置のプログラムのシミュレータ装置
において、前記割込処理の開始を検出する割込処理開始
検出手段と、前記割込処理の終了を検出する割込処理終
了検出手段と、アクセスされた前記レジスタである第1
のレジスタを検出し第1の状態制御データを発生するア
クセスレジスタ検出手段と、前記第1のレジスタの退避
命令および復帰命令をそれぞれ判定しそれぞれ第2およ
び第3の状態制御データを発生する退避命令および復帰
命令判定手段と、前記割込処理のレベルを判定し第4の
状態制御データを発生する割込レベル管理手段と、前記
第1〜第4の状態制御データの供給に応答して前記第1
のレジスタのうちの前記割込処理で不使用の第2のレジ
スタと前記割込処理で使用しても内容の変更がない第3
のレジスタとを検出し前記退避命令および復帰命令のう
ち前記第2および第3のレジスタに対する退避命令およ
び復帰命令を検出するレジスタ状態検出手段とを備えて
構成されている。
According to another aspect of the present invention, there is provided a simulator device for a program of the information processing device, wherein the saving and restoring operations of the register are performed by an interrupt process of the information processing device having a register. An interrupt process start detecting means for detecting the start of the interrupt process, an interrupt process end detecting means for detecting the end of the interrupt process, and the accessed register;
Access register detecting means for detecting the first register and generating the first state control data, and a save instruction for determining the save instruction and the restore instruction of the first register and generating the second and third state control data, respectively. And a return instruction determination means, an interrupt level management means for determining the level of the interrupt processing and generating fourth state control data, and the first to fourth state control data in response to the supply of the first to fourth state control data. 1
Second register that is not used in the interrupt process and third register that has no change in contents even if used in the interrupt process
And register state detecting means for detecting the save instruction and the restore instruction for the second and third registers among the save instruction and the restore instruction.

【0013】[0013]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0014】本発明の一実施例の構成をブロックで示す
図1を参照すると、この図に示す本実施例のプログラム
のシミュレータ装置は、本体部分であるシミューレータ
1と、シミュレータ1の制御を行うコンソール2と、シ
ミュレーション対象のプログラム情報を格納した入力用
のファイル3と、シミューレータ1の処理結果を出力情
報として格納する出力用のファイル4とを備える。
Referring to FIG. 1, which is a block diagram showing the configuration of an embodiment of the present invention, a simulator device for a program of the present embodiment shown in the drawing is a simulator 1 which is a main body portion, and a console which controls the simulator 1. 2, an input file 3 storing the program information of the simulation target, and an output file 4 storing the processing result of the simulator 1 as output information.

【0015】シミュレータ1はコンソール2から起動命
令の供給を受けシミュレータ1を起動する起動部11
と、ファイル3から上記プログラム情報の供給を受けメ
モリ部13に供給する入力部12と、入力部12から供
給された上記プログラム情報を記憶するメモリ部13
と、メモリ部13に記憶された上記プログラム情報を解
析命令解析部14と、解析した命令を実行する命令実行
部15と、割込を管理する割込制御部16と、レジスタ
のアクセス内容や割込処理内容から割込処理で不使用あ
るいは使用しても内容変更のないレジスタを検出し退避
・復帰命令のうちこれらレジスタに対する不要な退避・
復帰命令を検出する状態制御部17と、状態制御部17
の処理結果をシミューレータ1の処理結果としてファイ
ル4に出力する出力部18とを備える。
The simulator 1 is provided with an activation unit 11 which activates the simulator 1 by receiving an activation command from the console 2.
And an input unit 12 for supplying the program information from the file 3 to the memory unit 13, and a memory unit 13 for storing the program information supplied from the input unit 12.
An instruction analysis unit 14 that analyzes the program information stored in the memory unit 13, an instruction execution unit 15 that executes the analyzed instruction, an interrupt control unit 16 that manages an interrupt, and access contents and interrupts of registers. From the contents of the interrupt process, registers that are not used in the interrupt process or registers whose contents do not change even if they are used are detected, and unnecessary save / restore commands for these registers in the save / restore instructions are detected.
A state control unit 17 that detects a return instruction, and a state control unit 17
The output unit 18 outputs the processing result of 1 to the file 4 as the processing result of the simulator 1.

【0016】メモリ部13はシミュレーション対象のマ
イクロコンピュータのレジスタに関する情報を格納した
レジスタ部131を備える。
The memory unit 13 includes a register unit 131 that stores information about registers of the microcomputer to be simulated.

【0017】命令解析部14はレジスタ退避命令を判定
する命令判定部141と、レジスタ復帰命令を判定する
命令判定部142と、割込終了にともなうリターン命令
を判定する命令判定部143と、ソフト割込命令を判定
する命令判定部144とを備える。
The instruction analysis section 14 includes an instruction determination section 141 for determining a register save instruction, an instruction determination section 142 for determining a register restore instruction, an instruction determination section 143 for determining a return instruction upon completion of an interrupt, and a soft assignment. An instruction determination unit 144 that determines an embedded instruction.

【0018】割込制御部16は割込を発生する割込発生
部161と、割込レベルを管理する割込レベル管理部1
62とを備える。
The interrupt control unit 16 includes an interrupt generation unit 161 that generates an interrupt and an interrupt level management unit 1 that manages an interrupt level.
And 62.

【0019】これらの構成要素のうち、命令判定部14
4と割込発生部161とにより、割込処理が開始された
ことを検出する割込処理開始検出手段を構成する。命令
判定部143は割込処理の終了を検出する割込処理終了
検出手段を構成する。レジスタ部131はアクセスされ
たレジスタを検出するアクセスレジスタ検出手段を構成
する。命令判定部141と命令判定部142とによりレ
ジスタ退避および復帰のそれぞれの命令を検出するレジ
スタ退避/復帰命令検出手段を構成する。状態検出部1
7は退避および復帰が不必要なレジスタに対するレジス
タ退避/復帰命令を検出する不要レジスタ退避/復帰命
令検出手段を構成する。
Of these constituent elements, the instruction determination unit 14
4 and the interrupt generation unit 161 constitute an interrupt process start detecting means for detecting that the interrupt process is started. The instruction determination unit 143 constitutes an interrupt processing end detecting means for detecting the end of the interrupt processing. The register unit 131 constitutes an access register detecting means for detecting the accessed register. The instruction determination unit 141 and the instruction determination unit 142 constitute a register save / restore instruction detection unit that detects each register save / restore instruction. State detector 1
Reference numeral 7 constitutes unnecessary register save / restore instruction detecting means for detecting a register save / restore instruction for a register which does not require save and restore.

【0020】次に、本実施例の動作について説明する
と、まず、コンソール2からの起動制御により起動部1
1を起動する。起動部11はファイル3から入力部12
を介してメモリ部13にプログラム情報を供給する。ま
た、起動部11はプログラム情報の先頭の命令M1を命
令解析部14に供給する。命令解析部14は命令判定部
141〜144を用いてこの供給を受けた命令M1がレ
ジスタ退避命令、レジスタ復帰命令、割込終了リターン
命令またはソフト割込命令のいずれであるかを識別す
る。識別された命令M1は命令実行部15に供給され、
ここでこの命令M1対応の処理のシミュレーションが実
行される。このとき、シミュレーション対象のマイクロ
コンピュータのレジスタ(以下対象レジスタ)やメモリ
とのアクセスは、メモリ部13とで行われ、このうち上
記対象レジスタとのアクセスはレジスタ部131とで行
われ、レジスタ部131は上記対象レジスタの内容を状
態制御部17に状態制御データC1として供給する。ま
た命令M1がシミュレーションの実行中に割込を発生さ
せる命令である場合には、割込発生部161が割込発生
信号Bを割込レベル管理部162に供給する。このよう
に、命令実行部15での実行結果に基ずいて、次に実行
すべき命令が決定され、その命令M2が再度命令解析部
14に供給される。この命令M2が命令判定部141に
よりレジスタ退避命令であると判定された場合には、上
述の命令M1の場合と同様にレジスタ部131との間で
アクセス動作を行うとともに、この命令M2の内容が状
態制御部17に状態制御データC2として供給される。
また、命令M2が命令判定部142によりレジスタ復帰
命令であると判定された場合には、レジスタ部131と
の間でアクセス動作を行うとともに、この命令M2の内
容が状態制御部17に状態制御データC3として供給さ
れる。また、命令M2が命令判定部143により割込終
了リターン命令であると判定された場合には、この命令
M2の内容がデータRとして割込レベル管理部162に
供給される。さらに、命令M2が命令判定部144によ
りソフト割込命令であると判定された場合には、この命
令M2の内容がデータSBとして割込発生部161に供
給される。割込レベル管理部162のレベルが変化する
と、この変化は状態制御部17に状態制御データC4と
して供給される。状態制御部17はこれら状態制御デー
タC1〜C4の供給に応答して、後述の動作によりこの
命令M2がレジスタ退避・復帰命令である場合にアクセ
ス対象のレジスタが割込処理で不使用あるいは使用して
も内容変更のないレジスタであるかどうかを検出し、こ
の結果によりこの命令M2がレジスタに対する不要な退
避・復帰命令であるかどうかの検出結果の出力情報Oを
生成し、出力部18はこの出力情報Oをファイル4に供
給する。
Next, the operation of this embodiment will be described. First, the start-up unit 1 is controlled by the start-up control from the console 2.
Start 1. The starting unit 11 changes the input from the file 3 to the input unit 12.
The program information is supplied to the memory unit 13 via the. Further, the activation unit 11 supplies the first instruction M1 of the program information to the instruction analysis unit 14. The instruction analysis unit 14 uses the instruction determination units 141 to 144 to identify whether the instruction M1 received by the instruction is a register save instruction, a register restore instruction, an interrupt end return instruction, or a soft interrupt instruction. The identified instruction M1 is supplied to the instruction execution unit 15,
Here, the simulation of the process corresponding to the instruction M1 is executed. At this time, access to the register (hereinafter referred to as target register) of the simulation target microcomputer and memory is performed by the memory unit 13, and among these, access to the target register is performed by the register unit 131 and the register unit 131. Supplies the content of the target register to the state control unit 17 as state control data C1. When the instruction M1 is an instruction to generate an interrupt during execution of the simulation, the interrupt generation unit 161 supplies the interrupt generation signal B to the interrupt level management unit 162. In this way, the instruction to be executed next is determined based on the execution result of the instruction execution unit 15, and the instruction M2 is supplied to the instruction analysis unit 14 again. When this instruction M2 is determined to be a register save instruction by the instruction determination unit 141, an access operation is performed with the register unit 131 as in the case of the above-described instruction M1, and the content of this instruction M2 is It is supplied to the state control unit 17 as state control data C2.
When the instruction determination unit 142 determines that the instruction M2 is a register restore instruction, the instruction M2 performs an access operation with the register unit 131, and the content of the instruction M2 is sent to the state control unit 17 as state control data. Supplied as C3. When the instruction determination unit 143 determines that the instruction M2 is an interrupt end return instruction, the content of the instruction M2 is supplied to the interrupt level management unit 162 as data R. Further, when the instruction determination unit 144 determines that the instruction M2 is a soft interrupt instruction, the content of the instruction M2 is supplied to the interrupt generation unit 161 as the data SB. When the level of the interrupt level management unit 162 changes, this change is supplied to the state control unit 17 as the state control data C4. In response to the supply of the state control data C1 to C4, the state control unit 17 does not use or use the register to be accessed in the interrupt process when the instruction M2 is a register save / restore instruction by the operation described later. Even if it is a register whose contents are not changed, it is detected, and from this result, output information O of a detection result as to whether this instruction M2 is an unnecessary save / restore instruction for the register is generated, and the output unit 18 outputs The output information O is supplied to the file 4.

【0021】ファイル3のプログラム情報と、上記プロ
グラム情報の処理結果のファイル4に供給される出力情
報と、このときの状態制御部17に供給される情報のそ
れぞれの一例をアセンブラソースプログラムの形式で示
す図2(A),(B),(C)を参照すると、図2
(A)に示すプログラム情報は命令I1〜I5,I11
〜I17を有している。命令I1,I2等のMOVはこ
れら命令I1,I2等が転送命令であることを示し、ま
た、A,DE,およびHLはシミュレーション対象のマ
イクロコンピュータのレジスタを示す。[A]はAが指
示するメモリ部13のアドレスの格納内容を示す。ま
た、命令I3,I4のINCWはレジスタDE等の内容
のインクリメント命令であることを示す。命令I5のB
NCは分岐命令であることを示す。命令I11,I12
等のPUSUは退避命令を、命令I15,I16等のP
OPは復帰命令をそれぞれ示す。命令I17のRETI
は割込処理終了リターン命令を示す。図2(B)に示す
出力情報O1のNO−NEEDはその命令の処理不要を
示す。
An example of each of the program information of the file 3, the output information supplied to the file 4 of the processing result of the program information, and the information supplied to the state control unit 17 at this time is in the form of an assembler source program. 2 (A), (B), and (C) shown in FIG.
The program information shown in (A) includes instructions I1 to I5 and I11.
Have I17. MOVs of the instructions I1, I2, etc. indicate that these instructions I1, I2, etc. are transfer instructions, and A, DE, and HL indicate registers of the microcomputer to be simulated. [A] indicates the stored contents of the address of the memory unit 13 designated by A. Further, INCW of the instructions I3 and I4 indicates that it is an increment instruction of the contents of the register DE and the like. B of instruction I5
NC indicates a branch instruction. Instructions I11, I12
PUSU, etc., sends a save instruction to instructions P15, I15, I16, etc.
OP indicates a return instruction, respectively. RETI of instruction I17
Indicates an interrupt processing end return instruction. NO-NEED of the output information O1 shown in FIG. 2B indicates that processing of the instruction is unnecessary.

【0022】命令I1〜I5はそれぞれレジスタDEが
指示するメモリ13のアドレスの格納内容をレジスタA
に転送せよ、レジスタAの内容をレジスタHLが指示す
るメモリ13のアドレスに転送せよ、レジスタDEの内
容をインクリメントせよ、レジスタHLの内容をインク
リメントせよ、および前命令の実施後にキャリーがなけ
ればLABに分岐せよということを示す。また、命令I
11〜I17はそれぞれレジスタHLの内容を退避領域
に退避せよ、レジスタDEの内容を退避領域に退避せ
よ、レジスタAの内容を12Hにせよ、レジスタAの内
容をレジスタHLが指示するメモリ13のアドレスに転
送せよ、退避領域からレジスタDEに退避内容を復帰せ
よ、退避領域からレジスタHLに退避内容を復帰せよ、
割込処理を終了して元の処理に戻れということを示す。
この例では、命令I11〜I17の割込処理中にレジス
タDEの内容の操作を行なっていないので、明らかにこ
のレジスタDEの退避・復帰の命令I12,I15は不
要である。
Each of the instructions I1 to I5 stores the stored contents of the address of the memory 13 designated by the register DE in the register A.
To the address of the memory 13 designated by the register HL, to increment the contents of the register DE, to increment the contents of the register HL, and to the LAB if there is no carry after the execution of the previous instruction. Indicates to branch. Also, the instruction I
11 to I17 save the contents of the register HL to the save area, save the contents of the register DE to the save area, set the contents of the register A to 12H, and set the contents of the register A to the address of the memory 13 designated by the register HL. To the register DE, or from the save area to the register DE, or from the save area to the register HL.
Indicates that the interrupt process can be completed and the original process can be returned to.
In this example, since the contents of the register DE are not manipulated during the interrupt processing of the instructions I11 to I17, the instructions I12 and I15 for saving / restoring the register DE are obviously unnecessary.

【0023】図2(C)は命令I1〜I3のプログラム
情報のシミュレーション中における命令I2のシミュレ
ーションの実行直後に、割込処理I11〜I17が処理
された場合の状態制御部17に供給される状態情報S0
〜S11を示す。情報S0はレジスタA,DE,および
HLの名称と割込Intrとを示す。情報S1は命令I
1の実行に対応しレジスタDEが参照(R)されレジス
タAに書込まれた(W)ことの情報を示し、ともにレジ
スタ部131から状態制御データC1が供給される。情
報S2は命令I2の実行に対応し、レジスタAが参照さ
れレジスタHLも参照されたことの情報を示し、ともに
レジスタ部131から状態制御データC1が供給され
る。情報S3は割込が発生したことを示し、割込発生部
161から割込レベル管理部162を経由して状態制御
データC4が供給される。情報S4は命令I11の実行
に対応し、レジスタHLが退避されたことの情報を示
し、退避命令判定部141から状態制御データC2が供
給される。情報S5は命令I12の実行に対応し、レジ
スタDEが退避されたことの情報を示し、退避命令判定
部141から状態制御データC2が供給される。情報S
6は命令I13の実行に対応し、レジスタAに書込まれ
たことの情報を示し、レジスタ部131から状態制御デ
ータC1が供給される。情報S7は命令I14の実行に
対応し、レジスタAが参照されレジスタHLも参照され
たことの情報を示し、ともにレジスタ部131から状態
制御データC1が供給される。情報S8は命令I15の
実行に対応し、レジスタDEが復帰されたことの情報を
示し、復帰命令判定部142から状態制御データC3が
供給される。情報S9は命令I16の実行に対応し、レ
ジスタHLが復帰されたことの情報を示し、復帰命令判
定部142から状態制御データC3が供給される。情報
S10は命令I17の実行に対応し割込処理の終了を示
し、リターン命令判定部143から割込レベル管理部1
62を経由して状態制御データC4が供給される。情報
S11は命令I17の実行に対応し、レジスタDEが参
照され書込まれたことの情報を示し、レジスタ部131
から状態制御データC1が供給される。
FIG. 2C shows the state supplied to the state control unit 17 when the interrupt processes I11 to I17 are processed immediately after the simulation of the command I2 during the simulation of the program information of the commands I1 to I3. Information S0
~ S11 is shown. The information S0 indicates the names of the registers A, DE, and HL and the interrupt Intr. Information S1 is command I
1 indicates that the register DE is referenced (R) and written (W) to the register A corresponding to the execution of 1, and the state control data C1 is supplied from the register unit 131. The information S2 corresponds to the execution of the instruction I2 and indicates the information that the register A is referenced and the register HL is also referenced, and the state control data C1 is supplied from the register unit 131 together. The information S3 indicates that an interrupt has occurred, and the state control data C4 is supplied from the interrupt generation unit 161 via the interrupt level management unit 162. The information S4 corresponds to the execution of the instruction I11 and indicates the information that the register HL has been saved, and the save instruction determination unit 141 supplies the state control data C2. The information S5 corresponds to the execution of the instruction I12, indicates the information that the register DE has been saved, and the save instruction determination unit 141 supplies the state control data C2. Information S
Reference numeral 6 corresponds to the execution of the instruction I13 and indicates the information written in the register A, and the state control data C1 is supplied from the register unit 131. The information S7 corresponds to the execution of the instruction I14 and indicates the information that the register A is referenced and the register HL is also referenced, and the state control data C1 is supplied from the register unit 131 together. The information S8 corresponds to the execution of the instruction I15, indicates the information that the register DE has been restored, and the restoration instruction determination unit 142 supplies the state control data C3. The information S9 corresponds to the execution of the instruction I16 and indicates the information that the register HL has been restored, and the restoration instruction determination unit 142 supplies the state control data C3. Information S10 corresponds to the execution of the instruction I17 and indicates the end of the interrupt processing, and the return instruction determination unit 143 to the interrupt level management unit 1
The state control data C4 is supplied via 62. The information S11 corresponds to the execution of the instruction I17, indicates the information that the register DE is referred to and written, and the register unit 131
Is supplied with the state control data C1.

【0024】状態制御データC1〜C4の情報から、図
2(B)に示す出力情報O1の結果である「PUSH/
POP DE NO−NEED」すなわち、レジスタD
Eの退避/復帰命令の処理不要のメーセッジを得る。
From the information of the state control data C1 to C4, the result of the output information O1 shown in FIG.
POP DE NO-NEED ", ie register D
Obtain a message that does not require E save / restore instruction processing.

【0025】状態制御データC1〜C4の情報から状態
制御部17が出力情報O1を得るときのフローチャート
を示す図3を参照すると、この図に示す配列data、
変数p1,p2はそれぞれ状態制御部17の中にある状
態値である。変数p1は割込のレベルを示し、最初は0
で、通常のプログラム処理中の割込発生で1、さらに割
込が発生すると2となる。このレベル2の割込終了によ
り変数p1は1に、さらにこのレベル1の割込終了によ
り0に復帰する。変数p2はレジスタ名を示し、レジス
タAでは0、レジスタBCでは1、レジスタDEでは
2、レジスタHLでは3である。これらの変数P1,P
2で示される配列data[p1][p2]の最初の値
は0とする。
Referring to FIG. 3 which is a flow chart when the state control section 17 obtains the output information O1 from the information of the state control data C1 to C4, the array data shown in this figure,
The variables p1 and p2 are state values stored in the state control unit 17, respectively. The variable p1 indicates the interrupt level, and is initially 0.
Then, it becomes 1 when an interrupt occurs during normal program processing, and becomes 2 when an interrupt occurs further. The variable p1 returns to 1 upon completion of the level 2 interrupt, and returns to 0 upon completion of the level 1 interrupt. The variable p2 indicates a register name, which is 0 in the register A, 1 in the register BC, 2 in the register DE, and 3 in the register HL. These variables P1 and P
The first value of the array data [p1] [p2] shown by 2 is 0.

【0026】レジスタとのアクセス命令時に供給される
状態制御データC1により、そのデータC1のレジスタ
名からステップS1〜S8で変数p2の値が決まる。次
に、ステップS9で、data[p1][p2]が1の
場合には、ステップS10に進み、そのdata[p
1][p2]を2にする。ここで、data[p1]
[p2]の値1はレジスタ退避命令が実行済であること
を、2はレジスタ退避命令の実行後にレジスタのアクセ
ス命令が実行されたことをそれぞれ示す。
The value of the variable p2 is determined in steps S1 to S8 from the register name of the data C1 according to the state control data C1 supplied at the time of the access instruction to the register. Next, when data [p1] [p2] is 1 in step S9, the process proceeds to step S10, and data [p]
1] [p2] is set to 2. Where data [p1]
A value of 1 in [p2] indicates that the register save instruction has been executed, and a value of 2 indicates that the register access instruction has been executed after execution of the register save instruction.

【0027】レジスタ退避時に供給される状態制御デー
タC2により、そのデータC2のレジスタ名からステッ
プS11〜S18で変数p2の値が決まる。ステップS
19でそのdata[p1][p2]を1にする。
The value of the variable p2 is determined in steps S11 to S18 from the register name of the data C2 according to the state control data C2 supplied when the register is saved. Step S
At 19 the data [p1] [p2] is set to 1.

【0028】割込レベル変化時に供給される状態制御デ
ータC4では、ステップS20でレベルアップか否かを
判定し、アップ時にはステップS21に進み変数p1の
値をインクリメントし、ステップS22で変数p2が0
〜3のときのdata[p1][p2]が0になる。ま
た、ダウン時にはステップS23に進み変数p2が0〜
3のときのdata[p1][p2]が1になる場合に
出力部18に図2(B)に示す「PUSH/POPレジ
スタ名NO NEED」のメッセージを出力し、ステッ
プS24で変数p1の値をデクリメントする。したがっ
て、この場合は、レジスタの退避命令が実行されたのに
もかかわらず、そのレジスタに対するアクセス命令が一
度も実行されないということを意味する。
With the state control data C4 supplied when the interrupt level changes, it is determined in step S20 whether or not the level is raised, and when it is raised, the process proceeds to step S21, the value of the variable p1 is incremented, and the variable p2 is set to 0 in step S22.
The data [p1] [p2] for 0 to 3 becomes 0. Further, at the time of down, the process proceeds to step S23, where the variable p2 is 0
When data [p1] [p2] in the case of 3 is 1, the message "PUSH / POP register name NO NEED" shown in FIG. 2B is output to the output unit 18, and the value of the variable p1 is output in step S24. Decrement. Therefore, in this case, it means that the access instruction to the register is never executed even though the save instruction of the register is executed.

【0029】本発明の第2の実施例を示す図4を参照す
ると、この図に示す状態制御部17のフローチャートの
図3に示す第1の実施例のフローチャートとの相違点
は、状態制御データC1に対する処理においてステップ
S8の後に、後述のレジスタに対する書込の判定ステッ
プS39〜S43が付加されたことと、状態制御データ
C3の処理に対して変数P2が0〜3のときdata
[p1][p2]が3となる場合に出力部18に「PU
SH/POPレジスタ名NO NEED(READON
LY)」のメッセージを出力するステップS44が付加
されたことである。
Referring to FIG. 4 showing the second embodiment of the present invention, the difference between the flow chart of the state control unit 17 shown in this figure and the flow chart of the first embodiment shown in FIG. When the variable P2 is 0 to 3 for the processing of the state control data C3, data write determination steps S39 to S43 to be described later are added after the step S8 in the processing for C1.
When [p1] [p2] becomes 3, “PU
SH / POP register name NO NEED (READON
That is, step S44 for outputting the message "LY)" is added.

【0030】状態制御データC1の処理に追加されたス
テップS39〜S43の最初のステップS39でdat
a[p1][p2]が0でない場合に、次のステップS
40で状態制御データC1対応のレジスタアクセスデー
タがライト(書込)の値すなわちレジスタの内容変更で
あるか否かを判定し、ライトの値であればステップS4
1でdata[p1][p2]の値が上記レジスタに対
する書込命令が実行されたことを示す2となる。ライト
の値でなければ上記レジスタの参照のみの場合であり、
ステップS42でdata[p1][p2]の値が2か
否かの判断をし、2でなければステップS43で、da
ta[p1][p2]の値が上記レジスタの参照のみを
示す3になる。
In the first step S39 of steps S39 to S43 added to the processing of the state control data C1, dat
If a [p1] [p2] is not 0, the next step S
At 40, it is determined whether the register access data corresponding to the state control data C1 is a write (write) value, that is, a change in register contents, and if it is a write value, step S4
At 1, the value of data [p1] [p2] becomes 2 indicating that the write instruction for the register has been executed. If it is not a write value, it is only a reference to the above register,
In step S42, it is determined whether or not the values of data [p1] [p2] are 2, and if not 2, in step S43, da
The value of ta [p1] [p2] becomes 3 indicating only the reference of the register.

【0031】上述の他の動作については第1の実施例と
同様である。
The other operations described above are the same as in the first embodiment.

【0032】これにより、割込処理中に使用したレジス
タでも内容の参照だけで変更がない場合に退避・復帰命
令を不要として表示できる。
This makes it possible to display the save / restore instruction as unnecessary if the register used during the interrupt processing is not changed by merely referring to the content.

【0033】[0033]

【発明の効果】以上説明したように、本発明のプログラ
ムのシミュレータ装置は、退避命令および復帰命令のう
ち割込処理で不使用なレジスタと上記割込処理で使用し
ても内容の変更がないレジスタとを検出しこれら退避お
よび復帰が不要なレジスタに対する退避命令および復帰
命令を検出するレジスタ状態検出手段を備え、上記退避
命令および復帰命令の所在箇所をシュミレーション作業
者に通知することによって、必要最小限のレジスタを退
避させるようなレジスタ退避命令を有する高効率のプロ
グラムが容易に開発することができるという効果があ
る。
As described above, the simulator device for a program of the present invention does not change the contents of the save instruction and the restore instruction that are unused in the interrupt processing and that is used in the interrupt processing. It is equipped with a register status detection unit that detects registers and save and restore instructions for those registers that do not need to be saved and restored, and notifies the simulation operator of the location of the save and restore instructions. There is an effect that it is possible to easily develop a highly efficient program having a register saving instruction that saves a limited number of registers.

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

【図1】本発明のプログラムのシミュレータ装置の第1
の実施例を示すブロック図である。
FIG. 1 is a first simulator device of a program according to the present invention.
It is a block diagram showing an example of.

【図2】プログラム情報とその処理結果の出力情報と状
態制御部に供給される情報の一例を示す図である。
FIG. 2 is a diagram showing an example of program information, output information of a processing result thereof, and information supplied to a state control unit.

【図3】本実施例の動作の一例を示すフローチャートで
ある。
FIG. 3 is a flowchart showing an example of the operation of this embodiment.

【図4】本発明の第2の実施例の動作の一例を示すフロ
ーチャートである。
FIG. 4 is a flowchart showing an example of the operation of the second exemplary embodiment of the present invention.

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

1 シミュレータ 2 コンソール 3,4 ファイル 11 起動部 12 入力部 13 メモリ部 14 命令解析部 15 命令実行部 16 割込制御部 17 状態制御部 18 出力部 131 レジスタ部 141〜144 命令判定部 161 割込発生部 162 割込レベル管理部 1 Simulator 2 Console 3,4 File 11 Start-up Section 12 Input Section 13 Memory Section 14 Instruction Analysis Section 15 Instruction Execution Section 16 Interrupt Control Section 17 State Control Section 18 Output Section 131 Register Section 141-144 Instruction Determination Section 161 Interrupt Generation Division 162 Interruption level management section

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 レジスタを備える情報処理装置の割込処
理による前記レジスタの退避および復帰動作が行われる
前記情報処理装置のプログラムのシミュレータ装置にお
いて、 前記割込処理の開始を検出する割込処理開始検出手段
と、 前記割込処理の終了を検出する割込処理終了検出手段
と、 アクセスされた前記レジスタである第1のレジスタを検
出し第1の状態制御データを発生するアクセスレジスタ
検出手段と、 前記第1のレジスタの退避命令および復帰命令をそれぞ
れ判定しそれぞれ第2および第3の状態制御データを発
生する退避命令および復帰命令判定手段と、 前記割込処理のレベルを判定し第4の状態制御データを
発生する割込レベル管理手段と、 前記第1〜第4の状態制御データの供給に応答して前記
第1のレジスタのうちの前記割込処理で不使用の第2の
レジスタと前記割込処理で使用しても内容の変更がない
第3のレジスタとを検出し前記退避命令および復帰命令
のうち前記第2および第3のレジスタに対する退避命令
および復帰命令を検出するレジスタ状態検出手段とを備
えることを特徴とするプログラムのシミュレータ装置。
1. A simulator device for a program of the information processing device in which the register save and restore operations are performed by the interrupt process of the information processing device having a register, the interrupt process start detecting the start of the interrupt process. Detecting means; interrupt processing end detecting means for detecting the end of the interrupt processing; access register detecting means for detecting the first register which is the accessed register and generating first state control data; A save instruction / restore instruction determining unit that determines a save instruction and a restore instruction of the first register and generates second and third state control data, and a fourth state that determines a level of the interrupt processing. An interrupt level management means for generating control data, and one of the first registers in response to the supply of the first to fourth state control data. Of the save instruction and the restore instruction, the second register not used in the interrupt processing and the third register whose content is not changed even if used in the interrupt processing are detected and the second and third A simulator device for a program, comprising: a register state detecting means for detecting a save instruction and a restore instruction for a register.
【請求項2】 前記レジスタ状態検出手段が前記第1の
状態制御データの供給に応答して前記割込処理のレベル
を表す第1の変数と前記レジスタの名称を示す第2の変
数とから成る配列データを操作するための前記レジスタ
とのアクセス時に供給される第1の状態制御データの前
記レジタの名称から前記第2の変数を検出し前記配列デ
ータの値が前記レジスタに対する命令が実行済であるこ
とを示す予め定めた第1の数以外のときは処理を終了し
前記第1の数のときはこの配列データの値を前記レジス
タに対する命令の実行後アクセス命令が実行済であるこ
とを示す予め定めた第2の数にする第1の工程と、 前記第2の状態制御データの供給に応答して前記レジス
タの退避時に供給される第2の状態検出データの前記レ
ジスタの名称から前記第2の変数を検出し前記配列デー
タの値を前記第1の数にする第2の工程と、 前記第3の状態制御データの供給に応答して処理を終了
する第3の工程と、 前記第4の状態制御データの供給に応答して前記割込処
理のレベルの変化時に供給される第3の状態検出データ
の前記割込処理のレベルの上昇または低下を判定し前記
レベルの低下の場合に前記第2の変数の予め定めた第3
の数に対応して前記配列データの値が前記第1の数であ
る場合に前記第2および第3のレジスタに対する退避命
令および復帰命令を検出し対応するメッセージを出力し
前記第1の変数をデクリメントする第4の工程とを含む
ことを特徴とする請求項1記載のプログラムのシミュレ
ータ装置。
2. The register state detecting means comprises a first variable indicating the level of the interrupt processing and a second variable indicating the name of the register in response to the supply of the first state control data. The second variable is detected from the name of the register of the first state control data supplied at the time of access to the register for operating the array data, and the value of the array data has already been executed for the register. When it is other than a predetermined first number indicating that there is a certain value, the processing is terminated, and when it is the first number, the value of this array data indicates that the access instruction has been executed after the instruction for the register is executed. A first step of setting a predetermined second number; and from the name of the register of the second state detection data supplied when the register is saved in response to the supply of the second state control data, A second step of detecting a second variable and setting the value of the array data to the first number; a third step of ending the process in response to the supply of the third state control data; In response to the supply of the state control data of No. 4, it is determined whether the level of the interrupt processing of the third state detection data supplied at the time of the change of the level of the interrupt processing is increased or decreased, and when the level is decreased, A predetermined third of the second variable
In the case where the value of the array data is the first number, the save instruction and the restore instruction for the second and third registers are detected, a corresponding message is output, and the first variable is set. The program simulator device according to claim 1, further comprising a fourth step of decrementing.
【請求項3】 レジスタ状態検出手段が前記第1の状態
制御データの供給に応答して前記割込処理のレベルを表
す第1の変数と前記レジスタの名称を示す第2の変数と
から成る配列データを操作するための前記レジスタとの
アクセス時に供給される第1の状態制御データの前記レ
ジタの名称から前記第2の変数を検出し前記配列データ
の値が初期状態を示す予め定めた第4の数のときは処理
を終了し前記第4の数の以外のときは前記第1の状態制
御データ対応のレジスタアクセスデータが書込データで
あるか否かの判定をし書込データである場合には前記配
列データの値を前記レジスタに対する命令の実行後アク
セス命令が実行済であることを示す予め定めた第2の数
にして処理を終了し書込データでない場合には前記配列
データの値が前記第2の数であれば処理を終了し前記第
2の数でなければ前記配列データの値を前記アクセス命
令が参照命令であることを示す予め定めた第5の数にし
て処理を終了する第1Aの工程と、 前記第2の状態制御データの供給に応答して前記レジス
タの退避時に供給される第2の状態検出データの前記レ
ジスタの名称から前記第2の変数を検出し前記配列デー
タの値を前記第1の数にする第2の工程と、 前記第3の状態制御データの供給に応答して前記第2の
変数の予め定めた第3の数に対応して前記配列データの
値が前記第5の数である場合に対応するメッセージを出
力する第3Aの工程と、 前記第4の状態制御データの供給に応答して前記割込処
理のレベルの変化時に供給される第3の状態検出データ
の前記割込処理のレベルの上昇または低下を判定し前記
レベルの低下の場合に前記第2の変数の予め定めた第2
の値に対応して前記配列データの値が前記第1の値であ
る場合に前記第2および第3のレジスタに対する退避命
令および復帰命令を検出し対応するメッセージを出力し
前記第1の変数をデクリメントする第4の工程とを含む
ことを特徴とする請求項1記載のプログラムのシミュレ
ータ装置。
3. An array composed of a first variable representing a level of the interrupt processing and a second variable representing a name of the register in response to the supply of the first state control data by the register state detecting means. A fourth predetermined value that detects the second variable from the name of the register of the first state control data supplied when accessing the register for manipulating data and the value of the array data indicates the initial state. When it is the write data, it is judged whether or not the register access data corresponding to the first state control data is write data, and when it is other than the fourth number, The value of the array data is set to a predetermined second number indicating that the access instruction has been executed after the execution of the instruction to the register, and the processing is terminated. Is the first If the number is 2, the process is terminated, and if it is not the second number, the value of the array data is set to a predetermined fifth number indicating that the access instruction is a reference instruction, and the process is terminated. 1A And the value of the array data by detecting the second variable from the register name of the second state detection data supplied when the register is saved in response to the supply of the second state control data. To the first number, and a value of the array data corresponding to a predetermined third number of the second variable in response to the supply of the third state control data. A third step of outputting a message corresponding to the case of the fifth number; and a third state supplied when the level of the interrupt processing changes in response to the supply of the fourth state control data. Increasing or decreasing the level of detection data interrupt processing Second determined in advance of the determined second variable in the case of reduction of the level
Corresponding to the value of the array data is the first value, a save instruction and a restore instruction to the second and third registers are detected, and a corresponding message is output to output the first variable. The program simulator device according to claim 1, further comprising a fourth step of decrementing.
JP5221568A 1993-09-07 1993-09-07 Program simulator device Expired - Lifetime JP2513142B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5221568A JP2513142B2 (en) 1993-09-07 1993-09-07 Program simulator device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5221568A JP2513142B2 (en) 1993-09-07 1993-09-07 Program simulator device

Publications (2)

Publication Number Publication Date
JPH0773049A true JPH0773049A (en) 1995-03-17
JP2513142B2 JP2513142B2 (en) 1996-07-03

Family

ID=16768776

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5221568A Expired - Lifetime JP2513142B2 (en) 1993-09-07 1993-09-07 Program simulator device

Country Status (1)

Country Link
JP (1) JP2513142B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002543490A (en) * 1999-04-27 2002-12-17 トランジティブ テクノロジーズ リミテッド Method and apparatus for exception handling used in program code conversion
JP2007304926A (en) * 2006-05-12 2007-11-22 Matsushita Electric Ind Co Ltd Information processing method and instruction generation method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002543490A (en) * 1999-04-27 2002-12-17 トランジティブ テクノロジーズ リミテッド Method and apparatus for exception handling used in program code conversion
JP2007304926A (en) * 2006-05-12 2007-11-22 Matsushita Electric Ind Co Ltd Information processing method and instruction generation method
US7865706B2 (en) 2006-05-12 2011-01-04 Panasonic Corporation Information processing method and instruction generating method

Also Published As

Publication number Publication date
JP2513142B2 (en) 1996-07-03

Similar Documents

Publication Publication Date Title
US6327653B1 (en) Technique for easily changing operating systems of a digital computer system using at least two pushbuttons
JP2883784B2 (en) Microcomputer
JPH0533423B2 (en)
JP2513142B2 (en) Program simulator device
JP2662415B2 (en) Trace method
JPH0410081B2 (en)
JP2854248B2 (en) Programmable controller
JPH06324861A (en) System and method for controlling cpu
JP2000076095A (en) Device and method for tracing program and storage medium storing program therefor
JP3024719B2 (en) Arithmetic processing method of programmable controller
JP2000029508A (en) Programmable controller
JPH0764820A (en) Debugging processor
JP2503634B2 (en) Micro program controller
JP2001236247A (en) Software simulator and simulation processing method
JPH05250221A (en) Simulator execution system
JPH07295761A (en) Mirroring magnetic disk device
JPH0535499A (en) Data processing device and method
JP3102381B2 (en) Task debugging device, task debugging method, and recording medium therefor
JPH04338825A (en) Arithmetic processor
JPS5842487B2 (en) Program loading method
JPH08212083A (en) Interruption processor
JP2002196938A (en) Device for exception handling flow and its handling execution method
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPH01308656A (en) Evaluating circuit of program of printer
JPH04209007A (en) User program editing system for programmable controller

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19960305