JPH01251253A - Memory protecting device - Google Patents

Memory protecting device

Info

Publication number
JPH01251253A
JPH01251253A JP63078924A JP7892488A JPH01251253A JP H01251253 A JPH01251253 A JP H01251253A JP 63078924 A JP63078924 A JP 63078924A JP 7892488 A JP7892488 A JP 7892488A JP H01251253 A JPH01251253 A JP H01251253A
Authority
JP
Japan
Prior art keywords
memory
detection
address
write
ram
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
JP63078924A
Other languages
Japanese (ja)
Inventor
Osamu Asami
修 浅見
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP63078924A priority Critical patent/JPH01251253A/en
Publication of JPH01251253A publication Critical patent/JPH01251253A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To execute the memory protection by executing an inhibition and a detection of write by other semiconductor storage device than a RAM, with respect to write to a write inhibiting area in the RAM. CONSTITUTION:A detection use memory 1 being a semiconductor storage device exists in the same address space as a RAM 2. A detection input 4 is connected to a data read terminal 6 of the memory 1, and by this signal, a protecting address detection, namely, a memory protection of the RAM 2 is executed. Also, by using the memory 1, whether an address brought to address by data written in the memory 1 in advance is a protecting area of a write inhibition or not is decided, and if it is the protecting area, write is inhibited. Also, by generating an interruption request, etc., the detection can be informed to a CPU.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、マイクロコンピユークシステムにおいて、記
憶装置内のRAMに対し、書き込みの禁止およ°び検出
のための、メモリプロテクト装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a memory protection device for inhibiting and detecting writing to RAM in a storage device in a microcomputer system.

〔従来の技術] 従来のメモリプロテクト装置では、第2図に示す様に検
出対象となるメモリアドレスをレジスタ20に設定し、
この設定値とRAMへの書き込みのアドレス値との比較
を比較器21で行い、一致によりメモリプロテクトアド
レスを検出するものであった。
[Prior Art] In a conventional memory protection device, a memory address to be detected is set in a register 20 as shown in FIG.
A comparator 21 compares this set value with an address value written to the RAM, and a memory protect address is detected based on a match.

[発明が解決しようとする課題] このため、メモリプロテクトを行う複数のアドレス、領
域に対しては、レジスタと比較器を多数必要となり、構
成が複雑となる。更に、毎アドレス単位の設定等、柔軟
性を持つメモリプロテクト装置は困難である。
[Problems to be Solved by the Invention] For this reason, a large number of registers and comparators are required for a plurality of addresses and areas to be memory protected, resulting in a complicated configuration. Furthermore, it is difficult to provide a memory protection device that is flexible enough to allow settings for each address.

そこで、本発明はこの様な課題を解決するもので、より
簡単な構成により、メモリプロテクトのアドレス、領域
を複数、容易に設定でき、確実に検出し、メモリプロテ
クトを行うメモリプロテクト装置を提供するところであ
る。
SUMMARY OF THE INVENTION The present invention aims to solve these problems, and provides a memory protection device that has a simpler configuration, can easily set multiple addresses and areas for memory protection, and reliably detects and protects memory. By the way.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のメモリプロテクト装置は、マイクロコンビュー
タシステムにおいて、メモリ内のRAMへの書き込みに
対し、アクセスされたアドレスが書き込み禁止領域かを
検出し、メモリプロテクトを行うことを、上記メモリと
は別のメモリ 、を用いることを特徴とする。
In a microcomputer system, the memory protection device of the present invention detects whether an accessed address is a write-prohibited area when writing to a RAM in the memory, and performs memory protection on a memory other than the above-mentioned memory. It is characterized by using .

[作 用] 本発明の上記の構成によれば、メモリプロテクト装置に
おいて、メモリを用いることによって、あらかじめメモ
リに書き込まれたデータでアクセスされたアドレスが書
き込み禁止のプロテクト領域かを判断し、プロテクト領
域であれば、書き込みを禁止し、かつ割り込み要求等を
発生することによりマイクロプロセッサ(以下、CPU
とする。)に検出を知らせることを可能にするものであ
る。
[Operation] According to the above configuration of the present invention, in the memory protection device, by using the memory, it is determined whether the address accessed with data written in the memory in advance is a write-protected protected area, and the protected area is protected. If so, by prohibiting writing and generating interrupt requests etc., the microprocessor (hereinafter referred to as CPU)
shall be. ) to notify the detection.

[実 施 例] 第1図は、本発明のメモリプロテクト装置の一実施例に
おけるブロック図である。同図中1は、メモリプロテク
トのための検出用メモリであり、同図中2は、マイクロ
コンピュータシステムで通常に使用されるRAMである
6本実施例では検出用メモリ1にデータ幅1ビツトのR
AMを使用する。また、検出用メモリlはRAM2と同
一のアドレス空間に存在する。検出人力4は検出用メモ
リlのデータリード端子6に接続され、この信号により
プロテクトアドレス検出、すなわちRAM2のメモリプ
ロテクトを行う、設定人力3は、データライト人力9と
アンドゲート11を経由し、検出用メモリ1のデータラ
イト端子5に接続されている。この信号により検出用メ
モリ1へ検出用データを書き込むことができる。
[Embodiment] FIG. 1 is a block diagram of an embodiment of the memory protection device of the present invention. In the figure, 1 is a detection memory for memory protection, and 2 in the figure is a RAM normally used in microcomputer systems.In this embodiment, the detection memory 1 has a data width of 1 bit. R
Use AM. Furthermore, the detection memory 1 exists in the same address space as the RAM 2. The detection power 4 is connected to the data read terminal 6 of the detection memory 1, and this signal detects the protect address, that is, protects the memory of the RAM 2.The setting power 3 passes through the data write power 9 and the AND gate 11, is connected to the data write terminal 5 of the memory 1. This signal allows detection data to be written into the detection memory 1.

まずプロテクトのための、検出用メモリlへの検出用デ
ータの書き込みについて、第3図にタイミングチャート
を示し、説明する。検出用メモリ1のデータ入力端子7
にはデータバスの最下位のビットが接続されており、デ
ータ入力端子7の信号により検出用メモリ1にデータが
与えられる。
First, the writing of detection data to the detection memory l for protection will be described with reference to a timing chart shown in FIG. Data input terminal 7 of detection memory 1
The least significant bit of the data bus is connected to , and data is given to the detection memory 1 by a signal from the data input terminal 7 .

検出用メモリ1への書き込みの際、設定人力3の信号a
をレベル1とし、それ以外ではレベル0とする。(以下
、信号に対しレベルO°をローレベル、レベルlをハイ
レベルとする。)そして、データライト人力9からの書
き込みタイミング信号Cがハイレベルとなったとき、検
出用メモリlのデータライト端子5の信号dがハイレベ
ルとなり、データ入力端子7からデータバスの最下位の
ビットデータが検出用メモリlのあるアドレスに書き込
まれる。書き込まれたデータがローレベルのとき、書き
込まれたメモリアドレスがメモリプロテクトの検出アド
レスとなる。領域の設定も、連続したアドレスにローレ
ベルの、データを書き込むことで行^る。検出用メモリ
lへの書き込みでは設定人力3の信号aはハイレベルで
あり、ノットゲート13により、アンドゲート14の一
方の入力がローレベルとなり、信号fがローレベルとな
ってメモリ2への書き込みは行われない。
When writing to the detection memory 1, the setting manual 3 signal a
is set to level 1, and otherwise set to level 0. (Hereinafter, the level O° of the signal will be referred to as a low level, and the level 1 will be referred to as a high level.) Then, when the write timing signal C from the data write human power 9 becomes a high level, the data write terminal of the detection memory 1 5 becomes high level, and the lowest bit data of the data bus is written from the data input terminal 7 to a certain address in the detection memory l. When the written data is at a low level, the written memory address becomes the memory protection detection address. Area setting is also done by writing low-level data to consecutive addresses. When writing to the detection memory 1, the signal a of the setting manual 3 is at a high level, and the NOT gate 13 causes one input of the AND gate 14 to go to a low level, causing the signal f to go to a low level and writing to the memory 2. will not be performed.

この様にして、検出用メモリ1には、あらかじめプロテ
クトアドレスに関してローレベルのデータが書き込まれ
ているものとする。
In this way, it is assumed that low level data regarding the protect address is written in advance in the detection memory 1.

次に、プロテクトアドレスへの書き込みに対するメモリ
プロテクトの実行について、第4図にタイミングチャー
トを示し、説明する。上記により、検出アドレスの設定
が行われ、検出用メモリlのあるA番地に検出アドレス
の設定が行われたとする。CPUがRAM2上のこのA
番地に対し、書き込みを行うと、アドレスバスにA番地
のアドレスデータがRAM2に出力される。検出用メモ
リ1はRAM2と同一のアドレス空間に存在しているの
で、同様のアドレスデータは検出用メモリ1にも送られ
る。メモリプロテクトの実行中では、設定人力3の信号
aはローレベルであり、検出用メモリ1は読みだし専用
となる。そして、検出用メモリ1のA番地の設定された
ローレベルのデータがデータ出力端子8から出力される
。この様に、メモリプロテクトの検出アドレスでは、検
出用メモリ1からローレベルが出力される。−方、デー
タライト人力9からの信号は、アンドゲート14を経て
、信号fとなりアントゲ−!・12に入力される。アン
ドゲート12のもう一方には、データ出力端子8の信号
gが入力されている。そして、アンドゲート12の出力
はRAM2のデータライト端子10に接続されている。
Next, execution of memory protection for writing to a protect address will be described with reference to a timing chart shown in FIG. Assume that the detection address has been set as described above, and the detection address has been set at address A where the detection memory l is located. CPU is this A on RAM2
When writing is performed to an address, the address data of address A is output to the RAM 2 on the address bus. Since the detection memory 1 exists in the same address space as the RAM 2, similar address data is also sent to the detection memory 1. While memory protection is being executed, the signal a of the setting manual 3 is at a low level, and the detection memory 1 is read-only. Then, the low level data set at address A of the detection memory 1 is output from the data output terminal 8. In this manner, a low level is output from the detection memory 1 at the memory protection detection address. On the other hand, the signal from the data write power 9 passes through the AND gate 14 and becomes the signal f.・Input in 12. The signal g from the data output terminal 8 is input to the other side of the AND gate 12 . The output of the AND gate 12 is connected to the data write terminal 10 of the RAM 2.

この時、信号aがローレベルであることにより、信号f
は信号Cと等しい、したがって、データ出力端子8の信
号gがローレベルであれば、CPUはRAM2に書き込
みを行うことができず、メモリプロテクトが行われる。
At this time, since the signal a is at a low level, the signal f
is equal to signal C. Therefore, if the signal g at the data output terminal 8 is at a low level, the CPU cannot write to the RAM 2, and memory protection is performed.

データ出力端子8の信号gがローレベルであれば、メモ
リプロテクトと同時に、信号gはノットゲート15と経
てアンドゲート16に入力され、データライト入力の信
号でとアンドを取り、検出信号りとなる。
When the signal g at the data output terminal 8 is at a low level, at the same time as the memory protect is performed, the signal g is inputted to the AND gate 16 via the NOT gate 15, and is ANDed with the data write input signal to become the detection signal. .

検出信号11は、割り込み要求信号などにして、CPU
へ検出を知らせる。
The detection signal 11 is sent to the CPU as an interrupt request signal or the like.
to notify the detection.

この様に、メモリを用いてプロテクトアドレスを設定、
検出し、メモリプロテクトを行うことが可能である。ま
た、本実施例では、検出用メモリ1をRAMとしたが、
読みだし専用メモリ(以下、ROMとする。)でも可能
である。ROMを使用した場合、設定アドレスの変更は
不可能となるが、設定を行う必要がないので、設定人力
3、ゲート11.13.14が不必要となり、より構成
が簡単になる。
In this way, set the protect address using memory,
It is possible to detect and protect memory. Further, in this embodiment, the detection memory 1 is a RAM, but
A read-only memory (hereinafter referred to as ROM) is also possible. When a ROM is used, it is impossible to change the setting address, but since there is no need to perform setting, the setting manual 3 and the gates 11, 13, 14 are unnecessary, and the configuration becomes simpler.

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

以上述べた様に本発明によれば、RAM上の書き込み禁
止領域への書き込みに対する書き込み保護および検出を
、プロテクトすべきアドレスまたは領域の設定、変更を
容易に行い、かつ簡単な構成で実現することが可能であ
る。マイクロコンピユークシステムのソフトウェア開発
中には、ソフトウェアの不注意によってスタックやRA
M上のプログラム領域を破壊してしまうことが有り得る
0本発明のメモリプロテクト装置を用いることによって
、マイクロコンピュータシステム内のRAM上のメモリ
プロテクトを、RAM領域内各アドレス単位で設定、変
更を容易に行うことが可能である。このためソフトウェ
アの開発、デバッグ中に頻繁に設定、−変更が行え、作
業の効率性が向上し、また動作の信頼性の向上にも効果
は大である。
As described above, according to the present invention, it is possible to easily set and change the address or area to be protected, and to realize write protection and detection of writing to a write-protected area on RAM with a simple configuration. is possible. During software development for microcomputer systems, the stack and RA may be damaged due to software inadvertence.
By using the memory protection device of the present invention, it is possible to easily set and change the memory protection on RAM in a microcomputer system for each address in the RAM area. It is possible to do so. Therefore, settings and changes can be made frequently during software development and debugging, which improves work efficiency and is highly effective in improving operational reliability.

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

第1図は本発明のメモリプロテクト装置のブロック図で
ある。 第2図は、従来の検出方法を示す図である。 第3図は、本発明のメモリプロテクト装置における設定
データの書き込みのタイミングチャートである。 第4図は、本発明のメモリプロテクト装置におけるメモ
リプロテクトおよび検出のタイミングチャートである。 1・・・検出用メモリ 2・・・RAM 3・・・設定人力 4・・・検出入力 5・・・データライト端子 6・・・データリード端子 7・・・データ入力端子 8・・・データ出力端子 9・・・データライト入力 10・・・データライト端子 11・・・アンドゲート 12・・・アンドゲート 13・・・ノットゲート 14・・・アンドゲート 15・・・ノットゲート 16・・・アンドゲート 20・・・レジスタ 21・・・比較器 22・・・書き込み信号 23・・・検出信号 以上 出願人 セイコーエプソン株式会社 図面の1′7−害(内容に変更なし) 第3図 第4図 手続補正書(方式) 1、事件の表示  昭和63年  特 許 願  第7
8924号2、発明の名称  メモリプロテクト装置3
、補正する者 事件との関係  出願人 東京都新宿区西新宿2丁目4番1号 (236)セイコーエプソン株式会社 代表取締役  中 村 恒 也 4、代理人 〒104 東京都中央区京橋2丁目6番21号願書に最
初に添付した図面(第3図、第4図)の浄書別紙のとお
り(内容に変更なし)
FIG. 1 is a block diagram of a memory protection device of the present invention. FIG. 2 is a diagram showing a conventional detection method. FIG. 3 is a timing chart for writing setting data in the memory protection device of the present invention. FIG. 4 is a timing chart of memory protection and detection in the memory protection device of the present invention. 1...Detection memory 2...RAM 3...Setting manual power 4...Detection input 5...Data write terminal 6...Data read terminal 7...Data input terminal 8...Data Output terminal 9...Data write input 10...Data write terminal 11...And gate 12...And gate 13...Not gate 14...And gate 15...Not gate 16... AND gate 20...Register 21...Comparator 22...Write signal 23...Detection signal and above Applicant Seiko Epson Co., Ltd. 1'7-Harm of the drawing (no change in content) Figure 3, Figure 4 Draft procedure amendment (method) 1. Indication of case 1986 Patent application No. 7
No. 8924 2, Title of invention Memory protection device 3
, Relationship to the amended person case Applicant 2-4-1 Nishi-Shinjuku, Shinjuku-ku, Tokyo (236) Tsuneya Nakamura, Representative Director of Seiko Epson Corporation 4, Agent Address: 2-6 Kyobashi, Chuo-ku, Tokyo 104 As shown in the engraving appendix of the drawings (Figures 3 and 4) originally attached to Application No. 21 (no change in content)

Claims (1)

【特許請求の範囲】 読み書き可能な半導体記憶装置(以下、 RAMという)を有するマイクロコンピュータシステム
において、前記RAM内の書き込み禁止領域等への書き
込みに対し、書き込みの禁止および検出を、上記記憶装
置とは別に半導体記憶装置により行うことを特徴とする
メモリプロテクト装置。
[Claims] In a microcomputer system having a readable/writable semiconductor memory device (hereinafter referred to as RAM), write inhibition and detection for writing to a write-protected area in the RAM, etc. A memory protection device characterized in that the protection is performed separately by a semiconductor storage device.
JP63078924A 1988-03-31 1988-03-31 Memory protecting device Pending JPH01251253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63078924A JPH01251253A (en) 1988-03-31 1988-03-31 Memory protecting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63078924A JPH01251253A (en) 1988-03-31 1988-03-31 Memory protecting device

Publications (1)

Publication Number Publication Date
JPH01251253A true JPH01251253A (en) 1989-10-06

Family

ID=13675411

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63078924A Pending JPH01251253A (en) 1988-03-31 1988-03-31 Memory protecting device

Country Status (1)

Country Link
JP (1) JPH01251253A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0484244A (en) * 1990-07-26 1992-03-17 Nec Ic Microcomput Syst Ltd Storage circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0484244A (en) * 1990-07-26 1992-03-17 Nec Ic Microcomput Syst Ltd Storage circuit

Similar Documents

Publication Publication Date Title
EP0109504A2 (en) Protection system for storage and input/output facilities and the like
JPH01251253A (en) Memory protecting device
JPS59231800A (en) Preventing device for foul writing to main memory
JPS62160554A (en) Device for preventing wrong access to memory
JPS59112494A (en) Memory testing system
JPH02238536A (en) Storage protecting circuit
JPS61228544A (en) Write protection system
JPS63250753A (en) Memory access checking system
JPS6015762A (en) Preventing device for foul writing of main memory
JPS61216059A (en) System for protecting storage data
JPS59154698A (en) Protecting system of control storage
JPS61121146A (en) Memory protection system
JPH02278446A (en) Memory access control circuit
JPS6097448A (en) Memory protection system
JPH01261759A (en) Computer system
JPS6285357A (en) Memory protecting device
JPS61279940A (en) Fault detector for computer
JPS6120160A (en) Method for detecting exception of addressing
JPH05173886A (en) Writing device
JPH04268934A (en) Device for protecting memory from miswriting
JPH05189997A (en) Memory fault detecting mechanism
JPS6270956A (en) Memory protecting device
JPH01251254A (en) Interruption request generating system
JPS60138655A (en) Protecting method of nonvolatile memory
JPH02189661A (en) Write protection system for memory