JPH10207704A - Device for changing program of microcomputer - Google Patents

Device for changing program of microcomputer

Info

Publication number
JPH10207704A
JPH10207704A JP9006006A JP600697A JPH10207704A JP H10207704 A JPH10207704 A JP H10207704A JP 9006006 A JP9006006 A JP 9006006A JP 600697 A JP600697 A JP 600697A JP H10207704 A JPH10207704 A JP H10207704A
Authority
JP
Japan
Prior art keywords
instruction
address
program
correction
coincidence
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
JP9006006A
Other languages
Japanese (ja)
Other versions
JP3588951B2 (en
Inventor
Keisuke Tanaka
啓介 田中
Toshimichi Matsuzaki
敏道 松崎
Motonaga Nishimura
始修 西村
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP00600697A priority Critical patent/JP3588951B2/en
Publication of JPH10207704A publication Critical patent/JPH10207704A/en
Application granted granted Critical
Publication of JP3588951B2 publication Critical patent/JP3588951B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide the program changing device of a microcomputer for reducing the increase of a circuit scale to the minimum, relaxing the limitation of the size of a correction program, and reducing time delay until the execution of the correction program is started to the minimum. SOLUTION: This device is provided with a correction address register 31 and a comparator circuit 32. The values of an ROM fetch address and the correction address register are compared by the comparator circuit 32, and the result is transmitted to an instruction decoder 5. The instruction decoder 5 detects coincidence obtained by the comparator circuit 32, and obtains the start address of a correction program from a prescribed address on an RAM 6 by the execution of a microinstruction. Then, the execution of the program is branched to the start address of the correction program in the same RAM 6.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はマイクロコンピュー
タに内蔵されたROMに固定記憶されたプログラムを半
導体集積回路の製造後に修正し、正常に動作させる事が
できるマイクロコンピュータのプログラム変更装置に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer program changing apparatus which can correct a program fixedly stored in a ROM built in a microcomputer after a semiconductor integrated circuit is manufactured, and can operate normally. .

【0002】[0002]

【従来の技術】近年の電子機器にはその高機能化、高性
能化に対応する為にマイクロコンピュータが多く利用さ
れている。一般的にこれらのマイクロコンピュータの動
作を決めるプログラムは読み出し専用メモリ(以下RO
Mと略す)に格納される。特に民生機器等の大量生産さ
れるような機器に使用される場合は、その単価が安い等
の理由から半導体集積回路の製造工程時にプログラムを
固定設置するマスクROMが用いられる場合が多い。し
かしながら前記マスクROMは製造工程時にプログラム
を固定設置する為、製造後に仕様変更の発生やプログラ
ムミスの発覚等の理由によりプログラムに修正を加えた
くても不可能であり、最悪の場合は完成品を廃棄せざる
をえなかった。また、プログラムに修正を加えるために
は再度マイクロコンピュータを製造するしか方法が無く
費用と時間を浪費すると言う問題があった。
2. Description of the Related Art Recently, microcomputers are often used in electronic devices in order to cope with higher functions and higher performance. Generally, a program that determines the operation of these microcomputers is a read-only memory (hereinafter referred to as RO).
M). In particular, when used in mass-produced devices such as consumer devices, a mask ROM in which a program is fixedly installed in a semiconductor integrated circuit manufacturing process is often used because of its low unit price. However, since the mask ROM has a fixed program installed in the manufacturing process, it is not possible to modify the program for reasons such as a change in specifications or the detection of a program error after manufacturing. I had to discard it. Further, there is a problem in that the only way to add a modification to the program is to manufacture the microcomputer again, which wastes cost and time.

【0003】これらの問題を解決するために従来よりい
くつかのプログラム変更装置が考案され、この装置をマ
イクロコンピュータに内蔵することで製造後のマイクロ
コンピュータに対してプログラムの修正を可能ならしめ
ている。
[0003] In order to solve these problems, some program change devices have been devised, and by incorporating these devices in a microcomputer, it is possible to correct a program in a microcomputer after manufacturing.

【0004】図8は従来のプログラム変更装置の第1の
実施例である。図において1はプログラムカウンタ、2
はプログラムが格納されるROM、31は修正アドレス
レジスタ、32は比較回路、33は修正命令レジスタ、
4は選択回路、5は命令解読器である。
FIG. 8 shows a first embodiment of a conventional program changing apparatus. In the figure, 1 is a program counter, 2
Is a ROM in which a program is stored, 31 is a correction address register, 32 is a comparison circuit, 33 is a correction instruction register,
4 is a selection circuit, and 5 is an instruction decoder.

【0005】通常マイクロコンピュータはプログラムカ
ウンタ1により指し示されたROM2上の命令を順次読
み出し、命令解読器5で解読後、マイクロ命令等の実行
により基本動作を行う。
Usually, the microcomputer sequentially reads out the instructions on the ROM 2 pointed to by the program counter 1, decodes them with the instruction decoder 5, and then performs basic operations by executing microinstructions and the like.

【0006】本従来例のプログラム変更装置では、修正
が必要な命令が格納されるアドレスを修正アドレスレジ
スタ31に、修正後の命令を修正命令レジスタに格納す
る。修正アドレスレジスタ31とプログラムカウンタ1
の値は常に比較回路32により比較され、一致を検出す
ると選択回路4を修正命令レジスタ側に切り替え、RO
Mからではなく、修正命令レジスタに格納される命令コ
ードを命令解読器へ供給する事で命令の修正を行ってい
る。修正アドレスレジスタ31と比較回路32及び修正
命令レジスタ33で構成されるプログラム変更装置3a
は、一つのアドレスに格納される命令を修正する為に一
組必要であり、通常は複数のアドレスの命令を修正する
為に複数組のプログラム変更装置3a〜3nが実装され
る。
In the conventional program changing apparatus, an address at which an instruction requiring correction is stored in the correction address register 31, and the corrected instruction is stored in the correction instruction register. Corrected address register 31 and program counter 1
Are always compared by the comparison circuit 32, and when a match is detected, the selection circuit 4 is switched to the correction instruction register side, and RO
The instruction is corrected by supplying the instruction code stored in the correction instruction register to the instruction decoder, not from M. A program change device 3a including a correction address register 31, a comparison circuit 32, and a correction instruction register 33.
Is required to correct an instruction stored at one address, and usually a plurality of sets of program change devices 3a to 3n are mounted to correct instructions at a plurality of addresses.

【0007】図9は従来のプログラム変更装置の第2の
実施例である。図において1はプログラムカウンタ、2
はプログラムが格納されるROM、31は修正アドレス
レジスタ、32は比較回路、34は割込ベクタレジス
タ、5は命令解読器、6はRAMである。
FIG. 9 shows a second embodiment of the conventional program changing apparatus. In the figure, 1 is a program counter, 2
Is a ROM for storing a program, 31 is a modified address register, 32 is a comparison circuit, 34 is an interrupt vector register, 5 is an instruction decoder, and 6 is a RAM.

【0008】本従来例のプログラム変更装置では、修正
が必要な命令が格納されるアドレスを修正アドレスレジ
スタ31に、一連の修正プログラムをRAM6に、修正
プログラムの開始アドレスを割込ベクタレジスタ34に
格納する。修正アドレスレジスタ31とプログラムカウ
ンタ1の値は常に比較回路32により比較され、一致を
検出すると割込要求信号を発生する。CPUが割込要求
信号を受理すると、現在のプログラムカウンタ値等をス
タックに退避し、割込ベクタレジスタ34から割込分岐
先のアドレスを読み出し、プログラムカウンタ1に設定
する。この場合割込ベクタレジスタにはRAM上に格納
した修正プログラムの開始番地が格納されており、割込
処理プログラムとして、修正プログラムを実行すること
になる。
In the conventional program changing apparatus, an address at which an instruction requiring correction is stored in the correction address register 31, a series of correction programs are stored in the RAM 6, and a start address of the correction program is stored in the interrupt vector register 34. I do. The value of the modified address register 31 and the value of the program counter 1 are always compared by the comparing circuit 32, and when a match is detected, an interrupt request signal is generated. When the CPU receives the interrupt request signal, the CPU saves the current program counter value and the like on the stack, reads the address of the interrupt branch destination from the interrupt vector register 34, and sets it in the program counter 1. In this case, the start address of the correction program stored in the RAM is stored in the interrupt vector register, and the correction program is executed as the interrupt processing program.

【0009】図10は従来のプログラム変更装置の第3
の実施例である。図において1はプログラムカウンタ、
2はプログラムが格納されるROM、31は修正アドレ
スレジスタ、32は比較回路、35は分岐アドレスレジ
スタ、4は選択回路、5は命令解読器、36は分岐命令
発生回路である。
FIG. 10 shows a third example of the conventional program changing apparatus.
This is an embodiment of the present invention. In the figure, 1 is a program counter,
2 is a ROM for storing a program, 31 is a correction address register, 32 is a comparison circuit, 35 is a branch address register, 4 is a selection circuit, 5 is an instruction decoder, and 36 is a branch instruction generation circuit.

【0010】本従来例のプログラム変更装置では、修正
が必要な命令が格納されるアドレスを修正アドレスレジ
スタ31に、一連の修正プログラムをRAM6に、修正
プログラムの開始アドレスを分岐アドレスレジスタ35
に格納する。修正アドレスレジスタ31とプログラムカ
ウンタ1の値は常に比較回路32により比較され、一致
を検出すると選択回路4を分岐命令発生回路側に切り替
え、ROMからではなく、分岐命令発生回路により生成
される分岐命令コードを命令解読器へ供給する。前記分
岐命令発生回路では分岐命令の命令オペレーションコー
ドと、それに続くオペランドとして分岐アドレスレジス
タに格納される値を発生する。すなわちCPUは修正プ
ログラムの開始番地への分岐命令を解読・実行する事に
なり、結果として修正プログラムを実行することにな
る。
In the conventional program changing apparatus, an address at which an instruction requiring correction is stored in the correction address register 31, a series of correction programs are stored in the RAM 6, and a start address of the correction program is stored in the branch address register 35.
To be stored. The value of the modified address register 31 and the value of the program counter 1 are always compared by the comparison circuit 32. When a match is detected, the selection circuit 4 is switched to the branch instruction generation circuit side, and the branch instruction generated by the branch instruction generation circuit instead of the ROM. Supply the code to the instruction decoder. The branch instruction generating circuit generates an instruction operation code of the branch instruction and a value stored in the branch address register as an operand following the instruction operation code. That is, the CPU decodes and executes the branch instruction to the start address of the correction program, and as a result, executes the correction program.

【0011】[0011]

【発明が解決しようとする課題】しかしながら従来のプ
ログラム変更装置には下記のような問題があった。
However, the conventional program changing apparatus has the following problems.

【0012】第1の従来例では、比較回路32、修正ア
ドレスレジスタ31、修正命令レジスタ33からなる一
組のプログラム変更装置で修正可能な命令は一箇所のア
ドレスに対応する命令コード(例えば8ビットマイクロ
コンピュータでは1バイトの命令コード)のみである。
プログラム変更装置と修正命令コードが1対1に対応す
る為、複数の命令コードを修正可能とするには複数組の
プログラム変更装置を実装する必要がある。通常は8組
から16組程度実装される場合が多い。一般的な8ビッ
トマイクロコンピュータでは16ビット〜24ビット、
16ビットマイクロコンピュータでは24ビット〜32
ビットのアドレス線を有している。すなわち前記プログ
ラム変更装置の比較回路及び修正アドレスレジスタはア
ドレス線と同じビット幅を備える必要があり、またそれ
らと同じ数の修正命令レジスタ(一組あたりのビット幅
は一般的には8ビットマイクロコンピュータの場合は8
ビット、16ビットマイクロコンピュータの場合は16
ビット)が必要となり、複数組備えるとなると回路規模
を増大するという問題を生じる。また逆に修正プログラ
ムの大きさは実装されるプログラム変更装置の組数に制
限されてしまうという問題もある。
In the first conventional example, an instruction that can be corrected by a set of program change devices including a comparison circuit 32, a correction address register 31, and a correction instruction register 33 is an instruction code (for example, 8 bits) corresponding to one address. In a microcomputer, it is only a 1-byte instruction code).
Since the program change device and the correction instruction code have a one-to-one correspondence, it is necessary to implement a plurality of sets of program change devices in order to be able to correct a plurality of instruction codes. Usually, about 8 to 16 sets are mounted in many cases. 16 bits to 24 bits in a general 8-bit microcomputer,
24-bit to 32 for 16-bit microcomputer
It has a bit address line. That is, the comparison circuit and the correction address register of the program change device need to have the same bit width as the address line, and the same number of correction instruction registers (the bit width per set is generally an 8-bit microcomputer). 8 if
Bit, 16 for a 16-bit microcomputer
Bit) is required, and when a plurality of sets are provided, there arises a problem that the circuit scale is increased. On the contrary, there is also a problem that the size of the correction program is limited by the number of sets of the program change device to be mounted.

【0013】第2の従来例では、一般的な割込を用いて
修正プログラムを実行させる方式である為、プログラム
カウンタ1やプログラム状態語PSW(図示せず)のス
タックへの退避動作を伴う。従ってその為のスタック領
域の確保が必要であり、RAMを浪費するという問題が
ある。またスタックへの退避動作の為の時間が必要とな
り、実行までの時間的なロスを発生する。この事はスピ
ードを要する処理に取っては致命的になりかねない。更
に、近年のマイクロコンピュータでは処理速度の高速化
の為に命令の先読みという技術を用いられることが一般
的で、ROMの読み出しの為のプリフェッチアドレス
と、実際にCPUが実行している命令の実行アドレスと
は異なっている。その為プリフェッチアドレスと修正ア
ドレスレジスタ31の値を比較回路32で比較して、一
致した場合に割込を発生させ、修正プログラムを実行さ
せたとしても正しくその命令を修正したこととはならな
いという問題を生じる。なぜなら、例えば一致を検出し
た時に実行中の命令が分岐命令であった場合修正アドレ
スレジスタで指定した命令を実行しない場合がある。従
って命令先読み技術を利用したマイクロコンピュータに
おいては実行アドレスとの比較が必要であるが、一般的
には命令実行アドレスを保持するレジスタは実装されて
いない場合が多く、プログラム変更装置の為に前記実行
アドレスレジスタを設けることは回路規模を増大させる
という問題を生じる。
In the second conventional example, since the correction program is executed by using a general interrupt, the program counter 1 and a program status word PSW (not shown) are saved on a stack. Therefore, it is necessary to secure a stack area for that, and there is a problem that the RAM is wasted. Also, time is required for the operation of saving to the stack, which causes a time loss until execution. This can be fatal for speedy processes. Further, in recent microcomputers, a technique of prefetching an instruction is generally used to increase the processing speed, and a prefetch address for reading a ROM and the execution of an instruction actually executed by a CPU are generally used. It is different from the address. Therefore, the prefetch address and the value of the correction address register 31 are compared by the comparison circuit 32, and if they match, an interrupt is generated, and even if the correction program is executed, the instruction is not correctly corrected. Is generated. This is because, for example, if the instruction being executed is a branch instruction when a match is detected, the instruction specified by the correction address register may not be executed. Therefore, in a microcomputer using the instruction prefetching technique, comparison with an execution address is necessary. However, in general, a register holding an instruction execution address is often not mounted, and the execution of the program is not performed by a program change device. Providing an address register causes a problem of increasing the circuit scale.

【0014】第3の従来例では、修正アドレスレジスタ
31とプログラムカウンタ1を比較回路32で比較し一
致した場合に分岐命令を発生するという方式であり、特
定の分岐命令を発生させる為の分岐命令発生回路36が
必要となり回路規模を増大させるという問題がある。更
に以下に示す問題も発生する。
In the third conventional example, the correction address register 31 and the program counter 1 are compared by a comparison circuit 32 and a branch instruction is generated when they match, and a branch instruction for generating a specific branch instruction is used. There is a problem that the generation circuit 36 is required and the circuit scale is increased. Further, the following problem occurs.

【0015】近年のマイクロコンピュータでは命令のコ
ードサイズを縮小する為に命令コードのビット長の基本
単位をROMからの読み出しビット幅よりも小さくする
場合がある。図7は縮小化命令コードのフォーマットの
一例を示す。例えば図は16ビットマイクロコンピュー
タであるとする。一般的な16ビットマイクロコンピュ
ータでは命令コードのビット長の基本単位は16ビット
となり、命令オペレーションコードとそれに続くオペラ
ンドを合わせた命令の全ビット長は16ビットの倍数に
なる。また一般的な16ビットマイクロコンピュータで
はROMからの命令の読み出しを16ビット幅で行う
為、連続する命令の境界が読み出したROMデータの中
間に存在することはあり得ない。しかし縮小化命令コー
ドのマイクロコンピュータでは図7(a)の命令nに示
すように命令オペレーションコードが16ビット(M0
〜M1の2バイト)で続くオペランドが24ビット(M
2〜M4の3バイト)であるような場合が存在する。こ
の場合の命令コードの全ビット長は40ビット(M0〜
M4の5バイト)となり16ビット(2バイト)の整数
倍にはならない。このような場合ROMからの読み出し
が16ビット幅であると図7(b)に示すように読み出
したROMデータの中間に連続する命令の境界が存在す
る場合が存在する。同様のことが8ビットマイクロコン
ピュータや32ビットマイクロコンピュータでも存在し
得る。ROMへの命令フェッチアドレスだけを比較して
命令コードを分岐命令のコードにすり替える従来の方式
では、読み出しデータの中間を命令の境界として分岐命
令を生成する事は不可能である。なぜなら分岐命令に同
梱される修正命令直前の命令の最終コードを一意に決め
る事ができないからである。
In recent microcomputers, the basic unit of the bit length of an instruction code may be smaller than the bit width read from a ROM in order to reduce the code size of the instruction. FIG. 7 shows an example of the format of the reduced instruction code. For example, assume that the figure is a 16-bit microcomputer. In a general 16-bit microcomputer, the basic unit of the bit length of the instruction code is 16 bits, and the total bit length of the instruction including the instruction operation code and the operand following thereto is a multiple of 16 bits. In a general 16-bit microcomputer, instructions are read from the ROM with a 16-bit width, so that a boundary between consecutive instructions cannot exist in the middle of the read ROM data. However, in a microcomputer with a reduced instruction code, the instruction operation code has 16 bits (M0) as shown by the instruction n in FIG.
The following operand is 24 bits (M bytes).
2 to M4). In this case, the total bit length of the instruction code is 40 bits (M0 to M0).
M4 (5 bytes), which is not an integral multiple of 16 bits (2 bytes). In such a case, if the reading from the ROM is 16 bits wide, there may be a case where a boundary between consecutive instructions exists in the middle of the read ROM data as shown in FIG. 7B. The same can be said for an 8-bit microcomputer or a 32-bit microcomputer. In the conventional method in which only the instruction fetch address in the ROM is compared and the instruction code is replaced with the code of the branch instruction, it is impossible to generate the branch instruction using the middle of the read data as the instruction boundary. This is because the final code of the instruction immediately before the correction instruction bundled with the branch instruction cannot be uniquely determined.

【0016】本発明は前述の課題を解決し、(1)回路
規模の増大を最小限に留め、(2)修正プログラムの大
きさの制限を緩和し、(3)修正プログラムの実行を開
始するまでの時間遅れを最小限に留め、(4)命令先読
み技術を用いたマイクロコンピュータでも修正箇所のア
ドレスを直接指定可能で、(5)縮小化命令を用いたマ
イクロコンピュータでも修正箇所のアドレスを直接指定
可能なマイクロコンピュータのプログラム変更装置を提
供する事で、ROMに固定記憶された命令の修正をマイ
クロコンピュータの製造後に可能ならしめる事を目的と
する。
The present invention solves the above-mentioned problems, (1) minimizes the increase in circuit scale, (2) relaxes the limitation on the size of the correction program, and (3) starts executing the correction program. (4) The address of the corrected part can be directly specified even with a microcomputer using the instruction prefetching technique, and (5) The address of the corrected part can be directly specified even with a microcomputer using the reduced instruction. It is an object of the present invention to provide a microcomputer program change device that can be designated so that the instruction fixedly stored in the ROM can be modified after the microcomputer is manufactured.

【0017】[0017]

【課題を解決するための手段】前述の課題を解決するた
めに本発明のプログラム変更装置は、修正アドレスレジ
スタと比較回路と一致検出手段を備え、ROMフェッチ
アドレスと修正アドレスレジスタの値を比較回路で比較
し、その結果を命令解読器へ送出し、命令解読器では一
致検出手段にて比較回路での一致を検出するとマイクロ
命令の実行によりRAM上の所定のアドレスから修正プ
ログラムの開始アドレスを取得し、プログラムの実行を
同RAM内の修正プログラムの開始番地へ分岐させると
いう構成を有している。これにより (1)回路規模の増大を最小限に留め、(2)修正プロ
グラムの大きさの制限を緩和し、(3)修正プログラム
の実行を開始するまでの時間遅れを最小限に留め、
(4)命令先読み技術を用いたマイクロコンピュータで
も修正箇所のアドレスを直接指定可能で、(5)縮小化
命令を用いたマイクロコンピュータでも修正箇所のアド
レスを直接指定可能なマイクロコンピュータのプログラ
ム変更装置が得られる。
According to another aspect of the present invention, there is provided a program changing apparatus including a modified address register, a comparing circuit, and a coincidence detecting means. And sends the result to the instruction decoder. When the instruction detector detects a match in the comparison circuit by the match detecting means, the micro-instruction executes to obtain the start address of the correction program from a predetermined address in the RAM. Then, the execution of the program is branched to the start address of the correction program in the RAM. As a result, (1) the increase in the circuit scale is minimized, (2) the restriction on the size of the modification program is relaxed, and (3) the time delay until the execution of the modification program is minimized.
(4) A microcomputer program changing device that can directly specify the address of a correction portion even with a microcomputer using instruction prefetching technology and (5) a microcomputer that can directly specify the address of a correction portion even with a microcomputer using a reduced instruction. can get.

【0018】[0018]

【発明の実施の形態】本発明の請求項1に記載の発明
は、修正アドレスレジスタと比較回路と一致検出手段を
備え、ROMフェッチアドレスと修正アドレスレジスタ
の値を比較回路で比較し、その結果を命令解読器へ送出
し、命令解読器では一致検出手段にて比較回路での一致
を検出するとマイクロ命令の実行によりRAM上の所定
のアドレスから修正プログラムの開始アドレスを取得
し、プログラムの実行を同RAM内の修正プログラムの
開始番地へ分岐させる様にしたもので、プログラム変更
装置を実現する為に必要な回路規模を最小限に留めるこ
とができるという作用を有する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The invention according to claim 1 of the present invention comprises a corrected address register, a comparing circuit, and coincidence detecting means, and compares a ROM fetch address with a value of the corrected address register by a comparing circuit. Is sent to the instruction decoder, and when the match detector detects a match in the comparison circuit, the instruction decoder obtains the start address of the correction program from a predetermined address on the RAM by executing the microinstruction, and executes the program. The program is branched to the start address of the correction program in the RAM, and has the effect of minimizing the circuit scale required to realize the program change device.

【0019】本発明の請求項2に記載の発明は、比較回
路からの一致信号を命令の解読タイミングまで保持する
ようにしたもので、命令先読み技術を用いたマイクロコ
ンピュータで実行アドレスと、ROM読み出しアドレス
が異なる場合でも、単にROM読み出しアドレスとの比
較を行うだけで、該当命令の実行時に修正が可能である
という作用を有する。
According to a second aspect of the present invention, a coincidence signal from a comparison circuit is held until an instruction is decoded. The microcomputer uses an instruction prefetching technique to execute an execution address and read a ROM. Even when the addresses are different, there is an effect that correction can be performed at the time of execution of the corresponding instruction simply by comparing with the ROM read address.

【0020】本発明の請求項3に記載の発明は、修正ア
ドレス記憶手段と比較回路を複数組備えたものであり、
複数箇所のプログラムの修正が可能であるという作用を
有する。
According to a third aspect of the present invention, a plurality of sets of corrected address storage means and comparison circuits are provided.
This has the effect that a program at a plurality of locations can be modified.

【0021】本発明の請求項4に記載の発明は、修正ア
ドレス記憶手段と比較回路を複数組備え、更に比較回路
の一致出力信号をデコードした信号を命令の解読タイミ
ングまで保持するようにしたもので、前述の請求項1か
ら請求項3までの作用に加え、修正箇所を複数にした場
合でも、一致信号の保持に必要な回路規模を最小限に留
めることができるという作用を有する。
According to a fourth aspect of the present invention, a plurality of sets of corrected address storage means and a comparison circuit are provided, and a signal obtained by decoding a coincidence output signal of the comparison circuit is held until an instruction decoding timing. Thus, in addition to the above-described effects of claims 1 to 3, there is an effect that the circuit scale required for holding the coincidence signal can be minimized even when a plurality of correction points are provided.

【0022】本発明の請求項5に記載の発明は、一致信
号を命令コードの転送に同期して転送するもので、一致
信号の転送タイミングと命令コード転送タイミングを共
用化できるという作用を有する。
According to the fifth aspect of the present invention, the coincidence signal is transferred in synchronization with the transfer of the instruction code, and has an effect that the transfer timing of the coincidence signal and the instruction code transfer timing can be shared.

【0023】本発明の請求項6に記載の発明は、一致信
号を直接命令解読器に入力するようにしたもので、一致
の検出を容易に実現できるという作用を有する。
The invention according to claim 6 of the present invention is such that a coincidence signal is directly input to the command decoder, and has an effect that the coincidence can be easily detected.

【0024】本発明の請求項7に記載の発明は、一致の
検出手段として命令解読器に入力される命令レジスタと
マイクロアドレスポインタに特定の値を設定するように
したもので、命令解読器への入力信号を増加させること
なく一致の検出ができるという作用を有する。
According to a seventh aspect of the present invention, a specific value is set in an instruction register and a micro address pointer input to the instruction decoder as a coincidence detecting means. Has the effect that the coincidence can be detected without increasing the input signal of.

【0025】本発明の請求項8に記載の発明は、一致信
号のデコード値を直接RAMアドレスの一部として使用
するようにしたもので、修正プログラムの開始アドレス
取得手段としてのアドレス発生回路の回路規模を増大さ
せることなく容易に実現できるという作用を有する。
According to an eighth aspect of the present invention, a decoded value of a coincidence signal is directly used as a part of a RAM address, and a circuit of an address generating circuit as a starting address acquisition means of a correction program is provided. This has the effect that it can be easily realized without increasing the scale.

【0026】本発明の請求項9に記載の発明は、修正が
必要な命令の解読タイミングで一致の検出を行うように
したもので、縮小化命令コードを用いたマイクロコンピ
ュータであっても、ROM読み出しアドレスとの比較を
行う事で、該当命令の修正が可能であるという作用を有
する。
According to a ninth aspect of the present invention, a coincidence is detected at a timing of decoding an instruction requiring correction. The comparison with the read address has an effect that the corresponding instruction can be corrected.

【0027】以下本発明の実施例について、図面を参照
しながら説明する。図1は本発明の一つの実施例を示す
ブロック図であり、1はプログラムカウンタ、2はプロ
グラムが格納されるROM、31は修正アドレスレジス
タ、32は比較回路、5は命令解読器、6はRAM、7
は一致信号である。修正アドレスレジスタ31と比較回
路32からなるプログラム変更装置は複数の命令を修正
するために複数組実装される(3a〜3n)。プログラ
ムカウンタ1とROM2、比較回路32及びRAM6は
アドレスバスにより接続され、ROM2と命令解読器5
及びRAM6はデータバスにより接続される。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing one embodiment of the present invention, wherein 1 is a program counter, 2 is a ROM in which a program is stored, 31 is a modified address register, 32 is a comparison circuit, 5 is an instruction decoder, and 6 is an instruction decoder. RAM, 7
Is a coincidence signal. A plurality of sets of the program change device including the correction address register 31 and the comparison circuit 32 are mounted to correct a plurality of instructions (3a to 3n). The program counter 1 and the ROM 2, the comparison circuit 32 and the RAM 6 are connected by an address bus.
And the RAM 6 are connected by a data bus.

【0028】修正アドレスレジスタ31にはROM2に
格納される一連の命令コードの修正箇所(不具合箇所)
のアドレスを格納する。修正箇所が複数行に及ぶ場合
は、その修正箇所の先頭の命令コードが格納されるアド
レスを格納する。
The corrected address register 31 has a corrected portion (a defective portion) of a series of instruction codes stored in the ROM 2.
Stores the address of When the corrected portion extends over a plurality of lines, the address where the first instruction code of the corrected portion is stored is stored.

【0029】比較回路32は修正アドレスレジスタに格
納されたアドレス値とROM2に格納された命令コード
を読み出すためにプログラムカウンタ1からアドレスバ
スに出力されたアドレス値とを比較し、両アドレス値の
一致を検出すると一致信号7を出力する。
The comparison circuit 32 compares the address value stored in the corrected address register with the address value output from the program counter 1 to the address bus for reading out the instruction code stored in the ROM 2, and the two address values match. Is detected, a match signal 7 is output.

【0030】通常マイクロコンピュータは、プログラム
カウンタ1によりアドレス指示されたデータをROM2
から順次読み出し、読み出したデータ中の命令オペレー
ションコードを命令解読器5で解読し、マイクロ命令を
起動することで各種動作を実行する。一般的なマイクロ
コンピュータではROM2とRAM6が同一のメモリ空
間に配置されることが多く、マイクロコンピュータに内
蔵されるRAMにはCPU(図示せず)の実行に必要な
情報がデータとして格納保持されることが多いが、プロ
グラムカウンタ1がRAM6上のアドレスを指示する事
で、RAM6上の命令コードを実行することも可能であ
る。
Normally, the microcomputer stores the data addressed by the program counter 1 in the ROM 2.
, The instruction operation code in the read data is decoded by the instruction decoder 5, and various operations are executed by activating the microinstruction. In a general microcomputer, the ROM 2 and the RAM 6 are often arranged in the same memory space, and information necessary for execution of a CPU (not shown) is stored and held in a RAM built in the microcomputer. In many cases, the instruction code on the RAM 6 can be executed by the program counter 1 indicating an address on the RAM 6.

【0031】次に本プログラム変更装置にてROMに固
定記憶された命令を修正する方法について説明する。 (1)ROM2上に固定記憶されたプログラムに不具合
や仕様変更等の理由により修正の必要が生じた場合、そ
の被修正命令コード、又は一連の被修正プログラムの先
頭の命令コードが格納されるアドレス値を修正アドレス
レジスタ31に格納する。 (2)修正プログラムをRAM6に格納する。 (3)RAM6に格納された修正プログラムの開始アド
レスを、RAM6上の予め決められた所定のアドレスに
格納する。
Next, a method of correcting an instruction fixedly stored in the ROM by the present program changing apparatus will be described. (1) When a program fixedly stored in the ROM 2 needs to be modified due to a defect, a change in specification, or the like, the modified instruction code or the address where the first instruction code of a series of modified programs is stored. The value is stored in the correction address register 31. (2) The correction program is stored in the RAM 6. (3) The start address of the correction program stored in the RAM 6 is stored at a predetermined address on the RAM 6.

【0032】以上の操作をマイクロコンピュータのリセ
ットスタート時に外部の不揮発性メモリ等から、マイク
ロコンピュータに一般的に装備されるシリアルインター
フェースやパラレルインタフェース等を介して必要なデ
ータを読み込む事で行う。
The above operation is performed by reading necessary data from an external nonvolatile memory or the like at the time of reset start of the microcomputer via a serial interface or a parallel interface generally provided in the microcomputer.

【0033】これらの動作は予めROM2上に、外部の
不揮発性メモリの特定のアドレスに記憶されたデータの
状態や、マイクロコンピュータの端子の状態により、マ
イクロコンピュータのリセットスタート後起動される初
期設定プログラムの中で起動されるようなプログラムを
組み込んでおけばよい。
These operations are performed according to the state of data previously stored at a specific address in the external nonvolatile memory on the ROM 2 and the state of the terminals of the microcomputer. What is necessary is just to incorporate the program which is started in.

【0034】上記の設定がなされたマイクロコンピュー
タが動作中に、被修正命令コードの読み出し動作を行う
と、比較回路32により修正アドレスレジスタに格納さ
れたアドレス値との一致が検出され、一致信号を出力す
る。
If the operation of reading the instruction code to be corrected is performed during the operation of the microcomputer having the above setting, the comparison circuit 32 detects the coincidence with the address value stored in the modified address register, and outputs the coincidence signal. Output.

【0035】一致信号は命令解読器5に入力され、命令
オペレーションコードの解読タイミングに前記命令解読
器5に備えられた一致信号検知手段により一致が検知さ
れ、解読しようとする命令オペレーションコードが被修
正命令コードである事を検知すると以下の動作を行うマ
イクロ命令を起動する。 (1)RAM6上の所定のアドレスから修正プログラム
の開始アドレス値を取得する。 (2)取得した開始アドレス値に無条件分岐し、プログ
ラムカウンタ1にそのアドレス値を設定する。
The coincidence signal is input to the instruction decoder 5, and a coincidence is detected by the coincidence signal detecting means provided in the instruction decoder 5 at the timing of decoding the instruction operation code, and the instruction operation code to be decoded is corrected. When the instruction code is detected, a micro instruction that performs the following operation is activated. (1) Obtain the start address value of the correction program from a predetermined address on the RAM 6. (2) Unconditionally branch to the acquired start address value and set the address value in the program counter 1.

【0036】以下プログラムカウンタ1を順次インクリ
メント(又はデクリメント)する事でRAM6上に格納
された修正プログラムを読み出し、実行する。
Thereafter, the correction program stored in the RAM 6 is read out and executed by sequentially incrementing (or decrementing) the program counter 1.

【0037】修正プログラムの最後でROM2上のアド
レスへの分岐命令を実行させることで一連のプログラム
修正を完了させる。
A series of program corrections is completed by executing a branch instruction to an address on the ROM 2 at the end of the correction program.

【0038】修正アドレスレジスタ31と比較回路32
からなるプログラム変更装置が1組につき一箇所のプロ
グラム修正が可能である。従ってプログラム変更装置を
複数組(3a〜3n)備えることにより、複数箇所のプ
ログラムの修正が可能である。通常は2〜4組程度実装
すれば十分である。
Corrected address register 31 and comparison circuit 32
Can modify one program per set. Therefore, by providing a plurality of sets (3a to 3n) of program change devices, it is possible to correct programs at a plurality of locations. Usually, it is sufficient to mount about 2 to 4 sets.

【0039】一般的にプログラム変更装置の組数が増大
すると一致信号の本数も増大し、一致信号の保持手段
や、命令解読器における一致の検知手段の回路規模が増
大する。そこで回路規模の増大を最小限に留める為に以
下の対策を行う。
In general, as the number of sets of program change devices increases, the number of coincidence signals also increases, and the circuit scale of the coincidence signal holding means and the coincidence detection means in the instruction decoder increases. Therefore, the following measures are taken to minimize the increase in the circuit scale.

【0040】図2は本発明におけるプログラム変更装置
と一致信号出力手段を示すブロック図である。本図に於
いてはプログラム変更装置が3組(22−1)の場合に
ついて示すが、プログラム変更装置の組数が最大(2n
−1)組の場合についても同様である。
FIG. 2 is a block diagram showing the program change device and the coincidence signal output means according to the present invention. This figure shows a case where the number of program change devices is three (2 2 -1), but the number of sets of program change devices is the maximum (2 n).
-1) The same applies to the case of a set.

【0041】図2(a)において3a〜3cは3組のプ
ログラム変更装置、31a〜31cは修正アドレスレジ
スタ、32a〜32cは比較回路、7a〜7cは一致信
号、8はデコーダ、81、82は一致デコード信号であ
る。
In FIG. 2A, 3a to 3c are three sets of program change devices, 31a to 31c are modified address registers, 32a to 32c are comparison circuits, 7a to 7c are coincidence signals, 8 is a decoder, 81 and 82 are This is a coincidence decode signal.

【0042】修正アドレスレジスタ31a、31bにR
OM上の修正が必要な命令コードが格納されるアドレス
を設定し、比較回路32a〜32cを用いてアドレスバ
ス上に出力された命令フェッチアドレスとの比較を行っ
ている。命令フェッチアドレスと修正アドレスレジスタ
の値が一致すると比較回路32a〜32cは一致信号7
a〜7cを出力する。マイクロコンピュータの命令実行
により修正アドレスレジスタへのデータの書き込みや、
読み出しが可能な事は言うまでもない。
The correction address registers 31a and 31b have R
An address on the OM where an instruction code requiring correction is stored is set, and comparison with the instruction fetch address output on the address bus is performed using the comparison circuits 32a to 32c. When the instruction fetch address matches the value of the correction address register, the comparison circuits 32a to 32c output the match signal 7
a to 7c are output. Writing data to the correction address register by executing instructions from the microcomputer,
It goes without saying that reading is possible.

【0043】デコーダ8は前記一致信号7a〜7cを受
け、図2(b)に示す真理値表に従って一致デコード信
号81、82に変換する。具体的にはどの比較回路も一
致信号を出力していない場合は一致デコード信号として
(一致デコード信号82、一致デコード信号81)=
(0、0)を、比較回路32aが一致信号を出力してい
る場合は(0、1)を、比較回路32bが一致信号を出
力している場合は(1、0)を、比較回路32cが一致
信号を出力している場合は(1、1)を出力する。本真
理値表では、プログラム変更装置の性格上複数の修正ア
ドレスレジスタ31a〜31cに同じ修正アドレスを指
定することを想定していないが、必要であれば複数の一
致信号7a、7bが同時に出力された場合は一致デコー
ド信号として優先順位を付ければよい。例えば番号の若
い比較回路の一致出力を優先する事等が考えられる。こ
の場合は比較回路32aと32bが一致信号を出力して
いる場合は(一致デコード信号82、一致デコード信号
81)=(0、1)の一致デコード信号を出力すればよ
い。なお優先順位の付け方は任意である。またデコード
の割り当ても任意に構成可能であるが、いずれの比較回
路も一致信号を出力しない場合に全ての出力が同一(全
て0又は全て1)になるようにする事が好ましい。
The decoder 8 receives the match signals 7a to 7c and converts them into match decode signals 81 and 82 according to a truth table shown in FIG. Specifically, when none of the comparison circuits output a match signal, the match decode signal (match decode signal 82, match decode signal 81) =
(0, 0), (0, 1) when the comparison circuit 32a is outputting a coincidence signal, and (1, 0) when the comparison circuit 32b is outputting a coincidence signal. Outputs (1, 1) when the output signal is a match signal. In this truth table, it is not assumed that the same correction address is specified in the plurality of correction address registers 31a to 31c due to the nature of the program changing device. However, if necessary, a plurality of coincidence signals 7a and 7b are output simultaneously. In this case, the priority may be set as the coincidence decode signal. For example, it is conceivable to give priority to the coincidence output of a comparison circuit having a smaller number. In this case, when the comparison circuits 32a and 32b output the coincidence signal, the coincidence decode signal of (0, 1) ((coincidence decode signal 82, coincidence decode signal 81)) may be output. The order of priorities is arbitrary. The assignment of decoding can also be arbitrarily configured, but it is preferable that all outputs be the same (all 0s or all 1s) when none of the comparison circuits output a coincidence signal.

【0044】前述のような一致デコード信号を作成する
ことにより、後述するように命令解読器における保持手
段及び一致の検出手段が容易に構成できる。
By generating the coincidence decode signal as described above, the holding means and the coincidence detecting means in the instruction decoder can be easily configured as described later.

【0045】図3は本発明の命令解読器の一つの実施例
である。図に於いて80はn本の一致デコード信号であ
り、図2の実施例の場合は81、82の2本になる。9
はPLAで、91はPLAを構成するAND部、92は
OR部、A0は命令レジスタ、A1は命令キュー、B0
及びB1は命令と同じタイミングで一致デコード信号を
保持する一致デコード信号保持手段、Dはマイクロコン
ピュータの各部を制御し命令を実行させる制御信号であ
る。
FIG. 3 shows an embodiment of the instruction decoder of the present invention. In the drawing, reference numeral 80 denotes n coincidence decode signals. In the case of the embodiment shown in FIG. 9
Is a PLA, 91 is an AND part constituting the PLA, 92 is an OR part, A0 is an instruction register, A1 is an instruction queue, B0
B1 is a coincidence decode signal holding means for holding a coincidence decode signal at the same timing as the instruction, and D is a control signal for controlling each section of the microcomputer to execute the instruction.

【0046】本実施例は命令先読み技術を用いたマイク
ロコンピュータにおける命令解読器を示す。通常プリフ
ェッチアドレスにより指示され、読み出された命令コー
ドはデータバスを経由して命令キューA1に格納され
る。次に命令解読タイミングに命令キューに格納された
命令コードが命令レジスタに転送される。命令レジスタ
に格納された命令コードはPLAのAND部91へ入力
し、解読されPLAのOR部92よりマイクロコンピュ
ータの各部を制御する制御信号Dが出力され、各命令の
実行を行う。
This embodiment shows an instruction decoder in a microcomputer using an instruction prefetching technique. Usually, the instruction code specified and read by the prefetch address is stored in the instruction queue A1 via the data bus. Next, at the instruction decoding timing, the instruction code stored in the instruction queue is transferred to the instruction register. The instruction code stored in the instruction register is input to the AND section 91 of the PLA, decoded, and the control signal D for controlling each section of the microcomputer is output from the OR section 92 of the PLA to execute each instruction.

【0047】プログラムの変更を行う場合は下記の動作
を行う。 (1)図2の実施例に示したようなプログラム変更装置
により、所望の修正アドレスとプリフェッチアドレスの
比較を行い、一致した場合に出力される一致信号をデコ
ードした一致デコード信号80を、プリフェッチされた
命令コードが命令キューに格納されるのと同時に一致デ
コード信号保持手段B1に格納する。 (2)次に命令コードが命令レジスタに転送されるのと
同時に一致デコード信号保持手段B0に転送し、命令解
読タイミングに命令コードがPLAのAND部91に入
力されるのと同時に一致デコード信号保持手段B0に格
納される一致デコード信号をPLAのAND部91に入
力する。 (3)PLAでは一致デコード信号が入力されると、
(図2の実施例では(0、1)、(1、0)、(1、
1))命令コードの種別に無関係に以下の動作を実行す
るマイクロプログラムを起動する。
When the program is changed, the following operation is performed. (1) A desired modified address is compared with a prefetch address by a program changing device as shown in the embodiment of FIG. 2, and a coincidence decode signal 80 obtained by decoding a coincidence signal output in the case of a match is prefetched. The stored instruction code is stored in the coincidence decode signal holding means B1 at the same time as being stored in the instruction queue. (2) Next, the instruction code is transferred to the coincidence decode signal holding means B0 at the same time as the instruction code is transferred to the instruction register, and the coincidence decode signal is held at the same time as the instruction code is input to the AND section 91 of the PLA at the instruction decoding timing. The coincidence decode signal stored in the means B0 is input to the AND section 91 of the PLA. (3) In the PLA, when the coincidence decode signal is input,
(In the embodiment of FIG. 2, (0, 1), (1, 0), (1,
1)) A microprogram that executes the following operation regardless of the type of instruction code is started.

【0048】(a)RAM上の所定のアドレスから修正
プログラムの開始アドレス値を取得する。
(A) Obtain the start address value of the correction program from a predetermined address on the RAM.

【0049】(b)取得した開始アドレス値に無条件分
岐し、プログラムカウンタにそのアドレス値を設定す
る。 (4)以下プログラムカウンタを順次インクリメント
(又はデクリメント)する事でRAM上に格納された修
正プログラムを読み出し、実行する。 (5)修正プログラムの最後でROM上のアドレスへの
分岐命令を実行させることで一連のプログラム修正を完
了させる。
(B) Unconditionally branch to the acquired start address value and set the address value in the program counter. (4) The correction program stored in the RAM is read out and executed by sequentially incrementing (or decrementing) the program counter. (5) A series of program corrections is completed by executing a branch instruction to an address on the ROM at the end of the correction program.

【0050】なお本実施例では一致デコード信号を命令
解読タイミングまで保持し、PLAのAND部に入力し
たが、デコードをしていない一致信号を命令解読タイミ
ングまで保持し直接入力しても良い。
In this embodiment, the coincidence decode signal is held until the instruction decoding timing and input to the AND section of the PLA. However, the undecoded match signal may be held until the instruction decoding timing and directly input.

【0051】また本実施例では一致デコード信号をn本
そのままPLAのAND部91に入力するように構成し
たが、図2の実施例のデコーダでは一致が生じた場合に
はいずれかのビットが’1’となるため、n本の一致デ
コード信号をORゲートに入力し、1本の信号に集約す
る事で更に構成を簡単にできる。
In this embodiment, n coincidence decode signals are directly inputted to the AND section 91 of the PLA. However, in the decoder of the embodiment of FIG. Since it is 1 ', the configuration can be further simplified by inputting n coincidence decode signals to the OR gate and consolidating them into one signal.

【0052】図4は本発明の命令解読器の別の実施例で
ある。図に於いて80はn本の一致デコード信号であ
り、図2の実施例の場合は81、82の2本になる。9
はPLAで、91はPLAを構成するAND部、92は
OR部、A0は命令レジスタ、A1は命令キュー、B0
及びB1は命令と同じタイミングで一致デコード信号を
保持する一致デコード信号保持手段、Cはマイクロアド
レスポインタ、Dはマイクロコンピュータの各部を制御
し命令を実行させる制御信号、Eはマイクロアドレス制
御信号である。
FIG. 4 shows another embodiment of the instruction decoder of the present invention. In the drawing, reference numeral 80 denotes n coincidence decode signals. In the case of the embodiment shown in FIG. 9
Is a PLA, 91 is an AND part constituting the PLA, 92 is an OR part, A0 is an instruction register, A1 is an instruction queue, B0
B1 is a coincidence decode signal holding means for holding a coincidence decode signal at the same timing as the instruction, C is a microaddress pointer, D is a control signal for controlling each part of the microcomputer to execute the instruction, and E is a microaddress control signal. .

【0053】一般的なマイクロコンピュータでは命令解
読器にマイクロコード技術を用いられる事が多い。この
場合ハードウエアとしてはPLAが用いられ、PLAの
AND部入力には命令レジスタ値とマイクロアドレスポ
インタ値が入力される。またマイクロアドレスポインタ
は一つ前の状態によりマイクロアドレス制御信号にて決
定される。すなわち命令レジスタ値とマイクロポインタ
値で各命令の実行状態が決められる。
In a general microcomputer, a microcode technology is often used for an instruction decoder. In this case, a PLA is used as hardware, and an instruction register value and a micro address pointer value are input to an AND section input of the PLA. The micro address pointer is determined by the micro address control signal according to the previous state. That is, the execution state of each instruction is determined by the instruction register value and the micropointer value.

【0054】本実施例では図3の実施例と同様に、下記
の動作を行う。 (1)所望の修正アドレスとプリフェッチアドレスの比
較を行い、一致した場合に出力される一致信号をデコー
ドした一致デコード信号80を、プリフェッチされた命
令コードが命令キューに格納されるのと同時に一致デコ
ード信号保持手段B1に格納する。 (2)次に命令コードが命令レジスタに転送されるのと
同時に一致デコード信号保持手段B0に転送し、一致を
示す場合(図2の実施例では(0、1)、(1、0)、
(1、1))は命令レジスタとマイクロアドレスポイン
タを特定の値に設定し、その値をPLAのAND部91
に入力する。 (3)PLAでは前記特定の値が入力されると、以下の
動作を実行するマイクロプログラムを起動する。
In this embodiment, the following operation is performed as in the embodiment of FIG. (1) A desired modified address is compared with a prefetch address, and a match decode signal 80 obtained by decoding a match signal output in the case of a match is decoded at the same time when the prefetched instruction code is stored in the instruction queue. It is stored in the signal holding means B1. (2) Next, at the same time when the instruction code is transferred to the instruction register, the instruction code is transferred to the coincidence decode signal holding means B0 to indicate a match ((0, 1), (1, 0) in the embodiment of FIG. 2).
(1, 1)) sets the instruction register and the micro address pointer to specific values, and sets the values to the AND unit 91 of the PLA.
To enter. (3) In the PLA, when the specific value is input, a microprogram for executing the following operation is started.

【0055】(a)RAM上の所定のアドレスから修正
プログラムの開始アドレス値を取得する。
(A) Obtain the start address value of the correction program from a predetermined address on the RAM.

【0056】(b)取得した開始アドレス値に無条件分
岐し、プログラムカウンタにそのアドレス値を設定す
る。 (4)以下プログラムカウンタを順次インクリメント
(又はデクリメント)する事でRAM上に格納された修
正プログラムを読み出し、実行する。 (5)修正プログラムの最後でROM上のアドレスへの
分岐命令を実行させることで一連のプログラム修正を完
了させる。
(B) Unconditionally branch to the acquired start address value and set the address value in the program counter. (4) The correction program stored in the RAM is read out and executed by sequentially incrementing (or decrementing) the program counter. (5) A series of program corrections is completed by executing a branch instruction to an address on the ROM at the end of the correction program.

【0057】命令レジスタ及びマイクロアドレスポイン
タを特定のアドレスに設定する方法としては、それぞれ
をセット又はリセット付きのレジスタで構成し、一致デ
コード信号で制御しても良いし、またはそれぞれの出力
にANDゲートやORゲートを挿入して一致デコード信
号でゲートしても良い。
As a method of setting the instruction register and the micro address pointer to specific addresses, each may be constituted by a register with a set or reset and controlled by a coincidence decode signal, or an AND gate may be connected to each output. Alternatively, an OR gate may be inserted and gated with the coincidence decode signal.

【0058】図3及び図4に示した実施例では一致デコ
ード信号を命令コードの解読タイミングまで保持する手
段を有するため、変更命令の格納されるアドレスは単に
プリフェッチアドレスと比較すればよく、プリフェッチ
アドレスは通常アドレスバスに出力されている為、修正
アドレスレジスタとアドレスバスの比較を行うだけでよ
い為、プログラム変更装置の構成を容易にできる。
Since the embodiment shown in FIGS. 3 and 4 has means for holding the coincidence decode signal until the decoding timing of the instruction code, the address where the change instruction is stored may be simply compared with the prefetch address. Is normally output to the address bus, it is only necessary to compare the corrected address register with the address bus, so that the configuration of the program changing device can be simplified.

【0059】前述の実施例では命令解読器の構成をPL
Aを用いて実現してあるが、ランダムロジックを用いて
も構成が可能なことは言うまでもない。
In the above-described embodiment, the configuration of the instruction decoder is PL
Although it is realized by using A, it is needless to say that the configuration can be made by using random logic.

【0060】また命令プリフェッチ時の命令キューは1
段の場合について説明したが、2段以上の場合について
も同様である。
The instruction queue at the time of instruction prefetch is 1
Although the case of stages has been described, the same applies to the case of two or more stages.

【0061】本発明のプログラム変更装置では被修正命
令の実行サイクルで、マイクロプログラムの実行により ・RAM上の所定のアドレスから修正プログラムの開始
アドレス値の取得 ・取得した開始アドレス値に無条件分岐し、プログラム
カウンタにそのアドレス値を設定 の動作を行うが、図5はこの時に修正プログラムの開始
アドレスを格納するRAM上のアドレスを生成する手段
の実施例を示す。
In the program change device of the present invention, in the execution cycle of the instruction to be corrected, the microprogram is executed. ・ Acquisition of the start address value of the correction program from a predetermined address on the RAM ・ Unconditional branch to the acquired start address value The operation of setting the address value in the program counter is performed. FIG. 5 shows an embodiment of means for generating an address on the RAM for storing the start address of the correction program at this time.

【0062】図において8はデコーダ、B0及びB1は
命令と同じタイミングで一致デコード信号を保持する一
致デコード信号保持手段であり、図3及び図4に示した
実施例の一部分と同一である。
In the figure, reference numeral 8 denotes a decoder, and B0 and B1 are coincidence decode signal holding means for holding a coincidence decode signal at the same timing as the instruction, which is the same as a part of the embodiment shown in FIGS.

【0063】また図6は修正プログラムの開始アドレス
を格納するRAM空間とアドレス信号のビット構成を示
す。
FIG. 6 shows the RAM space for storing the start address of the correction program and the bit configuration of the address signal.

【0064】図6(a)においてF0からF2は3組の
プログラム変更装置に対応する修正プログラムの開始ア
ドレス格納領域である。
In FIG. 6A, F0 to F2 are the start address storage areas of the correction programs corresponding to the three sets of program change devices.

【0065】本実施例では簡単化の為に修正プログラム
を格納するRAMのアドレス空間を216バイト(アドレ
ス信号線は16ビット)、プログラム変更装置は図2に
示す様に3組であるとするが、アドレス信号線及びプロ
グラム変更装置の組数は任意の場合でも同様に考えるこ
とができる。
[0065] 2 16 bytes of RAM address space for storing a correction program for simplification in the present embodiment (the address signal lines 16 bits), and the program changing device is three pairs as shown in FIG. 2 However, the number of sets of the address signal lines and the program change devices can be similarly considered in any case.

【0066】RAM空間のアドレス信号線が16ビット
である為、図6(a)に示す様に修正プログラムの開始
番地を格納する16ビット(2バイト)の領域を3組確
保する。本実施例では領域F0(X’0202’とX’
0203’番地)に図2(a)のプログラム変更装置3
aの修正プログラム開始アドレスを、同様に領域F1
(X’0204’とX’0205’番地)にプログラム
変更装置3bの修正プログラム開始アドレスを、領域F
2(X’0206’とX’0207’番地)にプログラ
ム変更装置3cの修正プログラム開始アドレスを格納す
る。
Since the address signal lines in the RAM space are 16 bits, as shown in FIG. 6A, three sets of 16-bit (2 bytes) areas for storing the start address of the correction program are secured. In this embodiment, the region F0 (X'0202 'and X'
(0203 ') at the program change device 3 in FIG.
a. The correction program start address of the
(Addresses X'0204 'and X'0205'), the modified program start address of the program modifying device 3b is stored in the area F
2 (addresses X'0206 'and X'0207') stores the correction program start address of the program change device 3c.

【0067】一般的な16ビットマイクロコンピュータ
ではRAM空間へのアクセスを16ビット単位で行うこ
とができる。この場合は修正プログラムの開始アドレス
を取得する為には一致信号を出力したプログラム変更装
置3a〜3cのいずれかに従って単にX’202’番地
又はX’204’番地又はX’0206’番地のデータ
を16ビット単位で読み出せばよい。これらのアドレス
は図6(b)に示すように16ビットのアドレス信号線
のうち上位の15ビット(ビット3〜ビット15)には
固定値b’000000100000’を次の2ビット
(ビット1〜ビット2)は図2(b)のデコーダに従う
一致デコード信号を、最後の1ビット(ビット0)は固
定値b’0’を出力すればよい。一致デコード信号は図
5に示す様に修正プログラムの開始番地取得タイミング
で一致デコード信号保持手段B0に格納されるデータを
アドレスバスに出力するだけでよく、容易に回路を構成
できる。
A general 16-bit microcomputer can access the RAM space in 16-bit units. In this case, in order to obtain the start address of the correction program, the data of the address X'202 ', the address X'204', or the address X'0206 'is simply read according to any of the program changers 3a to 3c which output the coincidence signal. What is necessary is just to read in 16-bit units. As shown in FIG. 6B, the upper 15 bits (bit 3 to bit 15) of the 16-bit address signal line are assigned a fixed value b'00000000100000 'to the next two bits (bit 1 to bit 1). 2) may output a coincidence decode signal according to the decoder of FIG. 2B, and the last bit (bit 0) may output a fixed value b'0 '. As shown in FIG. 5, the coincidence decode signal only needs to output the data stored in the coincidence decode signal holding means B0 to the address bus at the start address acquisition timing of the correction program, and the circuit can be easily formed.

【0068】また8ビットマイクロコンピュータの様に
一度に8ビットのデータしかアクセスできない場合は、
8ビットデータを2回取得すればよく、図6(b)の最
下位ビット(ビット0)を固定値ではなく、1度目のア
ドレス取得でb’0’を、2度目のアドレス取得でb’
1’を出力する事で解決できる。
When only 8-bit data can be accessed at a time like an 8-bit microcomputer,
It is sufficient to acquire the 8-bit data twice, and the least significant bit (bit 0) in FIG. 6B is not a fixed value but b'0 'in the first address acquisition and b' in the second address acquisition.
This can be solved by outputting 1 '.

【0069】なお本実施例では一致デコード信号をビッ
ト1〜ビット2の2ビットに出力するようにしたが、修
正プログラム開始アドレス格納領域の構成や、RAM空
間のアドレスビット幅、マイクロコンピュータの扱える
データのビット幅(4ビット、8ビット、16ビット、
32ビット、64ビット等)により任意のビット位置に
出力する構成が考えられる。
In this embodiment, the coincidence decode signal is output in two bits of bit 1 and bit 2. However, the configuration of the correction program start address storage area, the address bit width of the RAM space, and the data that can be handled by the microcomputer Bit width (4 bits, 8 bits, 16 bits,
32 bits, 64 bits, etc.).

【0070】また図2(b)のデコーダの構成により一
致デコード信号がb’00’の場合はどのプログラム変
更装置も一致信号を出力しない場合に割り当てた為、
X’0200’〜X’0201’番地は未使用とした
が、デコーダの構成が変われば、割り当てる修正プログ
ラム開始アドレス格納領域のアドレスも変わってくる事
は言うまでもない。
Also, according to the decoder configuration of FIG. 2B, when the coincidence decode signal is b'00 ', it is assigned when no program change device outputs the coincidence signal.
Although the addresses X'0200 'to X'0201' are not used, it goes without saying that if the configuration of the decoder changes, the address of the correction program start address storage area to be allocated also changes.

【0071】図7は縮小化命令コードのフォーマットを
示す。例えば図は16ビットマイクロコンピュータであ
るとする。この場合の縮小化命令コードの基本単位は8
ビットであり、命令nは命令オペレーションコードが1
6ビット(M0〜M1の2バイト)、オペランドが24
ビット(M2〜M4の3バイト)であるとする。また続
く命令n+1は命令オペレーションコードが同じく16
ビット(N0〜N1の2バイト)、オペランドが16ビ
ット(N2〜N3の2バイト)であるとする。この場合
図7(b)に示す様に命令nがX’0100’番地から
格納されているとすると、X’0104’番地には命令
nの最終コードM4が、X’0105’番地には命令n
+1の最初のコードN0が格納される事になる。一般的
な16ビットマイクロコンピュータでは命令を16ビッ
ト単位でフェッチする為、X’0104’番地とX’0
105’番地はアドレスX’0104’番地のデータと
して同時にフェッチされる事になる。
FIG. 7 shows the format of the reduced instruction code. For example, assume that the figure is a 16-bit microcomputer. The basic unit of the reduced instruction code in this case is 8
Instruction n has an instruction operation code of 1
6 bits (2 bytes M0 to M1), 24 operands
Bits (M3 to M4 bytes). The subsequent instruction n + 1 has the same instruction operation code of 16
Assume that bits (2 bytes of N0 to N1) and the operand are 16 bits (2 bytes of N2 to N3). In this case, assuming that the instruction n is stored from the address X'0100 'as shown in FIG. 7B, the final code M4 of the instruction n is stored at the address X'0104' and the instruction n is stored at the address X'0105 '. n
The first code N0 of +1 is stored. In a general 16-bit microcomputer, instructions are fetched in 16-bit units, so that addresses X'0104 'and X'0
Address 105 'is fetched simultaneously as data at address X'0104'.

【0072】例えば被修正命令が命令n+1であった場
合、修正アドレスレジスタにはX’0104’を格納す
る事になる。従って命令の境界が命令フェッチ単位の境
界に無い場合は被修正命令の先頭を含むフェッチデータ
のアドレスを修正アドレスレジスタに指定する。
For example, if the instruction to be modified is instruction n + 1, X'0104 'is stored in the modified address register. Therefore, when the boundary of the instruction is not on the boundary of the instruction fetch unit, the address of the fetch data including the head of the instruction to be corrected is specified in the correction address register.

【0073】前述の例では16ビットマイクロコンピュ
ータの場合についての場合であるが、松下電子工業製の
8ビットマイクロコンピュータMN101シリーズのよ
うに8ビットマイクロコンピュータでありながら命令コ
ードのフォーマットの基本単位が4ビットのマイクロコ
ンピュータもある。また32ビットや64ビット以上の
マイクロコンピュータでも同様である。
In the above-described example, the case of a 16-bit microcomputer is used. However, even though it is an 8-bit microcomputer like the 8-bit microcomputer MN101 series manufactured by Matsushita Electronics, the basic unit of the instruction code format is 4 units. There is also a bit microcomputer. The same applies to microcomputers of 32 bits or 64 bits or more.

【0074】図7の例のように被修正命令が命令n+1
で、修正アドレスレジスタ値がX’0104’の場合、
図3又は図4に示す命令キューA1には命令nの最終コ
ードM4と、命令n+1の先頭コードN0が格納され、
一致デコード保持手段B1には一致デコード信号が格納
される。縮小化命令コードを用いるマイクロコンピュー
タでは命令解読器に於いて命令レジスタに命令キューか
ら命令オペレーションコードを格納するときに、該当命
令の命令オペレーションコードのみを抽出格納する手段
を有している(図示せず)。
As shown in the example of FIG.
Then, when the correction address register value is X'0104 ',
The last code M4 of the instruction n and the leading code N0 of the instruction n + 1 are stored in the instruction queue A1 shown in FIG.
The coincidence decode signal is stored in the coincidence decode holding means B1. The microcomputer using the reduced instruction code has means for extracting and storing only the instruction operation code of the instruction when storing the instruction operation code from the instruction queue in the instruction register in the instruction decoder. Zu).

【0075】従って命令キューA1から命令オペレーシ
ョンコードのみを抽出し、命令レジスタA0に格納する
タイミングで一致デコード信号を一致デコード信号保持
手段B1からB0に転送すればよく、転送後は前述のと
おりに一致を検出し、マイクロプログラムの実行により (1)RAM上の所定のアドレスから修正プログラムの
開始アドレス値の取得 (2)取得した開始アドレス値に無条件分岐し、プログ
ラムカウンタにそのアドレス値を設定 の動作を行い同様にプログラムの変更が可能となる。
Therefore, it is sufficient to extract only the instruction operation code from the instruction queue A1 and transfer the coincidence decode signal from the coincidence decode signal holding means B1 to B0 at the timing of storing the instruction operation code in the instruction register A0. And (1) obtaining the start address value of the correction program from a predetermined address on the RAM (2) unconditionally branching to the obtained start address value and setting the address value in the program counter. The operation is performed, and the program can be similarly changed.

【0076】従って本発明によると、命令コードのフォ
ーマットの如何に関わらず被修正命令の実行サイクルで
その命令の修正が可能である。
Therefore, according to the present invention, the instruction can be modified in the execution cycle of the instruction to be modified regardless of the format of the instruction code.

【0077】[0077]

【発明の効果】以上の様に本発明は、RAMに格納され
る修正プログラムの開始アドレスを同RAM内の予め定
められた所定のアドレスに格納し、所望の修正箇所のア
ドレスを格納する為の修正アドレス記憶手段を有し、命
令をフェッチアドレスと修正アドレス記憶手段に格納さ
れたアドレスとを比較し、一致した場合に一致信号を出
力する比較回路と複数の比較回路の一致出力をデコード
する回路を具備し、更にCPUの命令解読器には、前記
比較回路が一致信号を出力した事を検知する手段を備
え、一致信号を検知すると前記命令解読器はマイクロ命
令の実行により前記RAMの所定のアドレスから修正プ
ログラムの開始アドレスを取得し、プログラムの実行を
同RAM内の修正プログラムの開始番地へ分岐させるよ
うな構成を設ける事により、(1)回路規模の増大を最
小限に留め、(2)修正プログラムの大きさの制限を緩
和し、(3)修正プログラムの実行を開始するまでの時
間遅れを最小限に留め、(4)命令先読み技術を用いた
マイクロコンピュータでも修正箇所のアドレスを直接指
定可能で、(5)縮小化命令を用いたマイクロコンピュ
ータでも修正箇所のアドレスを直接指定可能な優れたマ
イクロコンピュータのプログラム変更装置を実現できる
ものである。
As described above, according to the present invention, the start address of the correction program stored in the RAM is stored at a predetermined address in the RAM, and the address of the desired correction location is stored. A comparing circuit for comparing a fetch address of an instruction with an address stored in the corrected address storing means, and outputting a coincidence signal when they match, and a circuit for decoding coincidence outputs of the plurality of comparing circuits; The instruction decoder of the CPU further comprises means for detecting that the comparison circuit has output a coincidence signal, and upon detecting the coincidence signal, the instruction decoder interprets a predetermined instruction of the RAM by executing a microinstruction. A configuration is provided that obtains the start address of the correction program from the address and branches the execution of the program to the start address of the correction program in the RAM. (1) Minimizing the increase in the circuit scale, (2) relaxing the restriction on the size of the correction program, (3) minimizing the time delay before starting the execution of the correction program, 4) An excellent microcomputer program changing device that can directly specify the address of a correction portion even with a microcomputer using instruction prefetching technology, and (5) can directly specify the address of a correction portion even with a microcomputer using a reduced instruction. Can be realized.

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

【図1】実施例全体を示すブロック図FIG. 1 is a block diagram showing an entire embodiment.

【図2】プログラム変更装置と一致信号出力手段の実施
例を示す図
FIG. 2 is a diagram showing an embodiment of a program change device and a coincidence signal output means;

【図3】命令解読器の第1の実施例を示す図FIG. 3 is a diagram showing a first embodiment of an instruction decoder;

【図4】命令解読器の第2の実施例を示す図FIG. 4 is a diagram showing a second embodiment of the instruction decoder;

【図5】アドレス生成手段を示す図FIG. 5 is a diagram showing an address generation unit.

【図6】修正プログラム開始アドレス格納領域を示す図FIG. 6 is a diagram showing a correction program start address storage area;

【図7】縮小化命令コードの一例を示す図FIG. 7 shows an example of a reduced instruction code.

【図8】第1の従来例を示す図FIG. 8 is a diagram showing a first conventional example.

【図9】第2の従来例を示す図FIG. 9 is a diagram showing a second conventional example.

【図10】第3の従来例を示す図FIG. 10 is a diagram showing a third conventional example.

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

1 プログラムカウンタ 2 ROM 3、3a〜3n プログラム変更装置 31 修正アドレスレジスタ 32 比較回路 33 修正命令レジスタ 34 割込ベクタレジスタ 35 分岐アドレスレジスタ 36 分岐命令発生回路 4 選択回路 5 命令解読器 6 RAM 7、7a、7b 一致信号 8 デコーダ 81、82 一致デコード信号 9 PLA 91 PLAのAND部 92 PLAのOR部 A0 命令レジスタ A1 命令キュー B0、B1 一致デコード信号保持手段 C マイクロアドレスポインタ D 制御信号 E マイクロアドレス制御信号 F0、F1、F2 修正プログラム開始アドレス格納領
DESCRIPTION OF SYMBOLS 1 Program counter 2 ROM 3, 3a-3n Program change device 31 Correction address register 32 Comparison circuit 33 Correction instruction register 34 Interrupt vector register 35 Branch address register 36 Branch instruction generation circuit 4 Selection circuit 5 Instruction decoder 6 RAM 7, 7a , 7b Match signal 8 Decoder 81, 82 Match decode signal 9 PLA 91 AND section of PLA 92 OR section of PLA A0 Instruction register A1 Instruction queue B0, B1 Match decode signal holding means C Micro address pointer D Control signal E Micro address control signal F0, F1, F2 Correction program start address storage area

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】読み出し専用メモリ(ROM)とランダム
アクセスメモリ(RAM)と演算及び制御を行う中央演
算装置(CPU)を同一チップ内に集積したマイクロコ
ンピュータで、前記ROMに格納された命令に修正箇所
が生じた場合に、その修正箇所から前記RAM内に格納
された修正プログラムに実行を分岐させるマイクロコン
ピュータのプログラム変更装置であって、 修正プログラムが前記RAM内に格納され、その開始ア
ドレスを同RAM内の予め定められた所定のアドレスに
格納し、 前記ROMの所望の修正箇所のアドレスを格納する為の
修正アドレス記憶手段と、 命令をフェッチする為の前記ROMへの読み出しアドレ
スと、前記修正アドレス記憶手段に格納されたアドレス
とを比較し、一致した場合に一致信号を出力する比較回
路とを具備し、 CPUの命令解読器は、前記比較回路が一致信号を出力
した事を検知する手段を備え、一致信号を検知すると前
記命令解読器はマイクロ命令の実行により前記RAMの
所定のアドレスから修正プログラムの開始アドレスを取
得し、プログラムの実行を同RAM内の修正プログラム
の開始番地へ分岐させる事を特徴とするマイクロコンピ
ュータのプログラム変更装置。
1. A microcomputer in which a read-only memory (ROM), a random access memory (RAM), and a central processing unit (CPU) for performing arithmetic and control are integrated in the same chip, and are modified into instructions stored in the ROM. A program changing device of a microcomputer for branching the execution from a corrected portion to a corrected program stored in the RAM when a portion is generated, the corrected program being stored in the RAM, and the start address being the same. Correction address storage means for storing the address of a desired correction location of the ROM, stored at a predetermined predetermined address in the RAM; read address to the ROM for fetching an instruction; Compares the address stored in the address storage means and outputs a match signal when they match. An instruction decoder of the CPU comprises means for detecting that the comparison circuit has output a coincidence signal, and upon detecting the coincidence signal, the instruction decoder interprets the predetermined instruction of the RAM by executing a microinstruction. A program change device for a microcomputer, which obtains a start address of a correction program from the address of the microcomputer and branches execution of the program to a start address of the correction program in the RAM.
【請求項2】修正アドレス記憶手段と命令のフェッチア
ドレスが一致すると、前記ROMから読み出された命令
コードと前記比較回路の一致信号を同時にCPUへ入力
し、CPUは前記命令コードと一致信号を同命令コード
の解読タイミングまで保持する手段を具備し、同命令コ
ードの解読時にCPUの命令解読器は入力された一致信
号により同命令コードが修正すべき命令コードである事
を検知する手段を備える事を特徴とする請求項1に記載
のマイクロコンピュータのプログラム変更装置。
2. When the corrected address storage means and the fetch address of the instruction match, the instruction code read from the ROM and the coincidence signal of the comparison circuit are simultaneously input to the CPU, and the CPU transmits the instruction code and the coincidence signal to the CPU. A means for holding the instruction code until the decoding timing is provided, and when decoding the instruction code, the instruction decoder of the CPU includes means for detecting that the instruction code is an instruction code to be corrected based on the input coincidence signal. 2. The microcomputer according to claim 1, wherein:
【請求項3】修正アドレス記憶手段と比較回路を複数組
備えることを特徴とする請求項1または請求項2に記載
のマイクロコンピュータのプログラム変更装置。
3. The microcomputer according to claim 1, wherein a plurality of sets of corrected address storage means and comparison circuits are provided.
【請求項4】読み出し専用メモリ(ROM)とランダム
アクセスメモリ(RAM)と演算及び制御を行う中央演
算装置(CPU)を同一チップ内に集積したマイクロコ
ンピュータで、 前記ROMに格納された命令に修正箇所が生じた場合
に、その修正箇所から前記RAM内に格納された修正プ
ログラムに実行を分岐させるマイクロコンピュータのプ
ログラム変更装置であって、 修正プログラムが前記RAM内に格納され、その開始ア
ドレスを同RAM内の予め定められた所定のアドレスに
格納し、 前記ROMの所望の修正箇所のアドレスを格納する為の
修正アドレス記憶手段と、命令のフェッチアドレスと、
前記修正アドレス記憶手段に格納されたアドレスとを比
較し、一致した場合に一致信号を出力する比較回路とを
最大で2n−1組備え(nは自然数)、 前記最大で2n−1本の一致出力から、どの比較回路が
一致したかを示すn本の一致デコード信号を生成するデ
コード回路を具備し、前記一致デコード信号の状態の
内、一組の特定の状態(全ての信号が0又は1)を全て
の比較回路が不一致の状態とし、 前記一致デコード信号を命令コードと同時にCPUへ入
力し、CPUは前記命令コードと一致デコード信号を同
命令コードの解読タイミングまで保持する手段を備え、 同命令コードの解読時にCPUの命令解読器は入力され
た一致信号により同命令コードが修正すべき命令コード
である事を検知する手段と、前記一致デコード信号から
修正プログラムの開始アドレスが格納された前記RAM
内の所定のアドレスを生成する手段を備え、 修正が必要である事を検知すると、前記命令解読器はマ
イクロ命令の実行により前記アドレス生成手段により生
成された前記RAMの所定のアドレスから修正プログラ
ムの開始アドレスを取得し、プログラムの実行を同RA
M内の修正プログラムの開始番地へ分岐させる事を特徴
とするマイクロコンピュータのプログラム変更装置。
4. A microcomputer in which a read-only memory (ROM), a random access memory (RAM), and a central processing unit (CPU) for performing calculations and controls are integrated in the same chip, and modified into instructions stored in the ROM. A program changing device of a microcomputer for branching the execution from a corrected portion to a corrected program stored in the RAM when a portion is generated, the corrected program being stored in the RAM, and the start address being the same. Correction address storage means for storing at a predetermined predetermined address in the RAM, storing an address of a desired correction location of the ROM, an instruction fetch address,
A maximum of 2 n -1 sets of comparison circuits for comparing the addresses stored in the corrected address storage means and outputting a coincidence signal when they match (n is a natural number), and the maximum is 2 n -1 From the coincidence output of each of the comparators, the decoder circuit generates n coincidence decode signals indicating which of the comparator circuits coincides with each other. Among the states of the coincidence decode signals, a set of specific states (all signals are 0) Or 1) all the comparison circuits are in a mismatched state, the coincidence decode signal is input to the CPU simultaneously with the instruction code, and the CPU is provided with means for holding the instruction code and the coincidence decode signal until decoding timing of the instruction code. When decoding the instruction code, the instruction decoder of the CPU detects from the input coincidence signal that the instruction code is an instruction code to be corrected, Wherein the RAM start address of the positive program is stored
Means for generating a predetermined address in the RAM, upon detecting that the correction is necessary, the instruction decoder decodes the correction program from the predetermined address of the RAM generated by the address generation means by executing the microinstruction. Get start address and execute program
A program changing device for a microcomputer, wherein a branch is made to a start address of a correction program in M.
【請求項5】請求項4に記載の命令コードと一致デコー
ド信号を同命令コードの解読タイミングまで保持する手
段として、 CPUは解読する命令コードを格納する為の命令レジス
タと少なくとも1段以上のプリフェッチされた命令コー
ドを格納する命令キューを備え、一致デコード信号は命
令コードと同じ段数の一時記憶手段上を、命令コードと
同期して転送させる事を特徴とするマイクロコンピュー
タのプログラム変更装置。
5. An instruction register for storing an instruction code to be decoded and at least one stage of prefetch as means for holding the instruction code and the coincidence decode signal according to claim 4 until decoding timing of the instruction code. A program change device for a microcomputer, comprising: an instruction queue for storing an instruction code, wherein a coincidence decode signal is transferred in synchronization with the instruction code on temporary storage means having the same number of stages as the instruction code.
【請求項6】請求項4に記載の修正すべき命令コードで
あることを検知する手段として一致デコード信号を命令
コードと同時に命令解読器に入力し、 命令解読器では修正すべき命令コードであることを示す
一致デコード信号が入力されると命令コードとは無関係
に前記RAMの所定のアドレスから修正プログラムの開
始アドレスを取得し、プログラムの実行を同RAM内の
修正プログラムの開始番地へ分岐させるマイクロ命令を
実行させる事を特徴とするマイクロコンピュータのプロ
グラム変更装置。
6. A coincidence decode signal is input to an instruction decoder simultaneously with an instruction code as a means for detecting that the instruction code is an instruction code to be corrected according to claim 4. When the coincidence decode signal indicating that the correction code is input, the start address of the correction program is obtained from a predetermined address of the RAM irrespective of the instruction code, and the execution of the program is branched to the start address of the correction program in the RAM. A microcomputer program changing device for executing instructions.
【請求項7】CPUの命令解読器に少なくとも命令レジ
スタの出力とマイクロアドレスポインタの出力を入力す
るマイクロコンピュータであって、前述請求項4に記載
の修正すべき命令コードであることを検知する手段とし
て、命令コードを命令レジスタに格納する時に修正すべ
き命令コードである事を示す一致デコード信号が入力さ
れていると命令レジスタとマイクロアドレスポインタに
特定の値を設定し、命令解読器では前記特定の値をデコ
ードすると、前記RAMの所定のアドレスから修正プロ
グラムの開始アドレスを取得し、プログラムの実行を同
RAM内の修正プログラムの開始番地へ分岐させるマイ
クロ命令を実行させる事を特徴とするマイクロコンピュ
ータのプログラム変更装置。
7. A microcomputer for inputting at least an output of an instruction register and an output of a microaddress pointer to an instruction decoder of a CPU, wherein said means detects the instruction code to be corrected according to claim 4. When a coincidence decode signal indicating that the instruction code is an instruction code to be corrected when storing the instruction code in the instruction register is input, a specific value is set in the instruction register and the micro address pointer, and the instruction decoder reads the specific value. A microcomputer which obtains a start address of the correction program from a predetermined address in the RAM, and executes a microinstruction for branching the execution of the program to the start address of the correction program in the RAM. Program change device.
【請求項8】請求項4に記載の修正プログラムの開始ア
ドレスが格納された前記RAM内の所定のアドレスを生
成する手段として、CPUに入力された一致デコード信
号を、RAMアドレスの特定のnビットに出力する事を
特徴とするマイクロコンピュータのプログラム変更装
置。
8. A means for generating a predetermined address in the RAM in which a start address of the correction program according to claim 4 is stored, the method comprising the steps of: A program change device for a microcomputer characterized by outputting to a microcomputer.
【請求項9】命令オペレーションコードとそれに続くオ
ペランドから構成される命令コードの語調が一度にフェ
ッチするデータのビット幅のn分の1(n=2又は4)
の整数倍で、連続する命令コードの境界が同時にフェッ
チするデータの中間位置に存在する場合があるマイクロ
コンピュータであって、 修正アドレス記憶手段には修正が必要な命令の命令オペ
レーションコードの先頭が存在するROMのアドレスを
格納し、 修正アドレス記憶手段と命令フェッチアドレスが一致し
たことを示す一致デコード信号を前記命令オペレーショ
ンコードの先頭が存在するフェッチデータと同時にCP
Uへ入力し、 CPUは修正が必要な命令コードの解読タイミングまで
一致デコード信号を保持する手段を備え、 修正が必要な命令コードの先頭が含まれるフェッチデー
タから抽出した命令オペレーションコードの解読時にC
PUの命令解読器は入力された一致信号により同命令コ
ードが修正すべき命令コードである事を検知する手段を
備え、 修正が必要である事を検知すると、前記命令解読器はマ
イクロ命令の実行により前述RAMの所定のアドレスか
ら修正プログラムの開始アドレスを取得し、プログラム
の実行を同RAM内の修正プログラムの開始番地へ分岐
させる事を特徴とするマイクロコンピュータのプログラ
ム変更装置。
9. The tone of an instruction code composed of an instruction operation code and an operand following the instruction operation code is 1 / n of the bit width of data to be fetched at a time (n = 2 or 4).
Where the boundary of consecutive instruction codes may be at the intermediate position of the data to be fetched at the same time, and the head of the instruction operation code of the instruction that needs to be modified exists in the modified address storage means. And a coincidence decode signal indicating that the instruction fetch address coincides with the corrected address storage means, at the same time as the fetch data at the beginning of the instruction operation code.
U, the CPU comprises means for holding a coincidence decode signal until the timing of decoding the instruction code requiring correction, and the CPU reads C when decoding the instruction operation code extracted from the fetch data including the head of the instruction code requiring correction.
The instruction decoder of the PU has means for detecting that the instruction code is an instruction code to be corrected based on the input coincidence signal, and when the instruction decoder detects that the instruction code needs to be corrected, the instruction decoder executes the micro instruction. A program change device for a microcomputer, wherein a start address of a correction program is obtained from a predetermined address in the RAM, and execution of the program is branched to a start address of the correction program in the RAM.
JP00600697A 1997-01-17 1997-01-17 Microcomputer program change device Expired - Fee Related JP3588951B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00600697A JP3588951B2 (en) 1997-01-17 1997-01-17 Microcomputer program change device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00600697A JP3588951B2 (en) 1997-01-17 1997-01-17 Microcomputer program change device

Publications (2)

Publication Number Publication Date
JPH10207704A true JPH10207704A (en) 1998-08-07
JP3588951B2 JP3588951B2 (en) 2004-11-17

Family

ID=11626655

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00600697A Expired - Fee Related JP3588951B2 (en) 1997-01-17 1997-01-17 Microcomputer program change device

Country Status (1)

Country Link
JP (1) JP3588951B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6889306B1 (en) 1999-10-29 2005-05-03 Matsushita Electric Industrial Co., Ltd. Microprocessor and program modification method in the microprocessor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6889306B1 (en) 1999-10-29 2005-05-03 Matsushita Electric Industrial Co., Ltd. Microprocessor and program modification method in the microprocessor

Also Published As

Publication number Publication date
JP3588951B2 (en) 2004-11-17

Similar Documents

Publication Publication Date Title
KR940003383B1 (en) Microprocessor having predecoder unit and main decoder unit operating pipeline processing scheme
TWI541658B (en) Data processing apparatus and semiconductor integrated circuit device
US20020124161A1 (en) Data processing system having redirecting circuitry and method therefor
US4954943A (en) Data processing system
JP3242508B2 (en) Microcomputer
EP1241567B1 (en) Method and apparatus for executing coprocessor instructions
US6058471A (en) Data processing system capable of executing groups of instructions in parallel
US5313644A (en) System having status update controller for determining which one of parallel operation results of execution units is allowed to set conditions of shared processor status word
EP0322769B1 (en) Data processing apparatus suitable for high speed processing
US5461715A (en) Data processor capable of execution of plural instructions in parallel
JPH0869377A (en) Electronic circuit and method for use of coprocessor
US6012138A (en) Dynamically variable length CPU pipeline for efficiently executing two instruction sets
US20070283139A1 (en) Information processing apparatus and control method used thereby
US5247624A (en) Microprogram controller including leading microinstruction from a generator executed while succeeding microinstruction from memory is read out
JP5933685B2 (en) Microcomputer and nonvolatile semiconductor device
JP3588951B2 (en) Microcomputer program change device
EP1177499B1 (en) Processor and method of executing instructions from several instruction sources
US5361338A (en) Pipelined system for decomposing instruction into two decoding parts and either concurrently generating two operands addresses of merging decomposing decoding codes based upon the second operand
JPH06295243A (en) Data processor
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
JPH1091430A (en) Instruction decoding device
EP0573071A2 (en) A microprocessor
JP2002091785A (en) Program modification device
JP2004086596A (en) Microcomputer
JP2002287956A (en) Microcomputer

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040727

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040809

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070827

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080827

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080827

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090827

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090827

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100827

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110827

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110827

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120827

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees