JPH0962504A - Instruction processor - Google Patents

Instruction processor

Info

Publication number
JPH0962504A
JPH0962504A JP23765595A JP23765595A JPH0962504A JP H0962504 A JPH0962504 A JP H0962504A JP 23765595 A JP23765595 A JP 23765595A JP 23765595 A JP23765595 A JP 23765595A JP H0962504 A JPH0962504 A JP H0962504A
Authority
JP
Japan
Prior art keywords
instruction
word length
address
shortened
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP23765595A
Other languages
Japanese (ja)
Inventor
Atsushi Kawai
淳 河井
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP23765595A priority Critical patent/JPH0962504A/en
Publication of JPH0962504A publication Critical patent/JPH0962504A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an instruction processor with which the length of instruction can be selected as needed and the execution time of instruction can be shortened. SOLUTION: An instruction memory part 10 is provided with a word length instruction memory area 11 for storing instruction codes equivalent to the number of data word length bits and an abbreviated instruction memory area 12 for storing instruction codes small in numbers than data word length bits. Based on an instruction address from an instruction executing part 31, an instruction length discriminating part 23 discriminates whether that instruction is an abbreviated instruction or not. When the discriminated result of the instruction length discriminating part 23 shows the abbreviated instruction, an instruction code extending part 22 inserts bits to the instruction codes inside the abbreviated instruction memory area and outputs them to the instruction executing part 31 as the instruction codes equivalent to the number of data word length bits.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータにお
ける、複数の命令長をもつ命令セットで構成されるプロ
グラムを実行する命令処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction processing device in a computer for executing a program including an instruction set having a plurality of instruction lengths.

【0002】[0002]

【従来の技術】従来、RISC(Reduced Instruction Set
Computer:縮小命令セットコンピュータ)型命令処理装
置では、(1) データ語長と同一の固定長の命令のみから
構成される命令セットをもつもの、(2) データ語長の半
分の固定長の命令のみから構成される命令セットをもつ
もの、あるいは、(3) データ語長と同一の命令とデータ
語長の半分の長さの命令とから構成される命令セットを
もつもののいずれかである。
2. Description of the Related Art Conventionally, RISC (Reduced Instruction Set)
Computer: A reduced instruction set computer type instruction processor that has (1) an instruction set consisting of only fixed length instructions that are the same as the data word length, and (2) fixed length instructions that are half the data word length. Either an instruction set consisting of only one or (3) an instruction set consisting of an instruction having the same data word length and an instruction having a half of the data word length.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記
(1) では、命令のビット数が多いため、多くの動作指
定、多くのレジスタ指定、大きな範囲の即値データの割
り付け、および大きな範囲でのメモリアドレス値の指定
などが可能である反面、オブジェクトコードサイズが大
きくなる欠点がある。
[Problems to be Solved by the Invention]
In (1), since the number of bits in the instruction is large, it is possible to specify many operations, many registers, allocate immediate data in a large range, and specify memory address values in a large range. It has the drawback of being large in size.

【0004】また、(2) では、命令長が(1) の半分とな
るため、オブジェクトコードサイズを比較的小さくする
ことが可能である。しかし、動作指定、レジスタ指定、
即値データの指定範囲、あるいはメモリアドレス値の指
定範囲が小さくなり、プログラミングに非常な制限を与
えたり、また、この制限のためにオブジェクトコードの
命令数が多くなり、オブジェクトコードサイズが小さく
ならないばかりか命令実行ステップ数が増加する問題が
ある。
Further, in (2), since the instruction length is half that in (1), it is possible to make the object code size relatively small. However, operation specification, register specification,
Not only does the specified range of immediate data or the specified range of memory address values become smaller, which imposes a great limit on programming, and because of this restriction, the number of instructions in the object code increases, and the object code size does not decrease. There is a problem that the number of instruction execution steps increases.

【0005】一方、(3) では、上記(1) 、(2) の欠点を
補うべく考案された命令セットをもち、複雑な動作指
定、あるいは、大きな即値やメモリアドレス値を与える
命令については(1) のタイプ、多くのビットを必要とせ
ずに指定可能な命令については(2) のタイプの命令を組
み合わせて使用できる長所がある。しかしながら、複数
の長さの命令にたいして命令読み出しを行うために、2
回の命令読み出しアクセス回数が必要な場合もあり、命
令読み出し時間の増加をもたらすこと、また、分岐制御
を行ったり、命令デコードを行うために、命令処理装置
内の回路が複雑になること、また、そのために命令実行
サイクル時間が長くなってしまう問題があった。
On the other hand, (3) has an instruction set devised to compensate for the drawbacks of (1) and (2) above, and for instructions that give a complicated operation or give a large immediate value or memory address value, The instructions of type 1) and instructions that can be specified without requiring many bits have the advantage that the instructions of type 2 can be used in combination. However, in order to read out an instruction of multiple lengths, 2
In some cases, the number of times of instruction read access needs to be increased, which results in an increase in instruction read time, and in that the circuit in the instruction processing device becomes complicated for branch control and instruction decoding. However, there is a problem in that the instruction execution cycle time becomes long.

【0006】このような背景から、必要に応じて命令長
を選択することができ、かつ、命令実行時間の短縮化を
図ることのできる命令処理装置を実現することが望まれ
ていた。
From such a background, it has been desired to realize an instruction processing device capable of selecting an instruction length as required and shortening an instruction execution time.

【0007】[0007]

【課題を解決するための手段】第1発明の命令処理装置
は、前述の課題を解決するために、任意の命令アドレス
を指定して、当該アドレスに対応した命令コードを受け
取る命令実行部と、データ語長ビット数と等しい命令コ
ードを格納するワード長命令メモリ領域と、データ語長
ビット数より少ない命令コードを格納する短縮形命令メ
モリ領域とからなる命令メモリ部と、命令実行部からの
命令アドレスに基づき、その命令が短縮形命令である
か、ワード長命令であるかを判定する命令長判定部と、
命令長判定部の判定結果が短縮形命令であった場合は、
短縮形命令メモリ領域内の命令コードを、データ語長ビ
ット数と等しい命令コードとの差分のビット数を挿入す
ることで、データ語長ビット数と等しい命令コードとし
て前記命令実行部に出力する命令コード拡張部とを備え
たことを特徴とするものである。
In order to solve the above-mentioned problems, an instruction processing device according to a first aspect of the present invention specifies an arbitrary instruction address and receives an instruction code corresponding to the address. An instruction memory unit consisting of a word length instruction memory region for storing an instruction code equal to the number of bits of the data word length, an abridged instruction memory region for storing an instruction code of less than the number of bits of the data word length, and an instruction from the instruction execution unit An instruction length determination unit that determines whether the instruction is a shortened instruction or a word length instruction based on the address,
If the judgment result of the instruction length judgment unit is a shortened instruction,
An instruction to be output to the instruction execution unit as an instruction code equal to the data word length bit number by inserting the difference bit number between the instruction code in the shortened instruction memory area and the instruction code equal to the data word length bit number. And a code extension section.

【0008】第1発明の命令処理装置は、このように構
成することにより、命令長判定部は、命令実行部からの
命令アドレスに基づいて、その命令が短縮形命令である
か、ワード長命令であるかを判定する。命令コード拡張
部は、命令長判定部での判定結果が短縮形命令であった
場合は、短縮形命令メモリ領域内の命令コードを、デー
タ語長ビット数と等しい命令コードとの差分のビット数
を挿入することで、データ語長ビット数と等しい命令コ
ードとして前記命令実行部に出力する。
According to the instruction processing device of the first aspect of the invention, the instruction length determination unit determines whether the instruction is a shortened instruction or a word length instruction based on the instruction address from the instruction execution unit. Is determined. The instruction code expansion unit determines the number of bits of the difference between the instruction code in the shortened instruction memory area and the instruction code equal to the number of bits of the data word when the determination result of the instruction length determination unit is the shortened instruction. Is inserted into the instruction execution unit as an instruction code equal to the data word length bit number.

【0009】第2発明の命令処理装置は、前述の課題を
解決するために、第1発明の命令処理装置において、予
め決定された境界アドレスとの比較により、その命令が
短縮形命令であるか、ワード長命令であるかを判定する
命令長判定部を備えたことを特徴とするものである。こ
のように構成することにより、命令長判定部は、命令実
行部からの命令アドレスを境界アドレスと比較し、その
命令が短縮形命令であるか、ワード長命令であるかを判
定する。
In order to solve the above-mentioned problems, the instruction processing device of the second aspect of the present invention is the instruction processing device of the first aspect of the invention, in which the instruction is a shortened type instruction by comparison with a predetermined boundary address. It is characterized in that an instruction length judging unit for judging whether the instruction is a word length instruction is provided. With this configuration, the instruction length determination unit compares the instruction address from the instruction execution unit with the boundary address and determines whether the instruction is a shortened instruction or a word length instruction.

【0010】第3発明の命令処理装置は、前述の課題を
解決するために、第1発明の命令処理装置において、予
め決定された上限アドレスと下限アドレスとの比較によ
り、その命令が短縮形命令であるか、ワード長命令であ
るかを判定する命令長判定部を備えたことを特徴とする
ものである。このように構成することにより、命令長判
定部は、命令実行部からの命令アドレスを上限アドレス
および下限アドレスと比較し、その命令が短縮形命令で
あるか、ワード長命令であるかを判定する。
In order to solve the above-mentioned problems, the instruction processing apparatus of the third invention is the instruction processing apparatus of the first invention, in which the instruction is shortened by comparing a predetermined upper limit address and lower limit address. Or a word length instruction is provided. With this configuration, the instruction length determination unit compares the instruction address from the instruction execution unit with the upper limit address and the lower limit address, and determines whether the instruction is a shortened instruction or a word length instruction. .

【0011】[0011]

【発明の実施の形態】以下、本発明の実施の形態を図面
を用いて詳細に説明する。 《実施形態1》図1は本発明の命令処理装置の実施形態
1を示す構成図であるが、この説明に先立ち、RISC型命
令処理装置で実行される命令フォーマットの説明を行
う。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described in detail below with reference to the drawings. << First Embodiment >> FIG. 1 is a block diagram showing a first embodiment of an instruction processing apparatus of the present invention. Prior to this explanation, an instruction format executed by the RISC type instruction processing apparatus will be explained.

【0012】図2は、RISC型命令処理装置で実行される
命令フォーマットの説明図であり、(a)は、データ語
長と同一の命令長(ワード長)の命令フォーマット、
(b)は、データ語長の半分の命令長(ハーフワード
長)の命令フォーマットを示す。図2の(a),(b)
いずれの命令フォーマットにおいても、命令コードは動
作指定部、デスティネーションオペランド指定部、ソー
ス1オペランド指定部、およびソース2オペランド/即
値オペランド指定部とから構成される。この命令コード
は、ソース1オペランドで指定されるレジスタの内容
と、ソース2オペランドで指定されるレジスタ、あるい
は即値オペランドで指定される即値そのものとを入力と
し、これに対して、動作指定部で指定される処理を行
い、結果をデスティネーションオペランドで指定される
レジスタに格納する動作を指定する。
FIG. 2 is an explanatory diagram of an instruction format executed by the RISC type instruction processing device. FIG. 2A shows an instruction format having the same instruction length (word length) as the data word length.
(B) shows an instruction format with an instruction length (half word length) that is half the data word length. 2A and 2B
In any instruction format, the instruction code is composed of an operation designation section, a destination operand designation section, a source 1 operand designation section, and a source 2 operand / immediate operand designation section. This instruction code takes the contents of the register specified by the source 1 operand and the register specified by the source 2 operand, or the immediate value itself specified by the immediate operand, as opposed to the instruction specified by the operation specification section. Specifies the operation of performing the specified process and storing the result in the register specified by the destination operand.

【0013】即ち、動作指定をf、デスティネーション
オペランドレジスタをdst、ソース1オペランドレジ
スタの内容をsrc1、ソース2オペランドレジスタの
内容をsrc2、および即値オペランドをimmとした
とき、f(src1,src2)→dst、あるいは、
f(src1,imm)→dstを意味する。
That is, when the operation designation is f, the destination operand register is dst, the content of the source 1 operand register is src1, the content of the source 2 operand register is src2, and the immediate operand is imm, f (src1, src2) → dst or
It means f (src1, imm) → dst.

【0014】ここではデータ語長は32ビットとしてい
るので、(a)のワード長命令では32ビットのフィー
ルドを全て使用してフルセットの動作指定を行うことが
できる。一方、(b)はハーフワード長命令であり、命
令コードのそれぞれのフィールドがワード長命令に比べ
て短いので、ワード長命令に比べ制限された範囲での動
作指定しか行えない。つまり、ハーフワード長命令はワ
ード長命令のサブセットとなる。
Since the data word length is 32 bits here, a full set operation can be specified by using all the 32 bit fields in the word length instruction of (a). On the other hand, (b) is a halfword length instruction, and since each field of the instruction code is shorter than the word length instruction, only the operation can be specified within a limited range as compared with the word length instruction. That is, halfword length instructions are a subset of word length instructions.

【0015】図示例では、ワード長命令においては動作
指定部が8ビット、デスディネーションオペランド指定
部が8ビット、ソース1オペランド指定部が8ビット、
およびソース2オペランド/即値オペランド指定部が8
ビットであるのに対し、ハーフワード長命令では動作指
定部が4ビット、デスディネーションオペランド指定部
が4ビット、ソース1オペランド指定部が4ビット、お
よびソース2オペランド/即値オペランド指定部が4ビ
ットであるため、動作指定が256→16、デスディネ
ーションオペランドレジスタ数が256→16、ソース
1オペランドレジスタ数が256→16、そしてソース
2オペランドレジスタ数が256→16、あるいは即値
オペランド範囲が−128〜127→−8〜7となる。
従って、ハーフワード長命令では1命令で指定可能な処
理に大きな制限が生ずる。
In the illustrated example, in the word length instruction, the operation designation section is 8 bits, the destination operand designation section is 8 bits, and the source 1 operand designation section is 8 bits.
And the source 2 operand / immediate operand specification part is 8
In contrast to a bit, in a halfword length instruction, the operation specification part is 4 bits, the destination operand specification part is 4 bits, the source 1 operand specification part is 4 bits, and the source 2 operand / immediate operand specification part is 4 bits. Therefore, the operation designation is 256 → 16, the destination operand register number is 256 → 16, the source 1 operand register number is 256 → 16, and the source 2 operand register number is 256 → 16, or the immediate operand range is −128. It becomes -127->-8-7.
Therefore, with the halfword length instruction, the processing that can be designated by one instruction is greatly limited.

【0016】また、(a)のワード長命令と、(b)の
ハーフワード長命令の両方を含む命令セットを実行する
ことが考えられ、この場合、複雑な指定が必要な命令は
ワード長命令で、単純な指定で済む命令はハーフワード
長命令で構成される。
It is also conceivable to execute an instruction set including both the word length instruction of (a) and the half word length instruction of (b). In this case, an instruction requiring complicated designation is a word length instruction. The instructions that can be specified simply are halfword length instructions.

【0017】図3は、ワード長命令/ハーフワード長命
令混在オブジェクトコード格納の説明図である。データ
語長を32ビットとするためワード長命令は32ビッ
ト、ハーフワード長は16ビットとなる。また、1回の
命令メモリに対する命令読み出しは32ビットとする。
図3に示すようにオブジェクトコードはワード長命令と
ハーフワード長命令とを含むため、命令コードの境界は
4バイト境界(4の倍数となるバイトアドレス)の場合
と2バイト境界(2の倍数となるバイトアドレス)の場
合がある。ところが、命令読み出しは32ビット単位で
あるため、ワード長命令が連続する2語に渡る場合があ
る。このとき、このワード命令を読み出すためには2回
の命令読み出しを行わなければならず、命令読み出し時
間の増大をもたらすことになる。特に、分岐先がワード
命令でこのような形で命令が格納されている場合には命
令の先読みを行うことが不可能となり、重大な問題とな
る。
FIG. 3 is an explanatory view of storing a word length instruction / halfword length instruction mixed object code. Since the data word length is 32 bits, the word length instruction is 32 bits and the half word length is 16 bits. Further, the instruction read from the instruction memory once is 32 bits.
Since the object code includes a word length instruction and a halfword length instruction as shown in FIG. 3, the instruction code boundary is a 4-byte boundary (a byte address that is a multiple of 4) and a 2-byte boundary (a multiple of 2). Byte address). However, since the instruction reading is in units of 32 bits, the word length instruction may extend over two consecutive words. At this time, in order to read this word command, it is necessary to read the command twice, resulting in an increase in the command reading time. In particular, when the branch destination is a word instruction and the instruction is stored in this way, it becomes impossible to prefetch the instruction, which is a serious problem.

【0018】そこで、本発明では、ワード長命令のため
のメモリ領域と、このワード長命令より短い短縮形命令
のためのメモリ領域を別々に設け、条件に応じていずれ
かのメモリ領域から命令を取出すようにすることで、必
要に応じて命令長を選択し、かつ、命令実行時間の短縮
化を図ったものである。
Therefore, in the present invention, a memory area for a word length instruction and a memory area for a shortened instruction shorter than the word length instruction are separately provided, and an instruction is issued from any one of the memory areas according to conditions. By taking out the instruction, the instruction length is selected as required and the instruction execution time is shortened.

【0019】図4は、本実施形態1で処理する命令セッ
トのうちのワード長命令のフォーマットと命令実行状態
の説明図である。図5は、本実施形態1で処理する命令
セットのうちの短縮形命令のフォーマットと命令実行状
態の説明図である。
FIG. 4 is an explanatory diagram of the format and instruction execution state of the word length instruction in the instruction set processed in the first embodiment. FIG. 5 is an explanatory diagram of a format of a short-form instruction and an instruction execution state in the instruction set processed in the first embodiment.

【0020】先ず、後述する命令メモリに格納された状
態、即ち、命令が実行される前の静的な状態での説明を
行う。本実施形態ではワード長命令を32ビット、短縮
形命令を21ビットとしているが、本発明においてはこ
れは例に過ぎず、本発明ではワード長命令をMビット、
短縮形命令をNビットとした時に、MおよびNはM>N
を満足する任意の値に対して適用可能である。
First, a description will be given of a state stored in an instruction memory described later, that is, a static state before the instruction is executed. In the present embodiment, the word length instruction is 32 bits and the shortened instruction is 21 bits. However, this is only an example in the present invention, and the word length instruction is M bits in the present invention.
When the shortened instruction is N bits, M and N are M> N
It is applicable to any value that satisfies

【0021】図4、図5いずれの命令フォーマットにお
いても、図2で説明した例と同様に、命令コードは、動
作指定部、デスティネーションオペランド指定部、ソー
ス1オペランド指定部、およびソース2オペランド/即
値オペランド指定部とから構成される。この命令コード
は、ソース1オペランドで指定されるレジスタの内容と
ソース2オペランドで指定されるレジスタあるいは即値
オペランドで指定される即値そのものとを入力として、
これに対して動作指定部で指定される処理を行い、結果
をデスティネーションオペランドで指定されるレジスタ
に格納する動作を指定する。即ち、動作指定をf、デス
ティネーションオペランドレジスタをdst、ソース1
オペランドレジスタの内容をsrc1、ソース2オペラ
ンドレジスタの内容をsrc2、および即値オペランド
をimmとしたとき、f(src1,src2)→ds
t、あるいは、f(src1,imm)→dstを意味
する。
In both the instruction formats shown in FIGS. 4 and 5, as in the example described with reference to FIG. 2, the instruction code includes an operation designation section, a destination operand designation section, a source 1 operand designation section, and a source 2 operand / It consists of an immediate operand specification part. This instruction code inputs the contents of the register specified by the source 1 operand and the register specified by the source 2 operand or the immediate value itself specified by the immediate operand,
The operation specified by the operation specifying unit is performed on this, and the operation of storing the result in the register specified by the destination operand is specified. That is, the operation designation is f, the destination operand register is dst, and the source 1
When the content of the operand register is src1, the content of the source 2 operand register is src2, and the immediate operand is imm, f (src1, src2) → ds
It means t or f (src1, imm) → dst.

【0022】図4のフォーマットは、ワード長命令であ
るので、32ビットのフィールドを全て使用してフルセ
ットの動作指定を行うことができる。一方、図5のフォ
ーマットは短縮形命令であり、命令コードのそれぞれの
フィールドがワード長命令に比べて短いので、ワード長
命令に比べ制限された範囲での動作指定しか行えない。
つまり、短縮形命令はワード長命令のサブセットとな
る。
Since the format of FIG. 4 is a word length instruction, a full set operation can be specified by using all 32-bit fields. On the other hand, the format of FIG. 5 is a shortened type instruction, and since each field of the instruction code is shorter than the word length instruction, only the operation can be specified within a limited range as compared with the word length instruction.
That is, the short instruction is a subset of the word length instruction.

【0023】図示例では、ワード長命令においては動作
指定部が8ビット、デスディネーションオペランド指定
部が6ビット、ソース1オペランド指定部が6ビット、
およびソース2オペランド/即値オペランド指定部が1
2ビットであるのに対し、短縮形命令では動作指定部が
5ビット、デスディネーションオペランド指定部が4ビ
ット、ソース1オペランド指定部が4ビット、およびソ
ース2オペランド/即値オペランド指定部が8ビットで
あるであるため、動作指定が256→32、デスディネ
ーションオペランドレジスタ数が64→16、ソース1
オペランドレジスタ数が64→16、そしてソース2オ
ペランドレジスタ数が64→16(ソース2オペランド
指定フィールドは12ビット→8ビットであるが、レジ
スタ指定部分はそのうちの下6ビット→下4ビットとす
る)、あるいは即値オペランド範囲が−2048〜20
47→−128〜127となる。
In the illustrated example, in the word length instruction, the operation designation section is 8 bits, the destination operand designation section is 6 bits, the source 1 operand designation section is 6 bits,
And source 2 operand / immediate operand specification part is 1
In contrast to 2 bits, in the short instruction, the operation specification part is 5 bits, the destination operand specification part is 4 bits, the source 1 operand specification part is 4 bits, and the source 2 operand / immediate operand specification part is 8 bits. Therefore, the operation designation is 256 → 32, the number of destination operand registers is 64 → 16, and the source 1
The number of operand registers is 64 → 16, and the number of source 2 operand registers is 64 → 16 (the source 2 operand designation field is 12 bits → 8 bits, but the register designation part is lower 6 bits → lower 4 bits) , Or the immediate operand range is -2048 to 20
47 → -128 to 127.

【0024】従って、ワード長命令を使用したプログラ
ムではフルセットの命令を使用して構成することが可能
であるが、短縮形命令を使用したプログラムでは上記の
制限を満たす範囲の命令のみを使用して構成する必要が
ある。
Therefore, the program using the word length instruction can be configured by using the full set of instructions, but the program using the abbreviated instruction uses only the instruction in the range satisfying the above restrictions. Need to be configured.

【0025】一方、後述する命令実行部は、上記ワード
長命令、および短縮形命令の2種の識別を行う機能はな
く、全ての命令はワード長命令、即ち、フルセットの動
作指定を行う命令コードを実行する機能のみで構成され
ている。従って、命令実行部に与えられる全ての命令は
32ビットの命令長である必要がある。このため、本実
施形態では、命令メモリから読み出した命令コードがワ
ード長命令である場合にはこれをそのまま命令実行部に
送り、命令メモリから読み出した命令コードが短縮形命
令である場合にはこれに対してビット挿入を行い、短縮
形命令をワード長命令に変換する機能を備えている。具
体的には、短縮形命令に対して0を値とするビットを挿
入し、これを実行しているもので、以下、このような構
成を図1を用いて説明する。
On the other hand, the instruction execution unit, which will be described later, does not have a function of distinguishing between the word length instruction and the abbreviated instruction, and all the instructions are word length instructions, that is, instructions that specify a full set operation. It consists only of the ability to execute code. Therefore, all the instructions given to the instruction execution unit need to have an instruction length of 32 bits. Therefore, in the present embodiment, when the instruction code read from the instruction memory is a word length instruction, it is sent to the instruction execution unit as it is, and when the instruction code read from the instruction memory is a shortened instruction, it is It has a function to insert a bit into and to convert a short instruction into a word length instruction. Specifically, a bit having a value of 0 is inserted into a shortened instruction and this is executed, and such a configuration will be described below with reference to FIG.

【0026】[構成]図1において、命令処理装置は、
命令メモリ部10、命令コード変換部20、命令実行部
30からなる。命令メモリ部10は、ワード長命令メモ
リ領域11と、短縮形命令メモリ領域12の2つの領域
で構成される。ワード長命令メモリ領域11は、データ
語長ビット数と等しい命令コードを格納するメモリ領域
であり、短縮形命令メモリ領域12は、データ語長ビッ
ト数より少ない命令コードを格納するメモリ領域であ
る。また、ワード長命令メモリ領域11は、CPUを含
むLSIの外部に接続されるとし、短縮形命令メモリ領
域12はCPUを含むLSIの内部に接続されるとす
る。従って、ワード長命令メモリ領域11からは32ビ
ットのワード長命令が読み出されてLSIに入力され、
LSI内部の短縮形命令メモリ領域12からは21ビッ
トの短縮形命令が読み出される。
[Structure] In FIG. 1, the instruction processing device is
The instruction memory unit 10, the instruction code conversion unit 20, and the instruction execution unit 30 are included. The instruction memory unit 10 is composed of two areas, a word length instruction memory area 11 and a shortened instruction memory area 12. The word length instruction memory area 11 is a memory area for storing an instruction code equal to the data word length bit number, and the shortened instruction memory area 12 is a memory area for storing an instruction code smaller than the data word length bit number. Further, it is assumed that the word length instruction memory area 11 is connected to the outside of the LSI including the CPU, and the shortened instruction memory area 12 is connected to the inside of the LSI including the CPU. Therefore, a 32-bit word length instruction is read from the word length instruction memory area 11 and input to the LSI,
A 21-bit short instruction is read from the short instruction memory area 12 inside the LSI.

【0027】ワード長命令メモリ領域11と短縮形命令
メモリ領域12とは別々の命令アドレス空間に配置され
る。従って、ワード長命令メモリ領域11、あるいは短
縮形命令メモリ領域12のどちらから命令コードを読み
出すかは、命令実行部30から出力される命令アドレス
の内容で識別される。
The word length instruction memory area 11 and the shortened instruction memory area 12 are arranged in different instruction address spaces. Therefore, whether the instruction code is read from the word length instruction memory area 11 or the shortened instruction memory area 12 is identified by the content of the instruction address output from the instruction execution unit 30.

【0028】本実施形態では命令アドレスはワード長命
令を単位として計算されるものとする。従って、読み出
しを行う命令がワード長命令メモリ領域11にあるワー
ド長命令の場合も、短縮形命令メモリ領域12にある短
縮形命令の場合でも、命令アドレスはワード長命令のサ
イズを単位としたアドレス計算で決定されるもとのす
る。本実施形態では、命令アドレスはバイトアドレスと
し、21ビット、即ち、命令アドレス空間全体として2
メガバイトのサイズとしている。ワード長命令長は32
ビット、そして短縮形命令長は21ビットとしている
が、上述のように命令アドレスは32ビットを単位とし
て計算されるため、ワード長命令、あるいは短縮形命令
にかかわらず2メガバイトの命令アドレス空間に合計5
12k(219)個までの命令を配置することができるこ
とになる。
In this embodiment, the instruction address is calculated in word length instructions. Therefore, regardless of whether the instruction to be read is a word length instruction in the word length instruction memory area 11 or a shortened instruction in the shortened instruction memory area 12, the instruction address is an address based on the size of the word length instruction. It is decided by calculation. In this embodiment, the instruction address is a byte address and has 21 bits, that is, 2 as the entire instruction address space.
It has a size of megabytes. Word length Instruction length is 32
Bits and abbreviated instruction length are 21 bits, but since instruction addresses are calculated in units of 32 bits as described above, the total is 2 megabytes of instruction address space regardless of word length instructions or abbreviated instructions. 5
Up to 12k (2 19 ) instructions can be arranged.

【0029】命令コード変換部20は、本発明の特徴と
なる部分で、命令長判定部21と、命令コード拡張部2
2とから構成される。命令長判定部21は、命令実行部
30からの命令アドレスに基づき、その命令が短縮形命
令であるか、ワード長命令であるかを判定する機能を有
している。命令コード拡張部22は、命令長判定部21
の判定結果が短縮形命令であった場合は、短縮形命令メ
モリ領域12内の命令コードをワード長に拡張し、ワー
ド長命令コードと等しい長さの命令コードとして命令実
行部30に出力する機能を有している。
The instruction code conversion unit 20 is a feature of the present invention and is an instruction length determination unit 21 and an instruction code expansion unit 2.
And 2. The instruction length determination unit 21 has a function of determining, based on the instruction address from the instruction execution unit 30, whether the instruction is a shortened instruction or a word length instruction. The instruction code extension unit 22 includes an instruction length determination unit 21.
If the result of the determination is that the instruction is a shortened instruction, the instruction code in the shortened instruction memory area 12 is expanded to a word length and output to the instruction execution unit 30 as an instruction code having a length equal to the word length instruction code. have.

【0030】図6は、命令長判定部21の構成図であ
る。命令長判定部21は、境界アドレスレジスタ21a
と比較回路21bとで構成される。境界アドレスレジス
タ21aは、ワード長命令メモリ領域11と短縮形命令
メモリ領域12の命令アドレス境界の値を保持するレジ
スタである。また、比較回路21bは、減算回路で構成
され、入力される命令アドレスから境界レジスタ21a
より入力される境界アドレスを減算し、もし、減算結果
が負であった場合には短縮形命令フラッグがアサートさ
れ“1”となる。
FIG. 6 is a block diagram of the instruction length determination unit 21. The instruction length determination unit 21 uses the boundary address register 21a.
And a comparison circuit 21b. The boundary address register 21a is a register that holds the value of the instruction address boundary between the word length instruction memory area 11 and the shortened instruction memory area 12. Further, the comparison circuit 21b is composed of a subtraction circuit, and the boundary register 21a is converted from the input instruction address.
The input boundary address is subtracted, and if the subtraction result is negative, the shortened instruction flag is asserted and becomes "1".

【0031】図7は、命令コード拡張部22の構成図で
ある。命令コード拡張部22は、複数のマルチプレクサ
回路(mux)で構成される。これらマルチプレクサ回
路は、その回路数が、(ワード長命令のビット数)−
(短縮形命令のビット数)に等しくなっている。また、
命令コード拡張部22では、マルチプレクサ入力の一方
に命令コード入力が、他方にはグランドレベル、即ち
“0”が入力されるよう構成され、そして、マルチプレ
クサ回路に対する選択信号としては、命令長判定部21
からの短縮形命令フラッグが入力されるよう構成されて
いる。そして、各マルチプレクサ回路は、短縮形命令フ
ラッグが“0”の場合に各命令コードを、“1”の場合
はグランドレベル、即ち“0”を選択するよう構成され
ている。
FIG. 7 is a block diagram of the instruction code extension unit 22. The instruction code extension unit 22 is composed of a plurality of multiplexer circuits (mux). The number of these multiplexer circuits is (the number of bits of the word length instruction)-
It is equal to (the number of bits of the shortened instruction). Also,
The instruction code expansion unit 22 is configured such that an instruction code input is input to one of the multiplexer inputs and a ground level, that is, “0” is input to the other input, and the instruction length determination unit 21 is used as a selection signal for the multiplexer circuit.
The short instruction flag from is input. Each multiplexer circuit is configured to select each instruction code when the shortened instruction flag is "0" and select the ground level, that is, "0" when the shortened instruction flag is "1".

【0032】また、マルチプレクサ回路の出力は拡張さ
れた命令コードとして命令実行部30に出力される。そ
して、マルチプレクサ回路に対する選択信号としては、
命令長判定部21からの短縮形命令フラッグが入力され
るよう構成されている。
The output of the multiplexer circuit is output to the instruction executing section 30 as an extended instruction code. Then, as the selection signal for the multiplexer circuit,
The short instruction flag is input from the instruction length determination unit 21.

【0033】また、命令実行部30は、命令メモリ部1
0に対して任意の命令アドレスを指定し、そのアドレス
に対応した命令コードを命令コード変換部20より受け
取るものであり、上述したように、ワード長命令、およ
び短縮形命令の2種の識別を行う機能はなく、全ての命
令はワード長命令、即ち、フルセットの動作指定を行う
命令コードを実行する機能のみで構成されている。
The instruction executing section 30 also includes an instruction memory section 1.
An arbitrary instruction address is designated with respect to 0, and the instruction code corresponding to the address is received from the instruction code conversion unit 20. As described above, two types of identification, that is, a word length instruction and a shortened instruction, are identified. There is no function to perform, and all the instructions are composed only of a word length instruction, that is, a function to execute an instruction code that specifies a full set of operations.

【0034】[動作]図1に示すように、命令長判定部
21には命令実行部30から命令アドレスが入力され
る。命令長判定部21は、この命令アドレスが、ワード
長命令メモリ領域11および短縮形命令メモリ領域12
のどちらを示すかを調べることで命令長判定を行う。こ
こで、命令アドレスが、短縮形命令メモリ領域12から
の命令読み出し、即ち、短縮形命令の読み出しを示す場
合には、命令長判定部21から短縮命令フラッグがアサ
ートされ“1”となる。命令コード拡張部22は、この
短縮命令フラッグが“1”の場合に、短縮形命令メモリ
領域12から入力される命令コードを拡張して命令実行
部30に出力する。一方、短縮命令フラッグが“0”の
場合には、ワード長命令メモリ領域11から入力される
命令コードをそのまま命令実行部30に出力する。
[Operation] As shown in FIG. 1, the instruction address is input from the instruction execution unit 30 to the instruction length determination unit 21. The instruction length determining unit 21 determines that the instruction address is the word length instruction memory area 11 and the shortened instruction memory area 12
The instruction length is determined by checking which of the two is shown. Here, when the instruction address indicates instruction reading from the shortened instruction memory area 12, that is, reading of the shortened instruction, the shortened instruction flag is asserted from the instruction length determination unit 21 and becomes “1”. When the shortened instruction flag is “1”, the instruction code expansion unit 22 expands the instruction code input from the shortened instruction memory area 12 and outputs it to the instruction execution unit 30. On the other hand, when the shortened instruction flag is “0”, the instruction code input from the word length instruction memory area 11 is output to the instruction execution unit 30 as it is.

【0035】命令長判定部21における命令長判定は以
下のように行われる。図6に示す境界アドレスレジスタ
21aにはワード長命令メモリ領域11と短縮形命令メ
モリ領域12の境界アドレスを設定する。本実施形態で
は、短縮形命令メモリ領域12のアドレス空間を0〜2
20−1バイト、ワード長命令メモリ領域11のアドレス
空間を220〜221−1として、境界アドレスを220とす
る。即ち、命令アドレス(バイトアドレス)が、 00 0000 0000 0000 0000 0000 〜01 1111 1111 1111 1111 1111 (2進数) に短縮形命令メモリ領域12が配置され、命令アドレス
が、 10 0000 0000 0000 0000 0000 〜11 1111 1111 1111 1111 1111 (2進数) にワード長命令メモリ領域11が配置されるとする。こ
の場合境界アドレスは、 10 0000 0000 0000 0000 0000 (2進数) とし、ワード長命令メモリ領域11の先頭番地を設定す
る。
The instruction length determination in the instruction length determination unit 21 is performed as follows. A boundary address between the word length instruction memory area 11 and the shortened instruction memory area 12 is set in the boundary address register 21a shown in FIG. In this embodiment, the address space of the shortened instruction memory area 12 is 0 to 2
20 -1 bytes, the address space of the word length instruction memory area 11 as a 2 20-2 21 -1, the boundary address and 2 20. That is, the instruction address (byte address) is 00 0000 0000 0000 0000 0000 0000 to 01 1111 1111 1111 1111 1111 (binary number), and the abbreviated instruction memory area 12 is arranged and the instruction address is 10 0000 0000 0000 0000 0000 0000 It is assumed that the word length instruction memory area 11 is arranged at 1111 1111 1111 1111 1111 (binary number). In this case, the boundary address is set to 10 0000 0000 0000 0000 0000 (binary number), and the start address of the word length instruction memory area 11 is set.

【0036】境界アドレスレジスタ21aに対する境界
アドレスの設定は命令実行により行う。命令実行部30
において境界アドレスレジスタ21aへの書き込み命令
が実行されると、データバスに設定すべき境界アドレス
値が出力され、更に境界アドレスレジスタ書き込み信号
がアサートされる。これにより、境界アドレスレジスタ
21aには、設定すべき境界アドレスが設定される。境
界アドレスレジスタ21aは、電源投入直後、最大番
地、即ち、 11 1111 1111 1111 1111 1111 (2進数) に設定されるよう回路構成されている。従って、電源投
入直後から境界アドレスレジスタ21aへの境界アドレ
ス設定までのプログラムは短縮形命令メモリ領域12に
格納されている必要があり、この場合、そのプログラム
は短縮形命令のみで構成される必要がある。
A boundary address is set in the boundary address register 21a by executing an instruction. Instruction execution unit 30
When a write command to the boundary address register 21a is executed at, the boundary address value to be set in the data bus is output, and the boundary address register write signal is asserted. As a result, the boundary address to be set is set in the boundary address register 21a. The boundary address register 21a is configured to be set to the maximum address, that is, 11 1111 1111 1111 1111 1111 (binary number) immediately after the power is turned on. Therefore, the program from immediately after the power is turned on to the setting of the boundary address in the boundary address register 21a needs to be stored in the short instruction memory area 12. In this case, the program needs to be composed of only the short instruction. is there.

【0037】新しく設定する境界アドレスは、境界アド
レスレジスタ21aに設定する命令の直後の命令から有
効となるものとする。比較回路21bは、命令実行部3
0から入力される命令アドレスから境界アドレスレジス
タ21aに設定されている境界アドレスを減じる。結果
が負となる場合には、(命令アドレス<境界アドレス)
であり、命令アドレスは短縮形命令メモリ領域12の領
域を示すことが認識され、短縮形命令フラッグが“1”
にアサートされる。もし、減算結果が負でない場合には
命令アドレスはワード長命令メモリ領域11の領域を示
すことが認識され、この場合には短縮形命令フラッグは
アサートされない、つまり“0”となる。そして、短縮
形命令フラッグは命令コード拡張部22に入力される。
The newly set boundary address becomes valid from the instruction immediately after the instruction set in the boundary address register 21a. The comparison circuit 21b includes the instruction execution unit 3
The boundary address set in the boundary address register 21a is subtracted from the instruction address input from 0. If the result is negative, (instruction address <boundary address)
It is recognized that the instruction address indicates the area of the shortened instruction memory area 12, and the shortened instruction flag is "1".
Asserted to. If the subtraction result is not negative, it is recognized that the instruction address indicates the area of the word length instruction memory area 11, and in this case, the shortened instruction flag is not asserted, that is, "0". Then, the shortened instruction flag is input to the instruction code expansion unit 22.

【0038】命令コード拡張部22では、命令長判定部
21からの短縮形命令フラッグに基づき動作を行う。例
えば、短縮形命令フラッグが“0”の場合には、命令ア
ドレスがワード長命令メモリ領域11(外部メモリ)で
あることを示しているため、ワード長命令メモリ領域1
1から32ビット長のワード長命令が読み出される。そ
して、読み出された命令コードは、命令コード拡張部2
2に入力されるが、短縮形フラッグが“0”であるた
め、マルチプレクサ回路は入力された命令コードをその
まま命令実行部30に出力する。また、命令コード[2
8〜24]、命令コード[21〜18]、命令コード
[15〜12]、および命令コード[7〜0]は、その
ままバスラインから命令コードとして送出される。従っ
て、この場合には図4に示すように、ワード長命令メモ
リ領域11からワード形命令がそのまま命令実行部30
に送られることになる。
The instruction code expansion unit 22 operates based on the shortened instruction flag from the instruction length determination unit 21. For example, when the shortened instruction flag is “0”, it indicates that the instruction address is the word length instruction memory area 11 (external memory). Therefore, the word length instruction memory area 1
A word length instruction with a length of 1 to 32 bits is read. Then, the read instruction code is stored in the instruction code expansion unit 2
2 is input, but since the shortened flag is "0", the multiplexer circuit outputs the input instruction code as it is to the instruction execution unit 30. In addition, the instruction code [2
8 to 24], the instruction code [21 to 18], the instruction code [15 to 12], and the instruction code [7 to 0] are transmitted as they are as instruction codes from the bus line. Therefore, in this case, as shown in FIG. 4, the word-type instruction is directly transferred from the word length instruction memory area 11 to the instruction execution unit 30.
Will be sent to

【0039】一方、短縮形命令フラッグが“1”の場合
には命令アドレスは短縮形命令メモリ領域12を示して
いるため、短縮形命令メモリ領域12(内部メモリ)か
ら21ビット長の短縮形命令が読み出される。読み出さ
れた命令コードは命令コード拡張部22に入力される。
ワード長命令メモリ領域11の出力と短縮形命令メモリ
領域12の出力はバス結合されていて、命令アドレスで
指定されて読み出しアクセスを行う方のメモリからバス
ラインが駆動される。従って、短縮形命令メモリ領域1
2から読み出された命令は短縮形命令であるため32ビ
ットのバスラインのうち21ビットしか駆動しない。
On the other hand, when the shortened instruction flag is "1", the instruction address indicates the shortened instruction memory area 12, so that the shortened instruction having a length of 21 bits from the shortened instruction memory area 12 (internal memory). Is read. The read instruction code is input to the instruction code expansion unit 22.
The output of the word length instruction memory area 11 and the output of the shortened instruction memory area 12 are bus-coupled, and the bus line is driven from the memory designated by the instruction address for read access. Therefore, the shortened instruction memory area 1
Since the instruction read from 2 is a shortened instruction, only 21 bits of the 32-bit bus line are driven.

【0040】短縮形命令メモリ領域12は32ビットの
バスラインである命令コード[31〜00]のうち、命
令コード[28〜24]、命令コード[21〜18]、
命令コード[15〜12]、および命令コード[7〜
0]のみを駆動する。残りの命令コード[31〜2
9]、命令コード[23〜22]、命令コード[17〜
16]、および命令コード[11〜8]は駆動されず、
電気的に高インピーダンス状態となる。これらはマルチ
プレクサ回路に入力されるが入力値は不定となる。この
場合には、マルチプレクサの選択信号である短縮形命令
フラッグは“1”であるため、バスラインから入力され
た不定値は選択されず、マルチプレクサのもう一方の入
力であるグランドレベル、即ち、“0”が選択され出力
される。
The shortened instruction memory area 12 includes instruction codes [28-24], instruction codes [21-18], among instruction codes [31-00] which are 32-bit bus lines.
Instruction code [15-12] and instruction code [7-
0] only. Remaining instruction code [31-2
9], instruction code [23-22], instruction code [17-
16], and the instruction codes [11-8] are not driven,
It is electrically in a high impedance state. These are input to the multiplexer circuit, but the input value is undefined. In this case, since the short instruction flag which is the selection signal of the multiplexer is "1", the undefined value input from the bus line is not selected, and the other input of the multiplexer, that is, the ground level, that is, " 0 "is selected and output.

【0041】従って、短縮形命令メモリ領域12より読
み出した21ビットの短縮形命令は、命令コード[28
〜24] 、命令コード[21〜18] 、命令コード
[15〜12] 、および命令コード[7〜0] のバス
ラインを駆動し、命令コード拡張部22をそのまま通過
し、命令実行部30に出力される。残りの命令コード
[31〜29] 、命令コード[23〜22]、命令コ
ード[17〜16]、および命令コード[11〜8]に
は、命令コード拡張部22から“0”が与えられ、命令
実行部30に出力される。これにより、図5に示すよう
に、短縮形命令がビット挿入されて、標準長命令と等し
い長さとなって出力されるものである。
Therefore, the 21-bit shortened instruction read from the shortened instruction memory area 12 is the instruction code [28
.About.24], instruction code [21-18], instruction code [15-12], and instruction code [7-0], drive the bus lines, pass through the instruction code expansion unit 22 as they are, and pass them to the instruction execution unit 30. Is output. "0" is given from the instruction code extension unit 22 to the remaining instruction codes [31 to 29], instruction code [23 to 22], instruction code [17 to 16], and instruction code [11 to 8]. It is output to the instruction execution unit 30. As a result, as shown in FIG. 5, the shortened type instruction is bit-inserted and is output with the same length as the standard length instruction.

【0042】[効果]以上のように、上記実施形態1で
は、ワード長命令メモリ領域11と短縮形命令メモリ領
域12とを設け、短縮形命令メモリ領域12から読み出
した命令コードに対しては、ビット挿入を行って、ワー
ド長命令メモリ領域11と等しいビット長として命令実
行部30に出力するようにしたので、次のような効果が
ある。
[Effect] As described above, in the first embodiment, the word length instruction memory area 11 and the shortened instruction memory area 12 are provided, and for the instruction code read from the shortened instruction memory area 12, Since bits are inserted and output to the instruction execution unit 30 as a bit length equal to that of the word length instruction memory area 11, the following effects can be obtained.

【0043】即ち、オブジェクトサイズが問題となるよ
うなプログラム、例えばLSI内蔵メモリに格納するよ
うなプログラムの場合には、短縮形命令のみでこれを構
成し、短縮形命令メモリ領域12に格納すれば、その問
題を解決することができる。また、命令実行時間が問題
となるようなプログラム、即ち、命令実行ステップ数を
最小としたいプログラムの場合には、ワード長命令のみ
でこれを構成し、ワード長命令メモリ領域11に格納す
れば、その問題を解決することができる。
That is, in the case of a program in which the object size is a problem, for example, a program to be stored in the LSI built-in memory, if it is composed of only the shortened instruction and stored in the shortened instruction memory area 12. , That problem can be solved. Further, in the case of a program in which the instruction execution time is a problem, that is, a program in which the number of instruction execution steps is desired to be minimized, if this is constituted by only the word length instruction and stored in the word length instruction memory area 11, You can solve the problem.

【0044】また、命令アドレスは標準長命令のサイズ
のみを単位として算出することで、命令アドレス計算を
単純にし、かつ、1回の命令メモリアクセスで必ず命令
コードを読み出すことが可能である。更に、命令実行部
30では、ワード命令長の命令のみを実行するだけでよ
いため、内部回路、および制御の複雑さを回避できる。
しかも、命令コード拡張部22では、1段のマルチプレ
クサの動作のみで短縮形命令をワード長命令に変換する
ことができるため、命令実行サイクル時間の増加を最少
化することが可能である。
Further, by calculating the instruction address only with the size of the standard length instruction as a unit, it is possible to simplify the instruction address calculation and read the instruction code without fail with one instruction memory access. Further, since the instruction execution unit 30 only needs to execute the instruction having the word instruction length, the complexity of the internal circuit and control can be avoided.
Moreover, the instruction code expansion unit 22 can convert the short instruction into the word length instruction only by the operation of the one-stage multiplexer, so that the increase in the instruction execution cycle time can be minimized.

【0045】しかも、短縮形命令メモリ領域12をRO
MとしてLSI内部に格納することで、外部からは見え
ない状態となるため、短縮形命令メモリ領域12のビッ
ト数は任意に設定が可能であり、必要最低限の構成とす
ることができ、低コスト化および消費電力の低減化を図
ることができる。
Moreover, the shortened instruction memory area 12 is RO
By storing it as M inside the LSI, it is invisible from the outside, so the number of bits of the shortened instruction memory area 12 can be set arbitrarily, and the minimum necessary configuration can be achieved. Cost and power consumption can be reduced.

【0046】即ち、本実施形態1の命令処理装置では、
同一のCPUにおいて、命令実行速度を重視するプログ
ラムを構成するためにフルセットの命令コードを使用し
たオブジェクトコードの生成を行うことと、オブジェク
トコードサイズを重視するプログラムを構成するために
命令長を削減したサブセットの命令コードを使用したオ
ブジェクトコードの生成を行うことを両立させ、これに
よって作成された2種のオブジェクトコードを、命令ア
ドレス空間の別の場所にそれぞれ配置することで、命令
読み出し時に両者を識別し、両者を含むひとつのアプリ
ケーションプログラム実行を行うことを可能とする。
That is, in the instruction processing device of the first embodiment,
In the same CPU, an object code is generated using a full set of instruction codes in order to configure a program that emphasizes instruction execution speed, and an instruction length is reduced in order to configure a program that emphasizes object code size. By making it possible to generate the object code using the instruction code of the specified subset, and by arranging the two kinds of object codes created by the instruction code in different places in the instruction address space, both can be read at the time of instruction reading. It is possible to identify and execute one application program including both.

【0047】短縮形命令で構成されたオブジェクトコー
ドは、LSIに内蔵するROM等に格納する場合のオブ
ジェクトコードサイズを削減できる利点がある。また、
この場合、短縮形命令はLSIに内蔵するため、LSI
外部のバスサイズ、あるいはメモリデータ幅とは独立に
任意にそのビット数を決定することができる。
The object code composed of the abbreviated instruction has an advantage that the object code size when it is stored in the ROM or the like built in the LSI can be reduced. Also,
In this case, the short instruction is embedded in the LSI,
The number of bits can be arbitrarily determined independently of the external bus size or the memory data width.

【0048】更に、C言語等の高級言語を用いてソース
プログラムを作成する場合には、ワード長命令で構成さ
れるオブジェクトコード生成機能と短縮形命令で構成さ
れるオブジェクト生成機能とを用意し、実際のソースプ
ログラムをコンパイルして、そのオブジェクトサイズを
評価することで、どちらのオブジェクトコードを採用す
るかを決定する方法が有用である。この方法により短縮
形命令で構成するオブジェクトコードサイズが、個々の
アプリケーションプログラムに対してどの程度削減でき
るのかを評価した後に、LSI内の内蔵ROM作成を行
うことが可能となる。
Further, when a source program is created by using a high-level language such as C language, an object code generating function composed of word length instructions and an object generating function composed of abbreviated instructions are prepared. A method of deciding which object code to adopt by compiling an actual source program and evaluating the object size is useful. According to this method, it is possible to create the internal ROM in the LSI after evaluating how much the object code size formed by the shortened instruction can be reduced for each application program.

【0049】《実施形態2》図8は、本発明の命令処理
装置における実施形態2の構成図である。この実施形態
2と、上記実施形態1の構成との違いは、実施形態1の
命令長判定部21内の境界アドレスレジスタ21aの代
わりに、命令長判定部23内に上限アドレスレジスタ、
および上限アドレスレジスタを設けたことであり、ま
た、命令実行部31からのレジスタ書き込み信号が、境
界アドレスレジスタ書き込み信号の代わりに、上限アド
レスレジスタ書き込み信号、および下限アドレスレジス
タ書き込み信号が設けられた点であり、その他は実施形
態1の構成と同一である。
<< Second Embodiment >> FIG. 8 is a block diagram of a second embodiment of the instruction processing apparatus of the present invention. The difference between the second embodiment and the configuration of the first embodiment is that instead of the boundary address register 21a in the instruction length determination unit 21 of the first embodiment, an upper limit address register in the instruction length determination unit 23,
And the upper limit address register is provided, and the register write signal from the instruction execution unit 31 is provided with the upper limit address register write signal and the lower limit address register write signal instead of the boundary address register write signal. Other than that, the configuration is the same as that of the first embodiment.

【0050】図9は、実施形態2における命令長判定部
23の構成図である。命令長判定部23は、上限アドレ
スレジスタ23a、下限アドレスレジスタ23b、比較
回路(減算器)23c、比較回路(減算器)23d、お
よび論理積回路23eからなる。
FIG. 9 is a block diagram of the instruction length determination unit 23 in the second embodiment. The instruction length determination unit 23 includes an upper limit address register 23a, a lower limit address register 23b, a comparison circuit (subtractor) 23c, a comparison circuit (subtractor) 23d, and a logical product circuit 23e.

【0051】実施形態2では、実施形態1で説明したワ
ード長命令メモリ領域11、および短縮形命令メモリ領
域12の命令アドレス空間上の配置制限を緩和するもの
である。実施形態1では、命令アドレス空間上、「短縮
形命令メモリ領域12<ワード長命令メモリ領域11」
であるような配置を前提とするものであったが、実施形
態2では、命令アドレス空間上、「第1のワード長命令
メモリ領域11a<短縮形命令メモリ領域12<第2の
ワード長命令メモリ領域11b」のような配置を行うこ
とが可能となる。尚、ここで、第1、第2のワード長命
令メモリ領域11a、11bはワード長命令メモリ領域
11と同様、標準長命令のみで構成されるオブジェクト
コードを格納するメモリである。これら第1、第2のワ
ード長命令メモリ領域11a、11bは任意のサイズで
あるとして、上限アドレスレジスタ23a、および下限
アドレスレジスタ3bを設定できるため、短縮形命令メ
モリ領域12を命令アドレス空間上、任意の場所に配置
することが可能である。
In the second embodiment, the restriction on the arrangement of the word length instruction memory area 11 and the shortened instruction memory area 12 in the instruction address space described in the first embodiment is relaxed. In the first embodiment, “shortened instruction memory area 12 <word length instruction memory area 11” in the instruction address space
However, in the second embodiment, “first word length instruction memory area 11a <shortened instruction memory area 12 <second word length instruction memory” is used in the instruction address space. It is possible to make an arrangement such as the area 11b ". The first and second word length instruction memory areas 11a and 11b are memories for storing an object code composed of only standard length instructions, like the word length instruction memory area 11. Assuming that the first and second word length instruction memory areas 11a and 11b have arbitrary sizes, the upper limit address register 23a and the lower limit address register 3b can be set, so that the shortened instruction memory area 12 is set in the instruction address space, It can be placed at any place.

【0052】[動作]実施形態2の基本的な機能、およ
び動作は実施形態1と同一である。実施形態2では、実
施形態1で説明した短縮形命令メモリ領域12の配置を
命令アドレス空間上任意の場所とするために、上限アド
レスレジスタ23aと下限アドレスレジスタ23bを設
けた。上限アドレスレジスタ23aには、短縮形命令メ
モリ領域12の上限アドレスより1大きな値を設定し、
下限アドレスレジスタ23bには、短縮形命令メモリ領
域12の下限アドレスを設定する。
[Operation] The basic functions and operations of the second embodiment are the same as those of the first embodiment. In the second embodiment, the upper limit address register 23a and the lower limit address register 23b are provided in order to arrange the shortened instruction memory area 12 described in the first embodiment at any place in the instruction address space. A value larger than the upper limit address of the shortened instruction memory area 12 by 1 is set in the upper limit address register 23a,
The lower limit address of the shortened instruction memory area 12 is set in the lower limit address register 23b.

【0053】これらのアドレス値の設定はプログラムに
より行い、命令実行部31から入力されるデータバスに
必要な書き込みアドレス値を出力し、更に、上限アドレ
スレジスタ23aに値を設定する場合には、上限アドレ
スレジスタ書き込み信号をアサートし、下限アドレスレ
ジスタ23bに値を設定する場合には、下限アドレスレ
ジスタ書き込み信号をアサートする。
These address values are set by a program, the necessary write address values are output to the data bus input from the instruction execution section 31, and further, when the values are set in the upper limit address register 23a, the upper limit is set. When the address register write signal is asserted and the lower limit address register 23b is set to a value, the lower limit address register write signal is asserted.

【0054】電源投入直後は、上限アドレスレジスタ2
3aには命令アドレス空間の最大値が、また、下限アド
レスレジスタ23bには命令アドレス空間の開始アドレ
スがハードウエアにより自動的に設定される。従って、
電源投入直後から上限アドレスレジスタ23a、下限ア
ドレスレジスタ23bへの境界アドレス設定までのプロ
グラムは短縮形命令メモリ領域12に格納されている必
要があり、この場合そのプログラムは短縮形命令のみで
構成される必要がある。
Immediately after the power is turned on, the upper limit address register 2
The maximum value of the instruction address space is set in 3a, and the start address of the instruction address space is automatically set in the lower limit address register 23b by hardware. Therefore,
The program from immediately after the power is turned on to the setting of the boundary address in the upper limit address register 23a and the lower limit address register 23b needs to be stored in the short instruction memory area 12, and in this case, the program is composed of only the short instruction. There is a need.

【0055】新しく設定する境界アドレスは、境界アド
レスに設定する命令の直後の命令から有効となるものと
する。比較回路23cは、命令実行部31から入力され
る命令アドレスから、上限アドレスレジスタ23aに設
定されている上限アドレスを減じる。結果が負となる場
合には、「命令アドレス<上限アドレス」であり、比較
回路23cの出力は“1”にアサートされ、論理積回路
23eに入力される。比較回路23dは、命令実行部3
1から入力される命令アドレスから下限アドレスレジス
タ23bに設定されている下限アドレスを減じる。結果
が0、または正となる場合には、「下限アドレス≦命令
アドレス」であり、比較回路23dの出力は“1”にア
サートされ、論理積回路23eに入力される。論理積回
路23eへの2つの入力が共に“1”の場合には、「下
限アドレス≦命令アドレス<上限アドレス」であるか
ら、短縮形命令メモリ領域12への命令コードアクセス
であることが認識される。この時、短縮形命令フラッグ
が“1”にアサートされ、論理積回路23eから出力さ
れる。
The newly set boundary address is valid from the instruction immediately after the instruction set to the boundary address. The comparison circuit 23c subtracts the upper limit address set in the upper limit address register 23a from the instruction address input from the instruction execution unit 31. When the result is negative, "instruction address <upper limit address", the output of the comparison circuit 23c is asserted to "1", and is input to the AND circuit 23e. The comparison circuit 23d includes the instruction execution unit 3
The lower limit address set in the lower limit address register 23b is subtracted from the instruction address input from 1. When the result is 0 or a positive result, “lower limit address ≦ instruction address”, the output of the comparison circuit 23d is asserted to “1” and input to the AND circuit 23e. When the two inputs to the logical product circuit 23e are both "1", "lower limit address≤instruction address <upper limit address" is satisfied, and it is recognized that the instruction code access to the shortened instruction memory area 12 is made. It At this time, the short instruction flag is asserted to "1" and output from the AND circuit 23e.

【0056】もし、上記以外の場合にはワード長命令メ
モリ領域11の領域を示すことが認識され、この場合に
は短縮形命令フラッグはアサートされない、つまり
“0”となる。短縮形命令フラッグは命令コード拡張部
22に入力される。ここで、命令コード拡張部22の動
作は実施形態1と同一であり、短縮形命令フラッグが
“0”の場合には入力される命令コード(標準長命令)
をそのまま出力し、また、短縮形命令フラッグが“1”
の場合には入力される命令コード(短縮形命令)にビッ
ト挿入(“0”挿入)を行い出力する。
If other than the above, it is recognized that the word length instruction memory area 11 is shown. In this case, the short instruction flag is not asserted, that is, "0". The shortened instruction flag is input to the instruction code expansion unit 22. Here, the operation of the instruction code extension unit 22 is the same as that of the first embodiment, and when the abbreviated instruction flag is "0", the instruction code (standard length instruction) that is input.
Is output as is, and the shortened instruction flag is "1".
In the case of, the bit is inserted (“0” is inserted) in the input instruction code (shortened instruction) and output.

【0057】[効果]実施形態1の効果は、そのまま実
施形態2でも有効である。更に、実施形態2では、実施
形態1での短縮形命令メモリ領域12(短縮形命令で構
成されるオブジェクトコードを格納する)の命令アドレ
ス空間上の配置制限を緩和し、実施形態1の、短縮形命
令メモリ領域12のアドレス<ワード長命令メモリ領域
11のアドレスという制限を取り除き、実施形態2では
短縮形命令メモリ領域12を命令アドレス空間の任意の
場所に配置することが可能である。
[Effects] The effects of the first embodiment are also valid as they are in the second embodiment. Further, in the second embodiment, the restriction on the arrangement of the shortened instruction memory area 12 (which stores the object code composed of the shortened instruction) in the instruction address space in the first embodiment is relaxed, and the shortened embodiment is shortened. The restriction that the address of the short instruction memory area 12 <the address of the word length instruction memory area 11 is removed, and in the second embodiment, the short instruction memory area 12 can be arranged at any place in the instruction address space.

【0058】[0058]

【発明の効果】以上説明したように、第1発明の命令処
理装置によれば、データ語長ビット数と等しい命令コー
ドを格納するワード長命令メモリ領域と、データ語長ビ
ット数より少ない命令コードを格納する短縮形命令メモ
リ領域とを設け、短縮形命令メモリ領域内の命令コード
に対しては、データ語長ビット数と等しい命令コードと
の差分のビット数を挿入することで、データ語長ビット
数と等しい命令コードとして命令実行部に出力するよう
にしたので、必要に応じて命令長を選択することがで
き、かつ、命令実行時間の短縮化を図ることができる。
As described above, according to the instruction processing apparatus of the first invention, the word length instruction memory area for storing the instruction code equal to the data word length bit number and the instruction code less than the data word length bit number. And a shortened instruction memory area for storing the data word length by inserting a difference bit number between the instruction code in the shortened instruction memory area and the instruction code equal to the data word length bit number. Since the instruction code equal to the number of bits is output to the instruction execution unit, the instruction length can be selected as necessary and the instruction execution time can be shortened.

【0059】また、第2発明の命令処理装置によれば、
予め決定された境界アドレスとの比較により、その命令
が短縮形命令であるか、ワード長命令であるかを判定す
るようにしたので、第1発明の命令処理装置の効果に加
えて、構成が簡単で低コスト化および消費電力の低減化
を図ることができる。
According to the instruction processing device of the second invention,
Since it is determined whether the instruction is a short-form instruction or a word length instruction by comparison with a predetermined boundary address, in addition to the effect of the instruction processing device of the first invention, the configuration is The cost can be reduced easily and the power consumption can be reduced.

【0060】更に、第3発明の命令読み出し装置によれ
ば、予め決定された上限アドレスと下限アドレスとの比
較により、その命令が短縮形命令であるか、ワード長命
令であるかを判定するようにしたので、ワード長命令メ
モリ領域と短縮形命令メモリ領域を命令アドレス空間
上、任意の場所に配置することができる。
Further, according to the instruction reading apparatus of the third aspect of the present invention, it is determined whether the instruction is a shortened instruction or a word length instruction by comparing a predetermined upper limit address and a lower limit address. Therefore, the word length instruction memory area and the shortened instruction memory area can be arranged at arbitrary positions in the instruction address space.

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

【図1】本発明の命令処理装置の実施形態1を示す構成
図である
FIG. 1 is a configuration diagram showing a first embodiment of an instruction processing device of the present invention.

【図2】RISC型命令処理装置で実行される命令フォーマ
ットの説明図である。
FIG. 2 is an explanatory diagram of an instruction format executed by a RISC type instruction processing device.

【図3】ワード長命令/ハーフワード長命令混在オブジ
ェクトコード格納の説明図である。
FIG. 3 is an explanatory diagram of storing a mixed object code of word length instruction / halfword length instruction.

【図4】本発明の命令処理装置の実施形態1で処理する
命令セットのうちのワード長命令のフォーマットと命令
実行状態の説明図である。
FIG. 4 is an explanatory diagram of a format of a word length instruction and an instruction execution state in an instruction set processed by the instruction processing device according to the first exemplary embodiment of the present invention.

【図5】本発明の命令処理装置の実施形態1で処理する
命令セットのうちの短縮形命令のフォーマットと命令実
行状態の説明図である。
FIG. 5 is an explanatory diagram of a format of a short-form instruction and an instruction execution state in an instruction set processed in the first embodiment of the instruction processing device of the present invention.

【図6】本発明の命令処理装置の実施形態1における命
令長判定部の構成図である。
FIG. 6 is a configuration diagram of an instruction length determination unit in the first embodiment of the instruction processing device of the present invention.

【図7】本発明の命令処理装置における命令コード拡張
部の構成図である。
FIG. 7 is a configuration diagram of an instruction code extension unit in the instruction processing device of the present invention.

【図8】本発明の命令処理装置における実施形態2の構
成図である。
FIG. 8 is a configuration diagram of a second embodiment in the instruction processing device of the present invention.

【図9】本発明の命令処理装置の実施形態2における命
令長判定部の構成図である。
FIG. 9 is a configuration diagram of an instruction length determination unit in the second embodiment of the instruction processing device of the present invention.

【符号の説明】[Explanation of symbols]

10 命令メモリ部 11 ワード長命令メモリ領域 12 短縮形命令メモリ領域 21、23 命令長判定部 22 命令コード拡張部 30、31 命令実行部 10 instruction memory unit 11 word length instruction memory region 12 shortened instruction memory region 21, 23 instruction length determination unit 22 instruction code expansion unit 30, 31 instruction execution unit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 任意の命令アドレスを指定して、当該ア
ドレスに対応した命令コードを受け取る命令実行部と、 データ語長ビット数と等しい命令コードを格納するワー
ド長命令メモリ領域と、データ語長ビット数より少ない
命令コードを格納する短縮形命令メモリ領域とからなる
命令メモリ部と、 前記命令実行部からの命令アドレスに基づき、その命令
が短縮形命令であるか、ワード長命令であるかを判定す
る命令長判定部と、 前記命令長判定部の判定結果が短縮形命令であった場合
は、前記短縮形命令メモリ領域内の命令コードを、デー
タ語長ビット数と等しい命令コードとの差分のビット数
を挿入することで、データ語長ビット数と等しい命令コ
ードとして前記命令実行部に出力する命令コード拡張部
とを備えたことを特徴とする命令処理装置。
1. An instruction execution unit for designating an arbitrary instruction address and receiving an instruction code corresponding to the address, a word length instruction memory area for storing an instruction code equal to the number of data word length bits, and a data word length. Based on the instruction address from the instruction execution unit, an instruction memory unit consisting of an abbreviated instruction memory area for storing an instruction code smaller than the number of bits, and whether the instruction is a abbreviated instruction or a word length instruction. A difference between the instruction length determining unit to determine and the instruction code in the shortened instruction memory area when the determination result of the instruction length determining unit is a shortened instruction and the instruction code equal to the data word length bit number. An instruction code expansion unit for outputting to the instruction execution unit an instruction code equal to the data word length bit number by inserting the number of bits of Processing equipment.
【請求項2】 請求項1記載の命令処理装置において、 予め決定された境界アドレスとの比較により、その命令
が短縮形命令であるか、ワード長命令であるかを判定す
る命令長判定部を備えたことを特徴とする命令処理装
置。
2. The instruction processing device according to claim 1, further comprising an instruction length determination unit that determines whether the instruction is a shortened instruction or a word length instruction by comparing with a predetermined boundary address. An instruction processing device characterized by being provided.
【請求項3】 請求項1記載の命令処理装置において、 予め決定された上限アドレスと下限アドレスとの比較に
より、その命令が短縮形命令であるか、ワード長命令で
あるかを判定する命令長判定部を備えたことを特徴とす
る命令処理装置。
3. The instruction processing apparatus according to claim 1, wherein an instruction length for determining whether the instruction is a shortened instruction or a word length instruction by comparing a predetermined upper limit address and a lower limit address. An instruction processing device comprising a determination unit.
JP23765595A 1995-08-23 1995-08-23 Instruction processor Pending JPH0962504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23765595A JPH0962504A (en) 1995-08-23 1995-08-23 Instruction processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23765595A JPH0962504A (en) 1995-08-23 1995-08-23 Instruction processor

Publications (1)

Publication Number Publication Date
JPH0962504A true JPH0962504A (en) 1997-03-07

Family

ID=17018548

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23765595A Pending JPH0962504A (en) 1995-08-23 1995-08-23 Instruction processor

Country Status (1)

Country Link
JP (1) JPH0962504A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801996B2 (en) 2000-02-08 2004-10-05 Kabushiki Kaisha Toshiba Instruction code conversion unit and information processing system and instruction code generation method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801996B2 (en) 2000-02-08 2004-10-05 Kabushiki Kaisha Toshiba Instruction code conversion unit and information processing system and instruction code generation method

Similar Documents

Publication Publication Date Title
US5784585A (en) Computer system for executing instruction stream containing mixed compressed and uncompressed instructions by automatically detecting and expanding compressed instructions
US4825355A (en) Instruction format for program control type data processing systems
US4450519A (en) Psuedo-microprogramming in microprocessor in single-chip microprocessor with alternate IR loading from internal or external program memories
US4403284A (en) Microprocessor which detects leading 1 bit of instruction to obtain microcode entry point address
EP0221577B1 (en) Microprogram control unit
EP0199173B1 (en) Data processing system
US4954943A (en) Data processing system
US7546442B1 (en) Fixed length memory to memory arithmetic and architecture for direct memory access using fixed length instructions
JP2001092662A (en) Processor core and processor using the same
US7853773B1 (en) Program memory space expansion for particular processor instructions
US5301338A (en) System including central processing unit
KR20060028403A (en) Data access program instruction encoding
JP3578735B2 (en) Information processing apparatus and information processing method
US20170329603A1 (en) Conditional selection of data elements
JPH0962504A (en) Instruction processor
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
JP3570287B2 (en) Microcomputer
JPH03271829A (en) Information processor
KR101220423B1 (en) Method for specifying an immediate value in an instruction
JPS6355634A (en) Data processing system
JP2000039995A (en) Flexible accumulate register file to be used in high performance microprocessor
JP2525492B2 (en) Programmable controller
US5463747A (en) Microprogram data processor processing operand address calculation and instruction execution with common hardware
JPH10187790A (en) Logic circuit simulator
EP0232797A2 (en) Pseudo-microprogramming in microprocessor with compressed control ROM and with strip layout of busses, alu and registers