JPH03147158A - Memory control circuit - Google Patents

Memory control circuit

Info

Publication number
JPH03147158A
JPH03147158A JP1286275A JP28627589A JPH03147158A JP H03147158 A JPH03147158 A JP H03147158A JP 1286275 A JP1286275 A JP 1286275A JP 28627589 A JP28627589 A JP 28627589A JP H03147158 A JPH03147158 A JP H03147158A
Authority
JP
Japan
Prior art keywords
memory
signal
circuit
write
memory write
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
JP1286275A
Other languages
Japanese (ja)
Inventor
Kazumi Kobayashi
和美 小林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Office Systems Ltd
Original Assignee
NEC Office Systems 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 NEC Office Systems Ltd filed Critical NEC Office Systems Ltd
Priority to JP1286275A priority Critical patent/JPH03147158A/en
Publication of JPH03147158A publication Critical patent/JPH03147158A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To protect important data in a memory without fail by providing an OR circuit to receive various control signals and to output a signal to instruct the write inhibition of the memory. CONSTITUTION:An OR circuit 2 is provided to make a reset signal 3 and this signal 3 shows any one of an IO read signal (IORD), IO write signal (IOWT) and memory read signal (MRD) is executed at a destination where a program runs away. When the program erroneously runs away just after an instruction to instruct the write permission of the memory and the signal 3 is executed before a memory write signal (MWT) 6, a signal 5 is turned OFF by this signal 3. Afterwards, even when the MWT 6 is turned ON, it is refused by an AND circuit 7 and a write signal 8 to a memory 9 is not turned ON like d. Thus, the fear to destroy the data in the desired area of the memory is reduced.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はメモリ制御回路に関し、特にメモリ書き込み許
可回路を有するメモリ制御回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a memory control circuit, and particularly to a memory control circuit having a memory write permission circuit.

〔従来の技術〕[Conventional technology]

マイクロプログラムを使用した一般的な装置の構成例を
第3図に示す、第3図においてROM13はマイクロプ
ログラムを格納しているメモリであり、CPU10では
このROM13から命令を読み出して実行し、RAM1
2に対してや入出力装置(図示せず〉に対してデータの
書き込み・読み出しを行なう、メモリ制御回路11では
RAM12への信号を制御する。特にRAM12にはプ
ログラムを実行する上で必要なデータを格納するエリア
がある。それらのデータには、デイツプスイッチの代用
として使用するデータやシステムの設定条件を表わすデ
ータ等があり、プログラム実行中これらのデータがむや
みに書きかえられたり、壊されたりしないよう通常次の
ような方法で保護している。
An example of the configuration of a general device using a microprogram is shown in FIG. 3. In FIG. 3, a ROM 13 is a memory that stores a microprogram.
The memory control circuit 11 controls signals to the RAM 12 and writes and reads data to and from input/output devices (not shown).In particular, the RAM 12 stores data necessary for executing programs. There is an area for storing data.These data include data used as a substitute for dip switches and data representing system setting conditions, and there is a risk that this data may be unnecessarily rewritten or destroyed while the program is running. This is usually protected by the following methods:

まずRAM12に書かれたデータは装置の電源が遮断さ
れると同時に全て消えてしまうため、第3図に示すよう
にRAM12の電源に並列にバッテリーを接続し、装置
の電源が遮断されてもRAM12はバッテリーが放電し
て電圧低下するまでの間、正常に動作してデータを保持
させる方法がある。またプログラム実行中に前述した保
護したいデータのエリアへ誤って書き込みを行なうこと
のないよう、第4図に示すようなメモリ制御回路を使用
する方法がある。以下この回路のデータ保護動作を説明
する。
First, all data written in the RAM 12 will be erased as soon as the device's power is cut off, so a battery is connected in parallel to the RAM 12's power supply as shown in Figure 3, so that even if the device's power is cut off, the RAM 12 There is a way to operate normally and retain data until the battery discharges and the voltage drops. Furthermore, there is a method of using a memory control circuit as shown in FIG. 4 to prevent erroneous writing to the above-mentioned data area to be protected during program execution. The data protection operation of this circuit will be explained below.

第5図はこのメモリ制御回路の動作を説明するためのタ
イミング図であってプログラム実行中メモリ書き込み許
可を指示する10命令Aを実行すると、IO命令Aの実
行時間a中、信号14がオンされ、この信号14によっ
てメモリ書き込み許可口FI1117でメモリ書き込み
許可信号18がオンされる。そこで、信号18がオンさ
れている間に、メモリ書き込み命令が実行されると、C
で示すように、メモリライト信号(MWT)16がAN
D回路19によってメモリ21に直接入力されるライト
信号20が作られ、出力される。次に信号18をオフす
るためにメモリ書き込み禁止を指示する■0命令Bを実
行すると、第5図に示すようにIO命令13の実行時間
す中信号15がオンされ、この信号15によってメモリ
書き込み許可回路17でメモリ書き込み許可信号18が
オフされる。この状態で仮にメモリ書き込み命令が実行
され、dで示すようにメモリライト信号(MWT)16
がオンされても、AND回路19で拒絶されメモリ21
に対して書き込みは行なわれない、つまり保護したいメ
モリのエリアに対する書き込みに当っては、必ずこの3
つの命令すなわち、メモリ書き込み許可を指示する命令
、メモリ書き込み命令、メモリ書き込み禁止を指示する
命令を実行する必要があり、メモリ内の一般のエリアへ
の書き込みを行なおうとしてアドレスが誤って、保護し
たいエリアを指してしまった場合などでもメモリ書き込
み許可が指示されていないため書き込みは行なわれず、
データは保護される。
FIG. 5 is a timing diagram for explaining the operation of this memory control circuit. When the 10th instruction A that instructs memory write permission during program execution is executed, the signal 14 is turned on during the execution time a of the IO instruction A. , This signal 14 turns on the memory write permission signal 18 at the memory write permission port FI1117. Therefore, if a memory write command is executed while signal 18 is on, C
As shown in , the memory write signal (MWT) 16 is
A write signal 20 that is directly input to the memory 21 is generated by the D circuit 19 and output. Next, when executing the ■0 instruction B that instructs memory write prohibition to turn off the signal 18, the signal 15 is turned on during the execution time of the IO instruction 13 as shown in FIG. The permission circuit 17 turns off the memory write permission signal 18 . In this state, if a memory write command is executed, a memory write signal (MWT) 16 is generated as shown by d.
Even if it is turned on, it is rejected by the AND circuit 19 and the memory 21
In other words, when writing to an area of memory that you want to protect, always use these three
It is necessary to execute three instructions: one to enable memory writing, one to write to memory, and one to disable memory writing. Even if you point to the area you want to write, the write will not be performed because memory write permission has not been specified.
Your data will be protected.

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

上述したように従来のメモリ制御回路では、メモリ書き
込み許可を指示する命令、メモリ書き込み命令、メモリ
書き込み禁止を指示する命令の3つの命令を実行するこ
とによって保護したいエリアへの書き込み可否を制御す
ることになっているため、メモリ書き込み許可を指示す
る■0命令が実行された後誤ってプログラムが暴走した
場合などにメモリ書き込み許可信号がオンされたままに
なってしまうと、メモリ内の保護したいエリアに対して
も書き込みが行なわれてデータが壊されることがあると
いう欠点があった。
As described above, conventional memory control circuits control whether writing to an area to be protected can be performed by executing three instructions: an instruction to enable memory writing, an instruction to write to memory, and an instruction to prohibit writing to memory. If the memory write permission signal remains on, such as when the program accidentally runs out of control after executing the ■0 instruction that instructs memory write permission, the area in the memory that you want to protect will There was also a drawback that data could be destroyed if data were written to.

本発明の目的は、メモリ書き込み許可を指示するIO命
令が実行された後に誤ってプログラムの暴走が生じた場
合などにもメモリ内の保護したいエリアのデータが破壊
されるおそれの少ないメモリ制御回路を提供することに
ある。
An object of the present invention is to provide a memory control circuit that is less likely to destroy data in an area to be protected in memory even if a program accidentally goes out of control after an IO instruction that instructs memory write permission is executed. It is about providing.

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

本発明のメモリ制御回路は、メモリ書き込み許可ならび
に禁止を指示する信号を受けてメモリ書き込み許可信号
を発生するメモリ書き込み許可回路と、このメモリ書き
込み許可信号とメモリライト信号(MWT)とでメモリ
を直接制御するメモリ書き込み信号を作るAND回路と
を備えて構成されるメモリ制御回路において、各種の制
御信号を受けてメモリ書き込み禁止を指示する信号を出
力するOR回路を設けることにより構成されている。
The memory control circuit of the present invention includes a memory write permission circuit that generates a memory write permission signal in response to a signal instructing permission or prohibition of memory writing, and a memory write permission circuit that directly controls the memory using the memory write permission signal and a memory write signal (MWT). The memory control circuit includes an AND circuit that generates a memory write signal to be controlled, and an OR circuit that receives various control signals and outputs a signal instructing memory write inhibition.

〔実施例〕〔Example〕

次に本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図および第2図はそれぞれ本発明の一実施例のメモ
リ制御回路のブロック図およびその動作を説明するタイ
ミング図である。第1図のメモリ制御回路において、メ
モリ書き込み許可を指示する命令(IO命令)が出され
ると、第2図(A)、(B)で示すように、この命令を
実行している期間aは信号1がオンされ、メモリ書き込
み許可口#!4の出力のメモリ書き込み許可信号5がオ
ンされる。このメモリ書き込み許可信号5がオンしてい
る間にメモリ書き込み命令を実行するためにメモリライ
ト信号(MWT>6がオンされAND回路7においてメ
モリ9に対するライト信号8が作される。またメモリ書
き込み許可信号5をオフするためのリセット信号3を作
るOR回路2が設けられ、この実施例においてはリセッ
ト条件として入出力装置(図示せず)に対しての読み出
し・書き込み時に出力されるIOリード信号(IORD
>、IOライト信号(IOWT)や、メモリに対しての
メモリリード信号(MRD)メモリライト信号(MWT
)の4信号のうちのいずれかがオンの時信号3をオンと
する。この実施例では必ずメモリ書き込み許可を指示す
る命令(工○命令)のすぐ後にメモリ書き洛み命令を実
行することとし、第2図<A)ではこの動作タイミング
を表わしている。この場合、信号5がオンになっている
間にメモリライト信号(MWT)6が出力され、ライト
信号8がCで示すように出力される。またメモリ書き込
み許可を指示する命令のすぐ後で誤ってプログラムが暴
走した場合を第2図(B)で表わしている。この場合は
プログラムが暴走した先で、l0RD、l0WT、MR
Dのいずれかが実行されたという信号3がMWT 6よ
りも先に実行された時この信号3によって信号5がオフ
され、その後にMWT6がオンしていても、AND回路
7によって拒否され、メモリ9に対するライト信号8は
dで示すようにオンされない、なお、プログラムが暴走
した先でMWTがl0RD、l0WT、MRDよりも先
に実行され、偶然に保護したいアドレスを指していた時
このアドレスに関してのみ書きかえが行なわれてしまう
こともないとは言えないが、このような場合においても
その後このMWTによってメモリ書き込み禁止が指示さ
れるため被害は最小限に保たれる。
FIGS. 1 and 2 are a block diagram of a memory control circuit according to an embodiment of the present invention and a timing diagram explaining its operation, respectively. In the memory control circuit of FIG. 1, when an instruction (IO instruction) instructing memory write permission is issued, the period a during which this instruction is executed is as shown in FIGS. 2(A) and (B). Signal 1 is turned on and memory write permission port #! The memory write enable signal 5 outputted from 4 is turned on. While this memory write permission signal 5 is on, the memory write signal (MWT>6 is turned on to execute the memory write command, and the AND circuit 7 generates a write signal 8 for the memory 9. Also, the memory write permission is An OR circuit 2 is provided to generate a reset signal 3 for turning off the signal 5, and in this embodiment, the reset condition is an IO read signal ( IORD
>, IO write signal (IOWT), memory read signal (MRD) for memory, memory write signal (MWT)
) is on, signal 3 is turned on. In this embodiment, the memory write command is always executed immediately after the command for instructing memory write permission (command), and FIG. 2<A) shows the timing of this operation. In this case, a memory write signal (MWT) 6 is output while the signal 5 is on, and a write signal 8 is output as shown by C. Further, FIG. 2(B) shows a case where the program accidentally goes out of control immediately after an instruction to permit memory writing. In this case, when the program goes out of control, l0RD, l0WT, MR
When signal 3 indicating that one of D has been executed is executed before MWT 6, this signal 3 turns off signal 5, and even if MWT 6 is turned on afterwards, it is rejected by AND circuit 7 and the memory is The write signal 8 for 9 is not turned on as shown by d. Furthermore, when the program goes out of control, MWT is executed before l0RD, l0WT, and MRD, and it happens to point to the address that you want to protect, only for this address. Although it cannot be said that rewriting will not occur, even in such a case, the damage will be kept to a minimum because the MWT will then instruct the memory to be prohibited from writing.

この実施例においては、メモリ書き込み許可信号5をリ
セットするためにrORD、l0WT。
In this embodiment, rORD, l0WT to reset the memory write enable signal 5.

MRD、MWTの4信号をあげて説明したが、この4信
号だけに限らず例えばMRDとMWTの2信号や、全く
別の命令に伴って出力される信号を用いてもよい、ただ
しMWTについてはメモリ書き込み命令実行後に必ずメ
モリ書き込み許可信号5をオフするため有効である。
The explanation has been given using four signals, MRD and MWT, but it is not limited to just these four signals, for example, two signals, MRD and MWT, or signals output in conjunction with completely different commands may be used. However, regarding MWT, This is effective because the memory write enable signal 5 is always turned off after the memory write command is executed.

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

以上説明したように本発明は、メモリ書き込み許可を指
示するIO命令によってオンされたメモリ書き込み許可
信号を例えばIO読み出し命令、IO書き込み命令、メ
モリ読み出し命令、メモリ書き込み命令のいずれかの実
行によってオフされることにより、メモリ書き込み保護
を指示する命令の実行後に誤ってプログラムが暴走した
場合でもメモリの内容が壊されるのを防止することがで
き、最悪の場合でも1つのアドレスに対してのみ壊され
るだけとなり、従来のようにプログラムが暴走したため
にメモリの内容の多くが壊されてしまうということがな
くなり、メモリ内の重要なデータを確実に保護できると
いう効果がある。
As explained above, the present invention enables a memory write permission signal that is turned on by an IO command that instructs memory write permission to be turned off by executing any one of an IO read command, an IO write command, a memory read command, and a memory write command. By doing so, even if the program accidentally goes out of control after executing an instruction that instructs memory write protection, the memory contents can be prevented from being destroyed, and in the worst case, only one address will be destroyed. As a result, much of the contents of the memory will not be destroyed due to a program running out of control, as was the case in the past, and important data in the memory can be reliably protected.

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

第1図は本発明の一実施例であるメモリ制御回路のブロ
ック図、第2図(A)、(B)は第1図のメモリ制御回
路の概略タイミング図、第3図はマイクロプログラムを
使用した一般的な装置の構成例のブロック図、第4図は
従来のメモリ制御回路のブロック図、第5図は第4図の
回路の概略波形図である。 1・・・メモリ書き込み許可命令実行中を表わす信号、
2・・・OR回路、3・・・OR回路よりの出力信号、
4・・・メモリ書き込み許可回路、5・・・メモリ書き
込み許可信号、6・・・メモリライト信号(MWT)、
7・・・AND回路、8・・・メモリへのライト信号、
9・・・メモリ、10・・・CPU、11・・・メモリ
制御回路、12・・・RAM、13・・・ROM、14
・・・メモリ書き込み許可命令実行中を表わす信号、1
5・・・メモリ書き込み禁止命令を表わす信号、16・
・・メモリライト信号<MWT)、17・・・メモリ書
き込み許可回路、18・・・メモリ書き込み許可信号、
1つ・・・AND回路、20・・・メモリへのライト信
号、21・・・メモリ。
Figure 1 is a block diagram of a memory control circuit that is an embodiment of the present invention, Figures 2 (A) and (B) are schematic timing diagrams of the memory control circuit of Figure 1, and Figure 3 uses a microprogram. 4 is a block diagram of a conventional memory control circuit, and FIG. 5 is a schematic waveform diagram of the circuit shown in FIG. 4. 1...Signal indicating that memory write permission command is being executed;
2...OR circuit, 3...output signal from the OR circuit,
4...Memory write permission circuit, 5...Memory write permission signal, 6...Memory write signal (MWT),
7...AND circuit, 8...Write signal to memory,
9...Memory, 10...CPU, 11...Memory control circuit, 12...RAM, 13...ROM, 14
...Signal indicating that memory write permission command is being executed, 1
5... Signal representing memory write prohibition command, 16.
...Memory write signal<MWT), 17...Memory write permission circuit, 18...Memory write permission signal,
1...AND circuit, 20...Write signal to memory, 21...memory.

Claims (1)

【特許請求の範囲】[Claims] メモリ書き込み許可信号を発生するメモリ書き込み許可
回路と、前記メモリ書き込み許可信号とメモリライト信
号とを受けてメモリ書き込み信号を作るAND回路と、
複数の制御信号を受けてメモリ書き込み禁止を指示する
信号を出力するOR回路とを設けたことを特徴とするメ
モリ制御回路。
a memory write permission circuit that generates a memory write permission signal; an AND circuit that receives the memory write permission signal and the memory write signal and generates a memory write signal;
1. A memory control circuit comprising: an OR circuit that receives a plurality of control signals and outputs a signal instructing memory write inhibition.
JP1286275A 1989-11-02 1989-11-02 Memory control circuit Pending JPH03147158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1286275A JPH03147158A (en) 1989-11-02 1989-11-02 Memory control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1286275A JPH03147158A (en) 1989-11-02 1989-11-02 Memory control circuit

Publications (1)

Publication Number Publication Date
JPH03147158A true JPH03147158A (en) 1991-06-24

Family

ID=17702259

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1286275A Pending JPH03147158A (en) 1989-11-02 1989-11-02 Memory control circuit

Country Status (1)

Country Link
JP (1) JPH03147158A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002065287A1 (en) * 2001-02-16 2002-08-22 Sony Corporation Data processing method and its apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002065287A1 (en) * 2001-02-16 2002-08-22 Sony Corporation Data processing method and its apparatus
US7240345B2 (en) 2001-02-16 2007-07-03 Sony Corporation Data processing apparatus and associated method
SG143064A1 (en) * 2001-02-16 2008-06-27 Sony Corp Data processing method and its apparatus
US8141057B2 (en) 2001-02-16 2012-03-20 Sony Corporation Data processing apparatus and associated method

Similar Documents

Publication Publication Date Title
KR100444537B1 (en) Data processor
JPH049321B2 (en)
CN114282206A (en) Stack overflow detection method, device, embedded system and storage medium
JPH03147158A (en) Memory control circuit
JPS58211254A (en) Accumulated program controlling system
JPS6074059A (en) Access control system for storage device
JPH02128266A (en) Register with protective function
JPS60239850A (en) Microprocessor system provided with no-break memory
JP2005209178A (en) Memory protection unit, memory protection method, and memory protection program
JPH11265319A (en) Method and device for reading out, changing and rewriting data stored in storage device
JPH05173886A (en) Writing device
JPH06149682A (en) Memory data protection circuit
JPS62137627A (en) Memory dump system
JP2602909B2 (en) Write-protection method during CPU runaway
JPS62286143A (en) Semiconductor memory device
JPH06187520A (en) Ic memory card
JP3645956B2 (en) System processing unit
JPH08106307A (en) Programmable controller
JPS60230248A (en) Memory protecting system
JPS62251857A (en) Memory control system
JPH03100846A (en) Memory write protection circuit
JPH05334195A (en) Information processor
JPS6285357A (en) Memory protecting device
JPH01267756A (en) Computer control device
JPH06202901A (en) Rom emulation system debugger and rom emulation method