JPH0344739A - Instruction exception detecting device - Google Patents

Instruction exception detecting device

Info

Publication number
JPH0344739A
JPH0344739A JP18111089A JP18111089A JPH0344739A JP H0344739 A JPH0344739 A JP H0344739A JP 18111089 A JP18111089 A JP 18111089A JP 18111089 A JP18111089 A JP 18111089A JP H0344739 A JPH0344739 A JP H0344739A
Authority
JP
Japan
Prior art keywords
instruction
undefined
decoded
decoding
basic operation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP18111089A
Other languages
Japanese (ja)
Other versions
JPH0769792B2 (en
Inventor
Kozo Kimura
浩三 木村
Tokuzo Kiyohara
督三 清原
Nobuo Higaki
信生 桧垣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP1181110A priority Critical patent/JPH0769792B2/en
Publication of JPH0344739A publication Critical patent/JPH0344739A/en
Publication of JPH0769792B2 publication Critical patent/JPH0769792B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To miniaturize the scale and to increase the working speed of an instruction exception detecting device by providing an instruction decoding PLA which outputs the valid data showing the undefined and defined instructions and an undefined instruction detecting circuit which decides an undefined or defined decoding instruction based on the valid data. CONSTITUTION:An instruction decoding PLA 2 decodes an instruction and outputs the data (valid data) showing a defined or undefined instruction. An undefined instruction detecting circuit 6 decides an undefined input instruction when the valid data outputted from the PLA 2 shows an undefined instruction and an instruction decoding control circuit 8 decides a valid input instruction of the PLA 2. Then a control memory address generating circuit 3 produces the head address of an instruction exception process routine as an address of a control memory 4. The memory 4 produces a corresponding microinstruction (instruction exception process). Thus it is possible to obtain a compact and high speed instruction exception detecting device having a simple decoding method.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はプロセッサの命令解読およびマイクロ命令発行
において未定義命令の検a 特権命令実行違反検出等を
行う命令例外検出装置に関するものであム 従来の技術 従来の命令例外検出装置として(友 例えば特開昭59
−737号公報に示されていも 第10図はこの従来の命令例外検出装置の構成国を示す
ものであり、 100は命令デコーダであも101は初
期アドレス発生装置であ、4 102はアドレス選択回
路であも 103はマイクロアドレスレジスタであ、%
  104はマイクロプログラム記憶装置であ4 10
5はマイクロ命令レジスタであも 以上のように構成された従来の命令例外検出装置におい
て、以下、動作を説明すも ここス 命令デコーダ10
0および初期アドレス発生装置101には定義済の命令
に関する情報のみを格納すも 命令が未定義命令の場合
に(上 命令デコーダ100においてどのアンド項も非
選択となり(どの定義済命令にも該当しないため)、初
期アドレス発生装置101から(よ アドレス0が出力
されも これよりマイクロプログラム記憶装置104の
アドレスOの内容が選択され 未定義命令処理ルーチン
が起動されも 発明が解決しようとする課題 しかしながら上記のような構成で(よ 命令デコーダお
よび初期アドレス発生装置をPLA等で実現した場合、
多重選択を用いてアドレス等を生成する場合には、 未
定義命令であっても一部のアンド項が選択されアドレス
Oが出力されなし1 (命令デコーダおよび初期アドレ
ス発生装置をPLAで実現することは従来例にも述べら
れていも )例えば 複数命令に共通なフィールドであ
るアドレシングモード指定フィールドを、命令のオペレ
ーションフィールドとは独立に解読した場合、未定義命
令であって板 共通なフィールドは解読され一部のアン
ド項が選択されも (この現象をPLAによるゴースト
と称する)よって、未定義命令検出をアドレスOの場合
とすると、命令解読方法が固定されPLAのターム数(
アンド項およびそのアンド項に対応するオア環をまとめ
てタームと称する)は増大してしまう。またPLAの特
徴である多重選択の効果が減少してしまう。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an instruction exception detection device for detecting undefined instructions and privileged instruction execution violations during processor instruction decoding and microinstruction issuance. As a conventional instruction exception detection device (for example, JP-A-59
10 shows the constituent countries of this conventional instruction exception detection device, 100 is an instruction decoder, 101 is an initial address generator, and 4102 is an address selection device. In the circuit 103 is the micro address register, %
104 is a microprogram storage device 4 10
Reference numeral 5 denotes a microinstruction register.The operation of the conventional instruction exception detection device configured as described above will be explained below.Instruction decoder 10
0 and the initial address generator 101 store only information related to defined instructions. However, if the instruction is an undefined instruction (above), any AND term is unselected in the instruction decoder 100 (does not correspond to any defined instruction). However, even if address 0 is output from the initial address generator 101 (because of this), the contents of address O of the microprogram storage device 104 are selected and an undefined instruction processing routine is activated. If the instruction decoder and initial address generator are implemented using PLA, etc.,
When generating addresses etc. using multiple selection, some AND terms are selected even if it is an undefined instruction, and address O is not output. For example, if the addressing mode specification field, which is a field common to multiple instructions, is decoded independently of the operation field of the instruction, it will be considered an undefined instruction and the common field will not be decoded. Even if some AND terms are selected (this phenomenon is called ghosting due to PLA), if undefined instruction is detected at address O, the instruction decoding method is fixed and the number of PLA terms (
The AND term and the OR ring corresponding to the AND term are collectively referred to as a term). Furthermore, the effect of multiple selection, which is a feature of PLA, is reduced.

また 使用を禁止したアドレシングモード(禁止アドレ
シングモードと称する)を有する定義済命令を解読した
場合、ベースとなる初期アドレスは命令のオペレーショ
ンフィールドのみによって生成されるたべ 初期アドレ
ス発生装置からは”on以外のアドレスが出力され 禁
止アドレシングモード検出が不可能となん 例えば レ
ジスタ間接アドレシングモードは使用が許され レジス
タ相対間接アドレシングモードは使用が禁止されている
命令を解読する場合、一部のマイクロ命令が異なるだけ
で、アドレスはオペレージ3ンによって決定されるたべ
 全く同じアドレスが発生することになる。
In addition, when a predefined instruction that has an addressing mode that is prohibited from use (referred to as a prohibited addressing mode) is decoded, the base initial address is generated only by the operation field of the instruction. For example, when decoding an instruction that is allowed to be used in register indirect addressing mode and prohibited to use in register relative indirect addressing mode, only some microinstructions are different. , since the address is determined by the Operator 3 system, exactly the same address will be generated.

−X  以上の問題点を解決する方法として、未定義命
令に対しても初期アドレスを必ず出力しマイクロプログ
ラム記憶装置に未定義命令処理ルーチン分岐用のマイク
ロ命令を割り付ける方法があも しかし 全ての未定義
命令に対応すると命令解読装置 初期アドレス発生装置
およびマイクロプログラム記憶装置の大型化を引き起こ
してしま う。
-X One way to solve the above problems is to always output the initial address even for undefined instructions and allocate a microinstruction for undefined instruction processing routine branching in the microprogram storage device. Corresponding to definition instructions would result in an increase in the size of the instruction decoder, initial address generator, and microprogram storage device.

以上のように 従来の命令例外検出装置は命令解読装置
の大型4L  複雑(L  それによる解読時間の増大
 つまり速度の低下、また命令解読方法の柔軟性の低下
などの問題を有してい1゜未定義命令検出方法としては
特開昭62−70937号公報に示されている方法があ
るが原理的には同じであも 本発明はかかる点に鑑へ 小型かつ高速で、解読方法が
簡単であり、命令および機能変更の容易な命令例外検出
装置を提供することを目的とすも課題を解決するための
手段 請求項1記載の発明(上 命令の基本動作を指定するフ
ィールドを他のフィールドとは独立に解読し 基本動作
を指定するフィールドのビットパターンが命令として定
義されていない場合には未定義命令であることを示すデ
ータを、基本動作を指定するフィールドのビットパター
ンが命令として定義されかつ付随動作を有する場合には
基本動作が許可している付随動作を示すデータを、基本
動作を指定するフィールドのビットパターンが命令とし
て定義されかつ付随動作を持たない場合には基本動作は
付随動作を持たないことを示すデータを出力し 付随動
作を指定するフィールドを他のフィールドとは独立に解
読L/%  指定されている付随動作を示すデータを出
力する命令解読手段と、命令解読手段で解読中の命令が
有効もしくは無効であることを示すデータを管理する命
令解読制御手段と、命令解読制御手段より出力されるデ
ータは解読中の命令が有効であることを示している場合
には 命令解読制御手段より出力されるデータより未定
複製命令であることを検出する未定義命令検出手段を備
えた命令例外検出装置であも請求項2記載の発明4友 
命令の基本動作を指定するフィールドを他のフィールド
とは独立に解読し 命令が実行を許可されるプロセッサ
の状態を示すデータを発生する命令解読手段と、プロセ
ッサの状態を管理する命令解読制御手段と、命令解読手
段より出力される実行が許可されるプロセッサの状態を
示すデータと命令解読制御手段より出力されるプロセッ
サの状態より命令が現在実行を許種 もしくは不許可で
あるかを判断する命令実行違反検出手段を備えた例外検
出装置であム請求項3記載の発明番友  命令の基本動
作を指定するフィールドを他のフィールドとは独立に解
読し 基本動作を指定するフィールドのビットパターン
が命令として定義されていない場合には未定義命令であ
ることを示すデータを、基本動作を指定するフィールド
のビットパターンが命令として定義されかつ付備動作を
有する場合には基本動作が許可している付随動作を示す
データを、基本動作を指定するフィールドのビットパタ
ーンが命令として定義されかつ付随動作を持たない場合
には基本動作は付随動作を持たないことを示すデータを
出力し 付随動作を指定するフィールドを他のフィール
ドとは独立に解読し 指定されている付随動作を示すデ
ータを出力する命令解読手段と、命令解読手段で解読中
の命令が有効もしくは無効であることを示すデータを管
理する命令解読制御手段と、命令解読制御手段より出力
されるデータは解読中の命令が有効であることを示して
いる場合には、 命令解読制御手段より出力されるデー
タより未定複製命令であることを検出する未定義命令検
出手段マイクロプログラムを格納する制御メモリを備え
た例外検出装置であん 作   用 請求項1記載の発明は前記した手段により、命令解読手
段において命令を解読し 命令解読制御手段より出力さ
れるデータは解読中の命令が有効であることを示し か
つ命令解読手段より出力されるデータは解読中の命令が
未定義命令であることを示す場合には命令が未定義命令
であることを検出し 命令解読制御手段より出力される
データは解読中の命令が有効であることを示し かつ命
令解読手段より出力されるデータは解読中の命令が付随
動作を有する定義済命令であることを示す場合には 命
令の基本動作が許可している付随動作を示すデータと命
令で指定されている付随動作を示すデータより許可され
ていない付随動作の組合せが発生する場合には命令が未
定義命令であることを検出する、 請求項2記載の発明は前記した手段により、命令解読手
段において命令を解読し 実行を許可されているプロセ
ッサの状態を示すデータとプロセッサの状態を比較し 
現在実行を許可されていない命令と判断することより、
命令例外を検出すも請求項3記載の発明は前記した手段
により、命令解読手段において命令を解読し 命令解読
制御手段より出力されるデータは解読中の命令が有効で
あることを示し かつ命令解読手段より出力されるデー
タは解読中の命令が未定義命令であることを示す場合に
は命令が未定義命令であることを検出し 命令解読制御
手段より出力されるデータは解読中の命令が有効である
ことを示し かつ命令解読手段より出力されるデータは
解読中の命令が付随動作を有する定義済命令であること
を示す場合には 命令の基本動作が許可している付随動
作を示すデータと命令で指定されている付随動作を示す
データより許可されでいない付随動作の組合せが発生す
る場合には命令が未定義命令であることを検出す瓜 お
よび、命令解読手段において命令を解読し 命令が定義
済命令であることが判断され 6令解読手段の出力する
アドレスより制御メモリに格納されている未定義命令処
理マイクロルーチンを起動する、 ことより未定義命令
を検出すも 実施例 第1図は本発明の命令例外検出装置の構成図であも 第
1図において1τ友 命令解読PLAへの入力を一時保
持する命令レジスタであも 2(よ命令を解読し 制御
メモリの初期アドレス(10ビツト)、マイクロ命令、
命令の使用可能なアドレシングモードを示すデ・−タ(
4ビツト)(可能アドレシングモードデータと称する)
、解読中の命令が指定するアドレシングモードを示すデ
ータ(2ビツト)(指定アドレシングモードデータと称
する)、および定複製命令または未定義命令を示スデー
タ(1ビツト)(バリッドデータと称する〉を出力する
命令解読PLA、3ζ上 制御メモリのアドレスを生成
する制御メモリアドレス生成回鍬41表  マイクロプ
ログラムを格納している制御メモリ (アトIノスは1
0ビツトとする)、 5(上 制御メモリ4が出力する
マ・fクロ命令を一時保持するマイクロ命令レジス久 
6(上 解読済の命令が未定義もしくは定複製であるこ
とを判断する未定義命令検出回詠71ヨ  命令解読P
LA2が出力する命令の使用可能なアドレシングモード
を示すデー久 および解読中の命令が指定するアドレシ
ングモードを示すデータより禁止アドレシングモードの
使用を検出する禁止アドレシングモード検出回跋 8(
友 現在解読中の命令が有効もしくは無効であるか(こ
こで用いている「有効」および「無効」と(上 命令の
定a鳳 未定義を表す意味ではなく、命令の定義域  
未定義を問わず命令として扱って良いのかどうかを表も
 命令として扱うことに意味がない命令を「無効な命令
」と称すん )の管理と、現在プロッセサが特権状態で
動作しているか否かを管理する命令解読制御回泳 第2
図1友 本実施例で用いる16ビツトを解読単位とする
命令フォーマットであも 簡単化のために次の2種類の
フォーマットを用い、4tOAi上 6ビツトのオペレ
ーション指定部 4ビツトのレジスタ直接モード指定!
6ビツトのアドレシングモード指定部を有する命令フォ
ーマットであ4 10B+1 10ビツトのオペレーシ
ョン指定部 6ビツトのアドレシングモードN 窓部を
有する命令フォーマツt・であ4 10Ci&  16
ビツトのオベレヘ・・ジョン指定部のみを持転 アドレ
シングモード指定を持たない命令フォーマットであ也 
第3図の201上 本実施例で用いる命令とビットバタ
・−ンの一覧である。簡単化のために説明に用いる命令
のみを記述す瓜 第4図の301上  本実施例で用い
る命令のアドレシングモードとビットパターンの−・覧
であh 簡単化のために用いるアドレシングモードはレ
ジスタ間接アドレシングモード((Rn))、即値アド
レシングモード(I m m )、レジスタ直接アドレ
シングモード(Rn)の3種類とす氏 第5図の40(
よ命令解読PLA2が出力す衣 命令に対して使用可能
であるアドレシングモードと、その命令が特権命令(プ
ロセッサが特権状態で動作しているときのみ実行可能な
命令。非特権状態で特権命令を実行しようとすると特権
命令違反例外が発生する)であるか苦力\ を示すデー
タフィールドのビットパターンであも 例えば ある非
特権命令に対して使用可能なアドレシングモード力<、
  Imrrz!:Rnなら1ヱ フィールドにはoi
io’を出力する。アドレシングモードを持たない命令
の場合にtit   o o o o ”を出力すも 
また ある特権命令に対して使用可能なアドレシングモ
ード75((Rn)ならば フィールドには″ 100
1’を出力する。アドレシングモードを持たない命令の
場合に(よ  1000”を出力すも 第6図の501
よ 命令解読PLA2が出力す水 解読中の命令が有す
るアドレシングモードを示すデータフィールドのビット
パターンであも 例えば 解読中の命令のアドレシング
モード指定部が(Rn)ならば”’01”を出力すも 
アドレシングモードのビットパターンにない場合にはア
ドレシングモードなしとして00”を出力すも 第7図
の606よ禁止アドレシングモード検出回路7で用いる
禁止アドレシングモードの使用を検出するパターンの一
覧表であも 禁止アドレシングモードの検出には特権命
令であるか否かは関係ないので、 0ビツト目はDON
’ T  CARE  LOGIC(値が0もしくは1
でも動作に影響しないこと)を表す*としていも 第8
図の701友 本実施例で用いる命令解読PLA2に格
納するデータであも 71〜85は命令解読PLA2の
各ターム(項)に対応す也 ここでは本実施例で説明す
るのに必要なタームのみを記述すも な抵 マイクロ命
令については本実施例には関係しないのでここでは値は
記述しなLl  第9図の90は本実施例で用いる制御
メモリ4に格納するマイクロプログラムである。 91
〜96は各アドレスに対応するマイクロ命令であも データで記述すると意味が不明確となるた△ マイクロ
命令の意味を記述すも 以上のように構成された本実施例の命令例外検出装置に
ついて、 (A)先ず、定義済命令A”ORR5,R9” (ビッ
トパターン” 001001. 0101 00100
ビ′)を解読する動作について説明すも(AI)命令レ
ジスタ1に一時保持され 命令解読PLA2に人力され
も (A2)命令解読PLA2においてターム71、?4.
 77、 79が選択され 制御メモリアドレスフィールド =  00101001i0″ (74,77、79) 可能アドレシングモー ドブ−タフイールド=  01
01’  (74,77) 指定アドレシングモードデータフィールド=  it″
 (79〉 バリッドデータフィールド=]”(71)が出力されも
 選択されるタームは第8図より明らかであム (A3)命令解読制御回路8 GL  命令解読PLA
2の入力命令が有効な命令と判断していると仮定する、
 よって命令解読PLA2の全出力フィールドも有効で
あも (A4)未定義命令検出回路6は 命令解読PLA2出
力のバリッドデータフィールド−1であること、および
、命令解読制御回路6が命令解読PLA2の入力命令が
有効な命令と判断していることより、人力命令は定義済
命令と判断すも(A5)禁止アドレシングモード検出回
路? C&命令解読PLA2出力の可能アドレシングモ
ードデータフィールド=0101であること、命令解読
PLA2出力の指定アドレシングモードデータフィール
ド=11であること、および、未定義命令検出回路6カ
丈 命令解読PLA2の入力命令が定義済命令と判断し
ていることより、禁止アドレシングモードではないこと
を判断する。禁止アドレシングモードの使用を検出する
パターンの一覧表60において、禁止アドレシングモー
ド検出の項が”0”になっていることより明らかであも
また この命令は特権命令でないことより、特権命令実
行違反の検出は行う必要がな1.%(八〇〉制御メモリ
アドレス生成回路3ば 人力命令が定義済命令であるこ
と、禁止アドレシングモードでないこと、および、特権
命令実行違反も起こしてないことより、命令解読PLA
2の出力アドレスを制御メモリ4用のアドレスとして生
威すも (A7)制御用メモリ4はアドレス’ooiox001
10”に対応するマイクロ命令(OR命令処理)91を
発行すも (A8)マイクロ命令をマイクロ命令レジスタ5に一時
保持し ブロセッザの実行ユニット等に対して発行すa
 実行ユニット・および引き続き行なわれる動作につい
て(友 本実施例とは直接関係ないので説明は省略すん (B)次に 未定義命令B(ビットパターンn1101
01 0010 001010″)を解読する動作につ
いて説明ず翫 (B1)命令レジスタ1に一時保持され 命令解読PL
A2に入力されも (B2〉命令解読P L A、 2においてターム79
のみが選択され 制御メモリアドレスフィールド =  0000000010” (79)可能アドレシ
ングモードデータフィールド=  0000’  (−
) 指定アドレシングモードデータフィールド=   11
” (79) バリッドデータフィールド= 0” (−)が出力され
も 選択されるタームは第8図より明らかであも (B3)命令解読制御回路8 G&  命令解読PLA
2の人力命令が有効な命令と判断していると仮定すも 
よって命令解読PLA2の全出力フィールドも有効であ
も (B4)未定義命令検出回路6(友 命令解読PLA2
出力のバリッドデータフィールド=Oであること、およ
び、命令解読制御回路6が命令解読PLA2の入力命令
が有効な命令と判断していることより、入力命令は未定
義命令と判断すん(B5)禁止アドレシングモード検出
回路7(表底に未定義命令検出回路6パ 命令解読PL
A2の入力命令が未定義命令と判断していることより、
禁止アドレシングモード検峠 および、特権命令実行違
反の検出は行う必要がな(ち (B6)制御メモリアドレス生成回路3ζ上 未定義命
令検出回路6が入力命令が未定義命令であると判断して
いることより、命令例外処理ルーチンの先頭アドレス”
  1111110000”を制御メモリ4用のアドレ
スとして生威すも 本実施例で1上 未定義命令例外は
命令例外の1つとして処理されも (B7)制御用メモリ4はアドレス” 1111110
QOO”に対応するマイクロ命令(命令例外処理)96
を発行すa (B8)マイクロ命令をマイクロ命令レジスタ5に一時
保持し プロセッサの実行ユニット等に対して発行すも
 実行ユニットおよび引き続き行なわれる命令例外処理
動作について(友 本実施例とは直接関係ないので説明
は省略すも 未定義命令Bを解読すると命令例外が検出されも (C)続いて、未定義命令C(ビットパターン″001
011 0101 001001”)を解読する動作に
ついて説明すも (C1)命令レジスタ1に一時保持され 命令解読PL
A2に入力されも (C2)命令解読PLA2においてターム? 1゜74
、 75. 77、 79が選択され制御メモリアドレ
スフィールド =  0010101110” (74,75,77、79) 可能アドレシングモードデータフィールド=″0101
″ (74,77) 指定アドレシングモードデータフィールド=” 11”
(79) バリッドデータフィールド= l” (71)が出力さ
れる。選択されるタームは第8図より明らかであも (C3)命令解読制御回路8ζよ 命令解読PLA2の
入力命令が有効な命令と判断していると仮定すも よっ
て命令解読PLA2の全出力フィールドも有効であも (C4〉未定義命令検出回路6(よ 命令解読PLA2
出力のバリッドデータフィールド=1であること、およ
び、命令解読制御回路6が命令解読PLA2の入力命令
が有効な命令と判断していることより、人力命令は定義
済命令と判断ずん(C5)禁止アドレシングモード検出
回路71ヨ命令解読PLA2出力の可能アドレシングモ
ードデータフィールド=0101であること、命令解読
PLA2出力の指定アドレシングモードデータフィール
ド=11であること、およ賦 未定義命令検出回路6カ
t 命令解読PLA2の入力命令が定義済命令と判断し
ていることより、禁止アドレシングモードではないこと
を判断ずん 禁止アドレシングモードの使用を検出する
パターンの一覧表60において、禁止アドレシングモー
ド検出の項が”0”なっていることより明らかである。
As mentioned above, conventional instruction exception detection devices have problems such as the large 4L instruction decoding device, which increases the decoding time, that is, reduces the speed, and reduces the flexibility of the instruction decoding method. As a definition instruction detection method, there is a method shown in Japanese Patent Application Laid-Open No. 62-70937, and although the principle is the same, the present invention takes into account these points. It is an object of the present invention to provide an instruction exception detection device that allows easy modification of instructions and functions. If the bit pattern of the field specifying the basic operation is not defined as an instruction, the data indicating that it is an undefined instruction is decoded independently, and if the bit pattern of the field specifying the basic operation is defined as an instruction and the accompanying If the basic action has an accompanying action, the data indicating the accompanying action permitted by the basic action is stored, and if the bit pattern of the field specifying the basic action is defined as an instruction and does not have an accompanying action, the basic action has an accompanying action. The field that specifies the accompanying action is decoded independently of other fields L/% An instruction decoding control means for managing data indicating whether the instruction is valid or invalid; and an instruction decoding control means for managing data indicating whether the instruction is valid or invalid; and if the data output from the instruction decoding control means indicates that the instruction being decoded is valid, the instruction decoding control means The fourth aspect of the invention according to claim 2 is an instruction exception detection device comprising undefined instruction detection means for detecting an undefined duplicated instruction from data output from the instruction.
an instruction decoding means for decoding a field specifying the basic operation of the instruction independently of other fields and generating data indicating a state of the processor in which execution of the instruction is permitted; and an instruction decoding control means for managing the state of the processor. , an instruction execution method that determines whether execution of the instruction is currently permitted or not based on data indicating the state of the processor whose execution is permitted output from the instruction decoding means and the state of the processor output from the instruction decoding control means; An exception detection device having violation detection means according to claim 3, wherein a field specifying a basic operation of an instruction is decoded independently of other fields, and a bit pattern of the field specifying the basic operation is detected as an instruction. If the bit pattern of the field specifying the basic operation is defined as an instruction and has an additional operation, the data indicating that it is an undefined instruction if it is not defined, and the accompanying operation permitted by the basic operation. If the bit pattern of the field specifying the basic action is defined as an instruction and does not have an accompanying action, output data indicating that the basic action does not have an accompanying action. An instruction decoding means that decodes data independently of other fields and outputs data indicating a specified accompanying action, and an instruction decoding control that manages data indicating whether the instruction being decoded by the instruction decoding means is valid or invalid. If the data output from the instruction decoding control means indicates that the instruction being decoded is valid, an undetermined copy instruction is detected from the data output from the instruction decoding control means. Definition instruction detection means An exception detection device equipped with a control memory storing a microprogram is used.The invention according to claim 1 decodes the instruction in the instruction decoding means by the above-mentioned means, and the data output from the instruction decoding control means. indicates that the instruction being decoded is valid, and the data output from the instruction decoding means indicates that the instruction being decoded is an undefined instruction. If the data output from the decoding control means indicates that the instruction being decoded is valid, and if the data output from the instruction decoding means indicates that the instruction being decoded is a defined instruction with an accompanying action, If a combination of ancillary operations that are not permitted based on the data indicating the ancillary operations permitted by the basic operation of the instruction and the data indicating the ancillary operations specified in the instruction occurs, the instruction is determined to be an undefined instruction. In the invention according to claim 2, the instruction is decoded by the instruction decoding means by the above-mentioned means, and the state of the processor is compared with data indicating the state of the processor that is permitted to execute.
Rather than determining that the instruction is currently not allowed to be executed,
Although an instruction exception is detected, the invention according to claim 3 decodes the instruction in the instruction decoding means by the above-mentioned means, and the data output from the instruction decoding control means indicates that the instruction being decoded is valid, and the instruction is decoded. If the data output from the instruction means indicates that the instruction being decoded is an undefined instruction, it is detected that the instruction is an undefined instruction, and the data output from the instruction decoding control means indicates that the instruction being decoded is valid. , and the data output from the instruction decoding means indicates that the instruction being decoded is a defined instruction with accompanying actions, the data output from the instruction decoding means is data indicating the accompanying actions permitted by the basic action of the instruction. If a combination of ancillary operations that are not allowed occurs based on the data indicating the ancillary operations specified in the instruction, it is detected that the instruction is an undefined instruction. When it is determined that the instruction is a defined instruction, the undefined instruction processing microroutine stored in the control memory is activated from the address output by the 6th instruction decoding means.In particular, when an undefined instruction is detected, the embodiment shown in FIG. This is a block diagram of the instruction exception detection device of the present invention. , microinstruction,
Data indicating available addressing modes for the instruction (
4 bits) (referred to as possible addressing mode data)
, data (2 bits) indicating the addressing mode specified by the instruction being decoded (referred to as specified addressing mode data), and data (1 bit) indicating the fixed copy instruction or undefined instruction (referred to as valid data). Instruction decoding PLA, on 3ζ Table 41 of control memory address generation times that generate control memory addresses Control memory that stores microprograms (AtoI node is 1
0 bit), 5 (top) Microinstruction register register that temporarily holds macroinstructions output by control memory 4.
6 (Part 1: Undefined instruction detection to determine whether the decoded instruction is undefined or fixed copy 71 Yo Instruction decoding P
Prohibited addressing mode detection circuit that detects the use of a prohibited addressing mode from the data indicating usable addressing modes of the instruction output by LA2 and the data indicating the addressing mode specified by the instruction being decoded 8 (
Friend: Whether the command currently being decoded is valid or invalid ("valid" and "invalid" used here)
Management of instructions (instructions that have no meaning in treating them as instructions are called "invalid instructions") and whether or not the processor is currently operating in a privileged state Command deciphering control loop to manage 2nd
Although the instruction format used in this example uses 16 bits as a unit of decoding, the following two formats are used for simplification: 6-bit operation specification section 4-bit register direct mode specification on 4tOAi!
An instruction format with a 6-bit addressing mode designation section 410B+1 a 10-bit operation designation section 6-bit addressing mode N An instruction format with a window section 410Ci & 16
Only the bit oberhesion specification part is transferred. It is also an instruction format that does not have an addressing mode specification.
Above 201 in FIG. 3 is a list of instructions and bit patterns used in this embodiment. For the sake of simplicity, only the instructions used in the explanation are described. Figure 4 shows the addressing modes and bit patterns of the instructions used in this example. There are three types of addressing mode ((Rn)), immediate addressing mode (I m m ), and register direct addressing mode (Rn).
The address mode that can be used for the instruction and the address mode that can be used for the instruction and whether the instruction is a privileged instruction (an instruction that can only be executed when the processor is operating in a privileged state. A privileged instruction is executed in a non-privileged state. If an attempt is made to do so, a privileged instruction violation exception will occur), or the bit pattern of the data field indicates that the available addressing modes for a certain non-privileged instruction are
Imrrz! :Rn is 1ヱ field is oi
Output io'. Outputs "tit o o o o" for instructions that do not have an addressing mode.
In addition, if the addressing mode is 75 ((Rn), which can be used for a certain privileged instruction, the field contains "100".
Outputs 1'. In the case of an instruction that does not have an addressing mode, it outputs ``1000'' (501 in Figure 6).
This is the bit pattern of the data field that indicates the addressing mode of the instruction being decoded.For example, if the addressing mode specification part of the instruction being decoded is (Rn), it will output "'01".
If it is not in the addressing mode bit pattern, 00" is output as there is no addressing mode. Also, 606 in FIG. 7 is a list of patterns used in the prohibited addressing mode detection circuit 7 to detect the use of prohibited addressing modes. Prohibited Since addressing mode detection does not matter whether the instruction is a privileged instruction or not, the 0th bit is DON.
' T CARE LOGIC (value 0 or 1
However, it does not affect the operation).
701 in the figure is the data stored in the instruction decoding PLA 2 used in this embodiment. 71 to 85 correspond to each term of the instruction decoding PLA 2. Here, only the terms necessary for explaining in this embodiment are shown. Since the microinstructions are not related to this embodiment, their values are not described here. 90 in FIG. 9 is a microprogram to be stored in the control memory 4 used in this embodiment. 91
96 is a microinstruction corresponding to each address, but if it is written as data, the meaning will be unclear. The meaning of the microinstruction will be described. Regarding the instruction exception detection device of this embodiment configured as described above, (A) First, defined instruction A “ORR5, R9” (bit pattern” 001001. 0101 00100
(AI) is temporarily held in the instruction register 1 and is manually input to the instruction decoding PLA2 (A2) In the instruction decoding PLA2, term 71, ? 4.
77, 79 are selected and control memory address field = 00101001i0'' (74, 77, 79) Possible Addressing Mode Booter Field = 01
01' (74, 77) Specified addressing mode data field = it''
(79> Valid data field=]" (71) is output. The selected term is clear from FIG. 8. (A3) Instruction decoding control circuit 8 GL Instruction decoding PLA
Assume that the input command 2 is determined to be a valid command.
Therefore, even if all output fields of the instruction decoding PLA2 are valid (A4), the undefined instruction detection circuit 6 confirms that the output field of the instruction decoding PLA2 is valid data field -1, and that the instruction decoding control circuit 6 inputs the input of the instruction decoding PLA2. Since the command is judged to be a valid command, it is determined that the manual command is a defined command.(A5) Is the prohibited addressing mode detection circuit? The possible addressing mode data field of the C & instruction decoding PLA2 output is 0101, the specified addressing mode data field of the instruction decoding PLA2 output is 11, and the input instruction of the instruction decoding PLA2 is Since it is determined to be a defined instruction, it is determined that it is not a prohibited addressing mode. In the list 60 of patterns for detecting the use of prohibited addressing modes, it is clear that the prohibited addressing mode detection item is "0", but since this instruction is not a privileged instruction, it is a violation of privileged instruction execution. No need to perform detection 1. % (80〉 Control memory address generation circuit 3) Since the manual instruction is a defined instruction, is not in a prohibited addressing mode, and does not cause a privileged instruction execution violation, the instruction decoding PLA
The output address of 2 is used as the address for control memory 4 (A7), but control memory 4 is set to address 'ooiox001.
10” (A8) The microinstruction is temporarily held in the microinstruction register 5 and issued to the execution unit of the processor, etc.
Regarding the execution unit and subsequent operations (tomo), the explanation is omitted as it is not directly related to this embodiment (B) Next, undefined instruction B (bit pattern n1101
01 0010 001010") is temporarily held in instruction register 1. Instruction decoding PL
Even if input to A2 (B2> instruction decoding PLA, 2, term 79
only selected Control Memory Address Field = 0000000010'' (79) Possible Addressing Mode Data Field = 0000' (-
) Specified addressing mode data field = 11
” (79) Valid data field = 0” Even if (-) is output, the selected term is clear from FIG. 8 (B3) Instruction decoding control circuit 8 G& Instruction decoding PLA
Assuming that the manual command in 2 is judged to be a valid command,
Therefore, even if all output fields of the instruction decoding PLA2 are valid (B4), the undefined instruction detection circuit 6 (friend)
Since the output valid data field = O and the instruction decoding control circuit 6 has determined that the input instruction of the instruction decoding PLA 2 is a valid instruction, the input instruction is determined to be an undefined instruction (B5) Prohibited. Addressing mode detection circuit 7 (undefined instruction detection circuit 6 on the bottom) Instruction decoding PL
Since the input command of A2 is judged to be an undefined command,
There is no need to check prohibited addressing mode and detect violations of privileged instruction execution (B6) On control memory address generation circuit 3ζ Undefined instruction detection circuit 6 has determined that the input instruction is an undefined instruction. In particular, the start address of the instruction exception handling routine"
1111110000" is used as the address for the control memory 4. However, in this embodiment, the undefined instruction exception is handled as one of the instruction exceptions (B7), but the control memory 4 is used as the address "1111110.
Microinstruction (instruction exception handling) 96 corresponding to “QOO”
(B8) The microinstruction is temporarily held in the microinstruction register 5 and issued to the execution unit of the processor. Therefore, the explanation will be omitted, but even if an instruction exception is detected when undefined instruction B is decoded (C), undefined instruction C (bit pattern "001
011 0101 001001")) (C1) is temporarily held in instruction register 1. Instruction decoding PL
Even if input to A2 (C2) is a term in instruction decoding PLA2? 1°74
, 75. 77, 79 are selected Control memory address field = 0010101110'' (74, 75, 77, 79) Possible addressing mode data field = ''0101
” (74, 77) Specified addressing mode data field = “11”
(79) Valid data field = l" (71) is output. Although the selected term is clear from FIG. Therefore, even if all output fields of instruction decoding PLA2 are valid (C4> undefined instruction detection circuit 6), instruction decoding PLA2
Since the output valid data field = 1 and the instruction decoding control circuit 6 judges that the input instruction of the instruction decoding PLA 2 is a valid instruction, the manual instruction is judged to be a defined instruction (C5) prohibited. Addressing mode detection circuit 71 - Possible addressing mode data field of instruction decoding PLA2 output = 0101, specified addressing mode data field of instruction decoding PLA2 output = 11, and undefined instruction detection circuit 6 cut Instructions Since the input command of the decoding PLA2 is determined to be a defined instruction, it can be determined that the prohibited addressing mode is not in use.In the list 60 of patterns for detecting the use of prohibited addressing modes, the item of prohibited addressing mode detection is "0". ``It is clearer than what is happening.

また この命令は特権命令でないこと−より、特権命令
実行違反の検出は行う必要がな(1 (C6〉制御メモリアドレス生成回路3【よ 入力命令
が定義済命令であること、禁止アドレシングモードでな
いこと、および、特権命令実行違反も起こしてないこと
より、命令解読PLA2の出力アドレスを制御メモリ4
用のアドレスとして生成すも (C7)制御用メモリ4はアドレス″oo1o1011
10”に対応するマイクロ命令(命令例外処理ルーチン
への分岐命令)94を発行すも(C8)マイクロ命令を
マイクロ命令レジスタ5に一時保持し プロセッサの実
行ユニット等に対して発行すも 実行ユニットおよび引
き続き行なわれる命令例外処理動作については 本実施
例とは直接関係ないので説明は省略すも 未定義命令Cを解読すると命令例外が検出されも (D)続いて、定複製命令D’ POP $5(Ino
n)” (ビットパターン”101000 0001 
010001”〉を解読する動作について説明すも(D
l)命令レジスタ1に一時保持され 命令解読PLA2
に入力されも (D2)命令解読PLA2においてターム72゜81.
84が選択され 制御メモリアドレスフィールド 0100000111” (81,84) 可能アドレシングモードデータフィールド=  010
1”  (84) 指定アドレシングモードデータフィールド=”lO’″
 (81) バリッドデータフィールド =″1” (72) が出力されも 選択されるタームは第8図より明らかで
あも (D3〉命令解読制御回路8(上 命令解読PLA2の
入力命令が有効な命令と判断していると仮定する。よっ
て命令解読PLA2の全出力フィールドも有効であも (D4)未定義命令検出回路6(よ 命令解読PLA2
出力のバリッドデータフィールド=1であること、およ
べ 命令解読制御回路6が命令解読PLA2の入力命令
が有効な命令と判断していることより、入力命令は定複
製命令と判断ずん(D5〉禁止アドレシングモード検出
回路7ζ上命令解読PLA2出力の可能アドレシングモ
ードデータフィールド=o i o iであること、命
令解読PLA2出力の指定アドレシングモードデータフ
ィールド=10であること、およべ 未定義命令検出回
路6戟 命令解読PLA2の入力命令が定複製命令と判
断していることより、禁止アドレシングモードであるこ
とを判断ずん 禁止アドレシングモードの使用を検出す
るパターンの一覧表60において、禁止アドレシングモ
ード検出の項がl  lHになっていることより明らか
であも また この命令は特権命令でないことより、特
権命令実行違反の検出は行う必要がな鶏 (D6)制御メモリアドレス生成回路3(よ 入力命令
が定複製命令であること、禁止アドレシングモードであ
ることより、命令例外処理ルーチンの先頭アドレス” 
1111110000’を制御メモリ4用のアドレスと
して生威すも 本実施例で(よ 禁止アドレシンギモー
ド発生例外は命令例外の1つとして処理されも (Dl)制御用メモリ4はアドレス”11111100
00’に対応するマイクロ命令(命令例外処理)96を
発行すも (D8)マイクロ命令をマイクロ命令レジスタ5に一時
保持し プロセッサの実行ユニット等i、: 対して発
行する、 実行ユニットおよび引き続き行なわれる命令
例外処理動作についてji  本実施例とは直接関係な
いので説明は省略すも 禁止アドレシングモードを有する定複製命令りを解読す
ると命令例外(禁止アドレシングモード例外)が検出さ
れも (E)続イテ、特権命令E″LPSWR6n(ヒツトパ
ターン”101000 0010 000110”)を
解読する動作について説明すも (El)命令レジスタ1に一時保持され 命令解読PL
A2に入力されも (C2)命令解読PLA2においてターム72゜79.
85が選択され 制御メモリアドレスフィールド =  0100001010” (79,85) 可能アドレシングモードデータフィールド=  111
1” (85) 指定アドレシングモードデータフィールド=  11”
  (79) バリッドデータフィールド = 1” (72) が出力されも 選択されるタームは第8図より明らかで
あも (B3)命令解読制御回路8cヨ  命令解読PLA2
の入力命令が有効な命令と判断していると仮定すも よ
って命令解読PLA2の全出力フィールドも有効であも (B4)未定義命令検出回路6(上 命令解読PLA2
出力のバリッドデータフィールド=1であること、およ
び、命令解読制御回路6が命令解読PLA2の入力命令
が有効な命令と判断していることより、人力命令は定義
済命令と判断ずん(B5)禁止アドレシングモード検出
回路7番上命令解読PLA2出力の可能アドレシングモ
ードデータフィールド=1111であること、命令解読
PLA2出力の指定アドレシングモードデータフィール
ド=11であること、および、未定義命令検出回路6戟
 命令解読PLA2の入力命令が定義済命令と判断して
いることより、禁止アドレシングモードでないことを判
断すん 禁止アドレシングモードの使用を検出するパタ
ーンの一覧表60において、禁止アドレシングモード検
出の項がHgjlになっていることより明らかであも 
また この命令は特権命令より、特権命令実行違反の検
出を行なう。命令解読制御回路6が管理しているプロセ
ッサの状態は”非特権状態”であることより、特権命令
は実行させることができな(℃よって、禁止アドレシン
グモード検出回路7において特権命令実行違反が検出さ
れも (B6)制御メモリアドレス生成回路3(友 入力命令
が定義済命令であること、特権命令実行違反が検出され
たことより、命令例外処理ルーチンの先頭アドレス” 
1111110000”を制御メモリ4用のアドレスと
して生威すも 本実施例で(友 特権命令実行違反は命
令例外の1つとして処理されも (B7)制御用メモリ4はアドレス” 1111110
000”に対応するマイクロ命令(命令例外処理)96
を発行すも (B8)マイクロ命令をマイクロ命令レジスタ5に一時
保持し プロセッサの実行ユニット等に対して発行すも
 実行ユニットおよび引き続き行なわれる命令例外処理
動作についてC友  本実施例とは直接関係ないので説
明は省略すも プロセッサが非特権状態の時に特権命令Eを解読すると
命令例外(特権命令実行違反〉が検出されも 以上のように本実施例によれば (B)命令の未定義 定複製を示すバリッドデータフィ
ールドを持つ命令解読PLAと、バリッドデータフィー
ルドより解読命令の未定徴 定複製を判断する未定義命
令検出回路を設けることにより、次の効果が得られも (Bl)多重選択を使用した解読方法およ沃出力データ
生成方法においてL 容易にバリッドデータフィールド
を生成でき、未定義命令の検出を行なえも (B2)命令解読PLAおよび、制御メモリは定義済命
令を解読するための最低限の容量しか必要としな(t (B3)バリッドデータフィールドを命令のオペレーシ
ョン指定フィールドの一部を用いて生成することにより
、命令解読PLAの容量の削減命令のビットパターンの
変更に対する修正の容易イし  命令の追加削除に対す
る修正の容易化が行なえも (C)バリッドデータフィールドを持つ命令解読PLA
と、バリッドデータフィールドより解読命令の未定義 
定複製を判断する未定義命令検出回路による未定義命令
検出と、未定義命令に対して命令例外処理ルーチンへの
分岐マイクロ命令を記述した制御メモリを用いた未定義
命令検出を同時に行なうことにより、次の効果が得られ
も(CI)ビットパターンの連続している定義済命令に
対する制御メモリのアドレス生r&i友  本実施例の
ような命令の一部のフィールドをそのままアドレスとす
る方法戟 一般的であも このうち一部のパターンのみ
未定義命令の場合ζ上 制御メモリにおいて未定義命令
の検出を行なうことにより、解読の簡単化 容量の削減
が行なえ&ミクロ的に1上 制御メモリの若干量の増大
が要求される爪 それ以上に命令解読PLAの容量の削
減が行な丸 全体としてはハードウェア量は減少すも(
C2〉命令の追加等4友 一般に1上 一部のみ未定義
であるパターンに割り付けられることが多い爪 そのよ
うな追加に対してL 制御メモリに既に記述された命令
例外処理ルーチンへの分岐命令を本来のマイクロ命令に
変更するだけで対応でき、命令解読PLAの変更も伴わ
な鶏 このように変更に対して、簡単に対応でき、かつ
変更に伴う容量の増加も最低限のもので対処可能であも
また 一般にi友 PLAの変更よりもROMの変更の
ほう力丈 ハードウェア作成およ医 検証からも容易で
あること(友 周知の事実であも(D)命令のオペレー
ションフィールドを他のフィールドとは独立に解読し決
定される可能アドレシングモードフィールドと、命令の
アドレシングモードを他のフィールドとは独立に解読し
決定される指定アドレシングモードフィールドを持つ命
令解読PLAと、可能アドレシングモードフィールドと
、指定アドレシングモードフィールドを比較し 禁止ア
ドレシングモードを検出する禁止アドレシングモード検
出回路を設(す、指定アドレシングモードが可能アドレ
シングモードに含まれない場合に(上 禁止アドレシン
グモード例外を発生することにより、次の効果が得られ
も (DI)命令解読PLAにおいて、オペレーションフィ
ールドとアドレシングモードを組合せて解読することに
より、禁止アドレシングモードを検出しようとすると命
令解読PLAの複雑化 容量増大を招いてしまう。本実
施例に用いた命令セットにおいて、組合せによる解読を
行なうと、 3種類のアドレシングモードによる単純計
算でも約3倍の増大となん (D2)本実施例の” CPSTRING”のようにア
ドレシングモードを持たない命令が存在してL 可能ア
ドレシングモードデータに”アドレシングモードなし”
の項目を設けることにより、簡単に対応できも することができも (E)命令のオペレーションフィールドを他のフィール
ドとは独立に解読し特権命令または非特権命令であるこ
とを表す可能アドレシングモードフィールドを持つ命令
解読PLAと、プロセッサの状態を管理している命令解
読制御回路を設(す、プロッセサが非特権状態にも拘ら
ず、命令解読PLAにおいて特権命令解読時には特権命
令実行違反を発生することにより、次の効果が得られも
(El)命令解読および、命令実行と独立に特権命令実
行違反の検出を行なえるの玄 実行速度に対するオーバ
ーヘッドが生じな(1 (C2〉特権命令か非特権命令の識別を命令解読PLA
で行なっているので、命令の仕様変更に対して用意に変
更可能であも (C3)禁止アドレシングモードの検出に使用する可能
アドレシングモードフィールドの一部のパターンを利用
するの致 命令解読PLAの容量増加は極端に少なL%
  (可能アドレシングモードフィールドの未使用パタ
ーンを利用すれば 命令解読PLAの容量増加は発生し
な鶏 )な叙 実際には可能アドレシングモードデータ
のパターン数種類に限定されており、アドレシングモー
ドの増加によってパターン数は指数関数的には増加しな
賎 (本実施例では簡単化のためにアドレシングモード
毎にlビット設けてあも )また 命令解読PLA2に
おいて、 lビットのバリッドデータフィールドを設け
である戟 これは未定義命令検出の高速化のためであり
、可能アドレシングモードデータの” oooo”を未
定義命令に割当てれば(従来”o o o o’に割当
てられていたものは変更となるが)、独立にバリッドデ
ータフィールドを設けなくても容易に実現できる。
Also, since this instruction is not a privileged instruction, there is no need to detect privileged instruction execution violations (1 (C6> Control memory address generation circuit 3). The input instruction is a defined instruction and is not in prohibited addressing mode. , and since no privileged instruction execution violation has occurred, the output address of the instruction decoding PLA 2 is set to the control memory 4.
The control memory 4 generated as an address for (C7) is the address "oo1o1011
10" (branch instruction to instruction exception handling routine) 94 (C8) The microinstruction is temporarily held in the microinstruction register 5 and issued to the execution unit of the processor, etc. Regarding the subsequent instruction exception handling operation, the explanation is omitted as it is not directly related to this embodiment, but even if an instruction exception is detected when undefined instruction C is decoded (D), the fixed copy instruction D' POP $5 (Ino
n)” (bit pattern”101000 0001
010001"> will be explained below (D
l) Temporarily held in instruction register 1 Instruction decoding PLA2
(D2) In command decoding PLA2, the term 72°81.
84 is selected Control Memory Address Field 0100000111” (81,84) Possible Addressing Mode Data Field = 010
1” (84) Specified addressing mode data field = “lO’”
(81) Even if valid data field = ``1'' (72) is output, the selected term is clear from Figure 8 (D3> Instruction decoding control circuit 8 (upper instruction decoding PLA 2 input command is a valid instruction) Therefore, even if all the output fields of the instruction decoding PLA2 are valid (D4), the undefined instruction detection circuit 6 (the instruction decoding PLA2
Since the output valid data field = 1 and the instruction decoding control circuit 6 determines that the input instruction of the instruction decoding PLA 2 is a valid instruction, the input instruction is determined to be a fixed copy instruction (D5> Prohibited addressing). Possible addressing mode data field of instruction decoding PLA2 output on mode detection circuit 7ζ = o i o i, specified addressing mode data field of instruction decoding PLA2 output = 10, and undefined instruction detection circuit 6 Since the input command of PLA2 is determined to be a fixed copy instruction, it can be determined that the prohibited addressing mode is in use.In the list 60 of patterns for detecting the use of prohibited addressing modes, the term for prohibited addressing mode detection is lH. Also, since this instruction is not a privileged instruction, there is no need to detect a violation of privileged instruction execution. In addition, since it is a prohibited addressing mode, the start address of the instruction exception handling routine is
1111110000' is used as the address for the control memory 4. However, in this embodiment, the prohibited addressing mode occurrence exception is handled as one of the instruction exceptions (Dl).
The microinstruction (instruction exception handling) 96 corresponding to 00' is issued (D8), but the microinstruction is temporarily held in the microinstruction register 5, and is issued to the execution unit of the processor, etc. Regarding instruction exception handling operation ji Since it is not directly related to this embodiment, the explanation will be omitted, but even if an instruction exception (prohibited addressing mode exception) is detected when a fixed copy instruction with a prohibited addressing mode is decoded, (E) Continuation Explaining the operation of decoding privileged instruction E"LPSWR6n (hit pattern "101000 0010 000110") (El) temporarily held in instruction register 1. Instruction decoding PL
Even if it is input to A2 (C2), the term 72°79.
85 is selected Control Memory Address Field = 0100001010'' (79,85) Possible Addressing Mode Data Field = 111
1” (85) Specified addressing mode data field = 11”
(79) Valid data field = 1" (72) Even if the selected term is clear from FIG. 8 (B3) Instruction decoding control circuit 8c Instruction decoding PLA2
Assume that the input instruction is determined to be a valid instruction. Therefore, even if all output fields of instruction decoding PLA2 are valid (B4) undefined instruction detection circuit 6 (upper instruction decoding PLA2)
Since the output valid data field = 1 and the instruction decoding control circuit 6 judges that the input instruction of the instruction decoding PLA 2 is a valid instruction, the manual instruction is judged to be a defined instruction (B5) prohibited. Addressing mode detection circuit 7 Upper instruction decoding Possible addressing mode data field of PLA2 output = 1111, specified addressing mode data field of instruction decoding PLA2 output = 11, and undefined instruction detection circuit 6 Instruction decoding Since the input command of PLA2 is determined to be a defined command, it can be determined that the prohibited addressing mode is not present. Even if it's more obvious than it is
This instruction also detects privileged instruction execution violations from privileged instructions. Since the state of the processor managed by the instruction decoding control circuit 6 is a "non-privileged state," privileged instructions cannot be executed. (B6) Control memory address generation circuit 3 (friend) Since the input instruction is a defined instruction and a privileged instruction execution violation has been detected, the start address of the instruction exception handling routine is
1111110000" as the address for the control memory 4. However, in this embodiment, even though privileged instruction execution violation is handled as one of the instruction exceptions (B7), the control memory 4 is set to the address "1111110.
Microinstruction (instruction exception handling) 96 corresponding to “000”
(B8) Temporarily retains the microinstruction in the microinstruction register 5 and issues it to the execution unit of the processor, etc. Regarding the execution unit and subsequent instruction exception handling operations, note C. Not directly related to this embodiment. Therefore, the explanation will be omitted, but when the processor decodes the privileged instruction E when the processor is in the non-privileged state, an instruction exception (privileged instruction execution violation) is detected.As described above, according to this embodiment, (B) undefined copying of the instruction. By providing an instruction decoding PLA with a valid data field indicating the valid data field and an undefined instruction detection circuit that determines unspecified duplication of the decoding instruction from the valid data field, the following effects can be obtained (Bl) Multiple selection is used. Although the decoding method and the output data generation method can easily generate valid data fields and detect undefined instructions (B2), the instruction decoding PLA and control memory are the minimum required to decode defined instructions. By generating a valid data field using a part of the operation specification field of the instruction, which requires only a capacity of (t (B3)), the capacity of the instruction decoding PLA is reduced. (C) Instruction decoding PLA with valid data field, which makes it easier to modify instructions for addition and deletion.
and the undefined decoding instruction from the valid data field.
By simultaneously detecting undefined instructions using an undefined instruction detection circuit that determines fixed duplication, and using a control memory in which a branch microinstruction to an instruction exception handling routine is written for undefined instructions, Although the following effects can be obtained (CI), there is a general method of generating addresses in control memory for defined instructions with continuous bit patterns. Amo If only some of these patterns are undefined instructions ζ By detecting undefined instructions in the control memory, decoding becomes easier and the capacity can be reduced and microscopically improved by a small amount of control memory. Even more important is the reduction in the capacity of the instruction decoding PLA.Although the overall amount of hardware will decrease (
C2> Addition of instructions, etc. 4 friends In general, 1 above A nail that is often assigned to a pattern that is only partially undefined L For such additions L A branch instruction to an instruction exception handling routine already written in the control memory It can be handled simply by changing the original microinstruction, and does not involve changing the instruction decoding PLA.In this way, it is easy to respond to changes, and the increase in capacity due to changes can be handled with a minimum amount. Amata In general, changing the ROM is easier than changing the PLA, and it is easier to create hardware and perform medical verification. an instruction decoding PLA having a possible addressing mode field that is decoded and determined independently of the other fields; a designated addressing mode field that is determined by decoding the addressing mode of the instruction independently of other fields; a possible addressing mode field; A prohibited addressing mode detection circuit is provided to compare the addressing mode fields and detect a prohibited addressing mode. However, in the (DI) instruction decoding PLA, if a prohibited addressing mode is attempted to be detected by decoding the operation field and addressing mode in combination, the instruction decoding PLA becomes complicated and its capacity increases. In the instruction set used, when combinatorial decoding is performed, even a simple calculation using three types of addressing modes results in an increase of approximately three times. (D2) There are instructions that do not have an addressing mode, such as "CPSTRING" in this example. "No addressing mode" in the L Possible addressing mode data
(E) An addressing mode field that allows the operation field of an instruction to be decoded independently of other fields to indicate that it is a privileged or non-privileged instruction. An instruction decoding PLA that has an instruction decoding PLA and an instruction decoding control circuit that manages the state of the processor are installed. , even if the following effects are obtained (El) Instruction decoding and privileged instruction execution violations can be detected independently of instruction execution. Identification and instruction decoding PLA
Even though it can be changed easily in response to changes in the instruction specifications, it is recommended to use some patterns in the possible addressing mode field (C3), which can be used to detect prohibited addressing modes.Instruction decoding PLA capacity The increase is extremely small L%
(If unused patterns in the possible addressing mode field are used, the capacity of the instruction decoding PLA will not increase.) In reality, the number of possible addressing mode data patterns is limited to several types, and as the number of addressing modes increases, the number of patterns increases. does not increase exponentially (in this embodiment, l bits are provided for each addressing mode for simplicity).Also, in the instruction decoding PLA2, an l bit valid data field is provided. This is to speed up the detection of undefined instructions, and if the possible addressing mode data "oooo" is assigned to the undefined instruction (the previously assigned "o o o o'" will be changed), it will become independent. This can be easily achieved without providing a valid data field.

また 特権命令の個数1友 通常全命令の1割未満であ
り、可能アドレシングモードの種類は限られていること
より、特権命令か非特権命令の区別をするために可能ア
ドレシングモードデータのバターンを2倍用意する必要
はなLs  (本実施例では簡単化のために可能アドレ
シングモードデータのパターンに直交して特権命令を表
すビットを設けてあも )よって、PLAの出力フィー
ルドは実現可能なビット長で表されも また 本実施例において、制御メモリ等はROM (R
ead 0nly Memory)によって、未定義命
令検出回廠 禁止アドレシングモード検出回路および、
制御メモリアドレス生成回路等は若干量の組合せ回路で
実現できも これ;よ マイクロプロセッサ等において
も実現が容易であること、マイクロプログラム制御に簡
単に取り入れ可能なことを考えると大きな長所であも 発明の詳細 な説明したように 本発明によれCL  命令解読装置
が小型かつ高速であり、命令解読方法が簡単であり、命
令の追加変更にも容易に対応可能である命令例外検出装
置を得ることができ、その実用的効果は太き(1
In addition, the number of privileged instructions is usually less than 10% of all instructions, and the types of possible addressing modes are limited. Therefore, in order to distinguish between privileged instructions and non-privileged instructions, the patterns of possible addressing mode data are set to 2. (In this embodiment, for simplicity, a bit representing a privileged instruction is provided orthogonal to the pattern of possible addressing mode data.) Therefore, the output field of the PLA has a realizable bit length. In this embodiment, the control memory etc. are ROM (R
ead 0nly Memory), an undefined instruction detection circuit, a prohibited addressing mode detection circuit, and
Although control memory address generation circuits can be realized with a small amount of combinational circuits, this is a great advantage considering that they can be easily realized in microprocessors and can be easily incorporated into microprogram control. As described in detail, according to the present invention, it is possible to obtain an instruction exception detection device in which the CL instruction decoding device is small and fast, the instruction decoding method is simple, and the instruction can be easily added and changed. The practical effect is significant (1

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

第1図は本発明の一実施例の命令例外検出装置の構成は
 第2図は同実施例で用いる命令フォーマットの説明は
 第3図は同実施例で用いる命令とビットパターンの説
明は 第4図は同実施例で用いる命令のアドレシングモ
ードとビットパターンの説明は 第5図は同実施例で用
いる命令解読PLAが出力する可能アドレシングモード
フィールドの説明は 第6図は同実施例で用いる命令解
読PLAが出力する命令で指定されたアドレシングモー
ドフィールドの説明は 第7図は同実施例で用いる禁止
アドレシングモード検出の説明は第8図は同実施例で用
いる命令解読PLAに格納するタームの説明は 第9図
は同実施例で用いる制御メモリに格納するマイクロプロ
グラムの説明は 第10図は従来の命令例外検出装置の
構成国であも 2・・・命令解読PLA、3・・・制御メモリアドレス
生成間取 4・・・制御メモ1八 〇・・・未定義命令
検出回廠 7・・・禁止アドレシングモード検出回廠 
8・・・命令解読制御同区
FIG. 1 shows the configuration of an instruction exception detection device according to an embodiment of the present invention. FIG. 2 shows an explanation of the instruction format used in the embodiment. FIG. 3 shows an explanation of the instructions and bit patterns used in the embodiment. The figure shows an explanation of the addressing mode and bit pattern of the instruction used in the same embodiment. Figure 5 shows the instruction decoding used in the same embodiment. The explanation of the possible addressing mode fields output by the PLA is shown. Figure 6 shows the instruction decoding used in the same embodiment. An explanation of the addressing mode field specified in the command output by the PLA is shown in Fig. 7. An explanation of the prohibited addressing mode detection used in this embodiment is shown in Fig. 8. An explanation of the terms stored in the PLA is shown in Fig. 8. FIG. 9 shows the explanation of the microprogram stored in the control memory used in the same embodiment. FIG. 10 shows the configuration of the conventional instruction exception detection device. Generation floor plan 4... Control memo 180... Undefined instruction detection circuit 7... Prohibited addressing mode detection circuit
8...Command decoding control same area

Claims (2)

【特許請求の範囲】[Claims] (1)命令の基本動作を指定する複数のフィールドと、
前記基本動作に付随しかつ直交に存在する付随動作のう
ちから一つの付随動作を指定する複数のフィールドから
なる命令において、前記基本動作を指定するフィールド
を他のフィールドとは独立に解読し、前記基本動作を指
定するフィールドのビットパターンが命令として定義さ
れていない場合には未定義命令であることを示すデータ
を、前記基本動作を指定するフィールドのビットパター
ンが命令として定義されかつ付随動作を有する場合には
前記基本動作が許可している付随動作を示すデータを、
前記基本動作を指定するフィールドのビットパターンが
命令として定義されかつ付随動作を持たない場合には前
記基本動作は付随動作を持たないことを示すデータを出
力し、前記付随動作を指定するフィールドを他のフィー
ルドとは独立に解読し、指定されている付随動作を示す
データを出力する命令解読手段と、前記命令解読手段で
解読中の命令が有効もしくは無効であることを示すデー
タを管理する命令解読制御手段と、前記命令解読制御手
段より出力されるデータは解読中の命令が有効であるこ
とを示し、かつ前記命令解読手段より出力されるデータ
は解読中の命令が未定義命令であることを示す場合には
命令が未定義命令であることを検出し、前記命令解読制
御手段より出力されるデータは解読中の命令が有効であ
ることを示し、かつ前記命令解読手段より出力されるデ
ータは解読中の命令が付随動作を有する定義済命令であ
ることを示す場合には、命令の基本動作が許可している
付随動作を示すデータと命令で指定されている付随動作
を示すデータより許可されていない付随動作の組合せが
発生する場合には命令が未定義命令であることを検出し
、前記命令解読制御手段より出力されるデータは解読中
の命令が有効であることを示し、かつ前記命令解読手段
より出力されるデータは解読中の命令が付随動作を持た
ない定義済命令であることを示す場合には、指定されて
いる付随動作を示すデータにかかわらず定義済命令であ
ることを検出する未定義命令検出手段を備えたことを特
徴とする命令例外検出装置
(1) Multiple fields that specify the basic operation of the instruction,
In an instruction consisting of a plurality of fields specifying one incidental operation from among incidental operations that are incidental to and orthogonal to the basic operation, the field specifying the basic operation is decoded independently of other fields, and the If the bit pattern of the field specifying the basic operation is not defined as an instruction, the bit pattern of the field specifying the basic operation is defined as an instruction and has an accompanying operation. In this case, data indicating the ancillary operations permitted by the basic operation,
If the bit pattern of the field that specifies the basic operation is defined as a command and does not have an accompanying operation, outputs data indicating that the basic operation does not have an accompanying operation, and sets the field that specifies the accompanying operation to another. an instruction decoder that decodes data independently of the fields of the field and outputs data indicating a specified accompanying operation; and an instruction decoder that manages data indicating whether the instruction being decoded by the instruction decoder is valid or invalid. data output from the control means and the instruction decoding control means indicates that the instruction being decoded is valid; and data output from the instruction decoding means indicates that the instruction being decoded is an undefined instruction. If so, it is detected that the instruction is an undefined instruction, the data output from the instruction decoding control means indicates that the instruction being decoded is valid, and the data output from the instruction decoding means is If the instruction being decoded indicates that it is a defined instruction with accompanying actions, the data indicating the accompanying actions permitted by the basic action of the instruction and the data indicating the accompanying actions specified by the instruction indicate that the instruction is not permitted. If a combination of incidental operations that are not specified occurs, it is detected that the instruction is an undefined instruction, and the data output from the instruction decoding control means indicates that the instruction being decoded is valid, and the instruction is If the data output from the decoding means indicates that the instruction being decoded is a defined instruction without an accompanying action, it is detected that the instruction is a defined instruction regardless of the data indicating the specified accompanying action. An instruction exception detection device characterized by comprising an undefined instruction detection means for detecting an undefined instruction.
(2)命令の基本動作を指定する複数のフィールドと、
前記基本動作に付随しかつ直交に存在する付随動作のう
ちから一つの付随動作を指定する複数のフィールドから
なる命令において、前記基本動作を指定するフィールド
を他のフィールドとは独立に解読し、前記命令が実行を
許可されるプロセッサの状態を示すデータを発生する命
令解読手段と、前記プロセッサの状態を管理する命令解
読制御手段と、前記命令解読手段より出力される前記実
行が許可されるプロセッサの状態を示すデータと前記命
令解読制御手段より出力される前記プロセッサの状態よ
り前記命令が現在実行を許可もしくは不許可であるかを
判断する命令実行違反検出手段を備えたことを特徴とす
る例外検出装置(3)命令の基本動作を指定する複数の
フィールドと、前記基本動作に付随しかつ直交に存在す
る付随動作のうちから一つの付随動作を指定する複数の
フィールドからなる命令において、前記基本動作を指定
するフィールドを他のフィールドとは独立に解読し、前
記基本動作を指定するフィールドのビットパターンが命
令として定義されていない場合には未定義命令であるこ
とを示すデータを、前記基本動作を指定するフィールド
のビットパターンが命令として定義されかつ付随動作を
有する場合には前記基本動作が許可している付随動作を
示すデータを、前記基本動作を指定するフィールドのビ
ットパターンが命令として定義されかつ付随動作を持た
ない場合には前記基本動作は付随動作を持たないことを
示すデータを出力し、前記付随動作を指定するフィール
ドを他のフィールドとは独立に解読し、指定されている
付随動作を示すデータを出力する命令解読手段と、前記
命令解読手段で解読中の命令が有効もしくは無効である
ことを示すデータを管理する命令解読制御手段と、前記
命令解読制御手段より出力されるデータは解読中の命令
が有効であることを示し、かつ前記命令解読手段より出
力されるデータは解読中の命令が未定義命令であること
を示す場合には命令が未定義命令であることを検出し、
前記命令解読制御手段より出力されるデータは解読中の
命令が有効であることを示し、かつ前記命令解読手段よ
り出力されるデータは解読中の命令が付随動作を有する
定義済命令であることを示す場合には、命令の基本動作
が許可している付随動作を示すデータと命令で指定され
ている付随動作を示すデータより許可されていない付随
動作の組合せが発生する場合には命令が未定義命令であ
ることを検出し、前記命令解読制御手段より出力される
データは解読中の命令が有効であることを示し、かつ前
記命令解読手段より出力されるデータは解読中の命令が
付随動作を持たない定義済命令であることを示す場合に
は、指定されている付随動作を示すデータにかかわらず
定義済命令であることを検出する未定義命令検出手段と
、マイクロプログラムを格納する制御メモリを備え、前
記命令解読手段の出力されるデータおよび前記命令解読
制御手段より出力される前記命令が有効であることを示
すデータより前記未定義命令検出手段が未定義命令を検
出する、および、前記命令解読手段において命令を解読
し、前記命令が定義済命令であることが判断され、前記
命令解読手段の出力するアドレスより制御メモリに格納
されている未定義命令処理マイクロルーチンを起動する
、ことより未定義命令検出を行うことを特徴とする命令
例外検出装置。
(2) multiple fields that specify the basic operation of the instruction;
In an instruction consisting of a plurality of fields specifying one incidental operation from among incidental operations that are incidental to and orthogonal to the basic operation, the field specifying the basic operation is decoded independently of other fields, and the an instruction decoding means for generating data indicating the state of the processor in which the instruction is permitted to be executed; an instruction decoding control means for managing the state of the processor; Exception detection characterized by comprising an instruction execution violation detection means for determining whether execution of the instruction is currently permitted or disallowed from data indicating the state and the state of the processor outputted from the instruction decoding control means. Device (3) In an instruction consisting of a plurality of fields specifying a basic operation of the instruction and a plurality of fields specifying one incidental operation from among incidental operations that are incidental to and orthogonal to the basic operation, the basic operation The field that specifies the basic operation is decoded independently from other fields, and if the bit pattern of the field that specifies the basic operation is not defined as an instruction, data indicating that it is an undefined instruction is sent to the field that specifies the basic operation. If the bit pattern of the field that specifies the basic operation is defined as a command and has an accompanying operation, the bit pattern of the field that specifies the basic operation is defined as an instruction, and the data indicating the accompanying operation permitted by the basic operation is If the basic action does not have an accompanying action, data indicating that the basic action does not have an accompanying action is output, the field specifying the accompanying action is decoded independently of other fields, and the specified accompanying action is executed. an instruction decoding means for outputting data indicating whether the instruction being decoded by the instruction decoding means is valid or invalid; and an instruction decoding control means for managing data indicating whether the instruction being decoded by the instruction decoding means is valid or invalid; detecting that the instruction is an undefined instruction if the instruction being decoded indicates that the instruction is valid, and the data output from the instruction decoding means indicates that the instruction being decoded is an undefined instruction;
The data output from the instruction decoding control means indicates that the instruction being decoded is valid, and the data output from the instruction decoding means indicates that the instruction being decoded is a defined instruction having an accompanying action. If a combination of ancillary operations that are not permitted by the data indicating the incidental operations permitted by the basic operation of the instruction and the data indicating the incidental operations specified in the instruction occurs, the instruction is undefined. The data output from the instruction decoding control means indicates that the instruction being decoded is valid, and the data output from the instruction decoding means indicates that the instruction being decoded performs an accompanying operation. If the instruction is a defined instruction that does not have a specified instruction, an undefined instruction detection means that detects that it is a defined instruction regardless of the data indicating the specified accompanying operation, and a control memory that stores the microprogram. the undefined instruction detection means detects an undefined instruction from data output from the instruction decoding means and data output from the instruction decoding control means indicating that the instruction is valid; The instruction is decoded by the decoding means, and it is determined that the instruction is a defined instruction, and an undefined instruction processing microroutine stored in the control memory is activated from the address output by the instruction decoding means. An instruction exception detection device characterized by detecting defined instructions.
JP1181110A 1989-07-12 1989-07-12 Instruction exception detector Expired - Fee Related JPH0769792B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1181110A JPH0769792B2 (en) 1989-07-12 1989-07-12 Instruction exception detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1181110A JPH0769792B2 (en) 1989-07-12 1989-07-12 Instruction exception detector

Publications (2)

Publication Number Publication Date
JPH0344739A true JPH0344739A (en) 1991-02-26
JPH0769792B2 JPH0769792B2 (en) 1995-07-31

Family

ID=16095028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1181110A Expired - Fee Related JPH0769792B2 (en) 1989-07-12 1989-07-12 Instruction exception detector

Country Status (1)

Country Link
JP (1) JPH0769792B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60193046A (en) * 1984-03-14 1985-10-01 Fujitsu Ltd Detecting system for instruction exception

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60193046A (en) * 1984-03-14 1985-10-01 Fujitsu Ltd Detecting system for instruction exception

Also Published As

Publication number Publication date
JPH0769792B2 (en) 1995-07-31

Similar Documents

Publication Publication Date Title
JPS5960652A (en) Data processing device
JPS62197830A (en) Data processing system
US5742801A (en) Microprocessor to which additional instructions are added and instructions addition method thereof
JPS61221936A (en) Data processor
JPH0344739A (en) Instruction exception detecting device
JPS5928300A (en) Semiconductor device
JP3507193B2 (en) Load / store instruction processor
JP3157242B2 (en) Error handling method in micro program control
JPH09288595A (en) Arithmetic processing unit
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPH10222361A (en) Rom program monitor device in processor of computer or the like
JPH1011312A (en) Information processor
JP2003196087A (en) Memory addressing system of microcontroller and page mapping device
KR910006841A (en) Data processing unit based on microprogram control
JPS60112148A (en) Memory device
JPH0538385A (en) Program copy preventing device
JPS6238746B2 (en)
JPS63155328A (en) Information processor
JPS59133613A (en) Software verifying method of process controller
JPH10143376A (en) Information processing device
JPH02110636A (en) Debugging device for tag architecture machine and its compiler
JPS61198336A (en) Scanning-in control system
JPS6037036A (en) Data processor
JPH03168845A (en) Instruction execution control system
JPS5847799B2 (en) memory protection device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees