JPH04125731A - Program breading point setting system - Google Patents

Program breading point setting system

Info

Publication number
JPH04125731A
JPH04125731A JP24684290A JP24684290A JPH04125731A JP H04125731 A JPH04125731 A JP H04125731A JP 24684290 A JP24684290 A JP 24684290A JP 24684290 A JP24684290 A JP 24684290A JP H04125731 A JPH04125731 A JP H04125731A
Authority
JP
Japan
Prior art keywords
address
program
rom
output
register
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
JP24684290A
Other languages
Japanese (ja)
Inventor
Takeshi Miura
剛 三浦
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
Original Assignee
Fujitsu Ltd
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 filed Critical Fujitsu Ltd
Priority to JP24684290A priority Critical patent/JPH04125731A/en
Publication of JPH04125731A publication Critical patent/JPH04125731A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To interrupt a program to perform a debugging or the like even in a ROM program system by substituting the ROM program instruction in an arbitrarily designatable address with an arbitrarily settable instruction at the time of program fetch. CONSTITUTION:The address of a breading point is written in a register 18. When the program stored in a ROM is executed, a processor CPU sets the CPU status to program fetch and puts the ROM address on an address bus AB. A decoding circuit 14 decodes the CPU status and finds the program fetch to output a memory read MEMRD, and an address coincidence detecting circuit 26 compares the address in the register 18 with the address on the address bus AB. When addresses coincide with each other, a control circuit 22 does not output an output enable signal OE (inversion of the high level and the low level) and causes an instruction register 24 to output its set data (an inter rupt instruction or the like) to a data bus DB.

Description

【発明の詳細な説明】 〔発明の概要〕 ROMに格納したプログラムをプロセッサが実行する処
理装置におけるプログラムのブレイクポイント設定方式
に関し、 ROM上のプログラムを任意所望の所で実行中断させる
ブレイクポイント設定方式を提供することを目的とし、 ROMに格納されたプログラムのブレイクポイント設定
方式において、プログラムのブレイクポイントアドレス
を格納するレジスタと、プロセッサが出力するアドレス
と該レジスタの内容をプログラムフェッチ時に比較する
アドレス一致回路と、8亥アドレス一致回路の出力によ
りプロセッサへのROM読出しデータを他のデータに変
更するROMデータ変更回路を設け、該レジスタへ、プ
ログラム走行を中断したい時点のアドレスを設定し、プ
ログラムフェッチ時にプロセッサが出力するアドレスが
該レジスタのアドレスと一致するとき、アドレス−数回
路の出力を受けてROMデータ変更回路が、プロセッサ
へ送られるデータをROM続出しデータでなく他のデー
タに変更するよう構成する。
[Detailed Description of the Invention] [Summary of the Invention] Regarding a program breakpoint setting method in a processing device in which a processor executes a program stored in a ROM, the breakpoint setting method interrupts execution of a program on a ROM at any desired point. In a breakpoint setting method for a program stored in ROM, there is a register that stores the breakpoint address of the program, and an address match that compares the address output by the processor and the contents of the register when fetching the program. A ROM data change circuit is provided that changes the ROM read data to the processor to other data by the output of the circuit and the 8-address matching circuit, and sets the address at the point in time when program execution is desired to be interrupted in the register, and when the program is fetched. When the address output by the processor matches the address of the register, the ROM data change circuit receives the output of the address-number circuit and changes the data sent to the processor to other data instead of ROM successive data. do.

〔産業上の利用分野〕[Industrial application field]

本発明は、ROMに格納したブロクラムをプロセッサが
実行する処理装置におけるプログラムのブレイクポイン
トの設定方式に関する。
The present invention relates to a method for setting breakpoints in a program in a processing device in which a processor executes a block diagram stored in a ROM.

ソフトデバッグにおいては、プログラムの実行を適宜の
所(ブレイクポイント)で中断し、その時のレジスタや
RAM等のデータをチエツクするという方法がしばしば
採用される。本発明はか\るプログラムのブレイクポイ
ントの設定方式に係るものである。
In software debugging, a method is often adopted in which program execution is interrupted at an appropriate point (breakpoint) and data in registers, RAM, etc. at that time is checked. The present invention relates to a method for setting breakpoints in such a program.

〔従来の技術〕[Conventional technology]

プログラムの実行を中断してその時の各部の状態を見る
には、その中断したい所(ブレイクポイント)の命令を
実行する直前で、マンマシンインタフェースを備えたモ
ータプログラムを起動し、キーボードなどから各部のリ
ード命令などを入力すればよい。しかしプログラムは一
般に書換えは不可能なROMに格納され、そしてブレイ
クポイントは任意可変であることが望まれるので、上記
処理には工夫が必要である。
To interrupt program execution and check the status of each part at that time, start the motor program equipped with a man-machine interface just before executing the command at the point where you want to interrupt (breakpoint), and then change each part from the keyboard etc. All you have to do is input a read command, etc. However, since programs are generally stored in a ROM that cannot be rewritten, and breakpoints are desired to be arbitrarily variable, the above processing requires some ingenuity.

第3図はROM型CPUの基本構成を示す。ROMにプ
ログラムが格納され、CPUとROMとはアドレスバス
ABとデータバスDBで接続される。CPUがROMの
プログラムを読出すときは、ROMアドレスとプログラ
ムフェッチコマンドを発行する。ROMアドレス−数回
路12はバスAB上のアドレスがROMアドレスである
とROMのチップセレクトC8信号を出力し、またデコ
ード回路14はCPUステータス信号がプログラムフェ
ッチであるとメモリリードMEMRD  (ROMの出
力イネーブル信号OE)を出力する。これでROMは指
定されたアドレスのデータ(プログラムの命令)を読出
し、それをデータバスDBへのせる。応答回路16はR
OMアドレス−数回路12がC3信号を生じ、またデコ
ード回路14がOE倍信号生じると、その旨をCPUへ
知らせる。これを受けてCPUはデータバスDB上のデ
ータ(プログラムの命令)を取込み、それを実行する。
FIG. 3 shows the basic configuration of a ROM type CPU. A program is stored in the ROM, and the CPU and ROM are connected by an address bus AB and a data bus DB. When the CPU reads a program from the ROM, it issues a ROM address and a program fetch command. The ROM address/number circuit 12 outputs a ROM chip select C8 signal when the address on bus AB is a ROM address, and the decode circuit 14 outputs a memory read MEMRD (ROM output enable signal) when the CPU status signal is a program fetch. output signal OE). The ROM then reads the data (program command) at the specified address and places it on the data bus DB. The response circuit 16 is R
When the OM address number circuit 12 generates the C3 signal and the decode circuit 14 generates the OE multiplication signal, this is notified to the CPU. In response to this, the CPU takes in the data (program instructions) on the data bus DB and executes it.

CPUではプログラムカウンタが次のアドレスを出力し
、上記処理が繰り返されてROMプログラムの各命令が
次々と実行されて行く。
In the CPU, the program counter outputs the next address, and the above process is repeated to execute each instruction of the ROM program one after another.

ROMにプログラムが格納された処理装置のソフトデバ
ッグにおいては従来、該プログラムをROM(リードオ
ンリーメモリ)から読出してRAM(ランダムアクセス
メモリ)上に展開し、か\る状態で適宜、所望のアドレ
スの命令を書換えてプログラムを中断する、例えば上記
命令を割込み命令に書換え、割込み処理部内でマンマシ
ンインタフェースを備えたモニタプログラムを起動して
各部の確認を行う、という方法が採られている。
Conventionally, in software debugging of a processing device in which a program is stored in a ROM, the program is read from the ROM (read-only memory), expanded on a RAM (random access memory), and then moved to a desired address as appropriate. A method is adopted in which the program is interrupted by rewriting the instruction, for example, the above instruction is rewritten to an interrupt instruction, and a monitor program equipped with a man-machine interface is started in the interrupt processing section to check each section.

プログラムの走行を再開する時は、書換えた命令を元の
命令に直し、命令カウンタを1戻して走行開始させる。
When the program restarts running, the rewritten command is replaced with the original command, the command counter is reset by 1, and the program starts running.

適当に走行した所で再び同様処理を行い、これを所望回
数繰り返す。
After the vehicle has traveled appropriately, the same process is performed again, and this process is repeated a desired number of times.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

プログラムがRAM上にあれば、その適所の命令を割込
み命令などに書換えて、プロセッサ等の各部の状態をチ
エツクし、ひいてはプログラムのバグ有無をチエツクす
ることが可能であり(プログラムの開発時はこの方法が
採られる)、プログラムがROMに格納されていても、
それを読出してRAMに展開すれば上記処理が可能であ
る。
If a program is on RAM, it is possible to rewrite the appropriate instructions to interrupt instructions, check the status of each part of the processor, etc., and even check for bugs in the program. method), even if the program is stored in ROM,
The above processing can be performed by reading it out and developing it in RAM.

しかしながら、ROM上のプログラムをRAM上に展開
してデバッグするという方法は、システムのRAM容量
に余裕がある場合に採用可能であり、余裕がなければこ
れは採用できない。
However, the method of expanding a program on ROM onto RAM and debugging it can be adopted if the system has sufficient RAM capacity; otherwise, this method cannot be adopted.

しかしRAMに余裕がない場合もROMプログラムを実
行中断したいことがある。また、プログラムはROMに
格納されて使用されるのが普通で、従ってRAM上のプ
ログラムではなく、最終形態のROM上のプログラムを
走行させ、実行中断してバグチエツクしたい要求がある
However, even if there is not enough RAM, it may be necessary to interrupt the execution of the ROM program. Further, programs are usually stored in ROM and used, and therefore there is a need to run a program in its final form in ROM rather than a program in RAM, and to interrupt execution and check for bugs.

本発明はか\る点に鑑みてなされたもので、R0M上の
プログラムを任意所望の所で実行中断させるブレイクポ
イント設定方式を提供することを目的とするものである
The present invention has been made in view of these points, and it is an object of the present invention to provide a breakpoint setting method for interrupting the execution of a program on R0M at any desired point.

[課題を解決するための手段] 第1図に示すように本発明では所望ブレイクポイントの
アドレスをセットするレジスタ18と、このレジスタ1
8にセットされたアドレスとアドレスバスAB上のアド
レスとを比較するアドレス−数回路26と、ROMデー
タ変更回路20を設ける。ROMデータ変更回路20は
制御回路22と命令レジスタ24を備え、制御回路22
は、アドレス−数回路22からの一致出力を受け、命令
レジスタ24とROMへ信号を出力する。命令レジスタ
24へは、ブレイクポイントで実行する命令例えば割込
み命令を書込んでおく。
[Means for Solving the Problems] As shown in FIG. 1, the present invention includes a register 18 for setting the address of a desired breakpoint, and
An address number circuit 26 that compares the address set to 8 with the address on the address bus AB, and a ROM data change circuit 20 are provided. The ROM data change circuit 20 includes a control circuit 22 and an instruction register 24.
receives a match output from the address/number circuit 22 and outputs a signal to the instruction register 24 and ROM. An instruction to be executed at a breakpoint, such as an interrupt instruction, is written in the instruction register 24.

全図を通してそうであるが、この図で他の図と同じ部分
には同じ符号が付しである。第3図と比較すれば、第1
図はブレイクアドレスレジスタ18と、ROMデータ変
更回路20と、アドレス−数回路26を付加した点が主
として異なる。
As in all figures, parts in this figure that are the same as in other figures are given the same reference numerals. If you compare it with Figure 3, the first
The main difference between the figures is that a break address register 18, a ROM data change circuit 20, and an address number circuit 26 are added.

〔作用] 本発明では走行を中断させたい点即ちブレイクポイント
のアドレスをレジスタ18へ書込んでおく。ROMに格
納されているプログラムを実行するときプロセッサCP
Uは、CPUステータスをプログラムフェッチにすると
共にROMアドレスをアドレスバスABにのせるが、デ
コード回路14はCPUステータスをデコードしてプロ
グラムフェッチであることが分るとメモリリードMEM
RDを出力し、アドレス−数回路26にレジスタ18の
アドレスとアドレスバスABのアドレスとを比較させる
。これらのアドレスが不一致の間は制御回路22はRO
Mに出力イネーブル信号OEを出し、一致すると制御回
路22は出力イネーブル信号OEを出さず(H,Lを反
転する)、代って命令レジスタ24にそこにセットされ
ているデータ(割込み命令など)をデータバスDBへ出
力させる。これでプログラムの走行が中断し、デパック
などを行なうことができる。ブレイクポイントは、レジ
スタ18にセットするアドレスにより任意に変更が可能
である。
[Operation] In the present invention, the address of the point at which the running is to be interrupted, that is, the address of the breakpoint, is written in the register 18. When executing a program stored in ROM, the processor CP
U sets the CPU status to program fetch and puts the ROM address on address bus AB, but when the decoding circuit 14 decodes the CPU status and finds that it is program fetch, it outputs memory read MEM.
RD is output, causing the address-number circuit 26 to compare the address of the register 18 and the address of the address bus AB. While these addresses do not match, the control circuit 22
The control circuit 22 outputs the output enable signal OE to M, and when they match, the control circuit 22 does not output the output enable signal OE (inverts H and L), but instead outputs the data (interrupt command, etc.) set in the instruction register 24. is output to the data bus DB. This will interrupt program execution and allow you to perform depacking, etc. The breakpoint can be changed arbitrarily by the address set in the register 18.

(実施例〕 第1図でROM格納プログラムの実行は第3図とはイ同
様で、CPUがCPUステータスをプログラムフェッチ
とし、アドレスバスABにアドレスをのせると、デコー
ド回路14はメモリリードを出し、これはROMの出力
イネーブルOEになるが、第1図ではこれはデコード回
路14がMEMRDlを出し、この場合はアドレス−数
回路26ではアドレス不一致であるからMEMRDIは
制御回路22に入ってMEMRD2になり、これがRO
MのOEになる。またROMアドレス−数回路12はバ
スAB上のアドレスがROMアドレスであればチップセ
レク)C3を出すので、ROMへは本例では該C5とO
Eが入り、またバスABからアドレスが入り、これでR
OMは該バスABのアドレスで読出しを行なってその読
出しデータをバスDBへのせる。また応答回路16は、
デコード回路14からのMHMRLIIとROMアドレ
ス−数回路12からのC8を受けるとその旨をCPUへ
伝えるので、CPUはデータバスDB上のデータ(プロ
グラムの命令)を取込む。CPUのアドレスカウンタは
次々と次のアドレスを発生し、これに伴なって上記のこ
とが繰り返され、プログラムが進行して行く。
(Example) The execution of the ROM stored program in FIG. 1 is the same as that in FIG. , this becomes the output enable OE of the ROM, but in FIG. 1, the decode circuit 14 outputs MEMRD1, and in this case, there is an address mismatch in the address-number circuit 26, so MEMRDI enters the control circuit 22 and is output to MEMRD2. This is RO
Becomes an OE of M. Also, if the address on bus AB is a ROM address, the ROM address/number circuit 12 outputs the chip select (C3), so in this example, the ROM address/number circuit 12 outputs the chip select (C5) and O
E enters, an address enters from bus AB, and now R
OM performs reading using the address on the bus AB and puts the read data on the bus DB. Further, the response circuit 16 is
When it receives MHMRLII from the decode circuit 14 and C8 from the ROM address/number circuit 12, it notifies the CPU of this fact, so the CPU takes in the data (program instructions) on the data bus DB. The address counter of the CPU generates the next address one after another, and the above process is repeated as the program progresses.

第2図は本発明の一実施例を示す。アドレス−数回路2
6は本例ではアドレスのビット数だけの個数の排他オア
ゲートEORと、これらの出力を受けるアンドゲートA
NDで構成される。排他オアゲー)EORの一方の入力
はブレイクポイントアドレスをセットされるレジスタ1
8の各ビットへ、そして他方の入力はアドレスバスAB
の各線(いずれもアドレスのビット数だけある)へ接続
される。アドレスの各ビットが一致すると各EORの出
力は0、これを反転すると1、これをアンドゲートAN
Dに入力するとアンドゲートの出力は1になり、これが
アドレス−数回路26の一致出力(CHANGE信号)
になる。なおROMアドレス−数回路26のアントゲー
トANDへはデコーダ14の)’ETC)I出力(CP
UステータスがプログラムフェッチであるときにMEM
RDと共に出る)も人力し、これがあるとき(1のとき
)アンドゲートANDの出力は1になる。
FIG. 2 shows an embodiment of the invention. Address-number circuit 2
In this example, 6 indicates exclusive OR gates EOR as many as the number of address bits, and an AND gate A that receives the outputs of these.
Consists of ND. Exclusive or game) One input of EOR is register 1 where the breakpoint address is set.
8 to each bit, and the other input is the address bus AB.
are connected to each line (there are as many as the number of bits in the address). When each bit of the address matches, the output of each EOR is 0, when it is inverted, it is 1, and this is connected to the AND gate AN
When input to D, the output of the AND gate becomes 1, which is the coincidence output (CHANGE signal) of the address-number circuit 26.
become. Note that the )'ETC)I output (CP
MEM when U status is program fetch
(which appears with RD) is also manually input, and when this is present (when it is 1), the output of the AND gate AND becomes 1.

ROMデータ変更回路20は本例では、制御回路22を
構成するインバータINVとアントゲートANDと命令
レジスタ24からなる。アドレス−数回路26から一致
出力があると、これは命令レジスタ24に入ってそこに
セットされたデータ(命令)をデータバスDBへ出力さ
せる。このとき上記−散出力はインバータで反転されて
1が0になるのでゲートANDは閉じ、デコーダ14の
出力MEM)iDlはROMの出力イネーブルOEにな
らない。つまりROMの読出しデータ出力は禁止される
。これと逆に不一致出力では、命令レジスタ24からデ
ータバスDBへのデータ送出は行なわれず、代って不一
致出力はインバータINVで反転されてOが1になり、
ゲー)ANDが開く。従ってこのときはデコーダ14の
出力MEMRDIはゲートANDを通ってMEM)+1
12になり、ROMの出力イネーブル端子OEに入力す
る。これでROMは読出しデータを出力可能になり、該
続出しデータをデータバ′スDBへ送出する。
In this example, the ROM data change circuit 20 includes an inverter INV, an ant gate AND, and an instruction register 24, which constitute a control circuit 22. When there is a match output from the address-number circuit 26, it enters the instruction register 24 and outputs the data (instruction) set therein to the data bus DB. At this time, the above -dispersed output is inverted by the inverter and 1 becomes 0, so the gate AND is closed and the output MEM)iDl of the decoder 14 does not become the output enable OE of the ROM. In other words, output of read data from the ROM is prohibited. On the other hand, when there is a mismatch output, no data is sent from the instruction register 24 to the data bus DB, and instead the mismatch output is inverted by the inverter INV and O becomes 1.
Game) AND opens. Therefore, at this time, the output MEMRDI of the decoder 14 passes through the gate AND
12 and is input to the output enable terminal OE of the ROM. The ROM is now capable of outputting read data and sends the read data to the data bus DB.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、任意に指定可能な
アドレスのROMプログラム命令をプログラムフェッチ
時に、任意に設定可能な命令に置換えることができるの
で、ROMプログラムシステムにおいてもプログラム中
断ができ、デバッグ等を行なうことができる。
As explained above, according to the present invention, a ROM program instruction at an address that can be specified arbitrarily can be replaced with an instruction that can be arbitrarily set when fetching a program, so that a program can be interrupted even in a ROM program system. You can perform debugging, etc.

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

第1図は本発明の原理図、 第2図は本発明の実施例を示すブロック図、第3図はR
OM型CPUの基本構成を示すブロック図である。 第1図で、18はレジスタ、20はROMデータ変更回
路、26はアドレス−数回路である。
Fig. 1 is a principle diagram of the present invention, Fig. 2 is a block diagram showing an embodiment of the present invention, and Fig. 3 is a R
FIG. 2 is a block diagram showing the basic configuration of an OM type CPU. In FIG. 1, 18 is a register, 20 is a ROM data changing circuit, and 26 is an address/number circuit.

Claims (1)

【特許請求の範囲】 1、ROMに格納されたプログラムのブレイクポイント
設定方式において、 プログラムのブレイクポイントアドレスを格納するレジ
スタ(18)と、プロセッサが出力するアドレスと該レ
ジスタの内容をプログラムフェッチ時に比較するアドレ
ス一致回路(26)と、該アドレス一致回路の出力によ
りプロセッサへのROM読出しデータを他のデータに変
更するROMデータ変更回路(20)を設け、 該レジスタへ、プログラム走行を中断したい時点のアド
レスを設定し、プログラムフェッチ時にプロセッサが出
力するアドレスが該レジスタのアドレスと一致するとき
、アドレス一致回路の出力を受けてROMデータ変更回
路が、プロセッサへ送られるデータをROM読出しデー
タでなく他のデータに変更することを特徴とするプログ
ラムのブレイクポイント設定方式。
[Claims] 1. In a breakpoint setting method for a program stored in a ROM, a register (18) that stores a breakpoint address of the program is compared with the address output by the processor and the contents of the register when fetching the program. and a ROM data change circuit (20) that changes the ROM read data to the processor to other data based on the output of the address match circuit. When an address is set and the address output by the processor at the time of program fetch matches the address of the register, the ROM data change circuit receives the output of the address match circuit and changes the data sent to the processor to other data instead of ROM read data. A breakpoint setting method for a program that is characterized by changing data.
JP24684290A 1990-09-17 1990-09-17 Program breading point setting system Pending JPH04125731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24684290A JPH04125731A (en) 1990-09-17 1990-09-17 Program breading point setting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24684290A JPH04125731A (en) 1990-09-17 1990-09-17 Program breading point setting system

Publications (1)

Publication Number Publication Date
JPH04125731A true JPH04125731A (en) 1992-04-27

Family

ID=17154518

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24684290A Pending JPH04125731A (en) 1990-09-17 1990-09-17 Program breading point setting system

Country Status (1)

Country Link
JP (1) JPH04125731A (en)

Similar Documents

Publication Publication Date Title
US7752427B2 (en) Stack underflow debug with sticky base
US4924382A (en) Debugging microprocessor capable of switching between emulation and monitor without accessing stack area
US4747045A (en) Information processing apparatus having an instruction prefetch circuit
JPH04125731A (en) Program breading point setting system
EP2628073B1 (en) Conditional selection of data elements
JPH03271829A (en) Information processor
JPH05216721A (en) Electronic computer
JP2525492B2 (en) Programmable controller
JPH06139084A (en) Information processor
JP2503210B2 (en) Micro program controller
JPH02231634A (en) Method for maintaining interchangeability of software
JP3651099B2 (en) Programmable controller
JPH036758A (en) Microprocessor
JPH0535499A (en) Data processing device and method
JPH06222917A (en) Electronic device
JPH0683986A (en) Single chip microcomputer
JPH0750446B2 (en) Data processing device
JPH03164945A (en) Data processor
JPH0436841A (en) Microcomputer
JPS60164850A (en) Stopping system of instruction executing operation in processor
JPH05108542A (en) Data processor
JPH0481939A (en) Control system for microcomputer
JPH07129435A (en) Processor with runaway monitoring function
JPS6138501B2 (en)
JPS6334640A (en) Information processor