JP3043861B2 - Data processing device - Google Patents

Data processing device

Info

Publication number
JP3043861B2
JP3043861B2 JP3252370A JP25237091A JP3043861B2 JP 3043861 B2 JP3043861 B2 JP 3043861B2 JP 3252370 A JP3252370 A JP 3252370A JP 25237091 A JP25237091 A JP 25237091A JP 3043861 B2 JP3043861 B2 JP 3043861B2
Authority
JP
Japan
Prior art keywords
bits
data
instruction
register
general
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP3252370A
Other languages
Japanese (ja)
Other versions
JPH0588887A (en
Inventor
啓二 建部
由利子 久間
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP3252370A priority Critical patent/JP3043861B2/en
Publication of JPH0588887A publication Critical patent/JPH0588887A/en
Application granted granted Critical
Publication of JP3043861B2 publication Critical patent/JP3043861B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、データ処理装置に関
し、特に、マイクロプロセッサ等において、所定のデー
タサイズ、方向、及びデータサイズ以下の指定されたビ
ット数により、データの桁移動を行なう命令を備えるデ
ータ処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing apparatus, and more particularly, to a microprocessor or the like which issues an instruction for moving a digit of data according to a specified data size, direction, and a specified number of bits smaller than the data size. The present invention relates to a data processing device provided.

【0002】[0002]

【従来の技術】近年、半導体集積回路の高集積化技術の
進歩に伴い、マイクロプロセッサ等の小型の命令処理装
置においても、その機能は豊富になって来ている。例え
ば、ザイログ社のZ80は、8ビットマイクロプロセッ
サでありながら豊富な命令セットを有している。ここで
は、Z80を例に採り、Z80の命令セットの1つであ
る4ビット単位のBCD形桁移動命令、RLD命令及び
RRD命令について言及し、問題点を指摘する。
2. Description of the Related Art In recent years, with the advance of the technology for increasing the degree of integration of semiconductor integrated circuits, the functions of even small-sized instruction processors such as microprocessors have become more abundant. For example, Zilog's Z80 has a rich instruction set despite being an 8-bit microprocessor. Here, the Z80 is taken as an example, and a BCD type digit shift instruction, RLD instruction, and RRD instruction in 4-bit units, which are one of the instruction sets of the Z80, are referred to, and problems are pointed out.

【0003】このRLD命令及びRRD命令は、それぞ
れ一度に4ビットずつ左右に移動する命令で、Aレジス
タ及びHLペアレジスタで示されるメモリ内のアドレス
の内容に作用し、BCD形データの操作に有効である。
これらの命令の作用を図8(1)及び(2)に要約して
いる。即ち、8ビットのAレジスタの下位4ビットを上
位群、HLペアレジスタの示すアドレスの8ビットデー
タの上位4ビット及び下位4ビットを下位群とし、この
上位群及び下位群を連結したものを、4ビット単位で左
右にローテートするものである。この時、Aレジスタの
データ及びHLペアレジスタが示すアドレスのデータの
データサイズは8ビット固定であり、ローテートするビ
ット数も4ビット単位と固定である。
The RLD instruction and the RRD instruction move right and left four bits at a time, and act on the contents of addresses in the memory indicated by the A register and the HL pair register, and are effective in operating BCD type data. It is.
The operation of these instructions is summarized in FIGS. 8 (1) and (2). That is, the lower 4 bits of the 8-bit A register are the upper group, the upper 4 bits and the lower 4 bits of the 8-bit data of the address indicated by the HL pair register are the lower group, and the upper group and the lower group are connected. Rotate right and left in 4-bit units. At this time, the data size of the data of the A register and the data of the address indicated by the HL pair register is fixed at 8 bits, and the number of bits to be rotated is also fixed at a unit of 4 bits.

【0004】例えば、メモリに8進数のデータがn番地
からn+m番地まで格納されているとし、n番地からn
+m番地までのデータを全体的に3ビットシフトするこ
とをZ80の命令で行なうとする。
For example, suppose that octal data is stored in a memory from address n to address n + m.
Assume that the data up to the address + m is shifted by 3 bits as a whole by the instruction of Z80.

【0005】上述のように、ローテート命令は4ビット
単位のため、先ずSLA(算術シフト)命令を実行して
n番地の8ビットデータの最下位から”0”をシフト
し、それによってAレジスタの7ビット目からシフトア
ウトされたデータをキャリーフラグに格納する。次に、
RL(左ローテート)命令を実行して、キャリーフラグ
をn+1番地の8ビットデータの最上位に連結したもの
を左ローテートする。この結果、キャリーフラグにはn
+1番地の8ビットデータの最上位ビットがシフトされ
格納される。次に、もう一度RL命令によりn+2番地
の最上位にキャリーフラグを連結したものを左ローテー
トする。以上の手順をn+m番地まで繰り返し行なう
と、n番地からn+m番地までのデータを全体的に1ビ
ットシフトしたことになる。従って、3ビットシフトさ
せるためには、以上の動作を3回繰り返さなければなら
ず、沢山の命令数及びサイクル数を必要とする。
As described above, since the rotate instruction is in units of 4 bits, first, an SLA (arithmetic shift) instruction is executed to shift "0" from the least significant bit of the 8-bit data at address n, whereby the A register The data shifted out from the seventh bit is stored in the carry flag. next,
An RL (left rotate) instruction is executed to rotate the carry flag concatenated to the uppermost position of the 8-bit data at the address (n + 1). As a result, the carry flag has n
The most significant bit of 8-bit data at address +1 is shifted and stored. Next, the one obtained by connecting the carry flag to the uppermost position of the address n + 2 by the RL instruction is rotated to the left again. By repeating the above procedure up to the address n + m, the data from the address n to the address n + m is shifted by one bit as a whole. Therefore, in order to shift by three bits, the above operation must be repeated three times, which requires a large number of instructions and cycles.

【0006】[0006]

【発明が解決しようとする課題】以上のように、従来の
データ処理装置では、連続するデータを任意のビット数
だけ桁移動操作する場合、沢山の命令数及びサイクル数
を必要とし、処理に時間がかかるという欠点があった。
As described above, the conventional data processing apparatus requires a large number of instructions and cycles when moving consecutive data by an arbitrary number of bits. However, there was a drawback that it took.

【0007】本発明は、上記問題点を解決するもので、
その目的は、所定のデータサイズ、方向、及びデータサ
イズ以下の指定されたビット数により、データの桁移動
を行なう命令を用意して、連続するデータを任意のビッ
ト数だけ桁移動する操作を高速に処理するデータ処理装
置を提供することである。
The present invention solves the above problems,
The purpose is to prepare an instruction to move the digit of data according to the specified data size, direction, and the specified number of bits smaller than the data size, and to speed up the operation to shift the digit of continuous data by an arbitrary number of bits. To provide a data processing device for processing.

【0008】[0008]

【課題を解決するための手段】前記課題を解決するため
に、本発明の特徴は、図1に示す如く、nビット(nは
任意の正整数)幅の第1のデータ格納手段1と、mビッ
ト(mは任意の正整数)幅の第2のデータ格納手段3
と、命令語を保持する命令レジスタ5と、前記命令レジ
スタ5の命令を解読して実行制御する制御手段7と、命
令を実行する演算手段9とを具備し、前記制御手段7
は、所定の命令解読時に、命令語情報で指定されたビッ
ト数k(kは任意の正整数)及び方向に従って、前記第
1のデータ格納手段1の下位kビットを上位群とし、前
記第2のデータ格納手段3の全ビットを下位群として、
これら上位群及び下位群を連結したデータを前記方向に
kビット桁移動し、結果の上位kビットを前記第1のデ
ータ格納手段1の下位kビットに、結果の残りの下位ビ
ットを前記第2のデータ格納手段3に格納することであ
る。
In order to solve the above-mentioned problems, a feature of the present invention is that, as shown in FIG. 1, first data storage means 1 having a width of n bits (n is an arbitrary positive integer); Second data storage means 3 having a width of m bits (m is an arbitrary positive integer)
An instruction register 5 for holding an instruction word, control means 7 for decoding and controlling the execution of the instruction in the instruction register 5, and an operation means 9 for executing the instruction.
When a predetermined instruction is decoded, the lower k bits of the first data storage unit 1 are set to an upper group according to the number of bits k (k is an arbitrary positive integer) and direction specified by the instruction word information, and the second All the bits of the data storage means 3 of the
The data obtained by concatenating the upper group and the lower group is shifted by k bits in the above direction, the upper k bits of the result are replaced with the lower k bits of the first data storage unit 1, and the remaining lower bits of the result are replaced with the second k bits. Is stored in the data storage means 3.

【0009】本発明の第2の特徴は、請求項1に記載の
データ処理装置において、前記データ処理装置は、ワン
チップ上に実現されることである。
A second feature of the present invention is that in the data processing device according to the first aspect, the data processing device is realized on one chip.

【0010】[0010]

【作用】本発明のデータ処理装置では、命令レジスタ5
に所定の命令がセットされた時に、制御手段7は、命令
語情報で指定されたビット数k(kは任意の正整数)及
び方向に従って、前記第1のデータ格納手段1の下位k
ビットを上位群とし、前記第2のデータ格納手段3の全
ビットを下位群として、これら上位群及び下位群を連結
したデータを前記方向にkビット桁移動し、結果の上位
kビットを前記第1のデータ格納手段1の下位kビット
に、結果の残りの下位ビットを前記第2のデータ格納手
段3に格納するようにしている。
In the data processing device of the present invention, the instruction register 5
When the predetermined instruction is set in the first data storage unit 1, the control unit 7 sets the lower k bits of the first data storage unit 1 in accordance with the number of bits k (k is an arbitrary positive integer) and direction specified by the instruction word information.
Bits are defined as an upper group, and all bits of the second data storage means 3 are defined as a lower group. Data obtained by connecting the upper group and the lower group is shifted by k bits in the above-mentioned direction, and the upper k bits of the result are converted into the above-mentioned k bits. The remaining lower bits of the result are stored in the second data storage unit 3 in the lower k bits of the first data storage unit 1.

【0011】これにより、命令語情報で指定されたビッ
ト数k及び方向に従って、データの桁移動を行なう命令
を用意して、連続するデータ等を任意のビット数だけ桁
移動する操作を高速に処理することができる。
Thus, an instruction for shifting the digit of data is prepared according to the number of bits k and direction specified by the instruction word information, and the operation of shifting the digit of continuous data by an arbitrary number of bits is processed at high speed. can do.

【0012】[0012]

【実施例】以下、本発明に係る実施例を図面に基づいて
説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0013】図2に本発明の一実施例に係るデータ処理
装置の構成図を示す。
FIG. 2 shows a configuration diagram of a data processing apparatus according to one embodiment of the present invention.

【0014】本実施例のデータ処理装置は、16ビット
のマイクロプロセッサ10(以下MPUと略記する)と
1ワードが16ビットのメモリ30から構成され、デー
タバス27及びアドレスバス29を介して接続されてい
る。
The data processing apparatus of this embodiment comprises a 16-bit microprocessor 10 (hereinafter abbreviated as MPU) and a 16-bit memory 30 with one word connected thereto via a data bus 27 and an address bus 29. ing.

【0015】MPU10は、メモリ30とのインタフェ
ースを司り、データラッチDR、アドレスラッチAR、
及びテンポラリレジスタTR0,TR1を備えるバスイ
ンタフェースユニット13(以下BIUと略記する)
と、4個の命令レジスタIR1〜IR4からなる命令レ
ジスタ群5と、命令レジスタ群5からの命令を解読する
命令デコーダ6と、バンクポインタBP、各種スタック
ポインタSP、及びレジスタ群R0〜R15からなる汎
用レジスタ群11と、演算等で使用する定数を保持する
定数ROM15と、各種演算を実行する演算器9と、演
算器9の入力側に接続されて桁移動命令等で使用するシ
フトレジスタSR1及びSR2とから構成され、各構成
要素はXバス21、Yバス23、及びZバス25を介し
てデータのやり取りを行なう。また、図2において、太
線はバスまたはデータのやり取りを行なう信号線、細線
は制御信号等の信号線を示している。
The MPU 10 manages an interface with the memory 30, and includes a data latch DR, an address latch AR,
And a bus interface unit 13 including temporary registers TR0 and TR1 (hereinafter abbreviated as BIU)
An instruction register group 5 including four instruction registers IR1 to IR4, an instruction decoder 6 for decoding instructions from the instruction register group 5, a bank pointer BP, various stack pointers SP, and register groups R0 to R15. A general-purpose register group 11, a constant ROM 15 for holding constants used in operations and the like, an operation unit 9 for executing various operations, a shift register SR1 connected to the input side of the operation unit 9 and used for a digit shift instruction and the like. SR2, and each component exchanges data via an X bus 21, a Y bus 23, and a Z bus 25. In FIG. 2, thick lines indicate signal lines for exchanging buses or data, and thin lines indicate signal lines for control signals and the like.

【0016】本実施例のデータ処理装置では、各命令は
次のようにして実行される。
In the data processing device of the present embodiment, each instruction is executed as follows.

【0017】先ず、メモリ30からデータバス27を介
してBIU13内のデータラッチDRに命令をフェッチ
する。次にフェッチした命令を命令レジスタ5のキュー
(queue )に取り込む。ここで、命令レジスタ群5は4
個の命令レジスタIR1〜IR4によるキューを構成し
ているが、これはバスアクセスが無い時に命令を先取り
してキューに取り込んでおくことにより、データ処理の
高速化を図るものである。次に、命令デコーダ6は命令
レジスタ群5のキューから順に命令を取り込み、該命令
を解読してその情報を制御部7へ送る。制御部7はその
情報に基づき制御信号を各構成要素に送り、命令を実行
させる。尚、制御部7は、演算器9、BIU13、及び
その他構成要素から信号を受け取り、更に各構成要素に
制御信号を返している。また、Xバス21、Yバス2
3、及びZバス25を介して、コンディション・コード
(CC)等を含むプログラム・ステイタス・ワード(P
SW)の制御等を行っている。
First, an instruction is fetched from the memory 30 to the data latch DR in the BIU 13 via the data bus 27. Next, the fetched instruction is fetched into a queue of the instruction register 5. Here, the instruction register group 5 is 4
A queue is formed by the instruction registers IR1 to IR4. This is to speed up data processing by prefetching an instruction and taking it into the queue when there is no bus access. Next, the instruction decoder 6 sequentially fetches instructions from the queue of the instruction register group 5, decodes the instructions, and sends the information to the control unit 7. The control unit 7 sends a control signal to each component based on the information to execute the command. The control unit 7 receives signals from the arithmetic unit 9, the BIU 13, and other components, and returns a control signal to each component. X bus 21, Y bus 2
3 and a program status word (P) including a condition code (CC) via the Z bus 25.
SW) and the like.

【0018】次に、本実施例で実行する桁移動命令の仕
様を図3を参照して説明する。
Next, the specification of the digit shift instruction executed in this embodiment will be described with reference to FIG.

【0019】先ずRML(Rotate Multibit Left)命令
は、命令語で指定される桁移動ビット幅をkビットとす
ると、第1のデータ格納手段1として汎用レジスタRn
(n=0〜15)を、第2のデータ格納手段3として汎
用レジスタRm(m=0〜15)またはメモリ30の特
定番地を、それぞれ使用して、汎用レジスタRnの下位
kビットと汎用レジスタRmまたはメモリ30の全ビッ
トとを連結して、kビット左にローテートする。尚、メ
モリ30の特定番地は、例えば汎用レジスタRj(j=
0〜15;j≠n)で指定されるものとする。
First, as for the RML (Rotate Multibit Left) instruction, assuming that the digit shift bit width specified by the instruction word is k bits, the general data register Rn is used as the first data storage means 1.
(N = 0 to 15) and the lower k bits of the general-purpose register Rn and the general-purpose register using the general-purpose register Rm (m = 0 to 15) or a specific address of the memory 30 as the second data storage means 3, respectively. Rm or all bits of the memory 30 are concatenated and rotated to the left by k bits. The specific address of the memory 30 is, for example, a general-purpose register Rj (j =
0 to 15; j ≠ n).

【0020】また、RMR(Rotate Multibit Right )
命令は、RML命令と同様で、指定されたkビット右に
ローテートする。
Further, RMR (Rotate Multibit Right)
The instruction rotates the specified k bits to the right, similarly to the RML instruction.

【0021】このRML命令またはRMR命令が実行さ
れる時の様子を、図4を使って説明する。同図は、第1
のデータ格納手段1を汎用レジスタR0、第2のデータ
格納手段3をメモリの特定番地(m番地)とした場合
に、RML命令(10ビットの桁移動)を実行する時の
シフトレジスタSR1及びSR2の遷移、並びに演算器
9の演算処理の様子を説明する図である。
The manner in which the RML or RMR instruction is executed will be described with reference to FIG. FIG.
If the data storage means 1 is a general-purpose register R0 and the second data storage means 3 is a specific address (address m) of a memory, the shift registers SR1 and SR2 when executing the RML instruction (10-bit shift). FIG. 6 is a diagram for explaining the transition of the calculation and the state of the arithmetic processing of the arithmetic unit 9.

【0022】先ず、汎用レジスタR0のデータがXバス
21を経てシフトレジスタSR1に転送される(図4
(1)参照)。同時にアドレスラッチARから出力され
たアドレスm番地に対応するデータがデータバス27及
びYバス23を経てシフトレジスタSR2に転送される
(図4(2)参照)。次に、シフトレジスタSR1のデ
ータを図4(3)に示すように10ビット右にシフト
し、更にシフトレジスタSR1及びSR2を連結して1
0ビット左にシフトすると、シフトレジスタSR1及び
SR2の内容は図4(4)及び(5)のようになる。こ
のシフトレジスタSR1及びSR2のデータを、それぞ
れBIU13内のテンポラリレジスタTR0及びTR1
に一時的に格納する。
First, the data of the general-purpose register R0 is transferred to the shift register SR1 via the X bus 21 (FIG. 4).
(See (1)). At the same time, data corresponding to the address m output from the address latch AR is transferred to the shift register SR2 via the data bus 27 and the Y bus 23 (see FIG. 4 (2)). Next, the data of the shift register SR1 is shifted rightward by 10 bits as shown in FIG.
After shifting to the left by 0 bits, the contents of the shift registers SR1 and SR2 are as shown in FIGS. 4 (4) and (5). The data in the shift registers SR1 and SR2 are transferred to temporary registers TR0 and TR1 in BIU 13, respectively.
To store temporarily.

【0023】次に、定数ROM15より、下位10ビッ
トが”1”で残りの上位ビットが”0”の指定されたビ
ット幅のデータと、汎用レジスタR0のデータを演算器
9に転送し、図4(6)に示すように、これらの論理積
(AND)を求める。更に図4(7)に示すように、こ
の論理積の結果とテンポラリレジスタTR1に一時的に
格納したシフトレジスタSR2のデータの論理和(O
R)を取る。
Next, from the constant ROM 15, data of the designated bit width in which the lower 10 bits are "1" and the remaining upper bits are "0" and the data of the general-purpose register R0 are transferred to the arithmetic unit 9, and As shown in FIG. 4 (6), the logical product (AND) of them is obtained. Further, as shown in FIG. 4 (7), the logical sum (O) of the result of this logical product and the data of the shift register SR2 temporarily stored in the temporary register TR1
Take R).

【0024】この論理和の結果をメモリ30のm番地へ
格納し、またテンポラリレジスタTR0に一時的に格納
されているシフトレジスタSR1のデータを汎用レジス
タR0に転送する。
The result of the logical sum is stored at address m of the memory 30, and the data of the shift register SR1 temporarily stored in the temporary register TR0 is transferred to the general-purpose register R0.

【0025】以上の動作によりRML命令が実行される
が、RMR命令の場合も同様に行なわれる。
The RML instruction is executed by the above operation, and the same is applied to the case of the RMR instruction.

【0026】次に本実施例のデータ処理装置を具体的に
使用する場合の適用例を説明する。
Next, an application example when the data processing device of the present embodiment is used specifically will be described.

【0027】図5は第1の適用例を示すもので、第1の
データ格納手段1を汎用レジスタRn、第2のデータ格
納手段3をメモリ30とし、メモリ30のm番地のデー
タの下位10ビットに汎用レジスタRnの下位10ビッ
トのデータを挿入し、m番地の上位10ビットのデータ
をm+2番地の下位10ビットに移動させ、以降の番地
に順次ずらせていく処理を行なうものである。
FIG. 5 shows a first application example, in which the first data storage means 1 is a general-purpose register Rn, the second data storage means 3 is a memory 30, and the lower 10 bits of the data at address m in the memory 30. The lower 10 bits of data of the general-purpose register Rn are inserted into the bits, the upper 10 bits of the address m are moved to the lower 10 bits of the address m + 2, and the subsequent addresses are sequentially shifted.

【0028】先ず図5(1)において、汎用レジスタR
n(下位10ビットにデータAが格納されている)とm
番地のデータをRML命令を使用して10ビット左にロ
ーテートする。汎用レジスタRnにはm番地の上位10
ビットのデータBが格納され、図5(2)のようにな
る。次に、汎用レジスタRnとm+2番地のデータとを
RML命令を使用して10ビット左にローテートする。
この時、汎用レジスタRnにはm+2番地の上位10ビ
ットのデータCが格納され、図5(3)のようになる。
同様に、汎用レジスタRnとm+4番地のデータをRM
L命令を使用して10ビット左にローテートし、図5
(4)に示すように、汎用レジスタRnにm+4番地の
上位10ビットのデータDが格納される。最後に、汎用
レジスタRnとm+6番地のデータをRML命令を使用
して10ビット左にローテートし、図5(5)に示す最
終状態となる。以上のように、連続する桁移動動作を同
じ命令を繰り返すだけで行なうことができる。
First, in FIG. 5A, the general-purpose register R
n (data A is stored in lower 10 bits) and m
The data at the address is rotated to the left by 10 bits using an RML instruction. The general register Rn contains the top 10
Bit data B is stored, as shown in FIG. Next, the general-purpose register Rn and the data at address m + 2 are rotated to the left by 10 bits using an RML instruction.
At this time, the data C of the upper 10 bits of the address m + 2 is stored in the general-purpose register Rn, as shown in FIG.
Similarly, the general-purpose register Rn and the data at address m + 4 are set to RM
Using the L instruction to rotate 10 bits to the left, FIG.
As shown in (4), the upper 10 bits of data D at address m + 4 are stored in the general-purpose register Rn. Finally, the general-purpose register Rn and the data at address m + 6 are rotated 10 bits to the left using an RML instruction, and the final state shown in FIG. As described above, successive digit shifting operations can be performed only by repeating the same command.

【0029】次に、図6に第2の適用例の動作説明図を
示す。本例は、第1のデータ格納手段1を汎用レジスタ
Rn、第2のデータ格納手段3をメモリ30とし、第1
の適用例とは逆に、メモリ30のm+6番地のデータの
下位10ビットのデータを汎用レジスタRnの下位10
ビットに挿入し、m+6番地の下位10ビットのデータ
をm+4番地の上位10ビットに移動させ、1つ前の番
地に順次ずらせていく処理を行なうものである。
FIG. 6 is a diagram for explaining the operation of the second application example. In this example, the first data storage unit 1 is a general-purpose register Rn, the second data storage unit 3 is a memory 30,
And the lower 10 bits of the data at address m + 6 of the memory 30 are stored in the lower 10 bits of the general-purpose register Rn.
In this process, the lower 10 bits of the data at address m + 6 are moved to the upper 10 bits at address m + 4 and sequentially shifted to the immediately preceding address.

【0030】RMR命令を使用して10ビット右にロー
テートすること以外、第1の適用例と同様である。この
ようにRMR命令は、下位番地から上位番地に向かって
データを移動させていく場合に有効である。
This is the same as the first application example, except that rotation is performed to the right by 10 bits using the RMR instruction. Thus, the RMR instruction is effective when data is moved from a lower address to an upper address.

【0031】次に、図7に第3の適用例の動作説明図を
示す。本例は、第1のデータ格納手段1を汎用レジスタ
Rn、第2のデータ格納手段3を連続する汎用レジスタ
RmからRm+3とし、汎用レジスタRmのデータの下
位10ビットに汎用レジスタRnの下位10ビットのデ
ータを挿入し、汎用レジスタRmの上位10ビットのデ
ータを汎用レジスタRm+1の下位10ビットに移動さ
せ、以降の汎用レジスタに順次ずらせていく処理を行な
うものである。
Next, FIG. 7 is a diagram for explaining the operation of the third application example. In the present example, the first data storage means 1 is a general-purpose register Rn, the second data storage means 3 is a continuous general-purpose register Rm to Rm + 3, and the lower 10 bits of the general-purpose register Rm are replaced with the lower 10 bits of the general-purpose register Rn. , The data of the upper 10 bits of the general-purpose register Rm is moved to the lower 10 bits of the general-purpose register Rm + 1, and the subsequent general-purpose registers are sequentially shifted.

【0032】図7(1)において、汎用レジスタRnの
下位10ビットのデータAと汎用レジスタRmのデータ
をRML命令を使用して10ビット左にローテートする
と、図7(2)に示すように、汎用レジスタRnには、
汎用レジスタRmの上位10ビットのデータBが格納さ
れる。次に、汎用レジスタRnのデータBと汎用レジス
タRm+1のデータとをRML命令を使用して10ビッ
ト左にローテートする。この時、汎用レジスタRnには
汎用レジスタRm+1の上位10ビットのデータCが格
納され、図7(3)のようになる。同様に、汎用レジス
タRnのデータCと汎用レジスタRm+2のデータをR
ML命令を使用して10ビット左にローテートし、図7
(4)に示すように、汎用レジスタRnに汎用レジスタ
Rm+2の上位10ビットのデータDが格納される。最
後に、汎用レジスタRnと汎用レジスタRm+3のデー
タをRML命令を使用して10ビット左にローテート
し、図7(5)に示す最終状態となる。
In FIG. 7A, when lower 10 bits of data A of the general-purpose register Rn and data of the general-purpose register Rm are rotated to the left by 10 bits using an RML instruction, as shown in FIG. The general-purpose register Rn includes:
The upper 10-bit data B of the general-purpose register Rm is stored. Next, the data B of the general-purpose register Rn and the data of the general-purpose register Rm + 1 are rotated to the left by 10 bits using an RML instruction. At this time, the higher-order 10-bit data C of the general-purpose register Rm + 1 is stored in the general-purpose register Rn, as shown in FIG. Similarly, data C of general-purpose register Rn and data of general-purpose register Rm + 2 are represented by R
Using the ML instruction to rotate 10 bits to the left, FIG.
As shown in (4), the higher-order 10-bit data D of the general-purpose register Rm + 2 is stored in the general-purpose register Rn. Finally, the data of the general-purpose register Rn and the general-purpose register Rm + 3 is rotated to the left by 10 bits using an RML instruction, and the final state shown in FIG.

【0033】また、第2の適用例と同様にRMR命令を
使用して、連続する汎用レジスタの桁移動動作を行なう
こともできる。
As in the case of the second application example, it is also possible to perform a digit shift operation of a continuous general-purpose register by using an RMR instruction.

【0034】以上説明したように、本実施例のデータ処
理装置では、第1及び第2のデータ格納手段1及び3の
の間の桁移動操作において、右ローテートの場合には第
2のデータ格納手段3の指定された桁移動数分の下位ビ
ットのデータが、左ローテートの場合には第2のデータ
格納手段3の指定された桁移動数分の上位ビットのデー
タが、それぞれ第1のデータ格納手段1の下位に格納さ
れ、これを次のローテート命令におけるシフトデータと
して使用できるため、連続するメモリ或いは汎用レジス
タのデータの桁移動動作を、同じ命令を繰り返すだけで
行なうことができる。例えば、ワードプロセッサ等の文
書処理において、字句の挿入操作等を行なう場合、アセ
ンブラ命令レベルでは上述した適用例のような操作を行
なうこととなるが、従来沢山の命令数及びサイクル数を
必要としていたものを、少ない命令数で高速に処理する
ことが可能となる。
As described above, in the data processing apparatus of the present embodiment, in the digit shifting operation between the first and second data storage means 1 and 3, the second data storage is performed in the case of right rotation. In the case of the left rotation, the data of the lower bits corresponding to the specified number of digit shifts of the means 3 is replaced with the first data of the upper bit corresponding to the specified number of digit shifts of the second data storage means 3. Since the data is stored in the lower part of the storage means 1 and can be used as shift data in the next rotate instruction, the digit shift operation of the data in the continuous memory or general-purpose register can be performed only by repeating the same instruction. For example, in a document processing such as a word processor, when performing a lexical insertion operation or the like, an operation as in the application example described above is performed at the assembler instruction level, but conventionally, a large number of instructions and cycles are required. Can be processed at high speed with a small number of instructions.

【0035】尚、データサイズは任意に設定することが
可能であり、また桁移動のビット数はデータサイズ以下
のビット数であれば任意に指定できる。
The data size can be set arbitrarily, and the number of bits for digit shift can be arbitrarily specified as long as the number of bits is smaller than the data size.

【0036】[0036]

【発明の効果】以上のように本発明によれば、命令語情
報で指定されたビット数k及び方向に従って、第1のデ
ータ格納手段の下位kビットを上位群とし、第2のデー
タ格納手段のデータを下位群として、これらを連結した
データを指定方向にkビット桁移動し、結果の上位kビ
ットを第1のデータ格納手段の下位kビットに、残りの
下位ビットを第2のデータ格納手段に格納する命令を命
令セットに用意したので、任意のビット単位で任意の方
向に桁移動することができ、連続するデータを任意のビ
ット数だけ桁移動する操作等を高速に処理しうるデータ
処理装置を提供することができる。
As described above, according to the present invention, according to the number of bits k and the direction specified by the instruction word information, the lower k bits of the first data storage means are set to the upper group, and the second data storage means is set. , And the concatenated data is shifted by k bits in the designated direction, the upper k bits of the result are stored in the lower k bits of the first data storage means, and the remaining lower bits are stored in the second data storage means. Since the instruction to be stored in the means is prepared in the instruction set, the digit can be shifted in an arbitrary direction in an arbitrary bit unit, and the data can be processed at a high speed, such as an operation of shifting consecutive data by an arbitrary number of bits. A processing device can be provided.

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

【図1】本発明の発明原理図である。FIG. 1 is a diagram showing the principle of the present invention.

【図2】本発明の一実施例に係るデータ処理装置の構成
図である。
FIG. 2 is a configuration diagram of a data processing device according to an embodiment of the present invention.

【図3】本発明の実施例における桁移動命令の仕様説明
図である。
FIG. 3 is an explanatory diagram of a specification of a digit shift instruction in the embodiment of the present invention.

【図4】本発明の実施例におけるRML命令またはRM
R命令の実行過程を説明する図である。
FIG. 4 shows an RML instruction or RM according to an embodiment of the present invention.
FIG. 9 is a diagram for explaining an execution process of an R instruction.

【図5】本発明の実施例の第1の適用例を説明する動作
説明図である。
FIG. 5 is an operation explanatory diagram illustrating a first application example of the embodiment of the present invention.

【図6】本発明の実施例の第2の適用例を説明する動作
説明図である。
FIG. 6 is an operation explanatory diagram illustrating a second application example of the embodiment of the present invention.

【図7】本発明の実施例の第3の適用例を説明する動作
説明図である。
FIG. 7 is an operation explanatory diagram illustrating a third application example of the embodiment of the present invention.

【図8】従来のマイクロプロセッサ(Z80)における
桁移動命令の仕様説明図である。
FIG. 8 is an explanatory diagram of a specification of a digit shift instruction in a conventional microprocessor (Z80).

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

1 第1のデータ格納手段 3 第2のデータ格納手段 5 命令レジスタ(命令レジスタ群) 6 命令デコーダ 7 制御手段(制御部) 9 演算手段(演算器) 10 マイクロプロセッサ(MPU) 11 汎用レジスタ群 13 バスインタフェースユニット(BIU) 15 定数ROM 21 Xバス 23 Yバス 25 Zバス 27 データバス 29 アドレスバス 30 メモリ DR データラッチ AR アドレスラッチ TR0,TR1 テンポラリレジスタ IR1〜IR4 命令レジスタ BP バンクポインタ SP 各種スタックポインタ R0〜R15 汎用レジスタ SR1,SR2 シフトレジスタ DESCRIPTION OF SYMBOLS 1 1st data storage means 3 2nd data storage means 5 Instruction register (instruction register group) 6 Instruction decoder 7 Control means (control part) 9 Operation means (arithmetic unit) 10 Microprocessor (MPU) 11 General-purpose register group 13 Bus interface unit (BIU) 15 Constant ROM 21 X bus 23 Y bus 25 Z bus 27 Data bus 29 Address bus 30 Memory DR Data latch AR Address latch TR0, TR1 Temporary register IR1 to IR4 Instruction register BP Bank pointer SP Various stack pointer R0 To R15 General-purpose register SR1, SR2 Shift register

フロントページの続き (56)参考文献 特開 昭64−81033(JP,A) 特開 昭62−93729(JP,A) 特開 昭53−76721(JP,A) 特開 昭62−58338(JP,A) ”Z8000ユーザーズ・マニュアル[1 ]CPU/MMU編”,第1版,シャー プ株式会社,1983年7月,p.1−173, 1−177 (58)調査した分野(Int.Cl.7,DB名) G06F 9/30 - 9/355 G06F 7/00 Continuation of front page (56) References JP-A-64-81033 (JP, A) JP-A-62-93729 (JP, A) JP-A-53-76721 (JP, A) JP-A-62-58338 (JP, A) , A) "Z8000 User's Manual [1] CPU / MMU Edition", 1st edition, Sharp Corporation, July 1983, p. 1-173, 1-177 (58) Field surveyed (Int. Cl. 7 , DB name) G06F 9/30-9/355 G06F 7/00

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 nビット(nは任意の正整数)幅の第1
のデータ格納手段と、mビット(mは任意の正整数)幅
の第2のデータ格納手段と、命令語を保持する命令レジ
スタと、前記命令レジスタの命令を解読して実行制御す
る制御手段と、命令を実行する演算手段とを有し、 前記制御手段は、所定の命令解読時に、命令語情報で指
定されたビット数k(kは任意の正整数)及び方向に従
って、前記第1のデータ格納手段の下位kビットを上位
群とし、前記第2のデータ格納手段の全ビットを下位群
として、これら上位群及び下位群を連結したデータを前
記方向にkビット桁移動し、結果の上位kビットを前記
第1のデータ格納手段の下位kビットに、結果の残りの
下位ビットを前記第2のデータ格納手段に格納すること
を特徴とするデータ処理装置。
1. A first bit having a width of n bits (n is an arbitrary positive integer)
A second data storage unit having a width of m bits (m is an arbitrary positive integer), an instruction register for holding an instruction word, and a control unit for decoding and controlling the execution of the instruction in the instruction register. And an arithmetic unit for executing an instruction. The control unit, when decoding a predetermined instruction, sets the first data according to the number of bits k (k is an arbitrary positive integer) and direction specified by the instruction word information. The lower k bits of the storage means are defined as an upper group, all the bits of the second data storage means are defined as a lower group, and the data obtained by connecting the upper group and the lower group is shifted by k bits in the above direction. A data processing apparatus, wherein bits are stored in the lower k bits of the first data storage means, and the remaining lower bits of the result are stored in the second data storage means.
【請求項2】 前記データ処理装置は、ワンチップ上に
実現されることを特徴とする請求項1に記載のデータ処
理装置。
2. The data processing device according to claim 1, wherein the data processing device is realized on one chip.
JP3252370A 1991-09-30 1991-09-30 Data processing device Expired - Fee Related JP3043861B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3252370A JP3043861B2 (en) 1991-09-30 1991-09-30 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3252370A JP3043861B2 (en) 1991-09-30 1991-09-30 Data processing device

Publications (2)

Publication Number Publication Date
JPH0588887A JPH0588887A (en) 1993-04-09
JP3043861B2 true JP3043861B2 (en) 2000-05-22

Family

ID=17236363

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3252370A Expired - Fee Related JP3043861B2 (en) 1991-09-30 1991-09-30 Data processing device

Country Status (1)

Country Link
JP (1) JP3043861B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0024312D0 (en) 2000-10-04 2000-11-15 Advanced Risc Mach Ltd Single instruction multiple data processing
US6986023B2 (en) * 2002-08-09 2006-01-10 Intel Corporation Conditional execution of coprocessor instruction based on main processor arithmetic flags
US8504807B2 (en) 2009-12-26 2013-08-06 Intel Corporation Rotate instructions that complete execution without reading carry flag

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Z8000ユーザーズ・マニュアル[1]CPU/MMU編",第1版,シャープ株式会社,1983年7月,p.1−173,1−177

Also Published As

Publication number Publication date
JPH0588887A (en) 1993-04-09

Similar Documents

Publication Publication Date Title
US5204953A (en) One clock address pipelining in segmentation unit
US6061783A (en) Method and apparatus for manipulation of bit fields directly in a memory source
KR940009094B1 (en) Data processing system
JPS58501560A (en) microprocessor
JPH0414385B2 (en)
JP3237858B2 (en) Arithmetic unit
JPH0546383A (en) Data processor
JP3043861B2 (en) Data processing device
JPH08212075A (en) Information processor
JP2559868B2 (en) Information processing device
JP2690406B2 (en) Processor and data processing system
JPH034936B2 (en)
US5499363A (en) Microprocessor coupled to coprocessor by coprocessor bus separate from system bus to external memory for increased efficiency
JP2748957B2 (en) Data processing device
JP2703884B2 (en) Data write control method
US4723258A (en) Counter circuit
JP2553200B2 (en) Information processing device
JPS6211736B2 (en)
JPS58178464A (en) Parallel arithmetic processing unit
JPH0831033B2 (en) Data processing device
JP2001216136A (en) Addition circuit and processor
JPH0524537B2 (en)
JPS6230455B2 (en)
JP2746775B2 (en) Central processing unit
JP2905989B2 (en) I / O controller

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080310

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090310

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100310

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20100310

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20110310

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees