JPH02259832A - Data processor - Google Patents
Data processorInfo
- Publication number
- JPH02259832A JPH02259832A JP1078204A JP7820489A JPH02259832A JP H02259832 A JPH02259832 A JP H02259832A JP 1078204 A JP1078204 A JP 1078204A JP 7820489 A JP7820489 A JP 7820489A JP H02259832 A JPH02259832 A JP H02259832A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- field
- accumulator
- operand
- register
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は主にマイクロプロセッサ(M)’LJ)のアー
キテクチャに係り、特に、高級言語プログラムに好適な
命令形式、及び、レジスタ構成に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention mainly relates to the architecture of microprocessors (M'LJ), and particularly to an instruction format and register configuration suitable for high-level language programs.
従来技術の例としてインテル社の32ビットマイクロプ
ロセツサ80386を用いて説明する。As an example of the prior art, a 32-bit microprocessor 80386 manufactured by Intel Corporation will be used.
汎用レジスタとしてレジスタEAX、EBX。Registers EAX and EBX as general-purpose registers.
ECX、El)Xがあり、レジスタEAXがアキューム
レータである。ECX, El)X, and register EAX is an accumulator.
暗黙にアキュームレータを指定できる(短縮形)命令は
、以ドの様に限定されている。転相命令ではメモリとの
転送においてのみ指定できる。算術/論理演算命令では
イミデイエイトとの演算においてのみ指定できる。また
、乗除算命令ではオペランドの片方はアキュームレータ
に限られている。The (abbreviated) commands that can implicitly specify an accumulator are limited to the following. Phase inversion instructions can only be specified in transfers to and from memory. For arithmetic/logical operation instructions, this can be specified only in operations with immediates. Furthermore, in multiplication/division instructions, one of the operands is limited to an accumulator.
この詳細な仕様については、インテル社1988年発行
のマイクロプロセッサ アンド ペリフェラル ハンド
ブック第1巻4−107頁から127頁に示されている
。The detailed specifications are shown in Microprocessor and Peripheral Handbook Vol. 1, pp. 4-107 to 127, published by Intel Corporation in 1988.
一般に、暗黙にアキュームレータを相定する命令形式の
方が汎用アドレッシングモードな使ってアキュームレー
タを指定する場合に比べて、命令長が短くなり、また、
実行時間も短くなる。そこで、高級言語コンパイラにお
いては、暗黙に指定する命令形式を生成する様にしてい
る。しかし、上記の様に80386ではアキュームレー
タを暗黙にアクセスできる命令が限られている。その他
の命令では汎用レジスタのFAXとしてアキュームレー
タを指定する必要がある。したがって、Ilb級言諸言
語コンパイラいて命令コードを生成するとき複雑な処理
が必要になる。つまり、命令の機能に応じて暗黙にアキ
ュームレータを指定できるか否かを判断しながら、命令
コードを決定しなければならない。In general, the instruction format that implicitly specifies the accumulator has a shorter instruction length than the instruction format that specifies the accumulator using general-purpose addressing mode.
Execution time is also shorter. Therefore, high-level language compilers generate instruction formats that are implicitly specified. However, as mentioned above, the 80386 has a limited number of instructions that can implicitly access the accumulator. For other instructions, it is necessary to specify the accumulator as the general-purpose register FAX. Therefore, when Ilb class language compilers generate instruction codes, complicated processing is required. In other words, the instruction code must be determined while determining whether or not the accumulator can be implicitly specified depending on the function of the instruction.
同様に他の従来の32ビットマイクロプロセツサにおい
ても、命令の機能に無関係にアキュームレータを暗黙に
指定することはできなかった。Similarly, in other conventional 32-bit microprocessors, it is not possible to implicitly specify an accumulator regardless of the function of an instruction.
そのため、高級言語コンパイラにおいて命令コードを生
成するとき複雑な処理が必要であった。Therefore, complicated processing is required when generating instruction codes in a high-level language compiler.
また、アキュームレータを汎用アドレッシングモードで
アクセスして直交性を保っていたが、この場合、命令コ
ードの中にアキュームレータを指すアドレスフィールド
が必要になり、命令コードの増大を招いていた。In addition, orthogonality was maintained by accessing the accumulator in a general-purpose addressing mode, but in this case, an address field pointing to the accumulator was required in the instruction code, resulting in an increase in the instruction code.
そこで1本発明の目的は、直交性を保ちながらアキュー
ムレータの指定が可能な命令体系を提供することにある
。Therefore, one object of the present invention is to provide an instruction system capable of specifying an accumulator while maintaining orthogonality.
上記の目的は、
(1)全ての命令において汎用アドレッシングで指定さ
れたオペランドとアキュームレータとの間の処理を可能
にし、
(2)演算結果をアキュームレータに格納するのか、ま
たは、汎用アドレッシングで指定されたデイテイネーシ
ョンオペランドの位置に格納するのかを示すフラグ命令
のビットフォーマットの一部としてもち、
(3)命令中の上記フラグを検出する手段をもち、(4
)上記検出手段に従って演算結果を格納する制御回路を
もつことにより、達成される。The purpose of the above is (1) to enable processing between the operand specified by general-purpose addressing and the accumulator in all instructions, and (2) to store the operation result in the accumulator or (3) has means for detecting the flag in the instruction; (4) has means for detecting the flag in the instruction;
) This is achieved by having a control circuit that stores the calculation results according to the detection means.
変数Xと変数Yの和を変数Zに格納する場合についてア
センブラプログラムで表わすと以下の様になる。The case where the sum of variable X and variable Y is stored in variable Z is expressed in an assembler program as follows.
LD x (1)AD
D Y (2)ST
Z (:1)(1)はロ
ード命令で、変数Xの内容をアキュームレータにセット
することを示している。LD x (1) AD
D Y (2) ST
Z (:1) (1) is a load instruction and indicates that the contents of variable X are set in the accumulator.
(2)は加算命令で、変数Yの内容とアキューlル−タ
の内容を加算して、その結果をアキューlル−タにセッ
トすることを示している。(2) is an addition instruction which indicates that the contents of the variable Y and the contents of the AccuL router are added, and the result is set in the AccuL router.
(3)はストア命令で、アキュームレータの内容を変数
Zに格納することを示している。(3) is a store instruction, which indicates that the contents of the accumulator are stored in variable Z.
上記の様にシンプルな命令列で記述することができる。It can be written using a simple sequence of instructions as shown above.
また、変数Xと変数Yの和を変数Yに格納する場合につ
いてアセンブラプログラムで表わすと以下の様になる。Furthermore, the case where the sum of variables X and Y is stored in variable Y is expressed in an assembler program as follows.
LL) X (4)A
Do/ST y (5)(4)は
ロード命令で、変数Xの内容をアキュームレータにセッ
トすることを示している。LL)X (4)A
Do/ST y (5) (4) is a load instruction and indicates that the contents of variable X are set in the accumulator.
(5)は加算命令で、変数Yの内容とアキュームレータ
の内容を加算して、その結果を変数Yにセットすること
を示している。(5) is an addition instruction, which indicates that the contents of variable Y and the contents of the accumulator are added, and the result is set in variable Y.
上記の様にシンプルな命令列で記述することができる。It can be written using a simple sequence of instructions as shown above.
なお、命令ニモニック/ S Tは演算結果を汎用アド
レッシングで指定されたオペランドへ格納することを示
す。Note that the instruction mnemonic /ST indicates that the operation result is stored in the operand specified by general-purpose addressing.
以ド、本発明の一実施倒を図を用いて説明する。 Hereinafter, one implementation of the present invention will be explained using the drawings.
第1図は本実施例のデータ処理装置の内部構成の一例を
示すブロック図である。レジスタファイル610は32
ビットデ一タ幅のレジスタ16本から成るレジスタファ
イルであり、内部データバス620,621,622に
図のように接続されている。RO611は演算用アキュ
ームレータAccD、R1612はアドレス計算用アキ
ュームレータA c a Aとして使われる。また、R
14613はフレームポインタFP、R15614はス
タックポインタS)’、619はプロタラムカウンタP
Cとして使われる。ALU630も32ビット幅の演算
器で人力データの加減算等の算術演算の他、論理演算も
実行できる。MAR640はメインメモリ645のアク
セスアドレスを保持するレジスタである。この内容は外
部アドレスバス641を経由してメインメモリ645へ
送られる。MDR642はメインメモリ645へ書き込
むデータまたはメインメモリ645から読み出したデー
タを保持するレジスタである。外部データバス643を
介してメインメモリ645とのデータ転送を行なう、命
命レジスタ650はメインメモリ645から読み出した
命令を保持するレジスタである。OPコードデコーダ6
60は命令レジスタ650のOPフィールド110を解
読して、その結果を制御回路680へ転送する。EAモ
ードデコーダ670は命令レジスタ650のEAフィー
ルド120を解読して、その結果を制御回路680へ転
送する。制御回路680は上記のデコード結果の他、命
令レジスタ650のDフィールド130を用いて、レジ
スタファイル610や演算器630らを制御し、命令レ
ジスタ650にボされた処理を実行していく。FIG. 1 is a block diagram showing an example of the internal configuration of the data processing device of this embodiment. The register file 610 is 32
This is a register file consisting of 16 registers with a bit data width, and is connected to internal data buses 620, 621, and 622 as shown in the figure. RO611 is used as an accumulator AccD for calculations, and R1612 is used as an accumulator A c a A for address calculations. Also, R
14613 is frame pointer FP, R15614 is stack pointer S)', 619 is protarum counter P
Used as C. The ALU 630 is also a 32-bit wide arithmetic unit that can perform not only arithmetic operations such as addition and subtraction of human data but also logical operations. MAR 640 is a register that holds the access address of main memory 645. This content is sent to main memory 645 via external address bus 641. The MDR 642 is a register that holds data written to the main memory 645 or data read from the main memory 645. An instruction register 650 that transfers data to and from the main memory 645 via the external data bus 643 is a register that holds instructions read from the main memory 645. OP code decoder 6
60 decodes the OP field 110 of the instruction register 650 and transfers the result to the control circuit 680. EA mode decoder 670 decodes the EA field 120 of instruction register 650 and forwards the result to control circuit 680. In addition to the decoding results described above, the control circuit 680 uses the D field 130 of the instruction register 650 to control the register file 610, the arithmetic unit 630, etc., and executes the processing written in the instruction register 650.
第2図は本実施例の命令フォーマットである。FIG. 2 shows the instruction format of this embodiment.
命令長は16ビット固定長で、アドレッシングモードに
応じて16ビットまたは32ビットの拡張部がこの後ろ
に付く、命令フォーマットは、8ビットのOPフィール
ド110.1ビットのDフィールド120.7ビットの
EAフィールド130に分かれている。OPフィールド
110はオペレーションフィールドであり、後述の第3
図に示す様に命令コード(オペレーションコード)を示
す。The instruction length is a fixed 16-bit length, followed by a 16-bit or 32-bit extension depending on the addressing mode.The instruction format is an 8-bit OP field, 110 bits, a 1-bit D field, 120 bits, and a 7-bit EA. It is divided into fields 130. The OP field 110 is an operation field, which will be described later.
As shown in the figure, instruction codes (operation codes) are shown.
1)(ディレクション)フィールド120は演算結果の
格納先を示す。EA(実効アドレス)フィールド130
は汎用レジスタ610もしくはメインメモリ645の実
効アドレス情報を示す。1) (Direction) field 120 indicates the storage location of the calculation result. EA (effective address) field 130
indicates effective address information of general-purpose register 610 or main memory 645.
本実施例では1つの命令は上記のO)’、13゜EAの
順序で記述され、
OP/l) EA
と表わされる。これをニモニックコードと呼ぶ。In this embodiment, one instruction is written in the above order of O)', 13°EA, and is expressed as OP/l)EA. This is called a mnemonic code.
OPフィールド110の内容を第3図に示す。The contents of the OP field 110 are shown in FIG.
Dフィールド120は主に結果の格納場所を指定するこ
とに使われている。例えば、At)l) (加算)命令
の場合、D=Oならば、
AccD+(EA)→A c c D
D=1ならば、
AccD+(EA)→(EA)
となる、SUB (減算)命令やAND (論理積)命
令も同様である。The D field 120 is mainly used to specify the storage location of the results. For example, in the case of At)l) (addition) instruction, if D=O, AccD+(EA)→A c c D If D=1, AccD+(EA)→(EA), SUB (subtraction) instruction The same applies to AND (logical product) instructions.
ここで、(EA)とはEAフィールド130で指定され
たオペランドを表わす。また、「→」印は左辺の値を右
辺のオペランドの鉋とすることを示している。Here, (EA) represents the operand specified in the EA field 130. Also, the "→" mark indicates that the value on the left side is the value of the operand on the right side.
S’l’(ストア)命令の場合は、D=Oならば、A
c c D−+(E A)
D=1ならば、
A c c A−)(E A)
となる。In the case of S'l' (store) instruction, if D=O, then A
cc D-+(EA) If D=1, then A cc A-)(EA).
Ll)(ロード)命令の場合は、1)=Oならば、(E
A)→A c c D
1)=1ならば、
(E A)→A c c A
となる。In the case of Ll) (load) instruction, if 1)=O, then (E
If A)→A c c D 1)=1, then (E A)→A c c A.
LDA(ロードアドレス)命令の場合は、I)=Oなら
ば、E A −+ A c c D
D=1ならば、
E A −+ A a c A
となる。In the case of an LDA (load address) instruction, if I)=O, then E A −+ A c c DD; if D=1, E A −+ A a c A.
ここで、EAとはEAフィールド130で指定されたオ
ペランドのアドレスを表わす。Here, EA represents the address of the operand specified in the EA field 130.
JUMP (ジャンプ)命令の場合は、D=Oならば、
EA−+PC
D=1ならば。In the case of a JUMP instruction, if D=O,
If EA-+PC D=1.
(E A)→pc となる。(E A) → pc becomes.
ここで、PCとは命令のアドレスを示すプログラムカウ
ンタである。Here, PC is a program counter that indicates the address of an instruction.
B / c c (条件付き分岐)命令の場合は、D=
Oならば、ccが成立するときに、EA−)PC
l)=1ならば、
ccが成立しないときに、EA−))’Cとなる。ここ
で、ccはB命令のcccフィールド310で示される
分岐条件である。For B/c c (conditional branch) instructions, D=
If O, then when cc holds, EA-)PC l)=1, when cc does not hold, EA-))'C. Here, cc is a branch condition indicated by the ccc field 310 of the B instruction.
JSR(サブルーチンジャンプ)命令の場合は、1つ=
0ならば、next PC−+PUSH,EA−+
PCD=1ならば、
next PC−+PUSH,FP−+PUS
H。For JSR (subroutine jump) instructions, one =
If 0, next PC-+PUSH, EA-+
If PCD=1, next PC-+PUSH, FP-+PUS
H.
SP−+F’P、EA−+PC となる。SP-+F'P, EA-+PC becomes.
ここで、next PCとはJSR命令の後ろに続く
命令のアドレスである。また、PUSH(ブツシュ)と
はスタックポインタSPの内容を4減らして、新しいス
タックポインタSPが指すアドレスにストアすることで
ある。Here, next PC is the address of the instruction following the JSR instruction. Further, PUSH means to reduce the contents of the stack pointer SP by 4 and store it at the address pointed to by the new stack pointer SP.
RTS (リターン)命令の場合は、 1)=Oならば
、PoP→PC
D=1ならば、
POP−+FP、pop−+pc
となる。In the case of an RTS (return) instruction, if 1)=O, PoP→PC; if D=1, POP-+FP, pop-+pc.
ここで、POP、(ポツプ)とはスタックポインタSP
が指すアドレスからフェッチして、その後、スタン・ク
ポインタ81−1の内容を4増やすことである。Here, POP is the stack pointer SP
, and then increment the contents of the stand point pointer 81-1 by 4.
EAフィールド130の内容を第4図に示す。The contents of the EA field 130 are shown in FIG.
第4図において、RnとはEAフィールド130のうち
、4ビットのフィールドnnnnで示された第n4目の
汎用レジスタの内容をさす。In FIG. 4, Rn indicates the contents of the n4th general-purpose register indicated by the 4-bit field nnnn in the EA field 130.
(aaa)とは丸カッコ内のaaaをアドレスとするメ
モリの内容をオペランドとすることを示す。(aaa) indicates that the contents of the memory whose address is aaa in parentheses are used as the operand.
したがって、(Rn)とは汎用レジスタRnの内容をア
ドレスとするメモリの内容をオペランドとすることを示
す。また、(Rn+disρ16)とは汎用レジスタR
nの内容と16ビットデイスプレースメントとの和をア
ドレスとするメモリの内容をオペランドとすることを示
す。Therefore, (Rn) indicates that the contents of the memory whose address is the contents of the general-purpose register Rn are used as the operand. Also, (Rn+disρ16) is general-purpose register R
This indicates that the operand is the contents of the memory whose address is the sum of the contents of n and the 16-bit displacement.
(Ac cA+Rn 申2)とはアドレス計算用アキュ
ームレータA c c A 612の内容と汎用レジス
タRnの内容を2倍した値との和をアドレスとするメモ
リの内容をオペランドとすることを示す。(Ac cA+Rn 2) indicates that the operand is the contents of the memory whose address is the sum of the contents of the address calculation accumulator A c c A 612 and the value obtained by doubling the contents of the general-purpose register Rn.
disp16または1mm16があるアドレッシングモ
ードでは、16ビットの基本部100の後ろに16ビッ
トの拡張部140が付く。また、disp32または1
mm32があるアドレッシングモードでは、16ビット
の基本部100の後ろに:32ビットの拡張部150が
付く。In the addressing mode with disp16 or 1mm16, a 16-bit basic part 100 is followed by a 16-bit extended part 140. Also, disp32 or 1
In an addressing mode with mm32, a 16-bit basic part 100 is followed by a :32-bit extension part 150.
POP/PUSHとはオペランドがソースオペランドの
場合はpop (ポツプ)、デスティネーションオペラ
ンドの場合はPUSH(ブツシュ)として動作すること
を示す。ここで、FOP (ポツプ)とはスタックポイ
ンタSPが指すアドレスからフェッチして、その後、ス
タックポインタSPの内容を4増やすことである。PU
SH(ブツシュ)とはスタックポインタS)Jの内容を
4減らして、新しいスタックポインタSPが指すアドレ
スにストアすることである。POP/PUSH indicates that the operand operates as a pop when it is a source operand, and as a PUSH when it is a destination operand. Here, FOP means fetching from the address pointed to by the stack pointer SP, and then increasing the contents of the stack pointer SP by 4. P.U.
SH means to reduce the contents of the stack pointer S)J by 4 and store it at the address pointed to by the new stack pointer SP.
(FP+8+nn *4)はEAフィールド130のう
ち右端の2ビットのフィールドnnの値を4倍して、フ
レームポインタFP613の内容と8との和をアドレス
するメモリの内容をオペランドすることを示す。これは
サブルーチンの引き数をスタックフレーム内に確保した
場合に、その引き数をアクセスするのに使われる。なお
この場合、ドPが示すアドレスには親ルーチンのドPの
値がセーブされている。また、F″P+4か示すアドレ
スには親ルーチンの戻り番地がセーブされている。(FP+8+nn *4) indicates that the value of the rightmost 2-bit field nn in the EA field 130 is multiplied by 4, and the contents of the memory that addresses the sum of the contents of the frame pointer FP613 and 8 are operanded. This is used to access subroutine arguments when they are allocated in the stack frame. In this case, the value of doP of the parent routine is saved at the address indicated by doP. Further, the return address of the parent routine is saved at the address indicated by F''P+4.
ト” P + 8が示すアドレスには第1の引き数がセ
ーブされており、以ト、第2.第3の引き数かセーブさ
れている。一方、I” P −4が示すアドレスには第
1の局所変数の領域、)” P −8が示すアドレスに
は第2の局所変数の領域が確保されている。The first argument is saved at the address indicated by I'P+8, and the second and third arguments are also saved.On the other hand, the address indicated by I'P-4 is saved. The area for the second local variable is reserved at the address indicated by "first local variable area, )" P-8.
(FP−4−nn*4)はEAフィールド130のうち
右端の2ビットのフィールドnnの値を4倍して、フレ
ームポインタFP613の内岑から減算し、更に4を引
いた値をアドレスとするメモリの内容をオペランドとす
ることを示す。これは上記のように局所変数をスタック
に確保したとき、その引き数をアクセスするのに使われ
る。(FP-4-nn*4) multiplies the value of the rightmost 2-bit field nn in the EA field 130 by 4, subtracts it from the inner value of the frame pointer FP613, and then subtracts 4 to obtain the address. Indicates that the contents of memory are used as operands. This is used to access the argument when a local variable is allocated on the stack as described above.
第5図はffW ’になプログラムの例を示す。FIG. 5 shows an example of a program for ffW'.
第5図(a)は汎用レジスタR2の内容と、レジスタR
3でアドレスを示されたメモリの内容を加算して、(レ
ジスタR4+disρ16)でアドレスを示されたメモ
リ領域に結果を格納することを示している。コードサイ
ズは2+2+4=8バイトである。これは;3オペラン
ド演算の例である。Figure 5(a) shows the contents of general-purpose register R2 and register R.
3 indicates that the contents of the memory whose address is indicated are added and the result is stored in the memory area whose address is indicated by (register R4+disρ16). The code size is 2+2+4=8 bytes. This is an example of a three-operand operation.
第5図(b)は汎用レジスタr< 2の内容と、レジス
タR3でアドレスを示されたメモリの内容を加算して、
レジスタR3でアドレスを刀くされたメモリ領域に結果
を格納することを示している。コードサイズは2+2=
4バイトである。これは2オペランド演算の例である。FIG. 5(b) shows the addition of the contents of general-purpose register r<2 and the contents of the memory whose address is indicated by register R3.
This indicates that the result is stored in the memory area whose address is set by register R3. Code size is 2+2=
It is 4 bytes. This is an example of a two-operand operation.
第5図(c)は、(PC+displ 6+R2*4)
でアドレスを示されたメモリの内容を演算用アキューム
レータA c c Dにロー1くすることを小しでいる
。コードサイズは4+2=6バイトであるにれはインデ
クスアドレッシングモードの例である。Figure 5(c) is (PC+displ 6+R2*4)
The content of the memory indicated by the address is set to low 1 in the arithmetic accumulator A c c D. The code size is 4+2=6 bytes. This is an example of index addressing mode.
第5図(d)は、 (R2+displ 6 L)で
アドレスを示されたメモリの内容にdisp16 2を
加算したアドレスで示されたメモリの内容を演算用アキ
ュームレータA c c Dにロードすることを示して
いる。コードサイズは4+4=8バイトである。FIG. 5(d) shows that the contents of the memory indicated by the address obtained by adding disp162 to the contents of the memory indicated by the address (R2+displ 6 L) are loaded into the arithmetic accumulator A c c D. ing. The code size is 4+4=8 bytes.
これは2重インダイレクトアドレッシングモートの例で
ある。This is an example of a dual indirect addressing mote.
本実施例の命令形式によれば、JSR命令やR′rS命
令でフレームポインタト”Pの更新が指定できるので、
高級百語のプロシジャ−コール/リターン時の処理が六
′h速に行なうことができる。According to the instruction format of this embodiment, it is possible to specify the update of the frame pointer "P" with the JSR instruction or the R'rS instruction.
High-level procedure call/return processing can be performed at 6'h speed.
また、3オペランド命令を最短6バイトで実現でき、コ
ードサイズの縮tJzに効果がある。Furthermore, a 3-operand instruction can be realized in a minimum of 6 bytes, which is effective in reducing the code size.
更に、変数Xと変数Yの和に変数Zを掛けて、その結果
を変数Zに格納する場合((x+y)*z→Z)を考え
ると、本発明の実施例では。Furthermore, considering the case where the sum of variable X and variable Y is multiplied by variable Z and the result is stored in variable Z ((x+y)*z→Z), in the embodiment of the present invention.
L D / A c c D X
ADD/AccD Y
MUL/ST Z
と、3命令で実行することができる。しかし、インテル
社の80386のような従来のマイクロプロセッサでは
、乗算命令の結果を汎用アドレスフィールドで示される
場所ヘスドアすることができないので、
MOV X、FAX
ADI) Y、FAX
MUL Z、FAX
MOV EA、X、Z
と、4命令に分けないと実行できない。It can be executed with three instructions: L D / A c c D X ADD / Acc D Y MUL / ST Z. However, conventional microprocessors such as Intel's 80386 cannot store the result of a multiplication instruction in the location indicated by the general address field, so MOV X, FAX ADI) Y, FAX MUL Z, FAX MOV EA, It cannot be executed unless it is divided into four instructions, X and Z.
第6図は制御回路680の動作を’)1e Lだフロー
チャートである。初期ルーチン゛710の後、EAフィ
ールド130がレジスタ直接モードの場合は直接命令実
行ルーチン740を実行し、EAフィールド130がメ
モリ参照モードの場合は、EA計算ルーチン730を実
行した後、命令実行ルーチン740を実行する。FIG. 6 is a flowchart showing the operation of the control circuit 680. After the initial routine 710, if the EA field 130 is in register direct mode, a direct instruction execution routine 740 is executed; if the EA field 130 is in memory reference mode, after executing the EA calculation routine 730, the instruction execution routine 740 is executed. Execute.
初期ルーチン710の内容を第7図に示す。The contents of the initial routine 710 are shown in FIG.
ステップ810ではP C(命令アドレス)619をM
AR640に転送し、メインメモリ645がら命令を読
み出す。In step 810, the PC (instruction address) 619 is
The instruction is transferred to the AR 640 and read from the main memory 645.
ステップ820ではML)R642に読み出された命令
を命令レジスタlR650にセットし。In step 820, the instruction read into the ML)R642 is set in the instruction register 1R650.
P’C619を更新する。Update P'C619.
ステップ830では命令レジスタ650の内容をOPコ
ードデコーダ660及びEAモードデコーダ670でデ
コードする。In step 830, the contents of the instruction register 650 are decoded by the OP code decoder 660 and the EA mode decoder 670.
EA計算ルーチン730の内容の一部を第8図に示す。A part of the contents of the EA calculation routine 730 is shown in FIG.
EA計算ルーチン730はメモリ参照時のアドレスをA
LU630に計ヤする。EAモードデコーダ670のデ
コード結果により、それぞれ独立のルーチンを実行する
。The EA calculation routine 730 sets the address when referencing the memory to A.
Calculate on LU630. Depending on the decoding results of the EA mode decoder 670, independent routines are executed.
第8図(a)はレジスタ間接モード時の処理ルーチンで
ある。EAフィールド130で指示されたレジスタの内
容をALU630に代入する。FIG. 8(a) shows a processing routine in register indirect mode. The contents of the register indicated by the EA field 130 are assigned to the ALU 630.
第8図(b)はディスプレースメント付きレジスタ間接
モード時の処理ルーチンである。FIG. 8(b) shows a processing routine in register indirect mode with displacement.
ステップ920ではPC(命令レジスタ)619をMA
R640に転送し、メインメモリ645からディスプレ
ースメントを読み出す。In step 920, the PC (instruction register) 619 is
Transfer to R640 and read the displacement from main memory 645.
ステップ930では)’C619を更新する。In step 930) 'C619 is updated.
ステップ940ではMDR642に読み出されたディス
プレースメントとEAフィールド130で指示されたレ
ジスタの内容をALU630で加算する。In step 940, the ALU 630 adds the displacement read into the MDR 642 and the contents of the register indicated by the EA field 130.
第8図(Q)はスケール付きインデクスモード時の処理
ルーチンである。EAフィールド130で指示されたレ
ジスタの内容をALU630の片方の入力側に付いてい
るシフタ631によって、2ビット右にシフトしたもの
と、アドレス計算用アキュームレータA c c A
612の内容をAL[J630で加算する。FIG. 8(Q) is a processing routine in the scaled index mode. The contents of the register specified by the EA field 130 are shifted 2 bits to the right by the shifter 631 attached to one input side of the ALU 630, and the address calculation accumulator A c c A
Add the contents of 612 with AL[J630.
命令実行ルーチン740の内容の一部を第9図に示す。A part of the contents of the instruction execution routine 740 is shown in FIG.
命令実行ルーチン730は○Pコードデコーダ660の
デコード結果により、それぞれ独立のルーチンを実行す
る。The instruction execution routines 730 execute independent routines depending on the decoding results of the ○P code decoder 660.
第9図(a)はAl)l)命令の処理ルーチンである。FIG. 9(a) is a processing routine for the Al)l) instruction.
EAモードデコーダ670のデコード結果により、レジ
スタ直接モードの場合はステップ1010を実行し、メ
モリ参照モードの場合はステップ1013を実行する。Depending on the decoding result of the EA mode decoder 670, step 1010 is executed in the case of register direct mode, and step 1013 is executed in case of memory reference mode.
ステップ1010では8JL算用アキユームレータA
c c D 611とEAフィールド130で指示され
たレジスタの内容をALU630で加算する。その後、
命令レジスタ650のDフィールド120がOならばス
テップ1011.lならばステップ1012を実行する
。In step 1010, 8JL calculation accumulator A
The ALU 630 adds c c D 611 and the contents of the register indicated by the EA field 130 . after that,
If D field 120 of instruction register 650 is O, step 1011. If it is l, step 1012 is executed.
ステップ1011ではALU630の演算結果を演算用
アキュームレータA c c D 611に格納する。In step 1011, the calculation result of the ALU 630 is stored in the calculation accumulator A c c D 611 .
ステップ1012ではALU630の演算結果をEAフ
ィールド130で指示されたレジスタに格納する。In step 1012, the calculation result of the ALU 630 is stored in the register designated by the EA field 130.
ステップ1013ではALU630に計算済みのメモリ
アドレスをMAR640に転送し、メインメモリ645
からオペランドを読み出す。In step 1013, the memory address calculated by the ALU 630 is transferred to the MAR 640, and the memory address calculated by the ALU 630 is transferred to the main memory 640.
Read the operand from.
ステップ1014では演算用アキュームレータAccD
611とメインメモリ645から読み出したオペランド
MDR642の内容をALUで加算する。その後、命令
レジスタ650のDフィールド120がOならばステッ
プLoll、lならばステップ1015を実行する。In step 1014, the calculation accumulator AccD
611 and the contents of the operand MDR 642 read from the main memory 645 are added by the ALU. Thereafter, if the D field 120 of the instruction register 650 is O, step Loll is executed, and if it is l, step 1015 is executed.
ステップ1015ではAL[J630の演算結果をML
)R642に転送し、メインメモリ645に格納する。In step 1015, the calculation result of AL[J630 is
) is transferred to R642 and stored in main memory 645.
このときのアドレスは直前にオペランドを読み出したア
ドレスと同じMAR640の内容である。The address at this time is the same content of the MAR 640 as the address from which the operand was read immediately before.
第9図(b)はLL)命令及びLL)A命令の処理ルー
チンである。LD命令ではEAモードデコーダ670の
デコード結果により、レジスタ直接モードの場合はステ
ップ1020を実行し、メモリ参照モードの場合はステ
ップ1023を実行する。FIG. 9(b) is a processing routine for the LL) instruction and the LL)A instruction. For the LD instruction, depending on the decoding result of the EA mode decoder 670, step 1020 is executed in the register direct mode, and step 1023 is executed in the memory reference mode.
またLDA命令では、メモリ参照モードの場合は判定1
025を実行し、レジスタ直接モードの場合は何もせず
終rする。Also, in the LDA instruction, in the memory reference mode, the judgment is 1.
Execute 025, and if in register direct mode, do nothing and exit.
ステップ1020ではEAフィールド130で指示され
たレジスタの内容をALU630に転送する。In step 1020, the contents of the register indicated by the EA field 130 are transferred to the ALU 630.
判定1025では、命令レジスタ650のDフィールド
120が0ならばステップ1021.1ならばステップ
1022を実行する。In decision 1025, if D field 120 of instruction register 650 is 0, then step 1021.1, then step 1022 is executed.
ステップ102JではALU630の演算結果を演算用
アキュームレ−タA c c D 611に格納する。In step 102J, the calculation result of the ALU 630 is stored in the calculation accumulator AC 611.
ステップ1022ではALU630の演算結果をアドレ
ス計算用アキュームレータAccA612に格納する。In step 1022, the calculation result of the ALU 630 is stored in the address calculation accumulator AccA 612.
ステップ1023ではALU630に計算済みのメモリ
アドレスをMAR640に転送し、メインメモリ645
からオペランドを読み出す。In step 1023, the memory address calculated by the ALU 630 is transferred to the MAR 640, and the memory address calculated by the ALU 630 is transferred to the main memory 640.
Read the operand from.
ステップ1024ではメインメモリ645から読み出し
たオペランドML)R642の内容をALUに転送する
。In step 1024, the contents of the operand ML)R642 read from the main memory 645 are transferred to the ALU.
第9図(c)はST命令の処理ルーチンである。FIG. 9(c) is a processing routine for the ST instruction.
EAモードデコーダ670のデコード結果及び命令レジ
スタ650のDフィールド120の値により、レジスタ
直接モードL)=Oの場合はステップ1030を実行し
、レジスタ直接モードで1つ=1の場合はステップ10
31を実行する。メモリ参照モードでL)=Oの場合は
ステップ1032を実行し、メモリ参照モードでD=1
の場合はステップ1033を実行する。According to the decoding result of the EA mode decoder 670 and the value of the D field 120 of the instruction register 650, if the register direct mode L) = O, step 1030 is executed, and if the register direct mode is 1 = 1, step 10 is executed.
Execute 31. If L)=O in memory reference mode, execute step 1032, and D=1 in memory reference mode.
If so, step 1033 is executed.
ステップ1030では演算用アキュームレータAc c
l)611の内容をEAフィールド130で指示された
レジスタに格納する。In step 1030, the calculation accumulator Acc
l) Store the contents of 611 in the register indicated by EA field 130;
ステップ1031ではアドレス計算用アキュームレータ
A c c A 612の内容をEAフィールド130
で指示されたレジスタに格納する。In step 1031, the contents of the address calculation accumulator A c c A 612 are stored in the EA field 130.
Store in the register specified by .
ステップ1032ではALU630に計算されているア
ドレスをMAR640に転送し、また、演算用アキュー
ムレータA c c D 6 L lの内容をML)R
642に転送して、メインメモリ645に格納する。In step 1032, the address calculated by the ALU 630 is transferred to the MAR 640, and the contents of the calculation accumulator A c c D 6 L l are transferred to the MAR 640.
642 and stored in the main memory 645.
ステップ1033テはA L U 630 ニ;?を算
されているアドレスをMAR640に転送し、また。Step 1033 is ALU 630;? Transfer the calculated address to the MAR640, and also.
アドレス計算用アキュームレータA c c A 61
2の内容をMDR642に転送して、メインメモリ64
5に格納する。Accumulator for address calculation A c c A 61
Transfer the contents of 2 to the MDR 642 and store it in the main memory 64.
Store in 5.
本発明の効果を第1図を用いて説明する。アキュームレ
ータとメモリの内容を乗算して結果をメモリに格納する
場合を考える。本発明では、MUL(乗算)命令におい
てもDフィールドが設けてあり、これによって、演算結
果をアキュームレータへでも、メモリへでも、どちらへ
でも格納することができる。したがって、上記の乗算の
動作は1つのM LJ L命令によって実行できる。そ
の動作を説明すると、At)L)命令と同様に。The effects of the present invention will be explained using FIG. Consider the case of multiplying an accumulator by the contents of memory and storing the result in memory. In the present invention, a D field is also provided in the MUL (multiplication) instruction, so that the result of the operation can be stored either in the accumulator or in the memory. Therefore, the above multiplication operation can be performed by one M LJ L instruction. Its operation is similar to the At)L) instruction.
(1)初期化ルーチンでは、アドレッシングモードをE
Aモートテコーダ670によってデコードし、命令の種
類をOPココ−〜デコーダ660によってデコートする
。(1) In the initialization routine, the addressing mode is set to E.
It is decoded by the A-mode coder 670, and the type of instruction is decoded by the OP coder 660.
(2)EA/L/−チンテは、EAII−−ドデコーダ
6”10の出力にしたがって、ALLI630で実効ア
ドレスを計算する。(2) The EA/L/-chinte calculates an effective address in the ALLI 630 according to the output of the EAII-decoder 6''10.
(3)命令実行ルーチンでは、まず、ALU630に計
算されている実効アドレスを使ってメモリデータをフェ
ッチする。次に、データ演算用アキュームレータ611
とメモリデータレジスタMDR642(1)乗算をAL
[J630で実施する。(3) In the instruction execution routine, first, memory data is fetched using the effective address calculated by the ALU 630. Next, the data calculation accumulator 611
and memory data register MDR642 (1) multiplication AL
[Implemented on J630.]
最後に、Dフラグ検出器690にしたがって、ALU6
30の乗算結果をメモリにストアする。Finally, according to the D flag detector 690, the ALU6
30 multiplication results are stored in memory.
一方、従来のマイクロプロセッサの場合をインテル社の
80386を例にして説明する。80386では乗算命
令の実行結果はレジスタにしか格納できない。そこで、
メモリに格納するときには。On the other hand, the case of a conventional microprocessor will be explained using Intel's 80386 as an example. In the 80386, the execution result of a multiplication instruction can only be stored in a register. Therefore,
when storing it in memory.
旦レジスタに格納してから、次に転送命令でこれをメモ
リに転送する必要がある。つまり、上Aピの命令実行ス
テップの(3)においてDフラグの検出がなく、乗算結
果はデータ演算用アキュームレータ611に一意に格納
される。この乗算結果をメモリに転送するためにはMO
V (転送)命令を実行する。更に、このように2つの
命令に分割して実行すると、メモリの実効アドレスを再
度計算しなければならず無駄である。It is necessary to first store it in a register and then transfer it to memory using a transfer instruction. In other words, the D flag is not detected in (3) of the instruction execution step of the upper A pi, and the multiplication result is uniquely stored in the data calculation accumulator 611. To transfer this multiplication result to memory, MO
Execute V (transfer) command. Furthermore, if the instruction is divided into two instructions and executed in this way, the effective memory address must be calculated again, which is wasteful.
本発明によれば、上記のように乗算結果をメモリにスト
アする場合も1つの命令で実行することができる。According to the present invention, storing the multiplication result in memory as described above can also be executed with one instruction.
以上述べてきたように本発明によれば、各命令は必ず汎
用アドレッシングフィールドを持つことになり、命令機
能とオペランドの間の的、変性を保つことができ、高級
言語コンパイラにおいて、命令コードの生成処理が簡潔
になる効果がある。As described above, according to the present invention, each instruction always has a general-purpose addressing field, and it is possible to maintain the target and deformation between the instruction function and the operand. This has the effect of simplifying processing.
また、演算結果をアキュームレータの代りに汎用アドレ
ッシングモードで示されたオペランドに格納できるので
、演算結果のストア命令を削減できる効果がある。Furthermore, since the operation result can be stored in the operand indicated in the general-purpose addressing mode instead of the accumulator, there is an effect that the number of store instructions for operation results can be reduced.
第1図は本発明の一実施例であるデータ処理装置のブロ
ック図、第2図は第1図のデータ処理装置の命令フォー
マットを示す図、第3図は第1図のデータ処理装置の○
Pフィールド及びDフィールドの詳細を示す図、第4図
は第1図のデータ処理装置のEAフィールドの詳細をボ
す図、第5図(a)、(b)、(c)、(d)は第1図
のデータ処理装置のプログラムの例をボす図、第6図は
制御回路680の動作を示したフローチャート図、第7
図は初期ルーチン710の詳細を示したフローチャート
図、第8図(a)、(b)、(c)はEA計算ルーチン
730の一例を示したフローチャート図、第9図(a)
、(b)、(c)は命令実行ルーチン740の例を示し
たフローチャート図である。
100・・・命令基本部、110・・・OPフィールド
、120・・・Dフィールド、130・・・ト:Aフィ
ールド、140・・・命令拡張部、650・・・命令レ
ジスタlR1660・・・OPコードデコーダ、6 ”
10・・・EAモードデコーダ、680・・・制御回路
、690・・・Dフラグ検出器、611・・・データ演
算用アキュームレー〈ニノ
第 1 図
第2図
命令フォーマット
・、○Pフィールド
tz。
第3図
○Pフィールド及びDフィールドの詳細第5図
プログラム例
(a)3オペランド演算
(b)2オペランド演算
(C)インデクスアドレッシングモード(d)2重イン
ダイレクトアドレッシングモード第4図
EAフィールドの詳細
第
乙
関
第
ゴ
娼FIG. 1 is a block diagram of a data processing device that is an embodiment of the present invention, FIG. 2 is a diagram showing an instruction format of the data processing device of FIG. 1, and FIG. 3 is a diagram showing the instruction format of the data processing device of FIG. 1.
FIG. 4 is a diagram showing details of the P field and D field; FIG. 4 is a diagram showing details of the EA field of the data processing device of FIG. 1; FIG. 5 (a), (b), (c), (d) 6 is a flowchart showing the operation of the control circuit 680, and FIG.
8(a), (b), and (c) are flowcharts showing an example of the EA calculation routine 730. FIG. 9(a) is a flowchart showing details of the initial routine 710.
, (b), and (c) are flowcharts showing examples of an instruction execution routine 740. 100... Instruction basic part, 110... OP field, 120... D field, 130... To:A field, 140... Instruction extension part, 650... Instruction register lR1660... OP Code decoder, 6”
DESCRIPTION OF SYMBOLS 10... EA mode decoder, 680... Control circuit, 690... D flag detector, 611... Accumulator for data operation <Nino 1 Figure 2 Instruction format, ○P field tz. Figure 3 ○Details of P field and D field Figure 5 Program example (a) 3-operand operation (b) 2-operand operation (C) Index addressing mode (d) Double indirect addressing mode Figure 4 Details of EA field 1st otsuki 3rd prostitute
Claims (1)
第1のオペランドを演算用アキュームレータとし、第2
のオペランドを汎用アドレッシングモードで指定するこ
とを特徴とするデータ処理装置。 2、データ処理装置の命令形式において、 加算命令や乗算命令のように2項演算を行なう命令は、
演算用アキュームレータを第1のオペランドとして暗黙
に指定し、第2のオペランドを指定するために汎用アド
レッシングフィールドを持つことを特徴とするデータ処
理装置。 3、請求項1又は2記載のデータ処理装置において、 該第2項演算を行なう命令は、 演算結果を該演算用アキュームレータに格納するのか、
または、該汎用アドレッシングフィールドで指定された
該第2のオペランドに演算結果を格納するのかを決定す
る1ビットのフィールドを持つことを特徴とするデータ
処理装置。 4、請求項1乃至3のいずれかに記載のデータ処理装置
において、 少なくとも、該第2演算を行なう命令は、 演算の種類を示すOPフィールド、 該汎用アドレッシングモードを示すEAフィールド、 結果の格納方向を決定するDフィールドから構成されて
おり、 上記のフィールドのビット位置が該第2項演算を行なう
命令で共通であることを特徴とするデータ処理装置。 5、請求項1乃至4のいずれかに記載のデータ処理装置
において、 該データ処理装置は、1チップのマイクロプロセッサで
構成されていることを特徴とするデータ処理装置。[Claims] 1. In the instruction format of a data processing device, an instruction that performs a binary operation such as an addition instruction or a multiplication instruction is
The first operand is an accumulator for calculation, and the second
A data processing device characterized in that an operand of is specified in a general-purpose addressing mode. 2. In the instruction format of data processing devices, instructions that perform binary operations such as addition instructions and multiplication instructions are
A data processing device having a general-purpose addressing field for implicitly specifying an arithmetic accumulator as a first operand and specifying a second operand. 3. In the data processing device according to claim 1 or 2, the instruction for performing the second term operation: stores the operation result in the operation accumulator;
Alternatively, a data processing device comprising a 1-bit field that determines whether a calculation result is stored in the second operand specified by the general-purpose addressing field. 4. The data processing device according to any one of claims 1 to 3, wherein at least the instruction for performing the second operation includes: an OP field indicating the type of operation; an EA field indicating the general-purpose addressing mode; and a storage direction of the result. 1. A data processing device comprising a D field that determines a D field, wherein a bit position of the field is common to an instruction that performs the second term operation. 5. The data processing device according to claim 1, wherein the data processing device is comprised of a one-chip microprocessor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1078204A JPH02259832A (en) | 1989-03-31 | 1989-03-31 | Data processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1078204A JPH02259832A (en) | 1989-03-31 | 1989-03-31 | Data processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH02259832A true JPH02259832A (en) | 1990-10-22 |
Family
ID=13655497
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1078204A Pending JPH02259832A (en) | 1989-03-31 | 1989-03-31 | Data processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH02259832A (en) |
-
1989
- 1989-03-31 JP JP1078204A patent/JPH02259832A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3657949B2 (en) | Back-compatible computer architecture with extended word size and address space | |
US5077657A (en) | Emulator Assist unit which forms addresses of user instruction operands in response to emulator assist unit commands from host processor | |
US6122638A (en) | Object-oriented processor and method for caching intermediate data in an object-oriented processor | |
US5249280A (en) | Microcomputer having a memory bank switching apparatus for accessing a selected memory bank in an external memory | |
JP2002366348A (en) | Data processing by multiple instruction sets | |
KR0167005B1 (en) | Central Processing Unit | |
JP2507638B2 (en) | Data processing device | |
JPH03218523A (en) | Data processor | |
JPH0496825A (en) | Data processor | |
EP0745932B1 (en) | Microprocessor supporting variable length instruction execution | |
JP2004086837A (en) | Data processor | |
US6467037B1 (en) | Utilizing a program counter with one or more data counters for executing instructions | |
JPH07120284B2 (en) | Data processing device | |
JP3345787B2 (en) | Data processing device | |
JP3556252B2 (en) | Data processing system and method for calculating offset total | |
US5774694A (en) | Method and apparatus for emulating status flag | |
US6275925B1 (en) | Program execution method and program execution device | |
JPH02259832A (en) | Data processor | |
Godse | ARM Controller | |
JP2956707B2 (en) | Information processing device | |
JP2522048B2 (en) | Microprocessor and data processing device using the same | |
Groote et al. | The Raspberry Pi and the ARM processor | |
EP0650614B1 (en) | Digital signal processor architecture | |
Elahi et al. | Assembly Language and ARM Instructions Part I | |
JPH04195629A (en) | Arithmetic flag generation device |