JPH03189734A - Cpu device containing plural memory elements - Google Patents

Cpu device containing plural memory elements

Info

Publication number
JPH03189734A
JPH03189734A JP1330061A JP33006189A JPH03189734A JP H03189734 A JPH03189734 A JP H03189734A JP 1330061 A JP1330061 A JP 1330061A JP 33006189 A JP33006189 A JP 33006189A JP H03189734 A JPH03189734 A JP H03189734A
Authority
JP
Japan
Prior art keywords
program
memory element
address
rom
cpu
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
JP1330061A
Other languages
Japanese (ja)
Inventor
Naoya Okamura
尚哉 岡村
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP1330061A priority Critical patent/JPH03189734A/en
Publication of JPH03189734A publication Critical patent/JPH03189734A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control Or Security For Electrophotography (AREA)

Abstract

PURPOSE:To prevent such a case where a CPU runs away with abnormality of a certain memory element and damages other memory elements by storing previously a prescribed instruction to the head address of each memory element. CONSTITUTION:A program is described to each memory element of a ROM 2 and a RAM except a ROM 1 serving as a memory element including a program start address at and after the head address of each memory element. When the ROM 1 has no operation at all, the program is carried out at the head address of the ROM 2 while passing through the address of the ROM 1. In this case, the program run is stopped at the head address of the ROM 2 where a program is already described. Thus no damage is given to the RAM nor a system. An exactly same operation is carried out even with no actuation of the ROM 2. Thus it is possible to reduce the probability to rewrite other memories or to damage the system.

Description

【発明の詳細な説明】 (Fl)産業上の利用分野 この発明は、複数のメモリ素子を有するCPU装置に関
する。
DETAILED DESCRIPTION OF THE INVENTION (Fl) Industrial Application Field The present invention relates to a CPU device having a plurality of memory elements.

(bl従来の技術 複数のメモリ素子(ROM、RAMなど)を有するコン
トローラなどの従来のCPU装置では、メモリ異常時に
RAMデータ破壊やシステムが受けるダメージに対して
保証する手段が取られていなかった。コントローラとし
ては、例えば第3図に示すような構成のものが考えられ
る。このコントローラのシステムは、CPU、ROM1
.ROM2.RAM、Ilo、セレクト回路からなり、
RAMはバッテリによってバックアップされている。第
4図はこのシステムのメモリマツプを示している。ここ
で、仮に、ROMIが静電気や取扱の誤りで全く動作し
なくなったとする。すると、ROMIのエリアである0
0001(番地(プログラム開始アドレス)から3FF
FH番地の内容は全て00となる。多くのcpuの場合
、00はNOP命令であるからCPUは何も処理しない
で、ROM2の先頭番地のプログラムを実行する。これ
は正常な動作ではないために、プログラマ−の意図とは
異なる処理を実行することになる。すなわちRAMに誤
ったデータを書き込んだり、CPUが暴走してシステム
にダメージを与える。また、ROM2で同様なことがお
こった場合も、RAMの内容は多くの場合データである
から、CPUはデータをプログラムの一部として見做し
て動作するために暴走し、RAMの内容を書き換えたり
システムにダメージをを与える。さらに、メモリの内容
が誤りであったり、メモリソケットの挿入ミスなどが生
じた場合には、プログラムの命令が全く意味のない命令
となり、この場合にも同様にCPUは暴走し、RAMの
内容を破壊したり、システムにダメージを与える。
(bl) Prior Art In conventional CPU devices such as controllers having multiple memory elements (ROM, RAM, etc.), no measures have been taken to guarantee against RAM data destruction or damage to the system in the event of a memory abnormality. As a controller, for example, one having a configuration as shown in Fig. 3 can be considered.The system of this controller includes a CPU, a ROM1
.. ROM2. Consists of RAM, Ilo, and select circuit.
RAM is backed up by a battery. FIG. 4 shows the memory map of this system. Now, suppose that the ROMI stops working at all due to static electricity or mishandling. Then, the ROMI area 0
0001 (address (program start address) to 3FF
The contents of the FH address are all 00. In the case of many CPUs, since 00 is a NOP instruction, the CPU executes the program at the first address of ROM2 without processing anything. Since this is not a normal operation, processing that is different from the programmer's intention will be executed. In other words, incorrect data may be written to the RAM, or the CPU may run out of control, damaging the system. Also, if the same thing happens with ROM2, the contents of RAM are often data, so the CPU treats the data as part of the program and runs out of control, rewriting the contents of RAM. or damage the system. Furthermore, if the contents of the memory are incorrect or there is a mistake in inserting the memory socket, the program instructions will become completely meaningless, and in this case, the CPU will go out of control and overwrite the contents of the RAM. destroy or damage the system.

(C1発明が解決しようとする課題 このように、従来は複数のメモリ素子の一部に異常が発
生した場合に何らの対策が施されていなかったために、
一部のメモリ素子が異常のときにはCPUが暴走して他
のメモリの内容を四き換えたりシステムにダメージを与
えてしまうという問題があった。
(C1 Problem to be solved by the invention) As described above, in the past, no countermeasures were taken when an abnormality occurred in some of the multiple memory elements.
There is a problem in that when some memory elements are abnormal, the CPU goes out of control and changes the contents of other memories, causing damage to the system.

この発明の目的は、各メモリ素子の先頭番地に所定の命
令を予め記憶させておくことによって上記の不都合を解
決することの出来るCPU装置を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a CPU device that can solve the above-mentioned inconvenience by storing a predetermined instruction in the first address of each memory element in advance.

(d)課題を解決するための手段 この発明は、複数のメモリ素子を有するcpu装置にお
いて、 プログラム開始アドレスを含むメモリ素子を除く各メモ
リ素子は、先頭番地から(CPUの最長命令バイト数−
1)個以上のNOP命令とそれに続(停止処理プログラ
ムとを予め記憶したメモリ素子で構成されていることを
特徴とする。
(d) Means for Solving the Problems This invention provides that in a CPU device having a plurality of memory elements, each memory element except the memory element containing the program start address is arranged starting from the first address (longest instruction byte number of the CPU -
1) It is characterized by being composed of a memory element that stores in advance at least one NOP command and its successor (stop processing program).

(Q)作用 この発明では、一部のメモリ素子に静電気破壊や誤挿入
などの異常があった場合、CPLIはそのメモリ素子に
対して、より上位のアドレス空間エリアを有するメモリ
素子の先頭番地で極めて高い確立で停止する。すなわち
、メモリデータが破壊していたりメモリソケットの誤挿
入などがあった場合には、多くの場合、CPUはでたら
めな演算処理を行いながら次のメモリ素子の先頭番地の
プログラムを実行する確立が非常に高いために、その異
常状態にあるメモリ素子の最終番地のデータがどのよう
な長さの命令の一部データであっても、次の番地である
次のメモリ素子の先頭番地からNOP命令が(CPUの
最長命令パイ!・数−1)個連続するために、前記最終
番地のデータが対応する命令は実行されずに、NOP命
令を通過して、最後のNOP命令の次の命令である停止
処理プログラムを実行してプログラムが停止する。
(Q) Effect In this invention, if some memory element has an abnormality such as electrostatic damage or incorrect insertion, the CPLI will respond to that memory element at the first address of the memory element that has a higher address space area. Stops with a very high probability. In other words, if memory data is corrupted or a memory socket is incorrectly inserted, there is a very high probability that the CPU will execute the program at the first address of the next memory element while performing random arithmetic processing. Therefore, no matter how long the data at the last address of the memory element in the abnormal state is part of an instruction, the NOP instruction is executed from the next address, which is the first address of the next memory element. Because (CPU's longest instruction pie!・number - 1) instructions are consecutive, the instruction to which the data at the final address corresponds is not executed, passes through the NOP instruction, and becomes the next instruction after the last NOP instruction. The program stops by executing the stop processing program.

CPUはプログラムが停止することにより、他のメモリ
を書き換えたりシステムにダメージを与える確率を少な
くすることができる。
By stopping the program, the CPU can reduce the probability of rewriting other memories and damaging the system.

(f)実施例 第1図はこの発明の実施例のメモリマツプを示している
。コントローラは第3図に示すものと同一である。図に
示すように、プログラム開始アドレスを含むメモリ素子
であるROMIを除<ROM2およびRAMの各メモリ
素子は、先頭番地からプログラム■が記述されている。
(f) Embodiment FIG. 1 shows a memory map of an embodiment of the present invention. The controller is the same as shown in FIG. As shown in the figure, a program (2) is written in each memory element of ROM2 and RAM except for ROMI, which is a memory element containing a program start address, starting from the first address.

なお、本実施例ではCPUにも内部RAMが配置されて
おり、このCPU内部[?AMの先頭番地からもプログ
ラム■が記述されている。
In addition, in this embodiment, an internal RAM is also arranged in the CPU, and this CPU internal [? Program ■ is also written starting from the first address of AM.

第2図は上記プログラム■の内容を示している、プログ
ラム■はN個のNOP命令とその後ろにに’E<JLI
MP命令を含む無限ルーチンとで構成されている。無限
ルーチンではJUMP命令によって一つ前のアドレスに
ジャンプするようになっているために実質的にこの位置
でプログラムが停止する。なお、このルーチンに代えて
HA L T命令を挿入することも可能である。上記N
個のNOP命令ではCPUは何もしないが、NはCPU
の最長命令のバイト数−1以上の数に等しくされている
Figure 2 shows the contents of the above program ■.Program ■ has N NOP instructions and 'E<JLI
It consists of an infinite routine including MP instructions. In the infinite routine, the JUMP instruction causes the program to jump to the previous address, so the program essentially stops at this position. Note that it is also possible to insert a HALT command instead of this routine. Above N
With NOP instructions, the CPU does nothing, but with NOP instructions, the CPU
is set equal to the number of bytes of the longest instruction in - a number greater than or equal to 1.

このよ・)な構成にすると、メモリ素子の1つが異常の
場合cpuは次のように動作する。
With this configuration, if one of the memory elements is abnormal, the CPU operates as follows.

先ず、ROMIが全く動作しない場合には、ROMIの
アドレスを素通りしてROM2の先頭番地からのプログ
ラムを実施する。この時、ROM2の先頭番地からはプ
ログラム■が記述されているために、そこでプログラム
が停止して、RAMやシステムにダメージを与えること
がなくなる。
First, if ROMI does not operate at all, the program is executed from the first address of ROM2, bypassing the ROMI address. At this time, since the program (2) is written starting from the first address of the ROM2, the program will not stop there and cause damage to the RAM or the system.

ROM2が動作しない場合も全く同様である。The same applies when ROM2 does not operate.

次に、メモリの内容が誤りであったり、メモリソケソI
・の挿入ミスなどがあってCP Uが暴走、した場合を
考える。−船釣なCPUの命令コードは約8割が演算命
令で、約1割がその他の処理命令であり、ジャンプ系の
命令は約1割である。また、メモリ素子のアドレスH後
までプログラムが入っていることは殆どなく、余った部
分にはOOかFFが入っている場合が殆どである。この
ため、CPUが暴走した場合にはでたらめな演算処理を
行いながら次のメモリ素子の先頭番地を実行する確立が
極めて高くなる。すなわち、プログラム■が実行される
ことになるために、この位置でCPUの暴走を止めるこ
とができる。前述のように、プログラム■は(最長命令
のバイト数−1)以上の個数(N個)のNOP命令を配
置しているために、プログラム■を実行する直前の命令
が最長命令であったとしても、結局、なにも行われず、
次の停止処理プログラムを実行してプログラムが実質的
に停止される。
Next, if the contents of the memory are incorrect or the memory
Consider a case where the CPU goes out of control due to an insertion error. - Approximately 80% of the instruction codes of the CPU are arithmetic instructions, approximately 10% are other processing instructions, and approximately 10% are jump instructions. Further, it is rare that a program is stored until after the address H of the memory element, and the remaining portion is almost always filled with OO or FF. Therefore, if the CPU goes out of control, there is an extremely high probability that the CPU will execute the first address of the next memory element while performing random arithmetic processing. That is, since program (2) will be executed, it is possible to stop the CPU from running out of control at this position. As mentioned above, program ■ has a number (N) of NOP instructions that is greater than or equal to (the number of bytes of the longest instruction - 1), so even if the instruction immediately before executing program ■ is the longest instruction, In the end, nothing was done,
The program is substantially stopped by executing the next stop processing program.

(a発明の効果 以上のようにこの発明によれば、複数のメモリ素子のう
ち何れかの素子が方向を誤って挿入されていたり、静電
気や取り扱いミスによってデータか破壊されていた場合
に、CPUが暴走を1!続し他のメモリ素子の内容を破
壊したりシステム全体に与えるダメージをを最小限に抑
えることができる。また外部からのノイズによってメモ
リデータが変わることがあっても、本発明によれば、シ
ステムに与えるダメージを最小限に抑えることが出来る
。このため、特に電源オン時などにスパイクノイズを発
生するノイズ源を有する装置、例えばハロゲンランプ、
高圧チャージャ、電源開閉リレーなどを多数有する電子
写真複写機に使用することにより、CPU暴走時の回復
作業が容易になる利点がある。
(A) Effects of the Invention According to the present invention, if any of the plurality of memory elements is inserted in the wrong direction or data is destroyed due to static electricity or mishandling, the CPU It is possible to minimize the damage caused to the entire system by destroying the contents of other memory elements by continuing to run out of control.Furthermore, even if memory data may be changed due to external noise, the present invention According to , damage to the system can be minimized.For this reason, devices with noise sources that generate spike noise, especially when the power is turned on, such as halogen lamps, etc.
By using the present invention in an electrophotographic copying machine that has a large number of high-voltage chargers, power switch relays, etc., there is an advantage that recovery work in the event of CPU runaway becomes easier.

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

第1図は本発明の実施例のメモリマツプを示し、第2図
はメモリ素子の先頭番地以下に配置されるプログラムの
内容を示している。また第3図は本発明が適用されるコ
ン1−ローラのブロック図であり、第4図は従来のコン
トローラのメモリマツプを示す図である。 プログラム■−停止処理プログラム。 第1図
FIG. 1 shows a memory map of an embodiment of the present invention, and FIG. 2 shows the contents of a program located below the first address of a memory element. 3 is a block diagram of a controller to which the present invention is applied, and FIG. 4 is a diagram showing a memory map of a conventional controller. Program - Stop processing program. Figure 1

Claims (1)

【特許請求の範囲】[Claims] (1)複数のメモリ素子を有するCPU装置において、 プログラム開始アドレスを含むメモリ素子を除く各メモ
リ素子は、先頭番地から(CPUの最長命令バイト数−
1)個以上のNOP命令とそれに続く停止処理プログラ
ムとを予め記憶したメモリ素子で構成されていることを
特徴とする、複数のメモリ素子を有するCPU装置。
(1) In a CPU device having multiple memory elements, each memory element except the memory element containing the program start address is
1) A CPU device having a plurality of memory elements, characterized in that it is constituted by a memory element in which at least one NOP instruction and a subsequent stop processing program are stored in advance.
JP1330061A 1989-12-19 1989-12-19 Cpu device containing plural memory elements Pending JPH03189734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1330061A JPH03189734A (en) 1989-12-19 1989-12-19 Cpu device containing plural memory elements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1330061A JPH03189734A (en) 1989-12-19 1989-12-19 Cpu device containing plural memory elements

Publications (1)

Publication Number Publication Date
JPH03189734A true JPH03189734A (en) 1991-08-19

Family

ID=18228344

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1330061A Pending JPH03189734A (en) 1989-12-19 1989-12-19 Cpu device containing plural memory elements

Country Status (1)

Country Link
JP (1) JPH03189734A (en)

Similar Documents

Publication Publication Date Title
US8015558B1 (en) System, method and computer program product for on-the-fly patching of executable code
CN110663006A (en) Resilient failover for industrial programmable logic controllers
JP3563412B2 (en) Method for modifying a code sequence and related devices
US8707424B2 (en) Method for making secure execution of a computer programme, in particular in a smart card
JPH03189734A (en) Cpu device containing plural memory elements
US7788533B2 (en) Restarting an errored object of a first class
JPH09198258A (en) Task stack overflow detecting circuit
JP3046328B2 (en) Pachinko game machine controller
US7246206B2 (en) Method and device for storing a computer program in a program memory of a control unit
US20050034010A1 (en) Program-controlled unit
WO1990005951A1 (en) Method of handling unintended software interrupt exceptions
KR100799599B1 (en) Operating System and Method of Embedded Hardware Including Microcontroller Without Storage Management Device
JPH0120775B2 (en)
JPH11338712A (en) Interruption sequence saving circuit
JPH0484224A (en) Stack area protection circuit
JP2000181510A (en) Backup data protecting method for programmable controller, and programmable controller
CN115114006A (en) Method and device for protecting single chip microcomputer application program interruption triggering field
KR100393985B1 (en) Memory protecting device and method
JP2021140642A (en) Data processing device, data processing method, and program
JPH07210421A (en) Debugging method in thread environment
JPH04264929A (en) Runaway preventing system for program
JPS6037041A (en) Data processor
JP2003330800A (en) Semiconductor integrated circuit
JPS58221448A (en) microcomputer
JPH05134929A (en) Data access control system