JP3854572B2 - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP3854572B2
JP3854572B2 JP2002343377A JP2002343377A JP3854572B2 JP 3854572 B2 JP3854572 B2 JP 3854572B2 JP 2002343377 A JP2002343377 A JP 2002343377A JP 2002343377 A JP2002343377 A JP 2002343377A JP 3854572 B2 JP3854572 B2 JP 3854572B2
Authority
JP
Japan
Prior art keywords
code
encryption
microprocessor
instruction
value
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.)
Expired - Lifetime
Application number
JP2002343377A
Other languages
Japanese (ja)
Other versions
JP2004178250A (en
Inventor
進 須賀川
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.)
L E Tech CO Ltd
Original Assignee
L E Tech 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 L E Tech CO Ltd filed Critical L E Tech CO Ltd
Priority to JP2002343377A priority Critical patent/JP3854572B2/en
Publication of JP2004178250A publication Critical patent/JP2004178250A/en
Application granted granted Critical
Publication of JP3854572B2 publication Critical patent/JP3854572B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Executing Machine-Instructions (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、ノイズの発生が多い環境とくに遊技ホール等での環境で用いられるマイクロプロセッサの暴走を防ぐとともに、不正に改竄されたプログラムの実行をリアルタイムで禁止することができるマイクロプロセッサに関するものである。
【0002】
【従来技術】
従来マイクロプロセッサの暴走を止めるための工夫は、例えばマイクロプロセッサとマイクロプロセッサのプログラムを格納した2組以上の同一内容のPROMと、マイクロプロセッサの作動時に制御PROMの出力を比較し、出力データが異なっていたときに、前記マイクロプロセッサを停止させる機能を設ける(特許文献1を参照)。
【0003】
また、プログラム実行アドレスを計数するプログラムカウンタと、プログラムカウンタがインクリメントされるごとにプログラムカウンタの内容を累積加算する加算器と、加算結果を保持するチェックサムバッファーと、予めオブジェクトプログラム命令に格納されたチェックサムデータと前記チェックサムバッファーからの出力データとを比較する比較器とからなり、前記比較器の不一致出力信号をリセット信号として用いて、マイクロプロセッサを停止させる機能を設ける(特許文献2を参照)。
【0004】
また、マイクロプロセッサがワーク領域やオペランドをオペコードとして読み込んだ場合、マイクロプロセッサに割り込みをかけてプログラムを初期化して、マイクロプロセッサの誤動作を防止する(特許文献3を参照)。
【0005】
また、マイクロプロセッサのプログラムを格納するROMの番地と格納内容に対応して、該プログラムを格納するROMがオペコードを格納している番地に対応する番地には一方の論理レベルの信号を格納し、該プログラムを格納するROMがオペコード以外を格納している番地に対応する番地にはもう一方の論理レベルの信号を格納する記憶回路と、マイクロプロセッサに設けられたフェッチタイミング検出回路の出力信号と前記記憶回路の出力信号との一致、不一致を検定して、マイクロプロセッサの停止する(特許文献4を参照)。
【0006】
また、命令語にオペコードかオペランドかを示す判別ビットを付加し、命令レジスタからは格納された命令語の判別ビットを出力させ、命令デコーダからは命令レジスタに格納された命令語をオペコードとして解読するかオペランドとして解読するかを示す信号を出力させ、命令レジスタと命令デコーダの出力を比較し、一致しない場合、割り込み要求して、マイクロプロセッサの停止する(特許文献5を参照)。
【特許文献1】
特開平2−307125号公報
【特許文献2】
特開平9−319621号公報
【特許文献3】
特開平5−233339号公報
【特許文献4】
特開平7−319734号公報
【特許文献5】
特開平5−020058号公報
【0007】
【本発明が解決しようとする課題】
マイクロプロセッサの暴走の原因の一つとして、マイクロプロセッサがプログラムの格納されているプログラム記憶手段から命令コードを読み込む際、コードを間違えて読んでしまうことで発生する場合がある。命令コードを含むプログラムはプログラム記憶手段に記憶されていて、このプログラム記憶手段は、データバス(例えば現状の遊技機用マイクロプロセッサにおいては8本)によって、マイクロプロセッサとつながっている。マイクロプロセッサに対する命令コードは、このデータバスを介してマイクロプロセッサに読み込まれ、実行される。このとき、静電気や電源等から発生するノイズの影響でデータバスの1本でも0,1の関係が崩れると、間違った命令コードとして実行されてしまう。マイクロプロセッサへの命令コードは、オペコードのみ又はオペコードとオペランドの対から構成されていて、命令長(1ステップ命令長)は、オペコードのみの場合は1バイト命令、オペコードとオペランドの対からなる場合は2バイト命令、3バイト命令、なかには、4バイト命令もある。このような長さの違う、沢山のステップが区切りもなくプログラム記憶手段のなかにびっしりと並んでいるから、例えば、実際の3バイト命令を間違って2バイト命令と解釈すると余った1バイトが次の命令と認識され延々と間違ってしまう。
【0008】
このようにマイクロプロセッサの暴走が発生したとき、従来のマイクロプロセッサは、暴走を検知しても、いずれもリセットにより初期状態に戻して、再度命令プログラムを初期状態から実行させるものばかりである。そのため、マイクロプロセッサが暴走していることを検知しても、暴走する直前に戻して、プログラムを継続することができなかった。とくに、遊技ホールにおいては、主にパチンコ球の補給、回収のための球の移動等によって、多量の静電気が発生し、マイクロプロセッサにとって良い動作状態とは言えなかった。また、遊技機においては不正集団による不正部品の取り付けやプログラム改竄防止の観点から、チップを搭載した基板の状態が外部から視認できるように透明なケースに収められているため、基板を覆い隠すようなノイズ対策ができなかった。そのため、マイクロプロセッサの暴走に関してチップ内の部品の配置、配線パターンの工夫、シールドなどの方法で少しでもノイズに対して強度のある方法を模索してきたが、決定的なものはなかった。
【0009】
【課題を解決するための手段】
本発明は、機械語プログラムのオペコード又はオペコードとオペランドの対からなる命令コードから、あらかじめ一定の計算方法で生成した第一の暗号コードを、前記命令コードが格納されている領域とは別の領域に格納し、マイクロプロセッサが前記命令コードを読み込んだ時に、前記命令コードを当該一定の計算方法で計算した第二の暗号コードと前記第一の暗号コードとを比較して、一致すれば命令を実行することを特徴とするマイクロプロセッサであり、また、第二の暗号コードを第一の暗号コードと比較した結果、一致しない場合、プログラムカウンタの値を命令コード読み込み前の値に戻して再度命令コードを読み込むことを特徴とするマイクロプロセッサである。
【0010】
また、プログラムカウンタと前記プログラムカウンタの値を保存するコピープログラムカウンタを有し、第二の暗号コードと第一の暗号コードとを比較した結果、一致する場合プログラムカウンタの値をコピープログラムカウンタへ書き込み、一致しない場合コピープログラムカウンタの値をプログラムカウンタへ書き込むことが出来るようにすることができる。
【0011】
さらに、第二の暗号コードと第一の暗号コードとを比較した結果、一致しない場合、一致しなかった回数を計測するカウンタを有し、このカウンタは、任意の時間にこの値を外部に知らしめるようにすることができる。また、このカウンタの値が、一定値に達すると記録を中止し、リセット信号を出力し初期状態に戻すこともできる。
【0012】
このようなマイクロプロセッサは、すべて遊技機用のマイクロプロセッサとして利用することが出来る。
【0013】
【発明の実施の形態】
本発明においては、1ステップの命令コード毎に一定の計算法則に従った計算ロジックを用意し、そこで計算した値(以下、第一の暗号コードという)を、あらかじめ命令コードが格納されている領域とは別の比較できる領域へ格納しておき、この計算結果により導き出されたコード(以下、第二の暗号コードという)と格納されている第一の暗号コードを比較する。
【0014】
本発明において一定の計算方法とは、単純な加減乗除、一定の方程式、ハッシュ関数などどのような計算方法でも良い。例えば、遊技機用マイクロプロセッサがオペコード又はオペコードとオペランドの対からなる命令コードを読み込んだら、命令コードを実行する前に同じ計算ロジックを使用してマイクロプロセッサ内で計算させる。
【0015】
本発明において命令コードが格納されている領域とは別の領域に第一の暗号コードを格納しているが、別の領域とは、第一の暗号コードを格納するための記憶手段を別途設けてもよいし、同じアドレスに2つの記憶手段を配置し、必要に応じて切り替えて使用する通称バンク切り替え方式を使用してもよい。なお、バンク切り替え方式を使用すると、命令コードのアドレスと第一の暗号コードのアドレスのオフセット計算が必要なくなり都合がよい。
【0016】
命令コードを1バイトづつ暗号化した場合、ノイズ等の影響でプログラムの途中に飛び込んできたときに、偶然に第一の暗号コードと第二の暗号コードが一致してしまうことも想定されるため、3バイト命令なら3バイト、2バイト命令なら2バイトで撹拌されることが好ましい。計算結果は同じ長さでも良いし、ハッシュ関数などによるサイズ縮小があっても良い。コードの不正な解読や改竄を防止するセキュリティ効果が要求される場合には、可変キーなど使った複雑な物がさらに好ましい。
【0017】
命令コードのコードの長さは何バイトでもよいが、Z80マイクロプロセッサを例に挙げると1バイト命令から4バイト命令いずれかになる。これら1バイト命令から4バイト命令の異なるコード長の命令コードから1バイトの暗号コードをハッシュ関数により作るには、最大長すなわち4バイトのバッファを用意して埋まらないところには常数(00など)を入れる。命令コードを暗号化し第一の暗号コードを作成する作業をプログラムの全ステップについて行う。第一の暗号コードを格納する記憶手段は基本的にはプログラムサイズと同等な物が必要になるが、データ領域は考える必要はないので現状の遊技機用マイクロプロセッサに使用した場合、最大3キロバイトの増加で済む。
【0018】
本発明のマイクロプロセッサには、プログラムカウンタとプログラムカウンタの値を保存するコピープログラムカウンタを用意し、イニシャル時にはプログラムカウンタ及びコピープログラムカウンタの両者の値ともにプログラムの先頭番地の値としておく。
【0019】
遊技機用マイクロプロセッサがオペコード又はオペコードとオペランドの対からなる命令コードを読み込んだら、命令を実行する前に計算ロジックにて計算した第二の暗号コードと、命令コードが格納されている領域とは別の領域にあらかじめ格納されている第一の暗号コードの内、命令コードに対応した位置の第一の暗号コードとをコンパレータに入れ整合性を見る。一致すればプログラムカウンタの値をコピープログラムカウンタに書き込んでから命令コードを実行する。一致しなければコピープログラムカウンタの値をプログラムカウンタに書き込んでプログラムステップの先頭に戻し再度命令コードを読み込ませる。もしプログラムの内容の一部が改竄されたとしても、命令コードが格納されている領域とは別の領域に置かれた第一の暗号コードまで改竄されない以上、マイクロプロセッサでは、第一の暗号コードと第二の暗号コードの比較動作を繰り返しているだけで、決して次の命令コードを実行しない。そのため、遊技用のマイクロプロセッサに本マイクロプロセッサを使用した場合、遊技は停止してしまい、プログラムの改竄防止の一助となる。
【0020】
なお、正規なプログラムであってもノイズ環境の悪いところにおける動作においては、再度読み込みが頻繁に起こることが想像される。本発明では再度読み込みが起こる度に、インクリメントするカウンタとそれを任意の時間に外部に出力したり、外部からカウンタをリセットする回路を設けてある。一定時間にこのカウンタの数値を調べれば、遊技機のノイズ下における動作状態を把握することができ、ノイズ環境の改善に役立つ。
【0021】
実際のプログラムは命令コードがびっしり詰め込まれているため、何処が命令の区切りかは分からない。このような状態でどの様に暗号化をするか、その方法を述べる。遊技機に使用するマイクロプロセッサの命令デコード回路を生かし、命令実行回路を動作させない、疑似プロセッサを使用する。擬似プロセッサとは、図1における縦の点線の左部分(レジスタA101、レジスタB102、計算ユニット106)を削除するなどして動作させないような構成とすることで容易に実現できる。疑似プロセッサは命令を実行しないので、例えばジャンプ命令や、条件分岐などがあっても、記憶手段に書かれた順番に、命令長のみを知らせてくれる。あとは、命令長に従って計算ロジックを使用し暗号コードを生成する事により効率的に行える。
【0022】
(発明の具体例)
図に基づいて、暴走を防ぐとともに不正に改竄されたプログラムの動作を禁止するマイクロプロセッサの構造について述べる。
【0023】
図1は、遊技機等に一般的に用いられているZ80マイクロプロセッサの演算部ブロック図である。命令を解読して、必要なレジスタに値をセットしてから、演算を行うという流れになっている。今回の発明の説明には、このZ80マイクロプロセッサを例にとって説明するが他のマイクロプロセッサも基本的に変わらない。
【0024】
図2は、本発明において、マイクロプロセッサがデータバスを介して記憶手段から読み出した命令コードが、正しいコードか否かを判定する構造である。点線で囲まれた記憶手段内のプログラムバンク209に書かれた、AA BB CCのコードは3バイト命令であり、この3バイトは暗号化計算ロジック205と同一の計算方法を用いて、DDなる第一の暗号コードとしてあらかじめ暗号データバンク210の次のアドレスに書かれている。なお、暗号化計算ロジック205と同一の計算方法は、マイクロプロセッサを使用する環境に応じて適宜設定すればよい。改竄や不正な解読が起こらない場所で使用する場合には、暗号化計算ロジック205は加算等の単純な計算をするだけでもよいし、改竄や不正な解読を防止する必要がある場合には、難解な暗号キーを用いた計算をすればよい。暗号データバンク210の使用しないアドレスには計算上存在し得ない値(ヌルコードなど)を入れておくか、或いはDDで埋めておく、この例ではDDは1バイトであるが、勿論2バイトや3バイトあるいは命令コードと同じサイズでも良い。
【0025】
Z80マイクロプロセッサは、オペコードAAを読み込むとCPUコントローラ201内の命令デコード回路(図示せず)により3バイト命令であることを解読して残りの2バイトのオペランドを読み込む。このとき、本発明を実行するためにマイクロプロセッサに付加した回路(以下付加回路と述べる)を介して、Z80マイクロプロセッサが読み込む命令コードを順番に4バイトバッファ204に転送する。
【0026】
Z80マイクロプロセッサが、オペランドに基づき、必要なレジスタに値を格納する間に、付加回路は暗号化計算ロジック205を通して、1バイトの第二の暗号コードを生成する。同時に付加回路は記憶手段のバンクを暗号データバンク210に切り替え、プログラムカウンタの指しているアドレスのデータ、すなわち第一の暗号コードであるDDをコンパレータ206に送る。暗号化計算ロジック205で生成された暗号の値、すなわち第二の暗号コードがDDであればコンパレータ206は一致信号を出し、この一致信号を確認したZ80マイクロプロセッサは命令コードを実行するとともにプログラムカウンタ202の値をコピープログラムカウンタ203に書き込む。不一致の場合は、コンパレータ206は不一致信号を出し、エラーカウンタ207の値をインクリメントすると同時にコピープログラムカウンタ203の値をプログラムカウンタ202に書き込んで再度命令コードのオペコード部分であるAAを読み込む。
【0027】
エラーカウンタ207は、暴走の発生した回数を記録するカウンタで、エラーカウンタ207の値は外部に報知することができる。また、エラーカウンタ207は、暴走の発生した回数が一定回数を超えたとき、マイクロプロセッサのリセット手段208に信号を出力する。エラーカウンタ207から信号を受けたマイクロプロセッサのリセット手段208は、マイクロプロセッサを初期状態に戻すためのリセット信号を出力する。
【0028】
もし、3バイト命令をマイクロプロセッサが2バイトないしは1バイト命令と間違えて計算をしても、プログラムカウンタ202が示すアドレスに格納されている第一の暗号コードはヌルコード又はDDであり計算が一致することはない。
【0029】
どんなに複雑な計算を行っても、1バイトから4バイトまでの暗号化では、多数の暗号化プログラムを解析すればどの命令がどの様な暗号になるか、サンプルするだけで解読されてしまう可能性がある。その為、全てのプログラムコードをハッシュ関数などで撹拌した暗号コードXXなどを別途作成し、AA,BB,CCから作られたDDに暗号情報として混ぜ込んでおくことも考えられる。このようにプログラムの全ての情報が暗号作成に絡むようにしておけば、容易に解読されることはない。
【0030】
図3は、周知のZ80マイクロプロセッサのデータ処理フローである。まず、マイクロプロセッサは、S301で命令コードからオペコードを読み出し、S302でプログラムカウンタをインクリメントする。次いでS303で命令コードをデコードし、命令が何バイト命令であるかを認識する。Z80マイクロプロセッサでは、最大4バイト命令までしかない。S304で1バイト命令(オペコードのみ)の場合はそのままS305で実行に移される。
【0031】
S306で2バイト命令(オペコード+オペランド)の場合は、S307でバイトカウンタを1に設定して、S308でオペランドを読み込み、S309でCPUバッファに転送し、S310でポインタをインクリメントし、S311でプログラムカウンタをインクリメントし、S312でバイトカウンタをデクリメントする。S313でバイトカウンタを確認するが、2バイト命令の場合は、ここでバイトカウンタが0であることを確認し、S305で実行に移される。
【0032】
S314で3バイト命令(オペコード+オペランド+オペランド)の場合は、S315でバイトカウンタを2に設定して、S313でバイトカウンタが0になるまで、2バイト命令と同じS308〜S312の過程を経由した後、S305で実行に移される。
【0033】
S314で3バイト命令ではないと判断された場合は、4バイト命令(オペコード+オペコード+オペランド+オペランド)であるため、S316でオペコードを読み出し、S317で命令をデコードし、S315でバイトカウンタを2に設定する。S308以降は3バイト命令と同じ過程を経由した後、S305で実行に移される。
【0034】
図4は、Z80マイクロプロセッサに本発明の処理を加えたものであり、本発明の代表的なフローである。まず、マイクロプロセッサは、S401で命令コードからオペコードを読み出し、S402でプログラムカウンタをインクリメントし、S403で4バイトバッファに転送し、S404でバッファポインタをインクリメントし、次いでS405で命令コードをデコードし、命令コードが何バイト命令であるかを認識する。
【0035】
S406で1バイト命令(オペコードのみ)の場合は、S407で命令コードを一定の計算方法で暗号化し、第二の暗号コードを取得する。続いてS408でロムをバンク切り替えして、暗号データバンクに切り替え、プログラムカウンタが示すアドレスの第一の暗号コードを取得する。そしてS409で第二の暗号コードと第一の暗号コードとを比較し、S410で一致と判断すると、S411でプログラムカウンタの値をコピープログラムカウンタに書き込み、S412で命令コードを実行する。S410で一致しないと判断すると、S413でコピープログラムカウンタの値をプログラムカウンタに書き込み、S414でエラーカウンタの値をインクリメントし、S401のオペコード読み出し過程の直前に戻される。なお、ここでマイクロプロセッサが使用されているノイズ環境の良し悪しを確認したいときのために、エラーカウンタの値を外部に出力することができる。エラーカウンタの値を調べることで、暴走回数を知ることができ、暴走回数が多いほどノイズが多く、ノイズ環境が悪いことがわかる。
【0036】
S415で2バイト命令(オペコード+オペランド)と判断した場合、S416でバイトカウンタを2に設定し、S417でオペランドを読み込み、S418でCPUバッファに転送し、S419で4バイトバッファに転送し、S420でバッファポインタをインクリメントし、S421でプログラムカウンタをインクリメントし、S422でバイトカウンタをデクリメントする。S423でバイトカウンタを確認するが、2バイト命令の場合は、ここでバイトカウンタが0であることが確認される。続いてS407で命令コードを一定の計算方法で暗号化し、第二の暗号コードを取得する。S408でロムをバンク切り替えして、暗号データバンクに切り替え、プログラムカウンタが示すアドレスの第一の暗号コードを取得する。そしてS409で第二の暗号コードと第一の暗号コードとを比較し、S410で一致と判断すると、S411でプログラムカウンタの値をコピープログラムカウンタに書き込み、S412で命令コードを実行する。S410で一致しないと判断すると、S413でコピープログラムカウンタの値をプログラムカウンタに書き込み、S414でエラーカウンタの値をインクリメントし、S401のオペコード読み出し過程の直前に戻される。
【0037】
S424で3バイト命令(オペコード+オペランド+オペランド)の場合は、S425でバイトカウンタを2に設定し、S417以降は2バイト命令と同じ過程を経由する。
【0038】
S424で3バイト命令ではないと判断された場合は、4バイト命令(オペコード+オペコード+オペランド+オペランド)であるため、S426でオペコードを読み出し、S427で命令をデコードし、S428で4バイトバッファに転送し、S429でバッファポインタをインクリメントする。S425以降は3バイト命令と同じ過程を経由する。
【0039】
図5は、図4の実施例に暴走した回数が一定回数を超えた場合、リセット信号を出力する内容を加えた例である。S501からS509に到達する過程は、図4のS401からS409に到達する過程と同一のため、省略する。S510で、第二の暗号コードと第一の暗号コードを比較した結果が、不一致であった場合、S513でコピープログラムカウンタの値をプログラムカウンタに書き込み、S514でエラーカウンタの値をインクリメントする。S515でエラーカウンタの値が既定値を超えていないとき、S501のオペコード読み出し過程の直前に戻される。
【0040】
S515でエラーカウンタの値が既定値を超えたとき、すなわち暴走回数が一定回数を超えたときには、S516でリセット信号を出力する。リセットを出力するまでの既定値については、ユーザーが任意の値に設定できるようにしてもよい。ノイズ環境の良好な場所では既定値を大きな値にする必要はないが、劣悪なノイズ環境の下でマイクロプロセッサを暴走させることなく、実行を継続させたいというケースでは、既定値をある程度大きく設定する必要がある。
【0041】
エラーカウンタの値を0に戻すタイミングは、ユーザーからの要求で可変できるようにして、マイクロプロセッサが使用されているノイズ環境のデータを収集する際に活用できるようにしてもよい。例えばユーザー自身がスイッチ等で0に戻すような設定にしても良いし、電源立ち上げ時や一定時間経過したときに0に戻すような設定にしても良い。また、エラーカウンタの値を集計できるようにして、ある環境においてマイクロプロセッサが単位時間あたり何回暴走したのかを記録できるようにしてもよい。
【0042】
本発明の実施例では遊技機用に用いる8ビットのマイクロプロセッサの例しか示さなかったが、勿論ビット長には拘らずに使用できる。また、当然、遊技機用以外の他の用途にも有効であり、特に車載用、航空機など人命に関わるような用途に対しては、絶大な効果を発揮することが期待できる。本発明のマイクロプロセッサを並列的に複数個使用し、実行する命令コードを多数決で決定するようにすることで、ノイズによるマイクロプロセッサの暴走を防止する効果を飛躍的に高めることができることはいうまでもない。
【0043】
【発明の効果】
本発明は、ノイズ等の原因によりマイクロプロセッサの暴走が発生しても、間違った命令コードは実行されないので、暴走によるデータ等の破壊を防ぐことができ、マイクロプロセッサの信頼性向上につながる。また、遊技用に本発明のマイクロプロセッサを使用した場合、不正集団によりプログラムを改竄されたとしても、正規のプログラム以外は実行されないため、不正なプログラムの動作を禁止し、遊技ホールにおける不正の排除につながる。
【0044】
マイクロプロセッサが命令コードの読み違いを起こした場合、命令コードの読み違いを起こす直近の命令コードに戻って、再度命令コードを実行し直すため、ノイズ環境の悪い遊技ホールに設置された遊技機においても、あたかもノイズの影響を受けていないかのように動作するため、遊技者も異常を感じることなく、遊技を継続することができる。また、各遊技メーカーの開発技術者においては、ノイズ対策にかける膨大な労力と費用を節減できる。さらに遊技以外の分野、例えばシミュレーション計算等の処理に長時間を要すプログラムの実行においては、暴走が発生しても初期状態に戻ることなく、処理を継続することができるため、信頼性の高いマイクロプロセッサを提供することができる。
【0045】
マイクロプロセッサの暴走した回数を計測し、外部に報知することができるため、目に見えないノイズ環境を数値として把握することができ、ノイズ対策に有効なサンプルデータを収集することができる。
【図面の簡単な説明】
【図1】 Z80マイクロプロセッサの演算部ブロック図。
【図2】 本発明マイクロプロセッサの動作説明図。
【図3】 Z80マイクロプロセッサのデータ処理フローチャート。
【図4】 本発明の第一の実施例を示すマイクロプロセッサのデータ処理フローチャート。
【図5】 本発明の第一の実施例を示すマイクロプロセッサのデータ処理フローチャート。
【符号の説明】
109、201 CPUコントローラ
202 プログラムカウンタ
203 コピープログラムカウンタ
204 4バイトバッファ
205 暗号化計算ロジック
206 コンパレータ
207 エラーカウンタ
208 マイクロプロセッサのリセット手段
209 プログラムバンク
210 暗号データバンク
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microprocessor capable of preventing runaway of a microprocessor used in an environment where noise is generated, particularly in a game hall, and prohibiting the execution of an illegally altered program in real time. .
[0002]
[Prior art]
The conventional way to stop the runaway of the microprocessor is to compare the output of the PROM with two or more identical contents storing the microprocessor and microprocessor program and the output of the control PROM when the microprocessor is in operation, and the output data is different A function is provided to stop the microprocessor when it is in the middle (see Patent Document 1).
[0003]
Also, a program counter that counts the program execution address, an adder that cumulatively adds the contents of the program counter each time the program counter is incremented, a checksum buffer that holds the addition result, and stored in advance in the object program instruction A comparator that compares the checksum data with the output data from the checksum buffer, and has a function of stopping the microprocessor by using the mismatch output signal of the comparator as a reset signal (see Patent Document 2) ).
[0004]
Further, when the microprocessor reads a work area or an operand as an operation code, the microprocessor is interrupted to initialize the program to prevent the microprocessor from malfunctioning (see Patent Document 3).
[0005]
Corresponding to the address and stored contents of the ROM for storing the program of the microprocessor, the signal storing one logic level is stored in the address corresponding to the address in which the ROM storing the program stores the operation code, A ROM that stores the program stores an address corresponding to an address that stores other than an opcode, a storage circuit that stores a signal of the other logic level, an output signal of a fetch timing detection circuit provided in a microprocessor, The microprocessor is stopped by checking for coincidence and inconsistency with the output signal of the memory circuit (see Patent Document 4).
[0006]
Also, a discrimination bit indicating whether it is an opcode or an operand is added to the instruction word, the discrimination bit of the stored instruction word is output from the instruction register, and the instruction word stored in the instruction register is decoded as an opcode from the instruction decoder A signal indicating whether to decode as an operand is output, the outputs of the instruction register and instruction decoder are compared, and if they do not match, an interrupt is requested and the microprocessor is stopped (see Patent Document 5).
[Patent Document 1]
JP-A-2-307125
[Patent Document 2]
JP-A-9-319621
[Patent Document 3]
JP-A-5-233339
[Patent Document 4]
JP 7-319734 A
[Patent Document 5]
JP-A-5-020058
[0007]
[Problems to be solved by the present invention]
One of the causes of the runaway of the microprocessor may occur when the microprocessor reads the instruction code from the program storage means storing the program by mistakenly reading the code. The program including the instruction code is stored in the program storage means, and the program storage means is connected to the microprocessor by a data bus (for example, eight in the current gaming machine microprocessor). The instruction code for the microprocessor is read into the microprocessor via the data bus and executed. At this time, if the relationship between 0 and 1 breaks down even with one data bus due to the influence of noise generated from static electricity or power, etc., it is executed as an incorrect instruction code. The instruction code to the microprocessor consists of only the opcode or the pair of opcode and operand. The instruction length (1 step instruction length) is 1 byte instruction if only the opcode is specified, and if it consists of a pair of opcode and operand. There are also 2-byte instructions, 3-byte instructions, and some 4-byte instructions. There are many different steps with different lengths, and they are lined up in the program storage means. For example, if an actual 3-byte instruction is mistakenly interpreted as a 2-byte instruction, the remaining 1 byte is the next. It is recognized as an order and is wrong.
[0008]
Thus, when the runaway of the microprocessor occurs, even if the conventional microprocessor detects the runaway, all of them are reset to the initial state by reset and the instruction program is executed again from the initial state. Therefore, even if it was detected that the microprocessor was running out of control, it was not possible to return to the state immediately before the runaway and continue the program. In particular, in the game hall, a large amount of static electricity was generated mainly due to replenishment of pachinko balls, movement of balls for recovery, etc., which was not a good operating condition for the microprocessor. In addition, in gaming machines, from the standpoint of mounting illegal parts by illegal groups and preventing falsification of programs, the state of the board on which the chip is mounted is housed in a transparent case so that it can be seen from the outside. The noise countermeasures could not be done. For this reason, we have sought a method that is strong against noise, such as the arrangement of components in the chip, the ingenuity of the wiring pattern, and shielding, with regard to the runaway of the microprocessor, but none has been decisive.
[0009]
[Means for Solving the Problems]
The present invention provides an area different from an area in which the instruction code is stored in a first encryption code generated by a predetermined calculation method from an operation code of an operation code of a machine language program or an operation code and an operand pair. And when the microprocessor reads the instruction code, the second encryption code calculated by the certain calculation method is compared with the first encryption code. If the result of comparing the second encryption code with the first encryption code does not match, the value of the program counter is returned to the value before reading the instruction code and the instruction is executed again. It is a microprocessor characterized by reading a code.
[0010]
Also, it has a program counter and a copy program counter for saving the value of the program counter, and if the second encryption code and the first encryption code are compared, if they match, the program counter value is written to the copy program counter. If they do not match, the value of the copy program counter can be written to the program counter.
[0011]
Further, if the second encryption code and the first encryption code do not match, the counter has a counter that counts the number of times that they do not match, and this counter knows this value externally at an arbitrary time. Can be squeezed. Further, when the value of the counter reaches a certain value, recording can be stopped, and a reset signal can be output to return to the initial state.
[0012]
All of such microprocessors can be used as microprocessors for gaming machines.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
In the present invention, a calculation logic in accordance with a certain calculation rule is prepared for each instruction code of one step, and a value calculated there (hereinafter referred to as a first encryption code) is stored in advance in an instruction code. The code is derived from the calculation result (hereinafter referred to as second encryption code) and the stored first encryption code is compared.
[0014]
In the present invention, the constant calculation method may be any calculation method such as simple addition / subtraction / division / division, a constant equation, or a hash function. For example, when a microprocessor for gaming machine reads an operation code consisting of an operation code or an operation code / operand pair, the same calculation logic is used in the microprocessor before the operation code is executed.
[0015]
In the present invention, the first encryption code is stored in an area different from the area where the instruction code is stored. However, the storage area for storing the first encryption code is provided separately from the other area. Alternatively, a common bank switching method may be used in which two storage units are arranged at the same address and switched as necessary. If the bank switching method is used, it is not necessary to calculate the offset between the address of the instruction code and the address of the first encryption code, which is convenient.
[0016]
If the instruction code is encrypted one byte at a time, it is assumed that the first encryption code and the second encryption code coincide by chance when jumping into the middle of the program due to the influence of noise etc. It is preferable that 3 bytes are agitated with 3 bytes and 2 bytes are agitated with 2 bytes. The calculation results may be the same length or may be reduced in size by a hash function or the like. In the case where a security effect for preventing unauthorized decoding and tampering of the code is required, a complicated object using a variable key is more preferable.
[0017]
The length of the code of the instruction code may be any number of bytes, but if the Z80 microprocessor is taken as an example, it will be either a 1-byte instruction or a 4-byte instruction. To create a 1-byte encryption code from an instruction code with a different code length from 1-byte instruction to 4-byte instruction using a hash function, a maximum number, that is, a 4-byte buffer is prepared and a constant (such as 00) is used. Insert. The operation of encrypting the instruction code and creating the first encryption code is performed for all steps of the program. The storage means for storing the first encryption code basically needs to be equivalent to the program size, but there is no need to consider the data area, so when used in the current gaming machine microprocessor, a maximum of 3 kilobytes Just increase.
[0018]
The microprocessor of the present invention is provided with a program counter and a copy program counter for storing the value of the program counter. At the initial stage, both the program counter and the copy program counter are set as the values at the head address of the program.
[0019]
When the gaming machine microprocessor reads an instruction code consisting of an opcode or an opcode / operand pair, the second encryption code calculated by the calculation logic before executing the instruction and the area where the instruction code is stored Of the first encryption codes stored in advance in another area, the first encryption code at the position corresponding to the instruction code is put in a comparator to check the consistency. If they match, the instruction code is executed after the value of the program counter is written to the copy program counter. If they do not match, the value of the copy program counter is written into the program counter, returned to the beginning of the program step, and the instruction code is read again. Even if part of the contents of the program is tampered with, the microprocessor does not tamper with the first encryption code placed in an area other than the area where the instruction code is stored. Only the comparison operation of the second encryption code is repeated, and the next instruction code is never executed. For this reason, when this microprocessor is used as a gaming microprocessor, the game stops and helps prevent falsification of the program.
[0020]
Even if it is a legitimate program, it can be imagined that reading frequently occurs again in the operation in a place where the noise environment is bad. In the present invention, a counter that increments every time reading occurs and a circuit that outputs the counter to the outside at an arbitrary time or resets the counter from the outside are provided. By examining the value of this counter at a certain time, it is possible to grasp the operating state of the gaming machine under noise, which is useful for improving the noise environment.
[0021]
Since an actual program is packed with instruction codes, it is not known where the instructions are separated. How to encrypt in such a state is described. A pseudo processor that does not operate an instruction execution circuit by using an instruction decode circuit of a microprocessor used in a gaming machine is used. The pseudo processor can be easily realized by adopting a configuration in which the left part of the vertical dotted line (register A101, register B102, calculation unit 106) in FIG. Since the pseudo processor does not execute an instruction, even if there is a jump instruction or a conditional branch, for example, only the instruction length is notified in the order written in the storage means. The rest can be done efficiently by generating a cryptographic code using calculation logic according to the instruction length.
[0022]
(Specific examples of the invention)
Based on the figure, the structure of a microprocessor that prevents runaway and prohibits the operation of an illegally tampered program will be described.
[0023]
FIG. 1 is a block diagram of an arithmetic unit of a Z80 microprocessor generally used for gaming machines and the like. The flow is such that an instruction is decoded, a value is set in a necessary register, and then an operation is performed. In the description of the present invention, this Z80 microprocessor will be described as an example, but other microprocessors are basically unchanged.
[0024]
FIG. 2 shows a structure for determining whether or not the instruction code read from the storage means by the microprocessor via the data bus is a correct code in the present invention. The AA BB CC code written in the program bank 209 in the storage means surrounded by a dotted line is a 3-byte instruction, and these 3 bytes are the same as the DD using the same calculation method as the encryption calculation logic 205. One encryption code is written in advance at the next address of the encryption data bank 210. Note that the same calculation method as that of the encryption calculation logic 205 may be set as appropriate according to the environment in which the microprocessor is used. When used in a place where tampering or unauthorized decryption does not occur, the encryption calculation logic 205 may only perform simple calculations such as addition, or when it is necessary to prevent tampering or unauthorized decryption, Calculations using esoteric encryption keys may be performed. A value (null code or the like) that cannot exist in calculation is put in an address that is not used in the encryption data bank 210, or is filled with DD. In this example, DD is 1 byte, but of course, 2 bytes or 3 It may be the same size as the byte or instruction code.
[0025]
When the Z80 microprocessor reads the operation code AA, the instruction decode circuit (not shown) in the CPU controller 201 decodes the 3-byte instruction and reads the remaining 2-byte operand. At this time, instruction codes read by the Z80 microprocessor are sequentially transferred to the 4-byte buffer 204 via a circuit (hereinafter referred to as an additional circuit) added to the microprocessor to execute the present invention.
[0026]
While the Z80 microprocessor stores the value in the required register based on the operand, the additional circuit generates a 1-byte second encryption code through the encryption calculation logic 205. At the same time, the additional circuit switches the storage means bank to the encryption data bank 210 and sends the data at the address pointed to by the program counter, that is, the first encryption code DD to the comparator 206. If the encryption value generated by the encryption calculation logic 205, that is, the second encryption code is DD, the comparator 206 issues a coincidence signal, and the Z80 microprocessor that has confirmed this coincidence signal executes the instruction code and program counter. The value 202 is written into the copy program counter 203. In the case of mismatch, the comparator 206 outputs a mismatch signal, increments the value of the error counter 207, and simultaneously writes the value of the copy program counter 203 into the program counter 202 to read AA which is the opcode portion of the instruction code again.
[0027]
The error counter 207 is a counter that records the number of times the runaway has occurred, and the value of the error counter 207 can be notified to the outside. Further, the error counter 207 outputs a signal to the reset means 208 of the microprocessor when the number of times of runaway exceeds a certain number. The reset means 208 of the microprocessor that has received the signal from the error counter 207 outputs a reset signal for returning the microprocessor to the initial state.
[0028]
If the microprocessor calculates the 3-byte instruction mistakenly as the 2-byte or 1-byte instruction, the first encryption code stored at the address indicated by the program counter 202 is a null code or DD, and the calculations match. There is nothing.
[0029]
No matter how complicated the calculation is, encryption from 1 byte to 4 bytes can be decrypted just by sampling which instruction becomes what kind of encryption if many encryption programs are analyzed There is. Therefore, it is also conceivable that an encryption code XX or the like obtained by stirring all program codes with a hash function or the like is separately created and mixed as encryption information in a DD made from AA, BB, and CC. In this way, if all the information of the program is involved in the creation of the code, it will not be easily deciphered.
[0030]
FIG. 3 is a data processing flow of a known Z80 microprocessor. First, the microprocessor reads the operation code from the instruction code in S301, and increments the program counter in S302. In step S303, the instruction code is decoded to recognize how many bytes the instruction is. The Z80 microprocessor only has a maximum of 4 byte instructions. If the instruction is a 1-byte instruction (only the operation code) in S304, the process proceeds to S305 as it is.
[0031]
In the case of a 2-byte instruction (opcode + operand) in S306, the byte counter is set to 1 in S307, the operand is read in S308, transferred to the CPU buffer in S309, the pointer is incremented in S310, and the program counter in S311 In step S312, the byte counter is decremented. In step S313, the byte counter is checked. If the instruction is a 2-byte instruction, it is confirmed here that the byte counter is 0, and the process proceeds to step S305.
[0032]
In the case of a 3-byte instruction (opcode + operand + operand) in S314, the byte counter is set to 2 in S315, and the same steps S308 to S312 are performed as in the 2-byte instruction until the byte counter becomes 0 in S313. Thereafter, execution is performed in S305.
[0033]
If it is determined in S314 that the instruction is not a 3-byte instruction, it is a 4-byte instruction (opcode + opcode + operand + operand), so the operation code is read in S316, the instruction is decoded in S317, and the byte counter is set to 2 in S315. Set. After S308, after going through the same process as the 3-byte instruction, the process proceeds to S305.
[0034]
FIG. 4 shows a typical flow of the present invention in which the processing of the present invention is added to a Z80 microprocessor. First, the microprocessor reads the operation code from the instruction code in S401, increments the program counter in S402, transfers it to the 4-byte buffer in S403, increments the buffer pointer in S404, and then decodes the instruction code in S405. Recognize how many bytes the code is.
[0035]
In the case of a 1-byte instruction (only an operation code) in S406, the instruction code is encrypted by a certain calculation method in S407, and a second encryption code is acquired. In step S408, the ROM is switched to a bank and switched to the encryption data bank, and the first encryption code at the address indicated by the program counter is acquired. Then, the second encryption code and the first encryption code are compared in S409, and if they match in S410, the value of the program counter is written in the copy program counter in S411, and the instruction code is executed in S412. If it is determined in S410 that they do not match, the value of the copy program counter is written in the program counter in S413, the value of the error counter is incremented in S414, and returned to immediately before the operation code reading process in S401. Note that the value of the error counter can be output to the outside in order to confirm whether the noise environment in which the microprocessor is used is good or bad. By checking the value of the error counter, the number of runaways can be known, and the greater the number of runaways, the greater the noise and the worse the noise environment.
[0036]
If it is determined in S415 that the instruction is a 2-byte instruction (opcode + operand), the byte counter is set to 2 in S416, the operand is read in S417, transferred to the CPU buffer in S418, transferred to the 4-byte buffer in S419, and transferred to S420. The buffer pointer is incremented, the program counter is incremented in S421, and the byte counter is decremented in S422. In step S423, the byte counter is confirmed. If the instruction is a 2-byte instruction, it is confirmed here that the byte counter is 0. In step S407, the instruction code is encrypted by a certain calculation method to obtain a second encryption code. In S408, the ROM is switched to a bank and switched to the encryption data bank, and the first encryption code at the address indicated by the program counter is acquired. Then, the second encryption code and the first encryption code are compared in S409, and if they match in S410, the value of the program counter is written in the copy program counter in S411, and the instruction code is executed in S412. If it is determined in S410 that they do not match, the value of the copy program counter is written in the program counter in S413, the value of the error counter is incremented in S414, and returned to immediately before the operation code reading process in S401.
[0037]
In the case of a 3-byte instruction (opcode + operand + operand) in S424, the byte counter is set to 2 in S425, and after S417, the same process as that of the 2-byte instruction is performed.
[0038]
If it is determined in S424 that the instruction is not a 3-byte instruction, it is a 4-byte instruction (opcode + opcode + operand + operand), so the operation code is read in S426, the instruction is decoded in S427, and transferred to the 4-byte buffer in S428. In step S429, the buffer pointer is incremented. After S425, the same process as the 3-byte instruction is performed.
[0039]
FIG. 5 is an example in which the content of outputting a reset signal is added to the embodiment of FIG. 4 when the number of runaways exceeds a certain number. The process from S501 to S509 is the same as the process from S401 to S409 in FIG. If the comparison result between the second encryption code and the first encryption code does not match in S510, the copy program counter value is written in the program counter in S513, and the error counter value is incremented in S514. When the error counter value does not exceed the predetermined value in S515, it is returned immediately before the operation code reading process in S501.
[0040]
When the value of the error counter exceeds a predetermined value in S515, that is, when the number of runaways exceeds a certain number, a reset signal is output in S516. The default value until the reset is output may be set to an arbitrary value by the user. If the noise environment is good, the default value does not need to be large, but if you want to continue execution without running the microprocessor out of control in a poor noise environment, set the default value to a certain level. There is a need.
[0041]
The timing for returning the value of the error counter to 0 may be variable according to a request from the user, and may be used when collecting data of a noise environment in which the microprocessor is used. For example, the user himself / herself may be set to return to 0 with a switch or the like, or may be set to return to 0 when the power is turned on or when a certain time elapses. Further, the error counter value may be aggregated so that the number of times the microprocessor has run out per unit time in a certain environment can be recorded.
[0042]
In the embodiment of the present invention, only an example of an 8-bit microprocessor used for a gaming machine is shown, but it can be used regardless of the bit length. Of course, it is also effective for other uses other than for gaming machines, and it can be expected to exert a great effect especially for uses related to human life such as in-vehicle use and aircraft. It goes without saying that by using a plurality of the microprocessors of the present invention in parallel and determining the instruction code to be executed by majority vote, the effect of preventing the microprocessor from running away due to noise can be dramatically improved. Nor.
[0043]
【The invention's effect】
According to the present invention, even if the microprocessor runs away due to noise or the like, the wrong instruction code is not executed. Therefore, the destruction of data or the like due to the runaway can be prevented, and the reliability of the microprocessor is improved. In addition, when the microprocessor of the present invention is used for gaming, even if the program is falsified by an unauthorized group, only the legitimate program will be executed, so the operation of the unauthorized program is prohibited, and fraud in the game hall is eliminated. Leads to.
[0044]
When a microprocessor misreads an instruction code, it returns to the most recent instruction code that causes the misreading of the instruction code, and re-executes the instruction code. However, since it operates as if it is not affected by noise, the player can continue the game without feeling abnormal. In addition, the development engineers of each game maker can save enormous effort and cost for noise countermeasures. Furthermore, in non-gaming fields, such as the execution of programs that require a long time for processing such as simulation calculations, the processing can be continued without returning to the initial state even if a runaway occurs. A microprocessor can be provided.
[0045]
Since the number of times the microprocessor has runaway can be measured and notified to the outside, the invisible noise environment can be grasped as a numerical value, and sample data effective for noise countermeasures can be collected.
[Brief description of the drawings]
FIG. 1 is a block diagram of a calculation unit of a Z80 microprocessor.
FIG. 2 is an operation explanatory diagram of the microprocessor of the present invention.
FIG. 3 is a data processing flowchart of the Z80 microprocessor.
FIG. 4 is a data processing flowchart of a microprocessor according to the first embodiment of the present invention.
FIG. 5 is a data processing flowchart of the microprocessor according to the first embodiment of the present invention.
[Explanation of symbols]
109, 201 CPU controller
202 Program counter
203 Copy program counter
204 4-byte buffer
205 Cryptographic calculation logic
206 Comparator
207 Error counter
208 Microprocessor resetting means
209 Program Bank
210 Cryptographic data bank

Claims (10)

機械語プログラムのオペコード又はオペコードとオペランドの対からなる命令コードから一定の計算方法で生成された第一の暗号コードを格納する暗号データ領域と当該命令コードが格納されているプログラム領域とを含む記憶手段と、マイクロプロセッサが前記プログラム領域から命令コードを読み込んだときに命令コードを前記一定の計算方法で計算し第二の暗号コードを生成する暗号化計算手段と、前記暗号化計算手段が生成した第二の暗号コードと前記命令コードに対応する前記記憶手段の暗号データ領域から読み出した第一の暗号コードとを比較する比較手段と、前記比較手段による比較の結果が一致すれば、命令を実行させるコントローラとを備えたことを特徴とするマイクロプロセッサ。Memory including an encryption data area for storing a first encryption code generated by a certain calculation method from an operation code of an operation code of a machine language program or a pair of an operation code and an operand, and a program area in which the instruction code is stored Means, an encryption calculation means for generating a second encryption code by calculating the instruction code by the predetermined calculation method when the microprocessor reads the instruction code from the program area, and the encryption calculation means Comparing means for comparing the second encrypted code with the first encrypted code read from the encrypted data area of the storage means corresponding to the instruction code, and executing the instruction if the comparison result by the comparing means matches And a controller. 請求項1に記載されたマイクロプロセッサにおいて、命令コードが1ステップ進む毎にインクリメントするプログラムカウンタを有し、第二の暗号コードと第一の暗号コードとを比較した結果、一致しない場合、当該プログラムカウンタの値を命令コード読み込み前の値に戻して再度命令コードを読み込むことを特徴とするマイクロプロセッサ。  The microprocessor according to claim 1, further comprising a program counter that increments every time the instruction code advances by one step, and if the second encryption code and the first encryption code do not match as a result of comparison, the program A microprocessor characterized in that the value of the counter is returned to the value before reading the instruction code and the instruction code is read again. 請求項2に記載されたマイクロプロセッサにおいて、プログラムカウンタの値を保存するコピープログラムカウンタを有し、第二の暗号コードと第一の暗号コードとを比較した結果、一致する場合プログラムカウンタの値をコピープログラムカウンタへ書き込み、一致しない場合コピープログラムカウンタの値をプログラムカウンタへ書き込むことが出来るようにしたことを特徴とするマイクロプロセッサ。  3. The microprocessor according to claim 2, further comprising a copy program counter for storing the value of the program counter, and when the second encryption code and the first encryption code are compared with each other, the program counter value is set if they match. A microprocessor characterized by being able to write to a copy program counter and write the value of the copy program counter to the program counter if they do not match. 請求項1乃至3に記載されたマイクロプロセッサにおいて、第二の暗号コードと第一の暗号コードとを比較した結果、一致しない場合、一致しなかった回数を計測するカウンタを有し、当該カウンタは任意の時間にカウンタ値を外部に知らしめるようにしたことを特徴とするマイクロプロセッサ。  The microprocessor according to any one of claims 1 to 3, further comprising a counter that counts the number of times when the second encryption code and the first encryption code do not match as a result of comparing the second encryption code and the first encryption code, A microprocessor characterized in that a counter value is informed to the outside at an arbitrary time. カウンタの値が一定値に達すると記録を中止し、リセット信号を出力する請求項4に記載されたマイクロプロセッサ。  5. The microprocessor according to claim 4, wherein when the value of the counter reaches a certain value, recording is stopped and a reset signal is output. 機械語プログラムのオペコード又はオペコードとオペランドの対からなる命令コードから一定の計算方法で生成された第一の暗号コードを格納する暗号データ領域と当該命令コードが格納されているプログラム領域とを含む記憶手段と、マイクロプロセッサが前記プログラム領域から命令コードを読み込んだときに命令コードを前記一定の計算方法で計算し第二の暗号コードを生成する暗号化計算手段と、前記暗号化計算手段が生成した第二の暗号コードと前記命令コードに対応する前記記憶手段の暗号データ領域から読み出した第一の暗号コードとを比較する比較手段と、前記比較手段による比較の結果が一致すれば、命令を実行させるコントローラとを備えたことを特徴とする遊技機用マイクロプロセッサ。Memory including an encryption data area for storing a first encryption code generated by a certain calculation method from an operation code of an operation code of a machine language program or a pair of an operation code and an operand, and a program area in which the instruction code is stored Means, an encryption calculation means for generating a second encryption code by calculating the instruction code by the predetermined calculation method when the microprocessor reads the instruction code from the program area, and the encryption calculation means Comparing means for comparing the second encrypted code with the first encrypted code read from the encrypted data area of the storage means corresponding to the instruction code, and executing the instruction if the comparison result by the comparing means matches A microprocessor for gaming machines, comprising: 請求項6に記載されたマイクロプロセッサにおいて、命令コードが1ステップ進む毎にインクリメントするプログラムカウンタを有し、第二の暗号コードと第一の暗号コードとを比較した結果、一致しない場合、当該プログラムカウンタの値を命令コード読み込み前の値に戻して再度命令コードを読み込むことを特徴とする遊技機用マイクロプロセッサ。  7. The microprocessor according to claim 6, further comprising a program counter that increments every time the instruction code advances by one step, and if the second encryption code and the first encryption code do not match, A microprocessor for a gaming machine, wherein a counter value is returned to a value before reading an instruction code and an instruction code is read again. 請求項7に記載されたマイクロプロセッサにおいて、プログラムカウンタの値を保存するコピープログラムカウンタを有し、第二の暗号コードと第一の暗号コードとを比較した結果、一致する場合プログラムカウンタの値をコピープログラムカウンタへ書き込み、一致しない場合コピープログラムカウンタの値をプログラムカウンタへ書き込むことが出来るようにしたことを特徴とする遊技機用マイクロプロセッサ。  8. The microprocessor according to claim 7, further comprising: a copy program counter for storing a value of the program counter, and when the second encryption code and the first encryption code are compared with each other, the program counter value is determined to match. A microprocessor for a gaming machine, wherein the value of the copy program counter can be written to the program counter if it does not coincide with the value written in the copy program counter. 請求項6乃至8に記載されたマイクロプロセッサにおいて、第二の暗号コードと第一の暗号コードとを比較した結果、一致しない場合、一致しなかった回数を計測するカウンタを有し、当該カウンタは任意の時間にカウンタ値を外部に知らしめるようにしたことを特徴とする遊技機用マイクロプロセッサ。  The microprocessor according to any one of claims 6 to 8, further comprising: a counter that counts the number of times when the second encryption code and the first encryption code do not match as a result of comparison, A microprocessor for a gaming machine, characterized in that a counter value is informed outside at an arbitrary time. カウンタの値が一定値に達すると記録を中止し、リセット信号を出力する請求項9に記載された遊技機用マイクロプロセッサ。  The gaming machine microprocessor according to claim 9, wherein when the value of the counter reaches a certain value, recording is stopped and a reset signal is output.
JP2002343377A 2002-11-27 2002-11-27 Microprocessor Expired - Lifetime JP3854572B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002343377A JP3854572B2 (en) 2002-11-27 2002-11-27 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002343377A JP3854572B2 (en) 2002-11-27 2002-11-27 Microprocessor

Publications (2)

Publication Number Publication Date
JP2004178250A JP2004178250A (en) 2004-06-24
JP3854572B2 true JP3854572B2 (en) 2006-12-06

Family

ID=32705164

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002343377A Expired - Lifetime JP3854572B2 (en) 2002-11-27 2002-11-27 Microprocessor

Country Status (1)

Country Link
JP (1) JP3854572B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4562759B2 (en) * 2007-09-03 2010-10-13 京楽産業.株式会社 Access control apparatus, access control method, and access control program
JP5050893B2 (en) * 2008-02-08 2012-10-17 大日本印刷株式会社 IC card attack detection method, IC card and IC card program
JP5200664B2 (en) * 2008-05-28 2013-06-05 大日本印刷株式会社 Fault attack detection method, security device, and computer program for falsifying memory contents
JP5200686B2 (en) * 2008-06-18 2013-06-05 大日本印刷株式会社 Information processing apparatus, normal processing determination method, and information processing program

Also Published As

Publication number Publication date
JP2004178250A (en) 2004-06-24

Similar Documents

Publication Publication Date Title
CN101281506B (en) Memory domain based security control within data processing system
Shankar et al. Side effects are not sufficient to authenticate software
EP2300952B1 (en) A method for adapting and executing a computer program and computer program product and computer architecture therefor
TW302455B (en)
US20140149729A1 (en) Reset vectors for boot instructions
CN101281459A (en) Protected function calling
TW200949684A (en) Microprocessor having a secure execution mode with provisions for monitoring, indicating, and managing security levels
TW200949677A (en) Microprocessor having secure non-volatile storage access
Averbuch et al. Truly-protect: An efficient VM-based software protection
JP2000233057A (en) Monitoring system for chip for controlling game machine
JP3854572B2 (en) Microprocessor
Yang et al. Arm pointer authentication based forward-edge and backward-edge control flow integrity for kernels
EP1465038A1 (en) Memory security device for flexible software environment
Gardner et al. On the Difficulty of Validating Voting Machine Software with Software.
Patel et al. Ensuring secure program execution in multiprocessor embedded systems: a case study
JPH11221329A (en) Game machine
CN110516445A (en) Identification method and device for anti-detection malicious code and storage medium
Stolz et al. Recommendation for a holistic secure embedded ISA extension
JPH11313957A (en) Control device and method for game machine
JP4847827B2 (en) Access control device
JP4482316B2 (en) Microcomputer for game machine control
Séré et al. Checking the paths to identify mutant application on embedded systems
JP2008191788A (en) Information processor
US9213864B2 (en) Data processing apparatus and validity verification method
KR100204382B1 (en) Method and apparatus for securing excutable programs against copying

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051124

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060614

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060728

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: 20060823

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060908

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120915

Year of fee payment: 6