JP2001337821A - Data processing device - Google Patents

Data processing device

Info

Publication number
JP2001337821A
JP2001337821A JP2000161137A JP2000161137A JP2001337821A JP 2001337821 A JP2001337821 A JP 2001337821A JP 2000161137 A JP2000161137 A JP 2000161137A JP 2000161137 A JP2000161137 A JP 2000161137A JP 2001337821 A JP2001337821 A JP 2001337821A
Authority
JP
Japan
Prior art keywords
instruction
bit
data
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.)
Withdrawn
Application number
JP2000161137A
Other languages
Japanese (ja)
Inventor
Naomiki Mitsuishi
直幹 三ッ石
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2000161137A priority Critical patent/JP2001337821A/en
Publication of JP2001337821A publication Critical patent/JP2001337821A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Microcomputers (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve process efficiency for a bit-operation especially keeping bit condition as a parameter even when a program is made by high level language. SOLUTION: This data processing device uses a designated bit of a designated general register for instance bit 0 of a general register R0L as a bit-accumulator, simultaneously supports a process that upper sides 7 bits are cleared in '0'. At this time for instance data processing device stores the bit n1 of a byte data in an address aa1 in bit 0 of the general register R0L, at the same time it can execute an instruction of the processing which clears bit7-1 in '0' ('BLDS #n1,(1)a1'). Under this constitution, 'flag = iop17' is realized by 'BLDS #7, (9)op1' and 'MOV. B R0L, (6)lag' and it is possible to contribute to the simplification of the program and reducing a program capacity and speeding up.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロコンピュ
ータなどのデータ処理装置におけるビット転送やビット
演算等のビット操作を伴う処理の効率化に関し、例え
ば、半導体集積回路化されたマイクロコンピュータ、マ
イクロプロセッサ、データプロセッサ又はCPUなどの
データ処理装置、特に機器組込み型のデータプロセッサ
に適用して有効な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the efficiency of processing involving bit operations such as bit transfer and bit operation in a data processing device such as a microcomputer, for example, a microcomputer integrated into a semiconductor integrated circuit, a microprocessor, The present invention relates to a technology which is effective when applied to a data processor such as a data processor or a CPU, particularly a data processor incorporated in a device.

【0002】[0002]

【従来の技術】半導体集積回路で成るマイクロコンピュ
ータのプログラムを、C言語のような高級言語で記述す
ることが増えてきている。
2. Description of the Related Art Increasingly, microcomputer programs composed of semiconductor integrated circuits are described in a high-level language such as the C language.

【0003】機器制御においては、マイクロコンピュー
タのI/Oポートなどの周辺機能にビット単位のデータ
を用いて処理することが多い。例えば、I/Oポートの
入力の状態を参照してプログラムの分岐を行なったりす
る。また、I/Oポートに所望の値を出力して、機器制
御を実現している。
In device control, processing is often performed using data in bit units for peripheral functions such as an I / O port of a microcomputer. For example, the program is branched by referring to the input state of the I / O port. Also, a desired value is output to the I / O port to realize device control.

【0004】マイクロコンピュータのCPUには、これ
らのビット単位のデータを容易に操作できるように、い
わゆるビット操作命令を持っている。ビット操作命令に
は、ビットデータの状態を検査するビットテスト(BT
ST)命令と、所定のビットデータの値を変更する命
令、例えば指定されたビットの値を“1”にセットする
ビットセット(BSET)命令、指定されたビットの値
を“0”にクリアするビットクリア(BCLR)命令、
および指定されたビットの値を反転するビットノット
(BNOT)命令などがある。更に、キャリ(C)フラ
グをビットアキュムレータとして、ビット転送や、ビッ
ト演算を行う命令を持つものがある。例えば、汎用レジ
スタ又はメモリのオペランドの指定された1ビットをキ
ャリーフラグに転送するビットロード(BLD)命令、
汎用レジスタ又はメモリのオペランドの指定された1ビ
ットにキャリーフラグの内容を転送するビットストア
(BST)命令等がある。
[0004] The CPU of the microcomputer has a so-called bit operation instruction so as to easily operate the data in bit units. Bit operation instructions include a bit test (BT) for checking the state of bit data.
ST) instruction, an instruction for changing the value of predetermined bit data, for example, a bit set (BSET) instruction for setting a specified bit value to “1”, and clearing a specified bit value to “0” Bit clear (BCLR) instruction,
And a bit knot (BNOT) instruction for inverting the value of a designated bit. Furthermore, there is a case where a carry (C) flag is used as a bit accumulator and has an instruction to perform bit transfer or bit operation. For example, a bit load (BLD) instruction that transfers a designated bit of a general register or memory operand to a carry flag;
There is a bit store (BST) instruction for transferring the contents of the carry flag to a designated bit of a general-purpose register or a memory operand.

【0005】[0005]

【発明が解決しようとする課題】例えばビット操作処理
として、第1のビットの状態を判定し、判定結果に応じ
て第2のビットをセット/クリアする場合、前記ビット
テスト命令を用いると、 BTST #n1,@aa1 BEQ L1 BSET #n2,@aa2 BRA L2 L1:BCLR #n2,@aa2 L2:という処理で実現できる。これは、アドレス@a
a1のデータのn1番目のビットの値を判定し、判定結
果が“0”であればラベルL1に分岐し、アドレス@a
a2のデータのn2番目のビットを“0”にクリアし、
判定結果が“1”であればアドレス@aa2のデータの
n2番目のビットを“1”にセットしてラベルL2に抜
ける、という処理である。
For example, as bit manipulation processing, when the state of a first bit is determined and the second bit is set / cleared in accordance with the determination result, the bit test instruction is used. # N1, @ aa1 BEQ L1 BSET # n2, @ aa2 BRA L2 L1: BCLR # n2, @ aa2 L2: This is the address $ a
The value of the n1th bit of the data of a1 is determined.
Clear the n2th bit of the data of a2 to “0”,
If the result of the determination is "1", the n2th bit of the data at the address $ aa2 is set to "1" and the process exits to the label L2.

【0006】上記処理にキャリ(C)フラグをビットア
キュムレータとするビット転送命令BLD,BSTを用
いれば、その処理は、 BLD #n1,@aa1 BST #n2,@aa2 のように、より簡単なプログラムとして記述でき、プロ
グラム容量の縮小や高速化に寄与できる。
If bit transfer instructions BLD and BST using the carry (C) flag as a bit accumulator are used in the above processing, the processing can be performed by a simpler program such as BLD # n1, $ aa1 BST # n2, $ aa2. And can contribute to a reduction in program capacity and an increase in speed.

【0007】C言語でソースプログラムを記述する場
合、ビットデータは、ビットフィールドで即ち構造体と
して宣言する。例えば、I/OポートIOP1の各ビッ
トは、 などと定義される。
When describing a source program in the C language, bit data is declared as a bit field, that is, as a structure. For example, each bit of the I / O port IOP1 is And so on.

【0008】一方、パラメータは、 unsigend char flag; などと定義される。キャラクタ型のパラメータflag
は、バイトサイズとされ、通常RAM上に配置される。
前記IOP1のビット7の内容を、前記パラメータfl
agに代入する記述である、 flag=iop17; に対応する処理は、iop17のビットの値を、バイト
サイズに符号なし拡張(上位7ビットを0とする)し
て、前記flagの領域に格納するという処理になる。
この処理は、 MOV.B #00,R0L BLD #7,@iop1 BST #0,R0L MOV.B R0L,@flag などとなる。即ち、レジスタR0Lに“0”を転送し、
iop1のビット7をキャリーフラグ(C)にロード
し、キャリーフラグ(C)をレジスタR0Lのビット0
に転送し、レジスタR0Lの値をアドレス@flagの
領域に転送する。ビット転送命令(BLD,BST)を
もつマイクロコンピュータであっても、符号なし拡張を
行なう必要があったりして、必ずしも効率がよくない、
ということが本発明者によって見出された。
[0008] On the other hand, the parameter is defined as unsendend char flag; Character type parameter flag
Is a byte size and is usually arranged on a RAM.
The contents of bit 7 of the IOP1 are stored in the parameter fl
In a process corresponding to flag = iop17 ;, which is a description to be substituted for ag, the value of the bit of iop17 is unsignedly extended to the byte size (the upper 7 bits are set to 0) and stored in the flag area. This is the process.
This process is described in MOV. B # 00, R0L BLD # 7, {iop1 BST # 0, R0L MOV. BR0L, $ flag, etc. That is, “0” is transferred to the register R0L,
Load bit 7 of Iop1 into carry flag (C) and store carry flag (C) in bit 0 of register R0L.
And transfers the value of the register R0L to the area of the address $ flag. Even microcomputers having bit transfer instructions (BLD, BST) are not necessarily efficient because of the need to perform unsigned extension.
That has been found by the present inventors.

【0009】また、前記の通り、アドレス@flagに
直接転送できる場合はよいが、格納先が配列などであっ
て、アドレス計算を必要とするような場合、ビットアキ
ュムレータとされるCフラグは、算術演算の結果が反映
され、不所望に変化してしまう場合もあるから、一旦、
汎用レジスタに待避したり、実行順序を入れ替えたりす
る必要がある。このような事態を考慮するとなれば、C
コンパイラの開発効率を損なうことにもないり易い。
As described above, it is good if the data can be directly transferred to the address $ flag. However, if the storage destination is an array or the like and an address calculation is required, the C flag used as the bit accumulator is Because the result of the calculation is reflected and may change undesirably,
It is necessary to save to a general-purpose register or change the execution order. Given this situation, C
It is easy to avoid compromising the development efficiency of the compiler.

【0010】本発明の目的は、機器制御用マイクロコン
ピュータ等のデータ処理装置において、C言語などの高
級言語でプログラムを作成した場合も、ビット操作、特
にビットの状態をパラメータなどとして保存したりする
場合の処理効率の向上を実現することにある。
An object of the present invention is to store a bit operation, particularly a bit state, as a parameter or the like in a data processing device such as a microcomputer for controlling devices even when a program is created in a high-level language such as C language. It is to realize the improvement of the processing efficiency in the case.

【0011】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0012】[0012]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0013】〔1〕データ処理装置は、ビットアキュム
レータとして、所定の汎用レジスタの所定のビット、例
えば、汎用レジスタR0Lのビット0を用いるように
し、同時に上位側7ビットを“0”にクリアするとい
う、処理をサポートする。このとき、データ処理装置
は、例えば、“BLDS #n1,@aa1”と表せる
命令(第1の所定の命令)を実行可能である。この命令
は、アドレスaa1のバイトデータのビットn1を、汎
用レジスタR0Lのビット0に格納するとともに、ビッ
ト7〜1を“0”にクリアする処理を指示する命令であ
る。
[1] The data processing device uses a predetermined bit of a predetermined general-purpose register, for example, bit 0 of the general-purpose register R0L, as a bit accumulator, and simultaneously clears the upper 7 bits to “0”. , Support processing. At this time, the data processing device can execute, for example, an instruction (first predetermined instruction) that can be expressed as “BLDS # n1, @ aa1”. This instruction is an instruction for storing the bit n1 of the byte data at the address aa1 in the bit 0 of the general-purpose register R0L and clearing the bits 7-1 to "0".

【0014】命令セットに、キャリ(C)フラグをビッ
トアキュムレータとする前記ビットロード(BLD)命
令を持つ場合、前記BLDS命令実行において所定のビ
ットを抽出する回路手段をBLD命令と共通に利用し、
抽出したビットをビット0に格納し、上位側を“0”に
すたデータを生成する回路を設け、汎用レジスタR0L
への書込み信号を発生するようにすればよい。
When the instruction set has the bit load (BLD) instruction using the carry (C) flag as a bit accumulator, circuit means for extracting a predetermined bit in the execution of the BLDS instruction is used in common with the BLD instruction.
A circuit for storing the extracted bits in bit 0 and generating data in which the upper bit is set to “0” is provided.
A write signal may be generated.

【0015】また、データ処理装置は、“BSTS #
n2,@aa2”と表せる命令を実行可能である。この
命令“BSTS #n2,@aa2”は、汎用レジスタ
R0Lのビット0を、アドレスaa2のバイトデータの
ビットn2に格納する処理を指示する。このとき、汎用
レジスタR0Lの上位ビットは無視され、アドレスaa
2の他のビットは保持される。
[0015] The data processing apparatus is provided with a "BSTS #
The instruction “BSTS # n2, $ aa2” instructs to store bit 0 of the general-purpose register R0L in bit n2 of the byte data of the address aa2. At this time, the upper bits of the general-purpose register R0L are ignored, and the address aa
The other two bits are retained.

【0016】命令セットに、汎用レジスタの指定された
1ビットにキャリーフラグ(C)の内容を転送するビッ
トストア(BST)命令を持つ場合、前記BSTS命令
実行において汎用レジスタR0Lのビット0を出力する
機能を新たに追加し、所定のビットへの挿入機能は共通
にすることができる。
When the instruction set has a bit store (BST) instruction for transferring the contents of the carry flag (C) to the designated one bit of the general-purpose register, bit 0 of the general-purpose register R0L is output in the execution of the BSTS instruction. A new function can be added, and the function of inserting into a predetermined bit can be made common.

【0017】命令コードなどに余裕がある場合には、前
記BLDS命令、BSTS命令において、汎用レジスタ
をR0Lに固定することなく、他の汎用レジスタも利用
可能にしてよい。複数のビットを操作する場合などに、
プログラミングを容易にできる。
If there is room in the instruction code or the like, other general-purpose registers may be used in the BLDS instruction and BSTS instruction without fixing the general-purpose register to R0L. When manipulating multiple bits,
Easy programming.

【0018】また、前記BLDS命令、BSTS命令に
おいて、ビットアキュムレータを、前記汎用レジスタR
0Lのビット0とするか、キャリ(C)フラグとするか
を選択できるようにしてよい。マイクロコンピュータ又
はコンパイラの一方のみに、前記選択する手段(CPU
CRの設定)を設けてもよい。既存のプログラムの互換
性を維持することもできる。
In the BLDS instruction and BSTS instruction, the bit accumulator is replaced with the general-purpose register R.
It may be made possible to select whether to use a 0 bit or a carry (C) flag. Only one of the microcomputer and the compiler is provided with the selecting means (CPU
CR setting). It can also maintain compatibility with existing programs.

【0019】上記BLDS命令によって、前記“fla
g=iop17;”は、 BLDS #7,@iop1 MOV.B R0L,@flag とすることができ、より簡単なプログラムとし、プログ
ラム容量の縮小や高速化に寄与できる。
According to the BLDS instruction, the "fla"
g = iop17; "can be BLDS # 7, $ iop1 MOV.BR0L, $ flag, which can be a simpler program, which can contribute to reduction in program capacity and speeding up.

【0020】汎用レジスタR0Lを使用しない限り、ア
ドレス計算を行なっても問題なく、Cコンパイラの開発
効率を損なうことが少ない。
As long as the general-purpose register R0L is not used, there is no problem in performing the address calculation, and the development efficiency of the C compiler is hardly impaired.

【0021】〔2〕更に好適な例においては、ビット転
送命令として、第1の所望のアドレスの所定のビットか
ら、第2の所望のアドレスの特定ビット例えばビット0
へ転送するようにし、同時に上位7ビットを0にクリア
する命令を実行できるようにしてよい。例えば、そのよ
うな命令(第2の所定の命令)は、 BLDMOV #n1,@aa1,@aa2 と表すことができる。この命令は、アドレスaa1のバ
イトデータのビットn1を、アドレスaa2のバイトデ
ータのビット0に格納するとともに、ビット7〜1を0
にクリアするようにされる。上記BLDMOV命令によ
って、前記“flag=iop17;”は、 BLDMOV #7,@iop1,@flag とすることができ、より簡単なプログラムとし、プログ
ラム容量の縮小や高速化に寄与できる。汎用レジスタR
0Lを使用せずに転送でき、プログラム効率を向上する
ことができる。
[2] In a further preferred example, as a bit transfer instruction, a specific bit of a second desired address, for example, bit 0, from a predetermined bit of a first desired address
And the instruction to clear the upper 7 bits to 0 may be executed at the same time. For example, such an instruction (a second predetermined instruction) can be represented as BLDMOV # n1, $ aa1, $ aa2. This instruction stores bit n1 of the byte data at address aa1 in bit 0 of the byte data at address aa2, and sets bits 7-1 to 0.
To be cleared. By the BLDMOV instruction, the "flag = iop17;" can be changed to BLDMOV # 7, $ iop1, $ flag, which can be a simpler program, which can contribute to reduction in program capacity and speeding up. General-purpose register R
The transfer can be performed without using 0L, and the program efficiency can be improved.

【0022】〔3〕また、別の例においては、ビット転
送命令として、第1の、所望のアドレスの所定のビット
から、第2の、所望のアドレスの所定のビットへ転送す
るようにしてもよい。この命令(第3の所定の命令)
は、例えば BMOV #n1,@aa1,#n2,@aa2 と表すことができる。この命令は、アドレスaa1のバ
イトデータのビットn1を、アドレスaa2のバイトデ
ータのビットn2に格納するとともに、そのほかのビッ
トを保持するようにされる。即ち、BLDS命令とBS
TS命令を同一の命令としたものである。I/Oポート
のビットの状態の保持に、RAMなどのバイトデータの
内、所要のビットデータのみを使用し、当該バイトデー
タの他のビットは、他の用途に有効に利用でき、RAM
などのメモリの使用効率を向上することができる。特に
アセンブリ言語などで、プログラミングを行なう場合に
は、有効である。また、C言語などにおいても、RAM
などにおくパラメータなどを、構造体として、ビットフ
ィールド宣言をおこなうことによって、RAM上の1バ
イトに、複数のビットを配置することができ、RAMの
使用量を節約できる。内蔵メモリのみで動作する、いわ
ゆるシングルチップモード時などに有効である。
[3] In another example, as a bit transfer instruction, a predetermined bit of a first desired address is transferred to a second predetermined bit of a desired address. Good. This command (third predetermined command)
Can be expressed as, for example, BMOV # n1, # aa1, # n2, # aa2. This instruction stores bit n1 of the byte data at address aa1 in bit n2 of the byte data at address aa2, and holds the other bits. That is, BLDS instruction and BS
The TS instruction is the same instruction. Only the necessary bit data of the byte data of the RAM or the like is used to hold the state of the bit of the I / O port, and the other bits of the byte data can be effectively used for other purposes.
For example, the efficiency of using a memory can be improved. This is particularly effective when programming is performed in an assembly language or the like. In C language, etc., RAM
By declaring a bit field as a structure with parameters and the like to be stored in the memory, a plurality of bits can be arranged in one byte in the RAM, and the amount of RAM used can be reduced. This is effective in a so-called single chip mode in which only the built-in memory operates.

【0023】また、前記汎用レジスタR0Lのビット0
や、キャリ(C)フラグなどのビットアキュムレータを
使用しないので、プログラム効率を向上し、使い勝手を
向上することができる。
Further, bit 0 of the general-purpose register R0L
In addition, since a bit accumulator such as a carry (C) flag is not used, program efficiency can be improved and usability can be improved.

【0024】この例を拡張した命令として、上記一方の
メモリを汎用レジスタとした命令をサポートすることも
できる。即ち、デスティネーション側を汎用レジスタと
した命令として、 BMOV #n1,@aa1,#n2,Rd の命令は、アドレスaa1のバイトデータのビットn1
を、汎用レジスタRdのバイトデータのビットn2に格
納するとともに、そのほかのビットを保持するようにさ
れる。
As an extended instruction of this example, an instruction using one of the memories as a general-purpose register can be supported. That is, as an instruction using the destination side as a general-purpose register, the instruction of BMOV # n1, $ aa1, # n2, Rd is stored in bit n1 of byte data of address aa1.
Is stored in the bit n2 of the byte data of the general-purpose register Rd, and the other bits are held.

【0025】また、ソース側を汎用レジスタとした命令
として、 BMOV #n1,Rs,#n2,@aa2 の命令は、汎用レジスタRsのバイトデータのビットn
1を、アドレスaa2のバイトデータのビットn2に格
納するとともに、そのほかのビットを保持するようにさ
れる。
As an instruction using the source side as a general-purpose register, the instruction of BMOV # n1, Rs, # n2,.
1 is stored in the bit n2 of the byte data at the address aa2, and the other bits are held.

【0026】さらに、ソース側、デスティネーション側
を汎用レジスタとした命令として、 BMOV #n1,Rs,#n2,Rd の命令は、汎用レジスタRsのバイトデータのビットn
1を、汎用レジスタRdのバイトデータのビットn2に
格納するとともに、そのほかのビットを保持するように
される。これらの命令をサポートすることにより、命令
と使用するデータの指定との間の制限がなくなり、乃至
少なくなり、プログラミング性を向上できる。
Further, the instructions of BMOV # n1, Rs, # n2, and Rd are instructions using the source side and the destination side as general purpose registers.
1 is stored in the bit n2 of the byte data of the general-purpose register Rd, and the other bits are held. By supporting these instructions, restrictions between instructions and the designation of data to be used are eliminated or reduced, and programmability can be improved.

【0027】〔4〕ビット転送命令においては、ソース
/デスティネーションのメモリからCPU内部のラッチ
手段(TRD、DBR)への転送を行なう命令実行機能
(bld−1、bst−1)と、汎用レジスタまたはラ
ッチ手段から所定のビットを抽出したり(bld、bm
ov1)、また、ビットアキュムレータなどを所定のビ
ットへ代入したり(bst、bmov2)する命令実行
機能を組合せるようにするとよい。
[4] In the case of a bit transfer instruction, an instruction execution function (bld-1, bst-1) for transferring data from a source / destination memory to latch means (TRD, DBR) inside the CPU, and a general-purpose register Alternatively, a predetermined bit is extracted from the latch means (bld, bm
ov1), and an instruction execution function of substituting a bit accumulator or the like into a predetermined bit (bst, bmov2) may be combined.

【0028】メモリからの転送を行なう命令実行機能を
共通化したり、ビット操作自体を行なう命令実行機能
を、汎用レジスタに対するビット操作命令と共通化した
りして、論理規模の縮小や、開発期間の短縮を図ること
ができる。
The instruction execution function for transferring data from the memory is shared, and the instruction execution function for performing the bit operation itself is shared with the bit operation instruction for the general-purpose register, thereby reducing the logic scale and the development period. Can be achieved.

【0029】前記ラッチ手段の少なくとも1つ(TR
D)は所望のビットを抽出して出力する機能、所望のビ
ットのみを格納する機能を持つことによって、ALUの
論理構成や動作を複雑化したりすることなく、ビットア
キュムレータとの間のロード/ストアと同様の動作によ
って、任意ビット間のビット転送を実現できる。
At least one of the latch means (TR
D) has a function of extracting and outputting a desired bit and a function of storing only the desired bit, so that load / store with the bit accumulator can be performed without complicating the logical configuration and operation of the ALU. By the same operation as described above, bit transfer between arbitrary bits can be realized.

【0030】前記メモリからの転送を行なう命令実行機
能において、当該メモリの実効アドレスを、別のラッチ
手段(TRA)に格納するとともに、前記ビット操作自
体を行なう命令実行機能は、結果を前記ラッチ手段(T
RD)に格納する。引き続き、メモリへの転送命令機能
を内部で生成し、前記アドレスを格納したラッチ手段の
内容をアドレスとして、前記演算結果を格納したラッチ
手段の内容をデータとして、メモリへの書込みを行なう
ようにする。メモリからラッチ手段へのデータ読み込
み、ラッチ手段の内容に基づくメモリへのライトは既存
の命令と共通化できるから、既存の命令動作を大きく変
更することなく、また、論理規模の増加を最小限にする
ことができる。
In the instruction execution function for transferring data from the memory, the effective address of the memory is stored in another latch means (TRA), and the instruction execution function for performing the bit operation itself stores the result in the latch means. (T
RD). Subsequently, a transfer command function to the memory is internally generated, and the content of the latch means storing the address is used as an address, and the content of the latch means storing the operation result is used as data to write to the memory. . Data reading from the memory to the latch means and writing to the memory based on the contents of the latch means can be shared with existing instructions, so that the existing instruction operation is not significantly changed and the increase in logical scale is minimized. can do.

【0031】前記ビットアキュムレータの選択を行なう
場合には、コンパイラなどの開発装置で、ビットアキュ
ムレータの選択を行なう手段を持つようにし、この選択
に基づいて、CPUの実行すべきプログラムを相違する
ようにすればよい。
When the bit accumulator is selected, a development device such as a compiler has means for selecting the bit accumulator, and based on this selection, the program to be executed by the CPU is made different. do it.

【0032】[0032]

【発明の実施の形態】図2には本発明に係るデータ処理
装置の一例であるCPU(例えば後述の図4に示される
CPU1)に内蔵されている汎用レジスタ及び制御レジ
スタの構成例(プログラミングモデル)を示す。
FIG. 2 shows a configuration example (programming model) of general-purpose registers and control registers incorporated in a CPU (for example, a CPU 1 shown in FIG. 4 described later) which is an example of a data processing apparatus according to the present invention. ).

【0033】CPUは、32ビット長の汎用レジスタを
8本持っている。汎用レジスタは、全て同一機能を持っ
ており、アドレスレジスタとしてもデータレジスタとし
ても使用することができる。
The CPU has eight 32-bit general-purpose registers. The general-purpose registers all have the same function, and can be used as both an address register and a data register.

【0034】データレジスタとしてしては32ビット、
16ビットおよび8ビットレジスタとして使用きる。ア
ドレスレジスタおよび32ビットレジスタとしては、一
括して汎用レジスタER(ER0〜ER7)として使用
する。16ビットレジスタとしては、汎用レジスタER
を分割して汎用レジスタE(E0〜E7)、汎用レジス
タR(R0〜R7)として使用する。これらは同等の機
能を持っており、16ビットジスタを最大16本まで使
用することができる。8ビットレジスタとしては、汎用
レジスタRを分割して汎用レジスタRH(R0H〜R7
H)、汎用レジスタRL(R0L〜R7L)として使用
する。これらは同等の機能を持っており、8ビットレジ
スタを最大16本まで使用することができる。各レジス
タ独立に使用方法を選択することができる。
As a data register, 32 bits,
Can be used as 16-bit and 8-bit registers. The address register and the 32-bit register are collectively used as general-purpose registers ER (ER0 to ER7). As a 16-bit register, a general-purpose register ER
Is divided and used as general-purpose registers E (E0 to E7) and general-purpose registers R (R0 to R7). These have the same function, and up to 16 16-bit registers can be used. As an 8-bit register, the general-purpose register R is divided into general-purpose registers RH (R0H to R7
H), used as general-purpose registers RL (R0L to R7L). These have equivalent functions and can use up to 16 8-bit registers. The method of use can be selected independently for each register.

【0035】汎用レジスタR0Lのビット0には、ビッ
トアキュムレータとしての機能がある。ビットアキュム
レータの場合、ビット0以外の上位側ビットは、ライト
時“0”とされ、リード時に無視される。
Bit 0 of general-purpose register R0L has a function as a bit accumulator. In the case of a bit accumulator, upper bits other than bit 0 are set to “0” at the time of writing and ignored at the time of reading.

【0036】汎用レジスタER7には、汎用レジスタと
しての機能に加えて、スタックポインタ(SP)として
の機能が割り当てられており、例外処理やサブルーチン
分岐などで暗黙的に使用される。例外処理は割込み処理
を含む。
The general-purpose register ER7 is assigned a function as a stack pointer (SP) in addition to the function as a general-purpose register, and is used implicitly in exception processing and subroutine branching. Exception processing includes interrupt processing.

【0037】PCは24ビットのプログラムカウンタ
で、CPU1が次に実行する命令のアドレスを示す。特
に制限されないもののCPU1の命令は、すべて2バイ
ト(ワード)を単位としているため、最下位ビットは無
効であり、命令リード時には最下位ビットは0とみなさ
れる。
PC is a 24-bit program counter which indicates the address of an instruction to be executed next by the CPU 1. Although not particularly limited, since the instructions of the CPU 1 are all in units of 2 bytes (words), the least significant bit is invalid, and the least significant bit is regarded as 0 when the instruction is read.

【0038】CCRは8ビットのコンディションコード
レジスタで、CPU1の内部状態を示している。割込み
マスクビット(I)とハーフキャリ(H)、ネガティブ
(N)、ゼロ(Z)、オーバフロー(V)、キャリ
(C)の各フラグを含む8ビットで構成されている。キ
ャリフラグ(C)は、算術演算時のキャリ/ボロー、シ
フト/ローテートのキャリとしての動作に加えて、ビッ
トアキュムレータとしての機能を持つ。
CCR is an 8-bit condition code register which indicates the internal state of the CPU 1. It is composed of 8 bits including an interrupt mask bit (I) and flags of half carry (H), negative (N), zero (Z), overflow (V) and carry (C). The carry flag (C) has a function as a bit accumulator in addition to an operation as a carry for carry / borrow and shift / rotate in an arithmetic operation.

【0039】EXRは8ビットのレジスタで、割込みな
どの例外処理の制御を行なう。割込みマスクビット(I
2〜I0)とトレース(T)の各ビットを含んでいる。
EXR is an 8-bit register that controls exception processing such as interrupts. Interrupt mask bit (I
2 to I0) and trace (T).

【0040】汎用レジスタ上のデータ構成例、メモリ空
間上のデータ構成、アドレッシングモードと実効アドレ
スの計算方法などについては、平成7年3月(株)日立
製作所発行『H8S/2600シリーズH8S/200
0シリーズプログラミングマニュアル』記載のCPUと
同様である。
For an example of a data configuration on a general-purpose register, a data configuration on a memory space, an addressing mode and a method of calculating an effective address, see “H8S / 2600 Series H8S / 200” issued by Hitachi, Ltd. in March 1995.
0 Series Programming Manual ”.

【0041】ビットアキュムレータとして、前記レジス
タR0Lのビット0を使用するか、CCRのキャリ
(C)フラグを使用するかを選択可能にされる。その選
択は、後述の制御レジスタCPUCRの所定のビットで
指定する。
As the bit accumulator, it is possible to select whether to use the bit 0 of the register R0L or to use the carry (C) flag of the CCR. The selection is specified by a predetermined bit of a control register CPUCR described later.

【0042】図1には本発明に係るデータ処理装置の一
例であるCPU1の命令セットに含まれるビット転送命
令(BLDS、BSTS、BLDMOV、BMOV)の
内容が例示される。
FIG. 1 illustrates the contents of bit transfer instructions (BLDS, BSTS, BLDMOV, BMOV) included in the instruction set of the CPU 1 as an example of the data processing apparatus according to the present invention.

【0043】BLDS命令は、“BLDS #n1,
<EA1>”のアセンブラフォーマットを持つ。R0L
をビットアキュムレータとする場合、ソースデータの指
定されたビットを、汎用レジスタR0Lのビット0に格
納し、上位ビットは0とする。ソースデータは、汎用レ
ジスタまたはメモリであって、<EA1>で指定する。
指定ビットは、そのビット番号をn1で指定する。
The BLDS instruction is “BLDS # n1,
<EA1> ”. R0L
Is a bit accumulator, the designated bit of the source data is stored in bit 0 of the general-purpose register R0L, and the upper bit is set to 0. The source data is a general-purpose register or a memory, and is specified by <EA1>.
The designation bit designates the bit number by n1.

【0044】BLDMOV命令は、“BLDMOV #
n1,<EA1>,<EA2>”のアセンブラフォーマ
ットを持つ。BLDS命令と同様であるが、結果は、汎
用レジスタR0Lではなく、デスティネーションのロケ
ーションに格納する。デスティネーションのロケーショ
ンは<EA2>で指定される。
The BLDMOV instruction is "BLDMOV #
n1, <EA1>, <EA2>". Similar to the BLDS instruction, but the result is stored not in the general-purpose register R0L but in the destination location. The destination location is <EA2>. It is specified.

【0045】BSTS命令は、“BSTS #n2,
<EA2>”のアセンブラフォーマットを持つ。R0L
をビットアキュムレータとする場合、汎用レジスタR0
Lのビット0を、デスティネーションデータの指定され
たビットに格納する。R0Lの上位ビットは無視し、デ
スティネーションデータの他のビットは保持する。デス
ティネーションのロケーションは、汎用レジスタまたは
メモリであって、<EA2>で指定する。指定ビット
は、そのビット番号をn2で指定する。
The BSTS instruction is “BSTS # n2,
<EA2> ”. R0L
Is a bit accumulator, the general-purpose register R0
The bit 0 of L is stored in the designated bit of the destination data. The upper bits of R0L are ignored, and the other bits of the destination data are retained. The location of the destination is a general-purpose register or a memory, and is specified by <EA2>. The designation bit designates the bit number by n2.

【0046】BMOV命令は、“BMOV #n1,<
EA1>,#n2,<EA2>”のアセンブラフォーマ
ットを持つ。ソースデータの指定されたビットを、デス
ティネーションデータの別の指定されたビットに格納す
る。ソースデータの他のビットは無視し、デスティネー
ションデータの他のビットは保持する。ソース、デステ
ィネーションのロケーションは、汎用レジスタまたはメ
モリであって、それぞれ<EA1>、<EA2>で指定
する。ソースデータ、デスティネーションデータの指定
ビットは、そのビット番号をそれぞれ、n1、n2で指
定する。
The BMOV instruction is “BMOV # n1, <
EA1>, # n2, <EA2>". The designated bit of the source data is stored in another designated bit of the destination data. The other bits of the source data are ignored and the destination bit is ignored. The source and destination locations are general-purpose registers or memories, and are designated by <EA1> and <EA2>, respectively. The bit numbers are designated by n1 and n2, respectively.

【0047】図3には(1)ビット0固定転送命令であ
るビット転送命令(BLDS、BSTS、BLDMO
V)、及び(2)任意ビット間のビット転送命令(BM
OV)の命令フォーマットを示す。
FIG. 3 shows bit transfer instructions (BLDS, BSTS, BLDMO) which are (1) bit 0 fixed transfer instructions.
V) and (2) a bit transfer instruction (BM
OV) instruction format.

【0048】BLDS命令は、汎用レジスタ上またはア
ドレス空間上のデータの所定のビットを、ビットアキュ
ムレータ(CまたはR0L[0])に格納するものであ
る。
The BLDS instruction stores a predetermined bit of data on a general-purpose register or an address space in a bit accumulator (C or R0L [0]).

【0049】BSTS命令は、ビットアキュムレータ
(CまたはR0L[0])を、汎用レジスタ上またはア
ドレス空間上のデータの所定のビットに格納し、そのほ
かのビットは保持するものである。
The BSTS instruction stores a bit accumulator (C or R0L [0]) in predetermined bits of data on a general-purpose register or an address space, and retains other bits.

【0050】アドレッシングモードについては、代表的
にレジスタ直接と、絶対アドレス8ビットの場合のみを
示す。
As for the addressing mode, typically, only the case of direct register and the case of an absolute address of 8 bits are shown.

【0051】レジスタ直接の場合は、1ワードの命令コ
ードで、各命令の機能を示すオペレーションフィールド
(op)と、ビット番号を指定するビットフィールド
(n)3ビットと、汎用レジスタを指定するレジスタフ
ィールド(r)4ビット、を有する。
In the case of a direct register, an operation field (op) indicating the function of each instruction, a bit field (n) for specifying a bit number, and a register field for specifying a general-purpose register are indicated by a one-word instruction code. (R) 4 bits.

【0052】絶対アドレス8ビットの場合は、2ワード
の命令コードで、第1ワードに、オペレーションフィー
ルド(op)とEA拡張部である絶対アドレス(EA)
を持ち、第2ワードに、前記レジスタ直接同様に、オペ
レーションフィールド(op)と、ビット番号を指定す
るビットフィールド(n)3ビットを有する。
When the absolute address is 8 bits, an operation field (op) and an absolute address (EA) which is an EA extension are included in the first word with a 2-word instruction code.
The second word has an operation field (op) and three bits of a bit field (n) for designating a bit number, similarly to the register directly.

【0053】第2ワードを、前記レジスタ直接の命令コ
ードと共通化する場合、データの所在を示すレジスタフ
ィールド(r)4ビットが不要になる。ビットアキュム
レータを汎用レジスタR0Lと限定せずに、レジスタ指
定フィールド(r)で指定した、任意のレジスタとする
ことができる。即ち、BLDS命令は、汎用レジスタ上
またはアドレス空間上のデータの所定のビットを、指定
した汎用レジスタのビット0に格納し、その上位ビット
を0とするようにする。ビットアキュムレータを汎用レ
ジスタR0Lと限定するより、柔軟な使用が可能にな
る。具体的には、複数のビットを操作するような場合
に、これに対応して、汎用レジスタを複数使用すること
ができる。
When the second word is shared with the register direct instruction code, 4 bits of the register field (r) indicating the location of the data become unnecessary. The bit accumulator is not limited to the general-purpose register R0L, but may be any register specified by the register specification field (r). That is, the BLDS instruction stores a predetermined bit of data on the general-purpose register or the address space in bit 0 of the designated general-purpose register, and sets the upper bit to 0. Flexible use is possible rather than limiting the bit accumulator to the general-purpose register R0L. Specifically, when a plurality of bits are manipulated, a plurality of general-purpose registers can be used correspondingly.

【0054】オペレーションフィールドの内容は、各命
令を定義するために、適宜設定される。
The contents of the operation field are set as appropriate to define each instruction.

【0055】任意ビット間のビット転送命令BMOVは
以下の通りである。レジスタ−レジスタ間の場合は、2
ワードの命令コードで、第1ワードに、オペレーション
フィールド(op)と汎用レジスタを指定するレジスタ
フィールド(r)4ビットを持ち、第2ワードに、オペ
レーションフィールド(op)と、ソース用、デスティ
ネーション用ビット番号を指定するビットフィールド
(n)各3ビット、を有する。
The bit transfer instruction BMOV between arbitrary bits is as follows. 2 between registers
In an instruction code of a word, the first word has an operation field (op) and a register field (r) for designating a general-purpose register, 4 bits, and the second word has an operation field (op), a source field, and a destination field. It has a bit field (n) for specifying a bit number, each three bits.

【0056】また、メモリと汎用レジスタとの間のビッ
ト転送命令は、汎用レジスタ間のビット転送命令は、レ
ジスタ指定フィールド、ビット指定フィールドを2つず
つ必要とし、1ワードの命令コードでは実現できない。
2ワード命令の場合は、BLDS命令とBSTS命令を
組合せたものと同等であるので、かかる汎用レジスタ間
のビット転送命令は定義しなくてもよいが、定義してあ
る方が、ビットアキュムレータを保持できるし、命令の
機能とアドレッシングモードの組合せが任意にできるの
で、使い易く、プログラム効率を向上できる。
A bit transfer instruction between a memory and a general-purpose register requires two register specification fields and two bit specification fields, and cannot be realized by a one-word instruction code.
In the case of a two-word instruction, it is equivalent to a combination of a BLDS instruction and a BSTS instruction. Therefore, the bit transfer instruction between the general-purpose registers does not need to be defined, but the defined one holds the bit accumulator. Since the combination of the instruction function and the addressing mode can be arbitrarily set, it is easy to use and the program efficiency can be improved.

【0057】図4には本発明に係るデータ処理装置の一
例である前記CPU1の構成例を示す。
FIG. 4 shows a configuration example of the CPU 1 which is an example of the data processing apparatus according to the present invention.

【0058】CPU1は、命令フェッチと命令解読を行
って制御信号を生成する命令制御部(命令制御手段)2
と前記制御信号に基づいて演算を行って命令を実行する
実行部(命令実行手段)3から構成される。
CPU 1 has an instruction control section (instruction control means) 2 for performing instruction fetch and instruction decoding to generate a control signal.
And an execution unit (instruction execution means) 3 for executing an instruction by performing an operation based on the control signal.

【0059】命令制御部2は、命令レジスタIR、命令
変更部CHG、命令デコーダDEC、レジスタセレクタ
RSEL、割込み制御部INTを含む。
The instruction control section 2 includes an instruction register IR, an instruction change section CHG, an instruction decoder DEC, a register selector RSEL, and an interrupt control section INT.

【0060】命令レジスタIRには内部データバスID
Bから命令がロードされる。ロードされた命令は命令デ
コーダDECによって解読される。命令デコーダDEC
は、例えば、マイクロROM或はPLA(Progra
mable Logic Array)または布線論理で
構成される。命令デコーダDECの出力の一部が命令デ
コーダDECにフィードバックされている。これは各命
令コード内の遷移に用いるステージコード(TMG)
と、命令コード間に用いる制御信号(MODS、MOD
D)を含む。
The internal data bus ID is stored in the instruction register IR.
Instructions are loaded from B. The loaded instruction is decoded by the instruction decoder DEC. Instruction decoder DEC
Is, for example, a micro ROM or a PLA (Program).
(M. Logic Array) or wired logic. A part of the output of the instruction decoder DEC is fed back to the instruction decoder DEC. This is the stage code (TMG) used for the transition in each instruction code
And control signals (MODS, MOD
D).

【0061】図4では命令デコーダDECの一部の機能
が概念的に図示されているしている。転送命令コード
(bld−1、bst−1、mov−st)は、ステー
トコード信号(nxttmg)、割込みマスク信号(i
ntmsk)、メモリリード信号(read)、メモリ
ライト信号(write)、テンポラリレジスタリード
/ライト信号(TRDr/w、TRAr/w:後述のt
rdgb、wbtrd、bittrdなどを含む)、制
御信号(mod:後述のMODS、MODDを含む)を
出力する。
FIG. 4 conceptually illustrates some functions of the instruction decoder DEC. The transfer instruction code (bld-1, bst-1, mov-st) is composed of a state code signal (nxttmg) and an interrupt mask signal (i
ntmsk), memory read signal (read), memory write signal (write), temporary register read / write signal (TRDr / w, TRAr / w: t described later)
rdgb, wbtrd, bittrd, etc.) and a control signal (mod: including MODS, MODED described later).

【0062】演算命令コード(exe:後述のbld−
0、bst−0、bldst−0、bmov−0a、b
mov−0b)は、割込みマスク信号(intms
k)、ソース汎用レジスタリード信号(Rsrd)、デ
スティネーション汎用レジスタリード/ライト信号(R
dr/w)、汎用レジスタR0Lリード/ライト信号
(R0Lr/w:後述のr0lgb、wbrolを含
む)、キャリフラグセット信号(Cset)、リードデ
ータバッファリード信号(DBRrd:後述のdbrg
bを含む)、テンポラリレジスタリード/ライト信号
(TRDr/w:後述のtrdgb、wbtrdを含
む)、ALU制御信号、及びデータ転送動作を内部生成
するための制御信号(mkmov)を出力する。
The operation instruction code (exe: bld-
0, bst-0, bldst-0, bmov-0a, b
mov-0b) is an interrupt mask signal (intms
k), source general register read signal (Rsrd), destination general register read / write signal (R
dr / w), general-purpose register R0L read / write signal (R0Lr / w: includes r0lgb, wbrol described later), carry flag set signal (Cset), read data buffer read signal (DBRrd: dbrg described below)
b), a temporary register read / write signal (TRDr / w: including trdgb and wbtrd described later), an ALU control signal, and a control signal (mkmov) for internally generating a data transfer operation.

【0063】命令デコーダDECはビットアキュムレー
タ選択信号を入力し、汎用レジスタR0Lリード/ライ
ト信号、キャリフラグセット信号が切り替えられる。ま
た、制御信号MODS、MODDによって、使用するデ
ータの入力元/出力先が切り替えられる。デスティネー
ション側メモリ(MODD=1)の場合は、内部でライ
ト型転送命令と同等の動作を行なう命令コードを発生さ
せる信号(mkmov)を出力する。また、所定のビッ
トフィールド(図1、図3のn1、n2)を、算術論理
演算器ALU及びテンポラリレジスタTRDに与える。
命令デコーダDECと命令実行の詳細については、後述
する。
The instruction decoder DEC receives a bit accumulator selection signal, and switches between a general-purpose register R0L read / write signal and a carry flag set signal. Further, the input source / output destination of the data to be used is switched by the control signals MODS and MODED. In the case of the destination-side memory (MODD = 1), a signal (mkmov) for generating an instruction code for performing an operation equivalent to a write-type transfer instruction internally is output. Further, predetermined bit fields (n1, n2 in FIGS. 1 and 3) are provided to the arithmetic and logic unit ALU and the temporary register TRD.
The details of the instruction decoder DEC and the instruction execution will be described later.

【0064】命令レジスタIRは、リードした命令を一
旦格納する。実行すべき命令は、命令デコーダDECに
出力される。
The instruction register IR temporarily stores the read instruction. The instruction to be executed is output to the instruction decoder DEC.

【0065】命令変更部CHGは、リードした命令以外
の命令コードを、命令デコーダDECに与える場合に動
作し、そのほかの場合は、命令レジスタIRの内容を命
令デコーダDECに与える。リードした命令以外の命令
コードは、割込み制御部INTの指示によって、割込み
などの例外処理を実行するとき、及び、命令デコーダD
ECの指示(mkmov)によって、前記内部でライト
型転送命令と同等の動作を行なう命令コード(mov−
st)を発生させるとき、などに用いる。
The instruction change unit CHG operates when an instruction code other than the read instruction is given to the instruction decoder DEC, and otherwise gives the contents of the instruction register IR to the instruction decoder DEC. Instruction codes other than the read instruction are used when an exception process such as an interrupt is executed according to an instruction from the interrupt control unit INT, and when the instruction decoder D
The instruction code (mov-m-v) that performs the same operation as the write-type transfer instruction internally in accordance with the instruction (mkmov) of the EC
It is used when generating (st).

【0066】割込み制御部INTは、後述の図14の割
込みコントローラ32の出力する割込み要求信号を受け
付ける。また、命令デコーダDECの出力する割込みマ
スク信号を参照して、割込みがマスクされていなけれ
ば、命令変更部CHGに割込みを指示する。
The interrupt controller INT accepts an interrupt request signal output from an interrupt controller 32 shown in FIG. 14 described later. Also, referring to the interrupt mask signal output from the instruction decoder DEC, if the interrupt is not masked, the interrupt is instructed to the instruction changing unit CHG.

【0067】図1及び図3に示されるところの、複数の
命令コード(オペレーションフィールドを持つワード)
を一連のものとして実行する命令の場合には、それぞれ
の命令コードが割込みマスクを指示して、所定の組合せ
の命令コードの実行が割り込みによって途切れないよう
にされている。
A plurality of instruction codes (words having an operation field) as shown in FIGS.
Are executed as a series of instructions, each instruction code indicates an interrupt mask so that execution of a predetermined combination of instruction codes is not interrupted by interruption.

【0068】レジスタセレクタRSELは、命令デコー
ダDECの指示と、命令コード中に含まれるレジスタフ
ィールドの情報に基づいて、汎用レジスタを選択する。
汎用レジスタR0Lをビットアキュムレータとして使用
する場合には、命令デコーダDECから直接指定可能に
なっている。
The register selector RSEL selects a general-purpose register based on the instruction of the instruction decoder DEC and the information of the register field included in the instruction code.
When the general-purpose register R0L is used as a bit accumulator, it can be directly specified from the instruction decoder DEC.

【0069】実行部3には、汎用レジスタER0〜ER
7、プログラムカウンタPC、コンディションコードレ
ジスタCCR、テンポラリレジスタTRA、TRD、算
術論理演算器ALU、分岐アドレス演算器AU、インク
リメンタINC、リードデータバッファDBR、ライト
データバッファDBW、アドレスバッファMAを含む。
これらのブロックはGBバス、DBバス、WBバスによ
って相互に接続されている。テンポラリデータレジスタ
TRDには、ビット入出力機能を備える。
The execution unit 3 includes general-purpose registers ER0 to ER
7, a program counter PC, a condition code register CCR, temporary registers TRA and TRD, an arithmetic and logic unit ALU, a branch address operation unit AU, an incrementer INC, a read data buffer DBR, a write data buffer DBW, and an address buffer MA.
These blocks are interconnected by a GB bus, a DB bus, and a WB bus. The temporary data register TRD has a bit input / output function.

【0070】図2に示される汎用レジスタER0〜ER
7、プログラムカウンタPC、コンディションコードレ
ジスタCCR以外は、プログラミング上は参照できず、
マイクロコンピュータ内部の動作にのみ用いられる。即
ち、リードデータバッファDBR、ライトデータバッフ
ァDBW、アドレスバッファMAなどは、内部アドレス
バスIAB、内部データバスIDBとのインタフェース
を採るために、一時的にデータをラッチするものであ
る。テンポラリレジスタTRA、TRDは、マイクロコ
ンピュータ内部の動作に適宜用いられる。
General-purpose registers ER0 to ER shown in FIG.
7, except for the program counter PC and the condition code register CCR, they cannot be referenced on programming.
Used only for operation inside the microcomputer. That is, the read data buffer DBR, the write data buffer DBW, the address buffer MA, and the like temporarily latch data in order to interface with the internal address bus IAB and the internal data bus IDB. The temporary registers TRA and TRD are appropriately used for the operation inside the microcomputer.

【0071】リードデータバッファDBRは、ROM、
RAM、内部I/Oレジスタ、或は図示はされない外部
メモリから、リードした命令コードやデータを一時的に
格納する。
The read data buffer DBR is a ROM,
Instruction codes and data read from a RAM, an internal I / O register, or an external memory (not shown) are temporarily stored.

【0072】ライトデータバッファDBWはROM、R
AM、内部I/Oレジスタ、或は外部メモリへのライト
データを一時的に格納する。
The write data buffer DBW has ROM, R
Write data to the AM, internal I / O register, or external memory is temporarily stored.

【0073】アドレスバッファMAは、CPUがリード
/ライトするアドレスを一時的に格納する。
Address buffer MA temporarily stores an address to be read / written by the CPU.

【0074】算術論理演算器ALUは、命令によって指
定される各種の演算や実効アドレスの計算などに用い
る。インクリメンタINCは、プログラムカウンタPC
のインクリメントに用いられる。
The arithmetic and logic unit ALU is used for various operations specified by instructions, calculation of effective addresses, and the like. The incrementer INC is a program counter PC
Used for the increment of.

【0075】また、実行部3の各部は、汎用レジスタの
分割E(16ビット)、H(8ビット)、L(8ビッ
ト)に対応して分割されている。メモリに対するビット
転送を行なう場合には、前記レジスタTRA、TRD、
DBRなどを用いる。
Each unit of the execution unit 3 is divided corresponding to division E (16 bits), H (8 bits) and L (8 bits) of the general-purpose register. When performing bit transfer to the memory, the registers TRA, TRD,
DBR or the like is used.

【0076】テンポラリレジスタTRAは、デスティネ
ーション側データがメモリになるBSTS、BMOV命
令の場合に、デスティネーションアドレスのリード時に
リードアドレスを格納し、データのデスティネーション
側メモリへのライト時に、デスティネーションアドレス
(リードアドレスと同じアドレス)を出力する。
The temporary register TRA stores a read address when reading the destination address in the case of a BSTS or BMOV instruction in which the destination data becomes a memory, and stores the read address when writing data to the destination memory. (The same address as the read address) is output.

【0077】テンポラリレジスタTRDは、ソース側デ
ータがメモリになるBLDS、BSTS命令の場合など
に、ソース側データを一時格納し、演算命令コードの実
行時にソース側データを出力する。また、デスティネー
ション側データがメモリになるBSTS、BMOV命令
の場合に、演算結果を一時格納し、データのデスティネ
ーション側メモリへのライト時に、ライトデータを出力
する。
The temporary register TRD temporarily stores the source data in the case of a BLDS or BSTS instruction in which the source data becomes a memory, and outputs the source data when the operation instruction code is executed. When the destination data is a BSTS or BMOV instruction that becomes a memory, the operation result is temporarily stored, and write data is output when the data is written to the destination memory.

【0078】リードデータバッファDBRは、更に、デ
スティネーション側データがメモリになる演算命令の場
合に、デスティネーション側データを一時格納し、演算
コードの実行時にソース側データを出力する。これら
の、レジスタTRA、TRD、DBRは適宜他の場合に
も動作も行なうが、詳細な説明は省略する。
Further, the read data buffer DBR temporarily stores the destination data when the destination data is an operation instruction that becomes a memory, and outputs the source data when the operation code is executed. These registers TRA, TRD, and DBR also operate as appropriate in other cases, but detailed description is omitted.

【0079】図5には算術論理演算器ALUのビット転
送命令に関係する部分のブロック図が示される。そのほ
かのALUの機能については図示を省略する。
FIG. 5 is a block diagram showing a portion related to a bit transfer instruction of the arithmetic and logic unit ALU. Illustration of other ALU functions is omitted.

【0080】算術論理演算器ALUは、デコーダ10、
セレクタ11、入力セレクタ12、入力セレクタ13、
論理演算回路14、ゼロ検出回路15、出力セレクタ1
6を含む。これらは、図示はされない制御信号によって
制御される。前記デコーダ10は、命令コードに含まれ
るビット番号を示す情報(bn)を入力して、指定され
たビットのみ1とし、そのほかのビットを0としたパタ
ーンを生成する。
The arithmetic and logic unit ALU includes a decoder 10,
Selector 11, input selector 12, input selector 13,
Logical operation circuit 14, zero detection circuit 15, output selector 1
6 inclusive. These are controlled by control signals (not shown). The decoder 10 inputs information (bn) indicating a bit number included in the instruction code, and generates a pattern in which only designated bits are set to 1 and other bits are set to 0.

【0081】前記セレクタ11は、キャリフラグ(C)
と内部バスDBのビット0(DB[0])を入力し、何
れかの入力をビットアキュムレータ選択信号で選択す
る。汎用レジスタR0Lをビットアキュムレータとする
場合には、所定のタイミングで、汎用レジスタR0Lの
内容が内部バスDBに出力されている。
The selector 11 has a carry flag (C).
And bit 0 (DB [0]) of the internal bus DB, and any input is selected by a bit accumulator selection signal. When the general-purpose register R0L is used as a bit accumulator, the contents of the general-purpose register R0L are output to the internal bus DB at a predetermined timing.

【0082】前記入力セレクタ12は、内部バスGBと
デコーダ10の出力(decout)を入力する。前記
入力セレクタ13は、セレクタ11が出力するビットア
キュムレータ(bacc)、レジスタTRDの指定され
たビット(trdbit)及びデコーダ10の出力(d
ecout)を入力する。
The input selector 12 inputs the internal bus GB and the output (decout) of the decoder 10. The input selector 13 includes a bit accumulator (bacc) output from the selector 11, a designated bit (trdbit) of the register TRD, and an output (d
ecoout).

【0083】前記論理演算回路14は、入力セレクタ1
2,13の出力に対して、所定の論理演算を行なう。前
記ゼロ検出回路15は、論理演算回路14の出力の全ビ
ットの論理和を生成する。出力セレクタ16は、論理演
算回路14の出力と、ゼロ検出回路15の出力(zou
t)を入力して、内部バスWBへの出力を行なう。
The logic operation circuit 14 includes the input selector 1
A predetermined logical operation is performed on outputs 2 and 13. The zero detection circuit 15 generates a logical sum of all bits of the output of the logical operation circuit 14. The output selector 16 outputs the output of the logical operation circuit 14 and the output of the zero detection circuit 15 (zoo
t) is input to output to the internal bus WB.

【0084】BLDS命令の場合は、論理演算回路は論
理積演算動作を行なう。指定されたビットのみ、データ
の入力値が抽出され、他のビットは0となる。即ち、 aluin1[7:0]=data[7:0]&dec
out[7:0]; aluin2[7:0]=decout[7:0]; である。
In the case of the BLDS instruction, the logical operation circuit performs an AND operation. Data input values are extracted only for the designated bits, and the other bits are set to 0. That is, aluin1 [7: 0] = data [7: 0] & dec
out [7: 0]; aluin2 [7: 0] = decout [7: 0];

【0085】論理演算回路14の出力は、ゼロ検出回路
(論理和回路)15に入力される。ゼロ検出回路15の
出力は、入力に対する全ビットの論理和、即ち、 zout=|(data[7:0]&decout
[7:0]); である。出力セレクタ16は、BLD命令のときは、ゼ
ロ検出回路15の出力をビット0に出力し、そのほかの
ビットを“0”にするような選択を行う。即ち、 aluout[7:0]={7’b0000000,z
out}; である。
The output of the logic operation circuit 14 is input to a zero detection circuit (logical sum circuit) 15. The output of the zero detection circuit 15 is the logical sum of all the bits with respect to the input, that is, zout = | (data [7: 0] & decout
[7: 0]); In the case of a BLD instruction, the output selector 16 outputs the output of the zero detection circuit 15 to bit 0 and makes a selection so that the other bits are set to “0”. That is, aboutout [7: 0] = {7′b00000000, z
out};

【0086】更に、前記出力セレクタ16の出力を汎用
レジスタR0Lへライトする指示が行われるようにされ
る。前記の通り、任意の汎用レジスタを使用可能とする
場合には、命令コードで指定された汎用レジスタへのラ
イトを指示するようにされる。
Further, an instruction to write the output of the output selector 16 to the general-purpose register R0L is issued. As described above, when an arbitrary general-purpose register can be used, a write to the general-purpose register specified by the instruction code is instructed.

【0087】なお、BLD命令の結果を、汎用レジスタ
R0Lに格納するに当たって、上位ビットを0拡張せ
ず、符号拡張する場合には、 aluout[7:0]={zout,zou
t,...,zout}; とすればよい。これにより、バイトデータH’00また
はH’FFがライトされるのに等しくされる。
When the result of the BLD instruction is stored in the general-purpose register R0L without sign-extending the upper bits instead of 0, the following equation is used: alouout [7: 0] = {zout, zou
t,. . . , Zout}; This is equivalent to writing the byte data H'00 or H'FF.

【0088】ビット論理演算命令を持つ場合は、選択さ
れたビットのみ、データとビットアキュムレータを算術
論理演算器ALUに入力するようにし、論理演算回路1
4に所定の演算を指示するようにすればよい。論理演算
回路14の入力セレクタ12,13を、下記のようにす
る。即ち、 aluin1[7:0]=data[7:0]&dec
out[7:0]; aluin2[7:0]=bacc&decout
[7:0]; である。
When a bit logical operation instruction is provided, data and a bit accumulator of only the selected bit are input to the arithmetic and logic unit ALU.
4 may be instructed to perform a predetermined calculation. The input selectors 12 and 13 of the logical operation circuit 14 are set as follows. That is, aluin1 [7: 0] = data [7: 0] & dec
out [7: 0]; aruin2 [7: 0] = bacc & decout
[7: 0];

【0089】入力セレクタ13の場合、1ビットのba
ccを、8ビットのdecout[7:0]の各ビット
と論理積を採り、8ビットのaluin2[7:0]を
得る。選択されたビットを、ビットアキュムレータの値
とし、そのほかのビットは0としたデータが入力され
る。
In the case of the input selector 13, 1-bit ba
The cc is ANDed with each bit of 8-bit decount [7: 0] to obtain 8-bit aruin2 [7: 0]. Data in which the selected bit is set to the value of the bit accumulator and the other bits are set to 0 is input.

【0090】結果は、ゼロ検出回路15で検出され、即
ち、 zout=|((data[7:0]<op>8{ba
cc})&decout[7:0]); と表現できる。ここで、<op>は指定された論理演算
であり、論理積、論理和、排他的論理和である。これを
汎用レジスタR0Lにライトすることは、前記同様に実
現することができる。
The result is detected by the zero detection circuit 15, that is, zout = | ((data [7: 0] <op> 8 {ba
cc}) & decout [7: 0]); Here, <op> is a designated logical operation, which is a logical product, a logical sum, or an exclusive logical sum. Writing this to the general-purpose register R0L can be realized in the same manner as described above.

【0091】BSTS命令については、論理演算回路1
5の入力セレクタ12を、下記のようにする。即ち、 aluin1[7:0]=data[7:0]& ̄de
cout[7:0]; である。論理演算回路15の入力セレクタ13は、前記
ビット論理演算と同様にする。即ち、 aluin2[7:0]=bacc & decout
[7:0]; である。論理演算回路15には論理積を指示することに
よって、指定されたビットはビットアキュムレータ、そ
のほかのビットは入力データとされて、ビットの挿入が
行われる。出力セレクタ16は、論理演算回路14の演
算結果を出力するようにする。即ち、各ビットは aluout = decout? 8{bacc}:
data; と表現される。尚、記号?はdecoutにより、続く
記号:で区切られた前後の信号を選択することを意味す
る。
For the BSTS instruction, the logical operation circuit 1
The input selector 12 of No. 5 is set as follows. That is, aluin1 [7: 0] = data [7: 0] &  ̄de
cout [7: 0]; The input selector 13 of the logical operation circuit 15 performs the same operation as the bit logical operation. That is, aluin2 [7: 0] = bacc & decount
[7: 0]; By instructing the logical operation circuit 15 to perform a logical product, the designated bit is used as a bit accumulator, and the other bits are used as input data, and bits are inserted. The output selector 16 outputs the operation result of the logical operation circuit 14. That is, each bit is: aloud = decout? 8 {back}:
data; In addition, symbol? Means that the signal before and after the signal delimited by the following symbol: is selected by decount.

【0092】算術論理演算器ALUの出力は、汎用レジ
スタに格納したり、テンポラリレジスタとデータライト
バッファなどを介して、所定のメモリにライト可能であ
る。
The output of the arithmetic and logic unit ALU can be stored in a general-purpose register or written to a predetermined memory via a temporary register and a data write buffer.

【0093】ビットアキュムレータのセレクタ11は、
ビットアキュムレータとして、キャリフラグ(C)また
は汎用レジスタR0Lのビット0(R0L[0])の何
れを使用するかを、モード信号によって選択する。
The selector 11 of the bit accumulator is
Whether the carry flag (C) or bit 0 (R0L [0]) of the general-purpose register R0L is used as the bit accumulator is selected by a mode signal.

【0094】任意ビット間のビット転送命令(BMO
V)については以下の通りである。第1モードの場合、
算術論理演算器ALUに入力されたソースデータの指定
されたビットをゼロ検出回路15で検出して、テンポラ
リレジスタTRDに格納したデスティネーションデータ
の別の指定されたビットに格納する。即ち、入力セレク
タ12,13の出力は、 aluin1[7:0]=data[7:0]&dec
out[7:0]; aluin2[7:0]=decout[7:0]; とされ、ゼロ検出回路15の出力は、 zout=|(data[7:0]&decout
[7:0]); となり、ビットアキュムレータの代わりに、テンポラリ
レジスタの指定されたビットに格納する他は、前記BL
DS命令と同一である。ここでdecoutは、ソース
側のビット番号をデコードしたものである。
A bit transfer instruction between arbitrary bits (BMO
About V), it is as follows. In the case of the first mode,
The specified bit of the source data input to the arithmetic and logic unit ALU is detected by the zero detection circuit 15 and stored in another specified bit of the destination data stored in the temporary register TRD. That is, the outputs of the input selectors 12 and 13 are: alin1 [7: 0] = data [7: 0] & dec
out [7: 0]; aruin2 [7: 0] = decout [7: 0]; and the output of the zero detection circuit 15 is: zout = | (data [7: 0] & decout
[7: 0]); In place of the bit accumulator, the BL is stored in the designated bit of the temporary register.
Same as the DS instruction. Here, "decout" is obtained by decoding the bit number on the source side.

【0095】第2モードの場合、テンポラリレジスタT
RDに格納したソースデータの指定されたビット(tr
dbit)を、算術論理演算器ALUに入力されたデス
ティネーションデータの、別の指定されたビットに格納
する。前記入力セレクタ12,13の出力は、 aluin1[7:0]=data[7:0]& ̄de
cout[7:0]; aluin2[7:0]=8{trdbit}&dec
out[7:0]; とされ、算術論理演算器ALUの出力は、 aluout=decout?8{trdbit}:d
ata; となり、baccの代わりに、trdbitを使用する
他は、前記BSTS命令と同一である。ここでdeco
utは、デスティネーション側のビット番号をデコード
したものである。
In the case of the second mode, the temporary register T
The designated bit (tr) of the source data stored in the RD
dbit) is stored in another designated bit of the destination data input to the arithmetic and logic unit ALU. The outputs of the input selectors 12 and 13 are: aluin1 [7: 0] = data [7: 0] &  ̄de
cout [7: 0]; aruin2 [7: 0] = 8 {trdbit} & dec
out [7: 0]; and the output of the arithmetic and logic unit ALU is as follows: aluout = decout? 8 {trdbit}: d
ata; is the same as the BSTS instruction except that trdbit is used instead of bacc. Where deco
ut is obtained by decoding the bit number on the destination side.

【0096】前記第1モード、第2モードとでは、命令
コード中の、ソース側/デスティネーション側のビット
番号フィールドが入れ替わっているので、デコーダ10
に入力する命令コードのビット位置は共通にできる。
In the first mode and the second mode, the bit numbers on the source side and the destination side in the instruction code are exchanged.
The bit position of the instruction code to be input to the.

【0097】図6にはテンポラリレジスタTRDのブロ
ック図が示される。テンポラリレジスタTRDは、レジ
スタ部22に加えて、デコーダ20、入力セレクタ2
1、出力セレクタ23を含む。出力セレクタ23の出力
trdbitは図5の入力セレクタ13に供給される。
FIG. 6 is a block diagram of the temporary register TRD. The temporary register TRD includes a decoder 20, an input selector 2
1, the output selector 23 is included. The output trdbit of the output selector 23 is supplied to the input selector 13 of FIG.

【0098】デコーダ20は、命令コードに含まれるビ
ット番号を示す所定の情報(bm)を入力して、指定さ
れたビットのみ“1”とし、そのほかのビットを“0”
としたパターンを生成する(tdecout[7:
0])。
The decoder 20 inputs predetermined information (bm) indicating a bit number included in the instruction code, sets only designated bits to “1”, and sets other bits to “0”.
(Tdecout [7:
0]).

【0099】出力セレクタ23で選択されるレジスタ部
22の指定されたビットは、以下の論理式 trdbit=|(trd[7:0]&tdecout
[7:0]); で得られる。即ち、デコーダ20の出力と、レジスタ部
22の各ビットの論理積を採り、その全ビットの論理和
を採るものであって、セレクタを構成し、所望のビット
を抽出する。これは、任意ビット間のビット転送命令
(BMOV)の第2モードで使用する。このとき、td
ecoutは、ソース側のビット番号をデコードしたも
のである。trd[7:0]はレジスタ部22の出力で
ある。
The designated bit of the register section 22 selected by the output selector 23 is represented by the following logical expression: trdbit = | (trd [7: 0] & tdecout
[7: 0]); That is, the logical product of the output of the decoder 20 and each bit of the register unit 22 is calculated, and the logical sum of all the bits is calculated. A selector is configured to extract a desired bit. This is used in the second mode of the bit transfer instruction (BMOV) between arbitrary bits. At this time, td
"ecout" is obtained by decoding the bit number on the source side. trd [7: 0] is an output of the register unit 22.

【0100】入力セレクタ21は、レジスタ部22への
入力値を、 casex(wbtrd,dbtrd,bittrd) 100:trdin[7:0]=wb[7:0]; 010:trdin[7:0]=db[7:0]; 011:trdin[7:0] =(8{zout} & tdecout[7:0]); |(db[7:0] &  ̄tdecout[7:0]); 001: trdin[7:0] =(8{zout} & tdecout[7:0]); |(trd[7:0]&  ̄tdecout[7:0]); 000: trdin[7:0]=trd[7:0]; のように選択する。即ち、制御信号wbtrdによっ
て、内部バスWBの内容が選択され、制御信号dbtr
dによって、内部バスDBの内容が選択される。また、
制御信号bittrdによって、選択されたビットは、
ゼロ検出回路15の出力が、その他のビットは、レジス
タ部22の元の値が選択される。同時に、上記制御信号
(wbtrd、dbtrd、bittrd)によって、
所定のクロック( ̄φ)に同期してライトが行われる。
これは以下のように記述できる。
The input selector 21 converts the input value to the register unit 22 into casex (wbtrd, dbtrrd, bittrd) 100: trdin [7: 0] = wb [7: 0]; 010: trdin [7: 0] = 011: trdin [7: 0] = (8 {zout} & tdecout [7: 0]); | (db [7: 0] & @ tdecout [7: 0]); 001: trdin [7: 0] = (8 {zout} & tdecout [7: 0]); | (trd [7: 0] & @ tdecout [7: 0]); 000: trdin [7: 0] = trd [ 7: 0]; That is, the content of the internal bus WB is selected by the control signal wbtrd, and the control signal dbtr
By d, the contents of the internal bus DB are selected. Also,
The bit selected by the control signal bittrd is:
For the output of the zero detection circuit 15 and the other bits, the original value of the register unit 22 is selected. At the same time, the control signals (wbtrd, dbtrrd, bittrd)
Writing is performed in synchronization with a predetermined clock ( ̄φ).
This can be described as follows.

【0101】 これは、任意ビット間のビット転送命令(BMOV)の
第1モードで使用する。このとき、tdecoutは、
デスティネーション側のビット番号をデコードしたもの
である。
[0101] This is used in the first mode of the bit transfer instruction (BMOV) between arbitrary bits. At this time, tdecount is
This is a decoded bit number on the destination side.

【0102】以下に、本発明の命令の実行タイミングの
例を示す。特に制限はされないものの、内部データバス
は16ビットであって、内蔵ROM、RAMリード/ラ
イトを1ステートでリード/ライト可能とする。内蔵R
OM、RAMは、IABをアドレスバスとし、IDBを
データバスとする。後述のPAB、PDBは接続されて
いないが、同様のタイミングを内部で生成している。以
下で説明する動作タイミングは、各動作サイクルTiで
クロック信号φの立ち上がりC1に同期され、クロック
信号φの立ち下がりC2に同期される。特に図示はしな
いが実際にはC2はクロック信号φの反転クロック信号
(若しくはノンオーバラップ信号)φ#の立ち上がりに
同期するタイミングとされる。
The following is an example of the execution timing of the instruction of the present invention. Although there is no particular limitation, the internal data bus is 16 bits, and the built-in ROM and RAM can be read / written in one state. Built-in R
The OM and RAM use IAB as an address bus and IDB as a data bus. Although the later-described PAB and PDB are not connected, the same timing is internally generated. The operation timing described below is synchronized with the rising edge C1 of the clock signal φ and the falling edge C2 of the clock signal φ in each operation cycle Ti. Although not particularly shown, C2 is actually a timing synchronized with the rising edge of the inverted clock signal (or non-overlap signal) φ # of the clock signal φ.

【0103】前記デコーダDECの出力する制御信号に
は、その位相に応じて、controlA、contr
olB、controlCがあり、制御対象によって、
位相が異なる。
The control signal output from the decoder DEC includes control A and control according to the phase.
olB and controlC, depending on the control target,
The phases are different.

【0104】controlAは、主として、バス制御
を行なう。バスコマンドやアドレス出力の制御を行な
う。
Control A mainly performs bus control. It controls bus commands and address output.

【0105】実行シーケンスの制御は、control
Bで行い、制御信号TMGやMODS、MODDの出
力、制御信号intmskによる割込みの禁止、デステ
ィネーションにデータを書き戻すための命令コード(m
ov−st)の生成信号mkmovの出力などを行な
う。また、算術論理演算器ALUに入力するデータの読
み出しの制御を行なう。
The execution sequence is controlled by control
B, output of control signals TMG, MODS, and MODD, prohibition of interruption by control signal intmsk, and instruction code (m
ov-st), and the like. Also, it controls the reading of data input to the arithmetic and logic unit ALU.

【0106】制御信号controlCは、算術論理演
算器ALUの制御と、演算結果の汎用レジスタ、テンポ
ラリレジスタなどへの書込みの指示を行なう。例えば、
命令リードを行なう場合は、制御信号controlA
に含まれる所定の制御信号が活性状態になり、次のC2
から、以下の一連の動作を行なう。(1)PCの内容が
内部バスGBに読み出され、アドレスバッファABに転
送され、アドレスバスIABに出力される。(2)命令
リード(if)を示すバスコマンドを出力する。(3)
インクリメンタINCに、内部バスGB上のプログラム
カウンタPCの値を取り込み、+2を指示する。(4)
次のC1(φ同期)で、内部バスWB上のインクリメン
トされたプログラムカウンタPC値を、プログラムカウ
ンタPCに書込む。
The control signal controlC controls the arithmetic and logic unit ALU and instructs the operation result to be written in a general-purpose register or a temporary register. For example,
When the instruction is read, the control signal controlA
Is activated, and the next C2
, The following series of operations are performed. (1) The contents of the PC are read to the internal bus GB, transferred to the address buffer AB, and output to the address bus IAB. (2) A bus command indicating an instruction read (if) is output. (3)
The value of the program counter PC on the internal bus GB is taken into the incrementer INC, and +2 is specified. (4)
At the next C1 (φ synchronization), the incremented program counter PC value on the internal bus WB is written to the program counter PC.

【0107】図7にはビット転送命令の第1の例(BL
DS#7,@FFFFFE)の実行タイミングが例示さ
れる。
FIG. 7 shows a first example of the bit transfer instruction (BL
DS # 7, @FFFFFE).

【0108】T0のC2(φ#同期)で、CPU1のア
ドレスバッファMAからアドレス信号がアドレスバスI
ABに出力される。T1のC1(φ同期)で、アドレス
バスIABの内容がアドレスバスPABに出力され、リ
ードサイクルが開始される。C2でリードデータが内部
データバスに得られ、これをT2のC1で命令レジスタ
IRにラッチする。これは、命令コードの第1のワード
であり(bld−1)、指定したアドレスのデータをテ
ンポラリレジスタTRDへ格納する。
At C2 (φ # synchronization) of T0, an address signal is sent from address buffer MA of CPU 1 to address bus I.
Output to AB. At C1 (φ synchronization) of T1, the contents of the address bus IAB are output to the address bus PAB, and a read cycle is started. The read data is obtained on the internal data bus in C2, and this is latched in the instruction register IR in C1 of T2. This is the first word of the instruction code (bld-1), and stores the data at the specified address in the temporary register TRD.

【0109】引き続き、T2のC2で次のアドレス(+
2された内容)がアドレスバスIABに出力され、この
リードデータがT3のC1で命令レジスタIRにラッチ
される。これは、命令コードの第2ワードであり(bl
d−0)、指定されたビットをアキュムレータに格納す
る。以上の動作は以前の命令の実行の制御によって行わ
れ、相対的な関係が異なる場合もある。
Subsequently, the next address (+
Is output to the address bus IAB, and the read data is latched in the instruction register IR at C1 of T3. This is the second word of the instruction code (bl
d-0), the designated bit is stored in the accumulator. The above operation is performed by controlling the execution of the previous instruction, and the relative relationship may be different.

【0110】直前の命令の実行が終了すると、命令のリ
ードから最も早く命令の実行が開始される場合には、T
2のC1で命令コード(bld−1)が命令デコーダD
ECに入力されて、命令の内容が解読される。解読結果
に従って、制御信号を出力して、各部の制御を行う。即
ち、8ビット絶対アドレスのアドレッシングモードであ
るので、この絶対アドレスに基づき、ソースデータのリ
ードを行い、リード結果をテンポラリレジスタ(TR
D)に格納する。また、制御信号MODS=1とすると
ともに、割込み禁止intmsk=1とする。
When the execution of the immediately preceding instruction is completed, if the execution of the instruction is started earliest after the instruction is read, T
2 and the instruction code (bld-1) is the instruction decoder D
It is input to the EC and the contents of the command are decoded. According to the decoding result, a control signal is output to control each unit. That is, since the addressing mode is an 8-bit absolute address, the source data is read based on the absolute address, and the read result is stored in a temporary register (TR).
D). In addition, the control signal MODS is set to 1 and the interrupt disable intmsk is set to 1.

【0111】T2のC2で、命令コードの第1ワードの
ビット7〜0(IR[7:0]=8’hFE)の内容
(絶対アドレス)を内部バスGBに読み出して、アドレ
スバッファMAに入力する。このとき上位ビットは1拡
張される。アドレスバッファMAからアドレス信号がバ
スIABに出力される。
At C2 of T2, the contents (absolute address) of bits 7 to 0 (IR [7: 0] = 8'hFE) of the first word of the instruction code are read out to the internal bus GB and input to the address buffer MA. I do. At this time, the upper bit is extended by one. An address signal is output from address buffer MA to bus IAB.

【0112】T3から、データがリードされる。また、
T3のC2で、プログラムカウンタPCの内容を内部バ
スGBに読み出して、アドレスバッファMAとインクリ
メンタINCに入力する。アドレスバッファMAからア
ドレス信号がバスIABに出力される。
Data is read from T3. Also,
At C2 of T3, the contents of the program counter PC are read out to the internal bus GB and input to the address buffer MA and the incrementer INC. An address signal is output from address buffer MA to bus IAB.

【0113】T4のC1で前記リードデータが、リード
データバッファDBRに格納される。更に、リードデー
タバッファDBRから内部バスDBに出力され、算術論
理演算器ALUに入力する。算術論理演算器ALUの動
作は無操作とする。T4のC2で、リードデータが、算
術論理演算器ALUから内部バスWBに出力され、テン
ポラリレジスタTRDに格納される。
At C1 of T4, the read data is stored in the read data buffer DBR. Further, the data is output from the read data buffer DBR to the internal bus DB and input to the arithmetic and logic unit ALU. The operation of the arithmetic and logic unit ALU is not operated. At C2 of T4, the read data is output from the arithmetic and logic unit ALU to the internal bus WB and stored in the temporary register TRD.

【0114】T4のC1で、命令コード(bld−0)
が命令デコーダDECに入力されて、制御信号MODS
とともに、命令の内容が解読される。解読結果に従っ
て、制御信号を出力して、各部の制御を行う。MODS
信号が1にセットされているので、テンポラリレジスタ
TRDの指定されたビットをビットアキュムレータに転
送する。
In C1 of T4, the instruction code (bld-0)
Is input to the instruction decoder DEC, and the control signal MODS
At the same time, the contents of the instruction are decrypted. According to the decoding result, a control signal is output to control each unit. MODS
Since the signal is set to 1, the designated bit of the temporary register TRD is transferred to the bit accumulator.

【0115】前記の通り、T4のC1の制御信号con
trolAによる命令リードとPCインクリメントの指
示に従い、T4のC2で、プログラムカウンタPCの内
容を内部バスGBに読み出して、アドレスバッファMA
とインクリメンタINCに入力する。アドレスバッファ
MAからアドレス信号がアドレスバスIABに出力され
る。T5のC1で、インクリメンタINCでインクリメ
ント(+2)された結果が、内部バスWBを経由してプ
ログラムカウンタPCにライトされる。
As described above, the control signal con for the C1 of T4.
In accordance with the instruction read by control A and the instruction of PC increment, the content of the program counter PC is read out to the internal bus GB at C2 of T4, and the address buffer MA
To the incrementer INC. An address signal is output from address buffer MA to address bus IAB. At C1 of T5, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

【0116】一方、T4のC2のcontrolBで、
算術論理演算器ALUの入力データの指示(trd_g
b)を行い、T5のC1のcontrolCで、ALU
制御と、レジスタ格納の指示(wb_r0l)を出力す
る。これに従って、テンポラリレジスタTRDの内容を
内部バスGBに読み出して、算術論理演算器ALUに入
力する。算術論理演算器ALUはBLDS命令を実行す
るために次の動作(bld)を行なう。算術論理演算器
ALUのデコーダ10には、命令コードのビット6〜4
(opcode[6:4]=7)が与えられ、算術論理
演算器ALUの入力セレクタ12はデコーダ10の出力
(decout=H’80)と内部バスGBとの論理積
を、算術論理演算器ALUの入力セレクタ13はデコー
ダ10のデコード出力decoutを出力して、これら
の、論理積演算を行なう。結果が、ゼロ検出回路15に
得られる(zout=gb[7]=trd[7])。
On the other hand, in control B of C2 of T4,
Indication of input data of arithmetic logic unit ALU (trd_g
b) is performed, and the ALU is
It outputs a control and register storage instruction (wb_r01). In accordance therewith, the contents of the temporary register TRD are read out to the internal bus GB and input to the arithmetic and logic unit ALU. The arithmetic and logic unit ALU performs the following operation (bld) to execute the BLDS instruction. The decoder 10 of the arithmetic and logic unit ALU includes bits 6 to 4 of the instruction code.
(Opcode [6: 4] = 7), and the input selector 12 of the arithmetic and logic unit ALU calculates the logical product of the output (decount = H'80) of the decoder 10 and the internal bus GB by the arithmetic and logic unit ALU. The input selector 13 outputs a decode output decount of the decoder 10 and performs an AND operation on these outputs. The result is obtained in the zero detection circuit 15 (zout = gb [7] = trd [7]).

【0117】汎用レジスタR0Lをビットアキュムレー
タとする場合には、内部バスWBの内容をR0Lに格納
する指示(wb_r0l)がなされる。また、キャリフ
ラグ(C)をビットアキュムレータとする場合には、制
御信号wb_r0lの代わりに、ゼロ検出回路15の結
果(zout)をキャリフラグに格納する指示を行なう
ようにする。
When general-purpose register R0L is used as a bit accumulator, an instruction (wb_r01) for storing the contents of internal bus WB in R0L is issued. When the carry flag (C) is a bit accumulator, an instruction to store the result (zout) of the zero detection circuit 15 in the carry flag is performed instead of the control signal wb_r01.

【0118】算術論理演算器ALUの出力セレクタ16
により、ゼロ検出回路15の結果をビット0とし、上位
を“0”とした出力データ({7’b0000000,
zout})が生成され、T5のC2で、内部バスWB
に出力される。内部バスWBまたはゼロ検出回路15の
内容が、前記指示に従って、汎用レジスタR0Lまたは
キャリフラグ(C)に格納される。
Output selector 16 of arithmetic and logic unit ALU
As a result, output data (# 7'b00000000, {7'b00000000,
zout}) is generated, and the internal bus WB is generated at C2 of T5.
Is output to The contents of the internal bus WB or the zero detection circuit 15 are stored in the general-purpose register R0L or the carry flag (C) according to the instruction.

【0119】T5のC1で、バスIDBの内容(次の命
令)が命令レジスタIRにラッチされ、デコーダDEC
に入力されて、命令の内容が解読される。解読結果に従
って、動作が行われる。T5のC2から命令リードを行
なう。
At C1 of T5, the contents of the bus IDB (next instruction) are latched in the instruction register IR, and the decoder DEC
And the contents of the command are decoded. The operation is performed according to the decoding result. The instruction is read from C2 of T5.

【0120】前記の通り、第1ワードと第2ワードが分
割されないために、T2のC2からT4のC2まで、連
続命令信号(intmsk)を出力する。本信号によっ
て、割込み要求などが発生していても、命令の実行を継
続することができる。
As described above, since the first word and the second word are not divided, a continuous command signal (intmsk) is output from C2 of T2 to C2 of T4. With this signal, execution of an instruction can be continued even if an interrupt request or the like has occurred.

【0121】R0L以外の汎用レジスタを使用する場合
には、命令コードのビット3〜0(op[3:0])を
命令デコーダDECでデコードして、T5のC1で、前
記制御信号wb_r0lに代えて、指定された汎用レジ
スタへ、内部バスWBからの入力を行なう指示を行なう
ようにすればよい。
When a general-purpose register other than R0L is used, bits 3 to 0 (op [3: 0]) of the instruction code are decoded by the instruction decoder DEC, and the control signal wb_r01 is replaced with the control signal wb_r01 at C1 of T5. Thus, an instruction for inputting from the internal bus WB to the designated general-purpose register may be issued.

【0122】図8にはビット転送命令の第2の例(BL
DMOV #6,@FFFFFD,@FFFF00)の
実行タイミングを示す。
FIG. 8 shows a second example of the bit transfer instruction (BL
DMOV # 6, $ FFFFFD, $ FFFF00).

【0123】T2のC1で命令コード(bld−1)が
命令デコーダDECに入力されて、命令の内容が解読さ
れる。これは、前記BLDS命令の第1ワードと同様で
ある。T4のC1で命令コードの第2ワード(bst−
1)が命令デコーダDECに入力されて、命令の内容が
解読される。解読結果に従って、制御信号を出力して、
各部の制御を行う。即ち、8ビット絶対アドレスのアド
レッシングモードであるので、この絶対アドレスに基づ
き、デスティネーションデータのリードを行い、リード
結果をリードデータバッファDBRに格納する。リード
に使用した実効アドレス(EA2=FFFF00)は、
T5のC1でテンポラリレジスタTRAに格納する。ま
た、制御信号MODD=1とする。第1ワードの出力し
た制御信号MODS=1を継続する。
At C1 of T2, the instruction code (bld-1) is input to the instruction decoder DEC, and the contents of the instruction are decoded. This is similar to the first word of the BLDS instruction. At C1 of T4, the second word (bst-
1) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the decoding result, output the control signal,
Control each part. That is, since the addressing mode is an 8-bit absolute address, the destination data is read based on the absolute address, and the read result is stored in the read data buffer DBR. The effective address (EA2 = FFFF00) used for reading is
The data is stored in the temporary register TRA at C1 of T5. It is also assumed that the control signal MODED = 1. The control signal MODS = 1 output from the first word is continued.

【0124】T5のC1で命令コード(bldmov−
0)が命令デコーダDECに入力されて、制御信号MO
DS、MODDとともに、命令の内容が解読される。解
読結果に従って、制御信号を出力して、各部の制御を行
う。制御信号MODS、MODDが1にセットされてい
るので、リードデータバッファDBRの指定されたビッ
トを、ビット0とし、上位を0としたデータを、テンポ
ラリレジスタTRDに格納するように制御を行なう。前
記同様に、T5のC1のcontrolAによる命令リ
ードとプログラムカウンタPCのインクリメントを行な
う。
The instruction code (bldmov-
0) is input to the instruction decoder DEC, and the control signal MO
The contents of the instruction are decoded together with DS and MODD. According to the decoding result, a control signal is output to control each unit. Since the control signals MODS and MODD are set to 1, the control is performed so that the designated bit of the read data buffer DBR is set to bit 0, and the data whose upper bit is set to 0 is stored in the temporary register TRD. In the same manner as described above, the instruction is read by the control A of C1 at T5 and the program counter PC is incremented.

【0125】T5のC2のcontrolBで、算術論
理演算器ALUの入力データの指示(dbr_gb)を
行い、T5のC1のcontrolCで、算術論理演算
器ALUに対する制御と、レジスタ格納の指示(wb_
trd)を出力する。これに従って、リードデータバッ
ファRDBの内容を内部バスGBに読み出して、算術論
理演算器ALUに入力する。算術論理演算器ALUはB
LDS命令と同様の動作を実行するために次の動作(b
ld)を行なう。算術論理演算器ALUのデコーダ10
には、命令コードのビット6〜4(IR[6:4]=
6)が与えられ、算術論理演算器ALUの入力セレクタ
12はデコーダ出力(decout=H’40)と内部
バスGBとの論理積を、算術論理演算器ALUの入力セ
レクタ13はデコーダ10のデコード出力を出力して、
これらの、論理積演算を行なう。結果が、ゼロ検出回路
15に得られる(zout=gb[6]=dbr
[6])。
The control data of the arithmetic and logic unit ALU is designated (dbr_gb) by the control B of C2 of T5, and the control of the arithmetic and logic unit ALU and the instruction of the register storage (wb_gb) are performed by the control C of C1 of T5.
trd) is output. In accordance therewith, the contents of the read data buffer RDB are read out to the internal bus GB and input to the arithmetic and logic unit ALU. Arithmetic logic unit ALU is B
To execute the same operation as the LDS instruction, the following operation (b
ld). Decoder 10 of arithmetic logic unit ALU
Are bits 6 to 4 of the instruction code (IR [6: 4] =
6) is given, the input selector 12 of the arithmetic and logic unit ALU calculates the logical product of the decoder output (decout = H'40) and the internal bus GB, and the input selector 13 of the arithmetic and logic unit ALU outputs the decode output of the decoder 10. And output
These logical product operations are performed. The result is obtained in the zero detection circuit 15 (zout = gb [6] = dbr)
[6]).

【0126】算術論理演算器ALUの出力セレクタ16
により、ゼロ検出回路15の結果をビット0とし、上位
を0とした出力データ(data0={7’b0000
000,zout})が生成され、T6のC2で、内部
バスWBに出力される。内部バスWBの内容が、前記指
示(wb_trd)に従って、テンポラリレジスタTR
Dに格納される。
Output selector 16 of arithmetic logic unit ALU
As a result, the output of the zero detection circuit 15 is set to bit 0, and the output data (data0 = $ 7'b0000
000, zout}) is generated and output to the internal bus WB at C2 of T6. According to the instruction (wb_trd), the contents of the internal bus WB are stored in the temporary register TR.
D.

【0127】T5のC2で、命令コード(mov−s
t)を発生する制御信号を生成し、当該命令コードは、
T6のC1から命令デコーダDECに入力する。この命
令コード(mov−st)は、テンポラリレジスタTR
Aをアドレスレジスタとし、テンポラリレジスタTRD
をデータレジスタとする転送命令同様の動作を行う。即
ち、T6のC2で、テンポラリレジスタTRAに格納さ
れているデスティネーション実効アドレス(EA2)を
GBに読み出し、アドレスバッファMAを経由してアド
レスバスIABに出力するとともに、バイトデータライ
トのバスコマンドを発行する。T7のC2で、テンポラ
リレジスタTRDに格納されている演算結果(data
o)をデータバスDBに読み出し、ライトデータバッフ
ァDBWを経由して、データバスIDBに出力して、デ
スティネーションのメモリアドレスに演算結果を書込
む。T7のC2から命令フェッチを行なうとともに、プ
ログラムカウンタPCのインクリメントを行なう。これ
によって、命令コード第2ワード(bst−1)で、命
令フェッチとPCインクリメントを行なわなかった分を
回復する。
At C2 of T5, the instruction code (mov-s
generating a control signal that generates t), and the instruction code is:
Input from C1 of T6 to the instruction decoder DEC. This instruction code (mov-st) is stored in the temporary register TR
A is an address register and a temporary register TRD
Performs the same operation as the transfer instruction using. That is, at C2 of T6, the destination effective address (EA2) stored in the temporary register TRA is read to GB, output to the address bus IAB via the address buffer MA, and a bus command for byte data write is issued. I do. At C2 of T7, the operation result (data) stored in the temporary register TRD
o) is read out to the data bus DB, output to the data bus IDB via the write data buffer DBW, and the operation result is written to the memory address of the destination. The instruction is fetched from C2 of T7, and the program counter PC is incremented. As a result, in the second word (bst-1) of the instruction code, the portion that has not been subjected to the instruction fetch and the PC increment is recovered.

【0128】デスティネーション側メモリにライトする
場合、命令コード(mov−st)をCPU1の内部で
発生することにより、命令コードを短縮し、処理時間を
短縮することができる。テンポラリレジスタTRAの内
容を参照することによって、再度実効アドレスの計算を
行なう必要がなく、更に、処理時間を短縮することがで
きる。既存の転送命令(MOV.B R0L,@ER
0)に類似する動作を採ることにより、設計を容易にす
ることができる。なお、命令コードの第1ワード(bl
d−1)でも、共通化のため、テンポラリレジスタTR
Aへの格納を行なっている。
When writing to the destination side memory, the instruction code (mov-st) is generated inside the CPU 1 so that the instruction code can be shortened and the processing time can be shortened. By referring to the contents of the temporary register TRA, it is not necessary to calculate the effective address again, and the processing time can be further reduced. Existing transfer instructions (MOV.B R0L, @ER
By adopting an operation similar to 0), design can be facilitated. The first word (bl) of the instruction code
d-1) However, for the sake of commonality, the temporary register TR
A is being stored.

【0129】前記同様に、第1ワードと第2ワード以降
が分割されないために、T2のC2からT6のC2ま
で、連続命令信号(intmsk)を出力する。本信号
によって、割込み要求などが発生していても、命令の実
行を継続することができる。
In the same manner as described above, a continuous instruction signal (intmsk) is output from C2 of T2 to C2 of T6 so that the first word and the second and subsequent words are not divided. With this signal, execution of an instruction can be continued even if an interrupt request or the like has occurred.

【0130】図9にはビット転送命令の第3の例(BS
TS#5,@FFFF10)の実行タイミングを示す。
T2のC1で命令コードの第1ワード(bst−1)が
命令デコーダDECに入力されて、命令の内容が解読さ
れる。解読結果に従って、制御信号を出力して、各部の
制御を行う。これは、図8の命令コードの第2ワード
(bst−1)と同一である。
FIG. 9 shows a third example of the bit transfer instruction (BS
TS # 5, $ FFFF10).
At C1 of T2, the first word (bst-1) of the instruction code is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the decoding result, a control signal is output to control each unit. This is the same as the second word (bst-1) of the instruction code in FIG.

【0131】T4のC1で、命令コードの第2ワード
(bst−0)が命令デコーダDECに入力されて、制
御信号MODDとともに、命令の内容が解読される。解
読結果に従って、制御信号を出力して、各部の制御を行
う。制御信号MODDが1にセットされているので、リ
ードデータバッファDBRの指定されたビットに、汎用
レジスタR0Lのビット0を格納し、その他のビットを
保持して、テンポラリレジスタTRDに格納するように
制御を行なう。
At C1 of T4, the second word (bst-0) of the instruction code is input to the instruction decoder DEC, and the contents of the instruction are decoded together with the control signal MODED. According to the decoding result, a control signal is output to control each unit. Since the control signal MODED is set to 1, control is performed such that bit 0 of the general-purpose register R0L is stored in the designated bit of the read data buffer DBR, and the other bits are stored and stored in the temporary register TRD. Perform

【0132】前記同様に、T3のC1のcontrol
Aによる命令リードとPCのインクリメントを行なう。
Similarly to the above, the control of C1 of T3
The instruction is read by A and the PC is incremented.

【0133】T3のC2のcontrolBで、算術論
理演算器ALUの入力データの指示(dbr_gb、r
0l_db)を行い、T4のC1のcontrolC
で、算術論理演算器ALUに対する制御と、レジスタ格
納の指示(wb_trd)を出力する。これに従って、
リードデータバッファDBRの内容を内部バスGBに読
み出して、算術論理演算器ALUに入力する。また、汎
用レジスタR0Lの内容を内部バスDBに読み出す。算
術論理演算器ALUはBSTS命令を実行するために次
の動作(bst)を行なう。算術論理演算器ALUのデ
コーダ10には、命令コードのビット6〜4(IR
[6:4]=5)と、内部バスDBのビット0(ビット
アキュムレータである汎用レジスタR0Lのビット0)
が与えられ、算術論理演算器ALUの入力セレクタ12
はデコーダ10の出力(decout=H’20)の反
転と内部バスGBとの論理積を、算術論理演算器ALU
の入力セレクタ13はデコーダ10の出力とビットアキ
ュムレータの論理積(H’20&8{DB[0]})を
出力して、これらの、論理積演算を行なう。
At the control B of C2 in T3, the instruction of the input data of the arithmetic and logic unit ALU (dbr_gb, r
0l_db) and controlC of C1 of T4
Then, the control for the arithmetic and logic unit ALU and the instruction for register storage (wb_trd) are output. According to this,
The contents of the read data buffer DBR are read out to the internal bus GB and input to the arithmetic and logic unit ALU. Further, the contents of the general-purpose register R0L are read out to the internal bus DB. The arithmetic and logic unit ALU performs the following operation (bst) to execute the BSTS instruction. The decoder 10 of the arithmetic and logic unit ALU has bits 6 to 4 of the instruction code (IR
[6: 4] = 5) and bit 0 of the internal bus DB (bit 0 of the general-purpose register R0L as a bit accumulator)
And the input selector 12 of the arithmetic and logic unit ALU
Calculates the logical product of the inversion of the output (decount = H'20) of the decoder 10 and the internal bus GB by the arithmetic and logic unit ALU.
Output selector 13 outputs a logical product (H'20 & 8 {DB [0]}) of the output of decoder 10 and the bit accumulator, and performs a logical product operation on these.

【0134】算術論理演算器ALUの出力セレクタ16
に結果({2’b00,DB[0],5’b0000
0})が生成され、T6のC2で、内部バスWBに出力
される。内部バスWBの内容が、前記指示(wb_tr
d)に従って、テンポラリレジスタTRDに格納され
る。T4のC2で、命令コード(mov−st)を発生
する制御信号を生成し、当該命令コードは、T5のC1
からデコーダDECに入力する。これは、図8と同一で
ある。
Output selector 16 of arithmetic and logic unit ALU
The result ($ 2'b00, DB [0], 5'b0000
0}) is generated and output to the internal bus WB at C2 of T6. The content of the internal bus WB is the instruction (wb_tr)
According to d), it is stored in the temporary register TRD. At C2 of T4, a control signal for generating an instruction code (mov-st) is generated.
To the decoder DEC. This is the same as FIG.

【0135】図10にはビット転送命令の第4の例(B
MOV #6,@FFFFFC,#5,@FFFF2
1)の実行タイミングを示す。命令コードの第3ワード
以外の動作は、図8と同一である。
FIG. 10 shows a fourth example of the bit transfer instruction (B
MOV # 6, $ FFFFFC, # 5, $ FFFF2
The execution timing of 1) is shown. Operations other than the third word of the instruction code are the same as those in FIG.

【0136】T5のC1で命令コード(bmov−0
b)が命令デコーダDECに入力されて、制御信号MO
DS、MODDとともに、命令の内容が解読される。解
読結果に従って、制御信号を出力して、各部の制御を行
う。制御信号MODS、MODDが1にセットされてい
るので、テンポラリレジスタTRDの指定されたビット
(ビット6)を、リードデータバッファDBRの指定さ
れたビット(ビット5)に代入し、その他のビットを保
持したデータを、テンポラリレジスタTRDに格納する
ように制御を行なう。算術論理演算器ALUは、BMO
V命令の第2モード(bmov2)で動作する。
The instruction code (bmov-0) at C1 of T5
b) is input to the instruction decoder DEC and the control signal MO
The contents of the instruction are decoded together with DS and MODD. According to the decoding result, a control signal is output to control each unit. Since the control signals MODS and MODD are set to 1, the designated bit (bit 6) of the temporary register TRD is substituted for the designated bit (bit 5) of the read data buffer DBR, and the other bits are held. Control is performed so that the data thus obtained is stored in temporary register TRD. The arithmetic and logic unit ALU is a BMO
It operates in the second mode (bmov2) of the V instruction.

【0137】前記同様に、T5のC1のcontrol
Aによる命令リードとプログラムカウンタPCのインク
リメントを行なう。
As described above, the control of C1 of T5
The instruction is read by A and the program counter PC is incremented.

【0138】T3のC2のcontrolBで、算術論
理演算器ALUの入力データの指示(dbr_gb)を
行い、T4のC1のcontrolCで、算術論理演算
器ALUに対する制御と、レジスタ格納の指示(wb_
trd)を出力する。これに従って、リードデータバッ
ファDBRの内容を内部バスGBに読み出して、算術論
理演算器ALUに入力する。
The control data of the arithmetic and logic unit ALU is instructed (dbr_gb) by the control B of C2 in T3, and the control for the arithmetic and logic unit ALU and the instruction of register storage (wb_g) are performed by the control C of C1 in T4.
trd) is output. In accordance with this, the contents of the read data buffer DBR are read out to the internal bus GB and input to the arithmetic and logic unit ALU.

【0139】算術論理演算器ALUはBMOV命令の第
2モードを実行するために次の動作を行なう。算術論理
演算器ALUのデコーダ10には、命令コードのビット
6〜4(IR[6:4]=5)が与えられ、入力セレク
タ12はデコーダ10の出力(decout=H’2
0)の反転と内部バスGBとの論理積を、入力セレクタ
13はデコーダ10の出力とテンポラリレジスタTRD
の指定されたビット(ビット6)trdbitの論理積
(H’20&8{trdbit})を出力して、これら
の、論理積演算を行なう。
The arithmetic and logic unit ALU performs the following operation to execute the second mode of the BMOV instruction. The instruction code bits 6 to 4 (IR [6: 4] = 5) are given to the decoder 10 of the arithmetic and logic unit ALU, and the input selector 12 outputs the output of the decoder 10 (decout = H′2).
0) and the logical product of the internal bus GB and the input selector 13 outputs the output of the decoder 10 and the temporary register TRD.
And outputs the logical product (H'20 & 8 {trdbit}) of the designated bit (bit 6) trdbit, and performs the logical product operation on them.

【0140】出力セレクタ16に結果(data0=
{DBR[7:6],trdbit,DBR[4:
0]})が生成され、T6のC2で、内部バスWBに出
力される。内部バスWBの内容が、前記指示(wb_t
rd)に従って、テンポラリレジスタTRDに格納され
る。T4のC2で、命令コード(mov−st)を発生
する制御信号を生成し、当該命令コードは、T5のC1
からデコーダDECに入力する。これは、図8と同一で
ある。
The result (data0 =
{DBR [7: 6], trdbit, DBR [4:
0]}) is generated and output to the internal bus WB at C2 of T6. The contents of the internal bus WB correspond to the instruction (wb_t).
rd), it is stored in the temporary register TRD. At C2 of T4, a control signal for generating an instruction code (mov-st) is generated.
To the decoder DEC. This is the same as FIG.

【0141】図11にはビット転送命令の第5の例(B
MOV #4,@FFFFFB,#3,R2L)の実行
タイミングを示す。全体的な動作は、概略、図7と同じ
であり、命令コードの第1ワード(bld−1)の動作
は、図7と同一である。
FIG. 11 shows a fifth example of the bit transfer instruction (B
MOV # 4, #FFFFFB, # 3, R2L). The overall operation is substantially the same as in FIG. 7, and the operation of the first word (bld-1) of the instruction code is the same as in FIG.

【0142】命令コードの第2ワードの動作は、概略、
図10と同じであるが、指定された汎用レジスタ(デス
ティネーション汎用レジスタRd=R2L)を内部バス
GBに読み出し、結果(data0={R2L[7:
4],trdbit,R2L[2:0]})は、指定さ
れた汎用レジスタ(R2L)に格納して、終了する。
The operation of the second word of the instruction code is roughly as follows.
10 is the same as FIG. 10 except that the designated general-purpose register (destination general-purpose register Rd = R2L) is read onto the internal bus GB, and the result (data0 = {R2L [7:
4], trdbit, R2L [2: 0]}) are stored in the designated general-purpose register (R2L), and the processing ends.

【0143】図12にはビット転送命令の第6の例(B
MOV #2,R3H,#1,@FFFF32)の実行
タイミングを示す。命令コードの第2ワード以外の動作
は、図9と同一である。
FIG. 12 shows a sixth example of the bit transfer instruction (B
MOV # 2, R3H, # 1, $ FFFF32). Operations other than the second word of the instruction code are the same as those in FIG.

【0144】T4のC1で、命令コード(bmov−0
a)が命令デコーダDECに入力されて、制御信号MO
DDとともに、命令の内容が解読される。制御信号MO
DDが1にセットされているので、指定された汎用レジ
スタ(R3H)の指定されたビット(ビット2)をテン
ポラリレジスタTRDの指定されたビット(ビット1)
に転送する。算術論理演算器ALUは、BMOV命令の
第1モードで動作する。
At C1 of T4, the instruction code (bmov-0
a) is input to the instruction decoder DEC, and the control signal MO
The contents of the instruction are decoded together with the DD. Control signal MO
Since DD is set to 1, the designated bit (bit 2) of the designated general-purpose register (R3H) is replaced with the designated bit (bit 1) of the temporary register TRD.
Transfer to The arithmetic and logic unit ALU operates in the first mode of the BMOV instruction.

【0145】前記同様に、T4のC1のcontrol
Aによる命令リードとプログラムカウンタPCのインク
リメントを行なう。
As described above, the control of C1 of T4
The instruction is read by A and the program counter PC is incremented.

【0146】T3のC2のcontrolBで、算術論
理演算器ALUの入力データの指示(rs_gb:R3
Hを指定するためr3h_gb)を行い、T4のC1の
controlCで、算術論理演算器ALUに対する制
御と、ゼロ検出回路15の出力のレジスタ格納の指示
(bittrd)を出力する。これに従って、汎用レジ
スタR3Hの内容を内部バスGBに読み出して、算術論
理演算器ALUに入力する。
At the control B of C2 of T3, the instruction of the input data of the arithmetic and logic unit ALU (rs_gb: R3
H3 is specified by r3h_gb), and the control C of C1 at T4 outputs an instruction (bittrrd) for controlling the arithmetic and logic unit ALU and storing the output of the zero detection circuit 15 in a register. In accordance therewith, the contents of the general-purpose register R3H are read out to the internal bus GB and input to the arithmetic and logic unit ALU.

【0147】算術論理演算器ALUはBMOV命令の第
1モードを実行するために次の動作(bmov1)を行
なう。算術論理演算器ALUのデコーダ10には、命令
コードのビット6〜4(IR[6:4]=2)が与えら
れ、入力セレクタ12はデコーダ10の出力(deco
ut=H’02)の反転と内部バスGBとの論理積を、
入力セレクタ13はデコーダ10の出力を出力して、こ
れらの、論理積演算を行なう。
The arithmetic and logic unit ALU performs the following operation (bmov1) to execute the first mode of the BMOV instruction. The decoder 10 of the arithmetic and logic unit ALU is provided with bits 6 to 4 (IR [6: 4] = 2) of the instruction code, and the input selector 12 outputs the output (deco
ut = H'02) and the logical product of the inversion of the internal bus GB and
The input selector 13 outputs the output of the decoder 10 and performs an AND operation on these outputs.

【0148】ゼロ検出回路15に結果(zout=|
(R3H[7:0]& H’02)=R3H[2])が
生成され、T6のC2で、前記指示(bittrd)に
従って、テンポラリレジスタTRDのビット1に格納さ
れる。そのほかのビットは保持され、結果(data0
={TRD[7:2],zout,TRD[0]})が
得られる。
The result (zout = |
(R3H [7: 0] &H'02) = R3H [2]) is generated and stored in bit 1 of the temporary register TRD according to the instruction (bittrd) at C2 of T6. Other bits are retained and the result (data0
= {TRD [7: 2], zout, TRD [0]}).

【0149】T4のC2で、命令コード(mov−s
t)を発生する制御信号を生成し、当該命令コードは、
T5のC1からデコーダDECに入力する。これは、図
8と同一である。
At C2 of T4, the instruction code (mov-s
generating a control signal that generates t), and the instruction code is:
Input from C1 of T5 to the decoder DEC. This is the same as FIG.

【0150】図13にはビット転送命令の第7の例(B
MOV #7,R4H,#6,R5L)の実行タイミン
グを示す。命令コードの第1ワード(mov−1)は、
指定された汎用レジスタ(R4H)をテンポラリレジス
タTRDに転送する。これは既存の命令(MOV.B
R4H,R0L)に類似する動作を採ることにより、設
計を容易にすることができる。第2ワードの動作は、図
11と同一である。
FIG. 13 shows a seventh example of the bit transfer instruction (B
MOV # 7, R4H, # 6, R5L). The first word (mov-1) of the instruction code is
The designated general-purpose register (R4H) is transferred to the temporary register TRD. This is because the existing instruction (MOV.B
R4H, R0L) can facilitate design. The operation of the second word is the same as in FIG.

【0151】図14には本発明に係るデータ処理装置の
一例として前記CPUを内蔵するマイクロコンピュータ
が示される。
FIG. 14 shows a microcomputer incorporating the CPU as an example of the data processing apparatus according to the present invention.

【0152】マイクロコンピュータ30は、前記CPU
1、システムコントローラ(SYSC)31、割込コン
トローラ(INT)32、CPU1の処理プログラムな
どを格納するメモリであるROM33、CPU1の作業
領域並びにデータの一時記憶用のメモリであるRAM3
4、タイマ35、シリアルコミュニケーションインタフ
ェース(SCI)36、A/D変換器37、第1乃至第
9入出力ポートIOP1〜IOP9、クロック発振器
(CPG)38等の機能ブロック若しくは機能モジュー
ルから構成され、公知の半導体製造技術により1つの半
導体基板上に形成される。
The microcomputer 30 has the CPU
1, a system controller (SYSC) 31, an interrupt controller (INT) 32, a ROM 33 that stores a processing program of the CPU 1, a work area of the CPU 1, and a RAM 3 that is a memory for temporarily storing data.
4. It is composed of functional blocks or modules such as a timer 35, a serial communication interface (SCI) 36, an A / D converter 37, first to ninth input / output ports IOP1 to IOP9, and a clock oscillator (CPG) 38. Is formed on one semiconductor substrate by the semiconductor manufacturing technology.

【0153】前記マイクロコンピュータ30は、電源端
子として、グランドレベル(Vss)、電源電圧レベル
(Vcc)、アナロググランドレベル(AVss)、ア
ナログ電源電圧レベル(AVcc)、アナログ基準電圧
(Vref)の入力端子を有すると共に、専用制御端子
として、リセット(RES)、スタンバイ(STB
Y)、モード制御(MD0、MD1)、クロック入力
(EXTAL、XTAL)の各端子を有する。CPG3
8の端子EXTAL、XTALに接続される水晶発振子
またはEXTAL端子に入力れる外部クロックに基づい
て生成される基準クロック(システムクロック)φに同
期して、マイクロコンピュータ30は動作を行う。この
基準クロック信号φの1周期をステートと呼ぶ。
The microcomputer 30 has, as power supply terminals, input terminals for ground level (Vss), power supply voltage level (Vcc), analog ground level (AVss), analog power supply voltage level (AVcc), and analog reference voltage (Vref). And dedicated control terminals such as reset (RES) and standby (STB).
Y), mode control (MD0, MD1), and clock input (EXTAL, XTAL) terminals. CPG3
The microcomputer 30 operates in synchronization with a reference oscillator (system clock) φ generated based on a crystal oscillator connected to the terminals EXTAL and XTAL or an external clock input to the EXTAL terminal. One cycle of the reference clock signal φ is called a state.

【0154】マイクロコンピュータ30の機能ブロック
は、内部バス39によって相互に接続される。内部バス
39は、アドレスバス、データバスの他、バスコマンド
やリード信号・ライト信号・バスサイズ信号などが伝達
されるコントロールバスを含む。特に図示はしないが、
前記の通り、内部アドレスバスはその位相によって、I
AB、PABの2種類があり、内部データバスもその位
相によって、IDB、PDBが存在する。IABとPA
B、IDBとPDBは相互にインタフェースされる。内
部バスのデータバス幅は16ビットとする。CPU1は
内蔵ROM33、RAM34を1ステートでリード/ラ
イト可能とする。かかる内部バス39を介して、CPU
1は、前記機能ブロックやモジュールをリード/ライト
する。
The functional blocks of the microcomputer 30 are interconnected by an internal bus 39. The internal bus 39 includes an address bus, a data bus, and a control bus to which a bus command, a read signal, a write signal, a bus size signal, and the like are transmitted. Although not specifically shown,
As described above, the internal address bus depends on its phase.
There are two types, AB and PAB, and the internal data bus also has IDB and PDB depending on the phase. IAB and PA
B, IDB and PDB are interfaced with each other. The data bus width of the internal bus is 16 bits. The CPU 1 makes the built-in ROM 33 and RAM 34 readable / writable in one state. Through such an internal bus 39, the CPU
1 reads / writes the functional blocks and modules.

【0155】ROM33は、CPU1の処理プログラム
を格納する。フラッシュメモリやマスクROMであっ
て、フラッシュメモリの場合は、所定PROMライタで
使用者が書込むことが可能である。マスクROMは、使
用者が提供する所定のオブジェクトファイルに基づい
て、製造工程での書込みが行われる。RAM34は、前
記パラメータなどを保持したりする。
The ROM 33 stores a processing program for the CPU 1. In the case of a flash memory or a mask ROM, in the case of a flash memory, a user can write data using a predetermined PROM writer. The mask ROM is written in a manufacturing process based on a predetermined object file provided by a user. The RAM 34 holds the parameters and the like.

【0156】システムコントローラ(SYSC)31
は、マイクロコンピュータ30の全体の状態を制御(動
作モードや低消費電力状態)するとともに、CPU1の
制御を行なう制御レジスタCPUCRを持ち、前記ビッ
トアキュムレータとしてCCR又は汎用レジスタの何れ
を用いるか等を指示する制御情報が設定される。
System controller (SYSC) 31
Has a control register CPUCR that controls the entire state of the microcomputer 30 (operation mode and low power consumption state) and controls the CPU 1, and instructs whether to use a CCR or a general-purpose register as the bit accumulator. Is set.

【0157】タイマ35、SCI36、A/D変換器3
7、入出力ポートIOP1〜IOP9、SYSC31、
INT32、CPG38が有する制御レジスタを総称し
て、内部I/Oレジスタと呼ぶ。これらには、ビット単
位で意味を持つビットやフラグが含まれる。例えば、出
力ポートや、割込み要因フラグなどがある。これらは、
C言語プログラムでは、構造体としてビットフィールド
宣言して取り扱われる。
Timer 35, SCI 36, A / D converter 3
7, input / output ports IOP1 to IOP9, SYSC31,
The control registers of the INT 32 and the CPG 38 are collectively called internal I / O registers. These include bits and flags that have meaning in bit units. For example, there are an output port and an interrupt factor flag. They are,
In a C language program, a bit field is declared as a structure and handled.

【0158】各入出力ポートIOP1〜IOP9は、ア
ドレスバス、データバス、バス制御信号あるいはタイマ
35、SCI36、A/D変換器37の入出力端子と兼
用されている。すなわち、タイマ35、SCI36、A
/D変換器37は、それぞれ入出力信号を有し、入出力
ポートと兼用にされた端子介して、外部と入出力される
ものである。例えばIOP5、IOP6、IOP7はタ
イマ35の入出力端子と兼用、IOP8はSCI36の
入出力端子と兼用にされている。アナログデータの入出
力端子は、入出力ポートIOP9と兼用にされている。
Each of the input / output ports IOP1 to IOP9 is also used as an address bus, a data bus, a bus control signal, or an input / output terminal of the timer 35, the SCI 36, and the A / D converter 37. That is, the timer 35, the SCI 36, A
The / D converter 37 has an input / output signal, and inputs / outputs to / from the outside via a terminal also used as an input / output port. For example, IOP5, IOP6, and IOP7 are also used as input / output terminals of the timer 35, and IOP8 is also used as input / output terminals of the SCI 36. An analog data input / output terminal is also used as an input / output port IOP9.

【0159】前記マイクロコンピュータ30にリセット
信号RESが与えられると、CPU1を始めとし、マイ
クロコンピュータ30はリセット状態になる。このリセ
ットが解除されると、CPU1は所定のアドレスからス
タートアドレスをリードして、このスタートアドレスか
ら命令のリードを開始するリセット例外処理を行う。こ
の後、CPU1は逐次、ROM33などから命令をリー
ドし、解読して、その解読内容に基づいてデータの処理
或はRAM34、タイマ35、SCI36等とのデータ
転送を行う。即ち、CPU1は、入出力ポートIOP1
〜IOP9、A/D変換器37などか入力されるデー
タ、或はSCI36などから入力される指示を参照しつ
つ、ROM33などに記憶されている命令に基づいて処
理を行い、その結果に基づいて、入出力ポートIOP1
〜IOP9、タイマ35などを使用しつて、外部に信号
を出力し、各種機器の制御を行うものである。
When a reset signal RES is given to the microcomputer 30, the microcomputer 30 including the CPU 1 is reset. When the reset is released, the CPU 1 reads a start address from a predetermined address and performs a reset exception process for starting reading an instruction from the start address. Thereafter, the CPU 1 sequentially reads and decodes the instructions from the ROM 33 or the like, and performs data processing or data transfer with the RAM 34, the timer 35, the SCI 36, or the like based on the decoded contents. That is, the CPU 1 sets the input / output port IOP1
Processing is performed based on instructions stored in the ROM 33 or the like with reference to data input from the IOP 9, the A / D converter 37 or the like, or instructions input from the SCI 36 or the like, and based on the result, , I / O port IOP1
A signal is output to the outside using the IOP9, the timer 35 and the like to control various devices.

【0160】タイマ35、SCI36、外部信号などの
状態を割込み信号として、CPU1に伝達することがで
きる。割込信号は、A/D変換器37、タイマ35、S
CI36、入出力ポートIOP1〜IOP9が出力し、
割込コントローラ(INT)32はこれを入力して、所
定のレジスタなどの指定に基づて、CPU1に割込要求
信号を与える。割込要因が発生すると、CPU1に割込
要求信号が発生され、CPU1は命令の切れ目で、実行
中の処理を中断し、例外処理状態を実行し、所定の処理
ルーチンに分岐し、所望の処理を行い、割込要因をクリ
アしたりする。所定の処理ルーチンの最後には、通常復
帰命令がおかれ、この命令を実行することによって前記
中断した処理を再開する。
The state of the timer 35, SCI 36, external signals, and the like can be transmitted to the CPU 1 as an interrupt signal. The interrupt signal includes an A / D converter 37, a timer 35,
CI36, input / output ports IOP1 to IOP9 output,
The interrupt controller (INT) 32 receives this and supplies an interrupt request signal to the CPU 1 based on the designation of a predetermined register or the like. When an interrupt factor occurs, an interrupt request signal is generated in the CPU 1, and the CPU 1 interrupts the process being executed at the break of the instruction, executes an exception processing state, branches to a predetermined processing routine, and executes a desired processing. And clear the interrupt factor. At the end of the predetermined processing routine, a normal return instruction is placed, and the interrupted processing is resumed by executing this instruction.

【0161】図15には前記CPU1の開発環境の概略
が示される。使用者は、各種エディタなどを用いて、C
言語乃至アセンブリ言語でプログラムを作成する。これ
は通常、複数のモジュールに分割して作成される。
FIG. 15 shows an outline of a development environment of the CPU 1. The user can use various editors and the like to
Create a program in language or assembly language. This is usually created by dividing into a plurality of modules.

【0162】Cコンパイラ40は、使用者の作成したそ
れぞれのC言語ソースプログラムを入力し、アセンブリ
言語ソースプログラム若しくはオブジェクトモジュール
を出力する。アセンブラ41は、アセンブリ言語ソース
プログラムを入力し、オブジェクトモジュールを出力す
る。リンケージエディタ42は、上記Cコンパイラ40
やアセンブラ41の生成した、複数のオブジェクトモジ
ュールを入力して、各モジュールの外部参照や相対アド
レスなどの解決を行い、1つのプログラムに結合して、
ロードモジュールを出力する。ロードモジュールは、シ
ミュレータ/デバッガ43に入力して、パーソナルコン
ピュータなどのシステム開発装置上で、CPU1の動作
をシミュレーションし、実行結果を表示し、プログラム
の解析や評価を行なうことができる。また、エミュレー
タ44に入力して、実際の応用システム上などで動作す
る、いわゆるインサーキットエミュレーションを行な
い、マイクロコンピュータ全体としての、実動作の解析
や評価を行なうことができる。さらに、ロードモジュー
ルをPROMライタ45に入力して、マイクロコンピュ
ータ30の内蔵ROM33がフラッシュメモリなどの場
合や、外部のフラッシュメモリなどに、作成したプログ
ラムをロードすることができる。必要に応じて、オブジ
ェクトコンバータなどによって、所望のフォーマットに
変換する。このほかに、ライブラリアンとして、汎用的
なサブルーチンなどを提供することもできる。
The C compiler 40 inputs each C language source program created by the user and outputs an assembly language source program or an object module. The assembler 41 inputs an assembly language source program and outputs an object module. The linkage editor 42 is a C compiler 40
And a plurality of object modules generated by the assembler 41, resolve external references and relative addresses of each module, combine them into one program,
Output the load module. The load module can be input to the simulator / debugger 43 to simulate the operation of the CPU 1 on a system development device such as a personal computer, display the execution result, and analyze and evaluate the program. Also, by inputting to the emulator 44, so-called in-circuit emulation that operates on an actual application system or the like is performed, analysis and evaluation of the actual operation of the entire microcomputer can be performed. Further, by inputting the load module to the PROM writer 45, the created program can be loaded into the case where the built-in ROM 33 of the microcomputer 30 is a flash memory or the like, or into an external flash memory or the like. If necessary, the data is converted into a desired format by an object converter or the like. In addition, a general-purpose subroutine can be provided as a librarian.

【0163】図16には前記CPU1のシステム開発装
置におけるビットアキュムレータの指定方法を例示す
る。ここでは、CPU1の命令を選択する場合を示す。
FIG. 16 exemplifies a method of specifying a bit accumulator in the system development device of the CPU 1. Here, a case where the instruction of the CPU 1 is selected is shown.

【0164】(a)に例示されるように、パーソナルコ
ンピュータなどのシステム開発装置上のディスプレイで
プロンプトが表示された状態で、例えば、“SET C
PU= BITACC−R0L”と入力すればよいよう
にする。
As illustrated in (a), while a prompt is displayed on a display on a system development apparatus such as a personal computer, for example, “SET C
PU = BITACC-R0L ".

【0165】或いは、(b)に例示されるように、プロ
ンプトが表示された状態で、“SET CPU”とコマ
ンドを入力し、これに対して、CPUの種類及び動作モ
ードのメニューを、例えば、“BITACC (1.B
ITACC−R0L、2.BITACC−C)”と表示
するとともに、メニュー番号の入力を要求し、使用者が
メニューの番号1〜2のいずれかを入力すればよいよう
にする。そのほかのオプションがある場合には、引き続
き入力可能にすればよい。
Alternatively, as shown in (b), while a prompt is displayed, a command “SET CPU” is input, and in response to this, a menu of CPU type and operation mode is displayed, for example. “BITACC (1.B
ITACC-R0L, 2. BITACC-C) "and prompts the user to enter a menu number so that the user may enter any of menu numbers 1-2. If there are other options, continue to enter It should be possible.

【0166】このほか、ウィンドウのドロップダウンメ
ニューで選択可能にしてもよいし、ワークステーション
などであれば、Cシェルコマンドとして入力することも
できる。かかる情報は、CPU情報ファイル(CPU定
義情報)などとして保存され、図15の通りコンパイル
時などに参照される。更に、アセンブラやCコンパイラ
などの、ソースプログラムの制御命令として、ビットア
キュムレータの選択などを入力することができる。
In addition, selection may be made from a drop-down menu of a window, or a workstation or the like may be input as a C shell command. Such information is stored as a CPU information file (CPU definition information) and is referred to at the time of compiling as shown in FIG. Furthermore, selection of a bit accumulator or the like can be input as a control instruction of a source program such as an assembler or a C compiler.

【0167】また、(c)に例示されるようにCコンパ
イラを実行する場合のオプションとして、設定してもよ
い。例えば、“ccomp−bitacc=r0l s
ource.c”と入力する。オプション「−bita
cc=r0l」でビットアキュムレータをR0Lとし、
「source.c」をコンパイルする。
Also, as an example when the C compiler is executed as illustrated in (c), it may be set as an option. For example, "ccomp-bitacc = r0ls
source. c ". Option" -bita
cc = r01 ”, the bit accumulator is set to R0L,
Compile "source.c".

【0168】Cコンパイラは、例えば、“flag=i
op17;”に対し、キャリフラグ(C)をビットアキ
ュムレータとする場合には、 MOV.B #00,R0L BLD #7,@iop1 BST #0,R0L MOV.B R0L,@flag などのプログラムを生成し、ビットアキュムレータをR
0Lとする場合には、 BLD #7,@iop1 MOV.B R0L,@flag などのプログラムを生成するようにされる。
The C compiler, for example, outputs “flag = i
op17; ", when the carry flag (C) is used as a bit accumulator, a program such as MOV.B # 00, R0L BLD # 7, $ iop1 BST # 0, R0L MOV.B R0L, $ flag is generated. And set the bit accumulator to R
0L, BLD # 7, {iop1 MOV. A program such as BR0L, $ flag is generated.

【0169】これらは、Cソースプログラムの字句や意
味の解析を行い、最適化を行なう段階は共通にでき、そ
の後、CPUに応じたプログラムを生成する段階でのみ
相違される。
The steps for analyzing the lexical and semantics of the C source program and performing the optimization can be common, and then differ only in the step of generating a program corresponding to the CPU.

【0170】Cコンパイラは、選択された命令の種類及
び動作モードに従って、使用可能な、オペレーション、
データサイズ、アドレッシングモードの組合せで示され
る命令などを判別して、C言語によるプログラムを、C
PU1の命令に変換し、アセンブリ言語プログラムやオ
ブジェクトモジュールとして出力する。
According to the selected instruction type and operation mode, the C compiler can use available operations,
An instruction indicated by a combination of a data size and an addressing mode is determined, and a program written in C language is
It is converted into PU1 instructions and output as an assembly language program or object module.

【0171】Cコンパイラ自体には、C言語によるプロ
グラムを、CPU1の命令に変換する機能の他、C++
言語によるプログラムのコンパイルや、モジュール間最
適化などといった、CPU1の命令セットとは直接関係
のない機能の向上が図られているが、CPU毎の個別の
コンパイラでは、これらの機能向上を全ての個別のコン
パイラに適用しなければならない。本発明のように、共
通のCコンパイラとしておけば、前記、CPU1の命令
セットとは直接関係のない機能向上を図ることが容易に
なり、また、開発効率などを向上することができる。
The C compiler itself has a function of converting a program in C language into an instruction of the CPU 1 and a function of C ++.
Improvements in functions that are not directly related to the instruction set of the CPU 1, such as compiling a program in a language and optimizing between modules, have been attempted. Must be applied to the compiler. If a common C compiler is used as in the present invention, it is easy to improve functions that are not directly related to the instruction set of the CPU 1, and it is possible to improve development efficiency and the like.

【0172】前記レジスタCPUCRの設定は上記ビッ
トアキュムレータの選択と同一であるようにする。これ
はアセンブリ言語で記述する場合には、レジスタCPU
CRに設定すべき値をxyとして、 MOV.B #xy,R0L MOV.B R0L,@CPUCR とすればよい。C言語ソースプログラムに埋め込むこと
も可能である。C言語で、 CPUCR=xy; などとしてもよい。
The setting of the register CPUCR is the same as the selection of the bit accumulator. If this is written in assembly language, register CPU
The value to be set in CR is xy, and MOV. B #xy, R0L MOV. BR0L, $ CPUCR. It can also be embedded in a C language source program. In C language, CPUCR = xy;

【0173】以上説明したCPUなどによれば、以下の
作用効果を得るものである。
According to the CPU and the like described above, the following functions and effects can be obtained.

【0174】〔1〕メモリ上のデータの任意のビット
を、所定の汎用レジスタ乃至メモリ上のデータの、所定
のビット(例えば、ビット0)に格納し、そのほかのビ
ットを固定的な値(0乃至符号拡張)などとする命令を
持つことにより、例えば、C言語で記述される、構造体
上のビットフィールド宣言された値の、キャラクタ型の
パラメータへの代入などを、容易に実行可能にし、命令
の実行時間を短縮したり、命令コード長を短縮したりす
ることができる。例えば、BLDS命令とMOV命令を
組合せることにより、従来技術における命令コード6ワ
ード、実行ステート数8ステートを、3ワード、5ステ
ートに短縮できる。機器制御用のマイクロコンピュータ
においてはかかる動作が頻出するから、効果は更に大き
くなる。ひいては、マイクロコンピュータの処理性能を
向上して、機器制御の高速化や高機能化などに寄与でき
る。C言語に即した命令を持つことによって、コンパイ
ルや最適化などの開発装置の開発効率の向上を図ること
ができる。
[1] An arbitrary bit of the data on the memory is stored in a predetermined bit (for example, bit 0) of the data on the predetermined general-purpose register or the memory, and the other bits are set to a fixed value (0). , Sign extension), etc., for example, making it possible to easily execute, for example, the assignment of a bit field declared value on a structure described in C language to a character type parameter, It is possible to reduce the execution time of an instruction and the length of an instruction code. For example, by combining the BLDS instruction and the MOV instruction, the instruction code of 6 words and the execution state number of 8 states in the related art can be reduced to 3 words and 5 states. Such operations frequently occur in the microcomputer for controlling equipment, and the effect is further enhanced. As a result, the processing performance of the microcomputer can be improved, thereby contributing to higher speed and higher functionality of device control. By having instructions conforming to the C language, it is possible to improve the development efficiency of a development device such as compiling and optimization.

【0175】〔2〕ビットアキュムレータを、キャリフ
ラグ(C)ではなく、汎用レジスタとすることにより、
操作すべきビットを、ビットアキュムレータに保持した
まま、アドレス計算などのほかの演算の実行を可能にし
て、プログラミングを容易にすることができる。また、
BSTS命令や、そのほかのビット論理演算命令も、同
一のビットアキュムレータを使用して、ビット単位の論
理演算を容易に行なうことができる。
[2] By using a general-purpose register for the bit accumulator instead of the carry flag (C),
While the bits to be operated are held in the bit accumulator, other operations such as address calculation can be executed, thereby facilitating programming. Also,
The BSTS instruction and other bit logical operation instructions can also easily perform a logical operation on a bit basis using the same bit accumulator.

【0176】〔3〕ビットアキュムレータを、キャリフ
ラグ(C)とするか、汎用レジスタとするかを指定可能
にすることにより、多様な使用方法に対応できる。キャ
リフラグ(C)をビットアキュムレータとする既存のC
PUが存在する場合には、このソフトウェア資産を有効
に利用することができる。キャリフラグ(C)をビット
アキュムレータとする場合には、汎用レジスタの本数が
十分に多くはない場合などであっても、限られた資源を
有効に利用することができる。
[3] A variety of usages can be supported by allowing the bit accumulator to be designated as a carry flag (C) or a general-purpose register. Existing C with carry flag (C) as bit accumulator
If a PU exists, this software asset can be used effectively. When the carry flag (C) is a bit accumulator, limited resources can be effectively used even when the number of general-purpose registers is not sufficiently large.

【0177】開発装置は、上記ビットアキュムレータを
選択する手段を持つことによって、Cコンパイラなどを
共通にし、開発効率を向上することができる。共通化に
よって、移植やメンテナンスの工数なども低減できる。
使用者も、ビットアキュムレータの使用方法に拘らず、
共通に利用可能であって、便利である。ビットアキュム
レータの使用方法を変更したり、両方のプログラムで比
較を行なったりすることが直ちに行なえるので、開発期
間の短縮に寄与したり、不所望の費用を抑止できる。
Since the development device has a means for selecting the bit accumulator, a C compiler and the like can be used in common, and the development efficiency can be improved. Common use can also reduce the man-hours for transplantation and maintenance.
The user, regardless of how to use the bit accumulator,
Commonly available and convenient. Since the method of using the bit accumulator can be changed or a comparison can be made between both programs immediately, it is possible to contribute to shortening the development period and to suppress undesired costs.

【0178】〔4〕ビットアキュムレータとして使用す
る汎用レジスタを選択可能にすることによって、複数の
ビットを操作するような場合に、プログラミングの柔軟
性を向上できる。例えば、 flag1=iop17; flag2=iop27; という場合において、flag1とflag2を連続す
るアドレスに配置していれば、 BLD #7,@iop1,R0L BLD #7,@iop2,R0H MOV.W R0,@flag などとして、メモリに対するライトを共通化して、高速
化を図ったりすることができる。
[4] By making a general-purpose register used as a bit accumulator selectable, programming flexibility can be improved when a plurality of bits are manipulated. For example, in the case of flag1 = iop17; flag2 = iop27; and if flag1 and flag2 are arranged at consecutive addresses, BLD # 7, $ iop1, R0L BLD # 7, $ iop2, R0H MOV. Writes to the memory can be shared as WR0, $ flag, etc., to achieve higher speed.

【0179】〔5〕任意のビットから別の任意のビット
への転送を可能にして、プログラミングを容易にし、実
行時間を短縮できる。内蔵RAM上に、構造体のビット
フィールドなどを宣言して、複数のビットを保持して、
内蔵RAMの利用効率を向上することができる。ソース
及びデスティネーションを、汎用レジスタ/メモリか
ら、それぞれ独立に選択可能にして、プログラミングを
更に容易にできる。
[5] Transfer from an arbitrary bit to another arbitrary bit is enabled, thereby facilitating programming and shortening execution time. Declaring a bit field of a structure, etc. on the built-in RAM, holding multiple bits,
The use efficiency of the built-in RAM can be improved. The source and destination can be independently selected from general-purpose registers / memory, thereby facilitating programming.

【0180】〔6〕既存の、ビット転送命令の命令コー
ドと、その機械語や制御を共通化し、命令デコーダの、
従来の設計資産を有効に利用することができ、論理的な
規模の追加と変更を最小限にし、論理的・物理的規模の
増大を最小限にできる。また、開発に必要な期間を短縮
し、資源を節約することができる。
[6] The instruction code of the existing bit transfer instruction, its machine language and control are shared, and the
Conventional design resources can be effectively used, and addition and change of a logical scale can be minimized, and an increase in a logical and physical scale can be minimized. In addition, the time required for development can be shortened, and resources can be saved.

【0181】命令コードを複数のワードからなるように
し、メモリからの転送を行なう命令実行機能、ビット操
作自体を行なう命令実行機能、メモリへの転送命令機能
を別々の命令コードのワードで制御するようにし、それ
ぞれを既存の類似の命令と同様の動作を行なうように
し、開発期間を短縮することができる。前記メモリから
の転送を行なう命令実行機能やメモリへの転送命令機能
は、ビット転送命令の種類に共通に利用できるから、ま
た、ビット操作自体を行なう命令実行機能は、汎用レジ
スタに対するものと共通に利用できるから、論理規模の
増加を抑止できる。前記メモリからの転送を行なう命令
実行機能を共通にしておくことによって、アドレッシン
グモードの種類を増やすことも容易にできる。
The instruction code is composed of a plurality of words, and the instruction execution function for transferring data from the memory, the instruction execution function for performing bit manipulation itself, and the instruction function for transferring data to the memory are controlled by different instruction code words. Each of them performs the same operation as an existing similar instruction, thereby shortening the development period. Since the instruction execution function for transferring data from the memory and the transfer instruction function for transferring data to the memory can be used in common for the types of bit transfer instructions, the instruction execution function for performing the bit operation itself is commonly used for general-purpose registers. Since it can be used, an increase in the logical scale can be suppressed. By making the instruction execution function for transferring data from the memory common, it is possible to easily increase the types of addressing modes.

【0182】〔7〕テンポラリレジスタTRDの様なラ
ッチ手段には、指定されたビットの状態を判定する手段
を設け、算術論理演算器ALUなどに読み出したりする
ことなく、所定のビットの状態を判定できるようにする
ことにより、ビット転送命令の全体的な動作を変更する
ことなく、実現できるから、変更する部分を小さくし、
また論理的規模の増加を最小限にすることができる。同
様に、所定のビットのみの入力を行なう手段を設けるこ
とによって、変更する部分を小さくし、また論理的規模
の増加を最小限にすることができる。
[7] The latch means such as the temporary register TRD is provided with means for determining the state of a designated bit, and the state of a predetermined bit is determined without reading it out to the arithmetic logic unit ALU or the like. By doing so, it can be realized without changing the overall operation of the bit transfer instruction.
Also, an increase in logical scale can be minimized. Similarly, by providing a means for inputting only predetermined bits, the portion to be changed can be reduced and the increase in logical scale can be minimized.

【0183】任意ビット間のビット転送命令(BMO
V)の第1モード、第2モードは、それぞれBLDS命
令、BSTS命令とALUの動作を共通にでき、論理規
模の増加を抑止し、開発期間の短縮を図ることができ
る。
A bit transfer instruction between arbitrary bits (BMO
In the first mode and the second mode V), the operations of the BLDS instruction and BSTS instruction and the ALU can be made common, respectively, thereby suppressing an increase in logical scale and shortening the development period.

【0184】任意ビット間のビット転送命令(BMO
V)の第1モード、第2モードとでは、命令コード中
の、ソース側/デスティネーション側のビット番号フィ
ールドを入れ替えて、デコーダに入力する命令コードの
ビット位置は共通にし、論理の簡略化を図ることができ
る。
A bit transfer instruction between arbitrary bits (BMO
In the first mode and the second mode of V), the bit number fields on the source side / destination side in the instruction code are exchanged, and the bit position of the instruction code input to the decoder is made common, thereby simplifying the logic. Can be planned.

【0185】以上本発明者等によってなされた発明を実
施例に限定されるものではなく、その要旨を逸しない範
囲において種々変更可能である。例えば、ビット0固定
転送と任意ビット間転送の両方を持つ必要はなく、一方
のみ、乃至それらの内の一部の命令やアドレッシングモ
ードのみであってもよい。
The invention made by the present inventors is not limited to the embodiment, but can be variously modified without departing from the gist of the invention. For example, it is not necessary to have both the bit 0 fixed transfer and the transfer between arbitrary bits, and only one of them or only some of the instructions and the addressing modes may be used.

【0186】ビットアキュムレータは、汎用レジスタR
0Lのビット0とするか、キャリ(C)フラグとするか
の選択に限定されない。両方を使用可能にし、命令の種
類を別にしたり、アドレッシングモードなどで指定可能
にしてもよい。汎用レジスタR0Lのほか、任意の汎用
レジスタを指定可能にできることは前記の通りである。
ビット0を使用するほか、ビット7など、最上位ビット
としてもよい。上位のビットは、0とするほか、ビット
0と同じ内容(例えば、H’00、FFを格納)にでき
ることは前記の通りである。これらを選択可能にした
り、命令やアドレッシングモードの種類などで指定可能
にしてもよい。
The bit accumulator is a general-purpose register R
The present invention is not limited to the selection between the bit 0 of 0L and the carry (C) flag. Both may be used, and the type of instruction may be different, or may be specified in an addressing mode or the like. As described above, an arbitrary general-purpose register can be specified in addition to the general-purpose register R0L.
Instead of using bit 0, it may be the most significant bit such as bit 7. As described above, the upper bit can be set to 0 and can have the same content as that of bit 0 (for example, storing H'00 and FF). These may be selectable, or may be specified by the type of command or addressing mode.

【0187】ビットを転送するソースまたはデスティネ
ーションのデータのサイズは、バイトに限定されず、ワ
ードなどであってもよく、当該CPUの持つデータサイ
ズに応じて適宜選択可能である。複数のサイズを使用可
能にしてもよい。
The size of source or destination data for transferring bits is not limited to bytes, but may be words or the like, and can be appropriately selected according to the data size of the CPU. Multiple sizes may be available.

【0188】ビットを転送するソースまたはデスティネ
ーションのアドレッシングモードも、レジスタ直接や8
ビット絶対アドレスに限定されず、16ビット乃至32
ビット絶対アドレスやレジスタ間接など、当該CPUの
持つアドレッシングモードに応じて適宜使用可能であ
る。ソースとデスティネーションのアドレッシングモー
ドは相互に一致している必要はない。
The source or destination addressing mode for transferring bits can be set directly to the register or to the 8
It is not limited to a bit absolute address, but 16 bits to 32 bits
It can be used as appropriate according to the addressing mode of the CPU, such as a bit absolute address or register indirect. The source and destination addressing modes need not match each other.

【0189】上述の例では、ソースまたはデスティネー
ションのデータをリードする命令コードと、ビット転送
の演算動作を実行する命令コードと、実行結果をライト
する命令コードとに分けて実行するものとしたが、命令
コードの構成や、命令コードの解読方法や、命令の実行
方法については種々の方法を採ることができる。例え
ば、BLDMOV命令は、メモリ−メモリのBMOV命
令と共通にシーケンスになるようにしてあるが、第2ワ
ードと第3ワードの順序を入れ替えて、デスティネーシ
ョンのメモリはリードを行なわず、演算結果(TRD)
のライトのみを行なうようにしてもよい。この方が1ス
テートの短縮が可能である。この場合、ライト型転送命
令と同等の動作を行なう命令コード(mov−st)の
生成は行なわないようにする。
In the above example, the instruction code for reading the source or destination data, the instruction code for executing the bit transfer operation, and the instruction code for writing the execution result are executed separately. For the configuration of the instruction code, the method of decoding the instruction code, and the method of executing the instruction, various methods can be adopted. For example, the BLDMOV instruction is sequenced in common with the BMOV instruction of the memory-memory, but the order of the second word and the third word is reversed, the destination memory does not read, and the operation result ( TRD)
May be performed only. This can shorten one state. In this case, generation of an instruction code (mov-st) that performs the same operation as the write-type transfer instruction is not performed.

【0190】制御信号は、MODS、MODDを用いる
ものとしたが、そのほかの制御信号に分割することもで
きる。また、命令コードの基本単位16ビットに限定す
る必要はなく、8ビット或いは32ビットなど任意のビ
ット幅とできる。
Although the control signal uses MODS and MODED, it can be divided into other control signals. Further, the basic unit of the instruction code does not need to be limited to 16 bits, and may be an arbitrary bit width such as 8 bits or 32 bits.

【0191】CPUの内部構成、例えば、内部バスやA
LUの構成や、動作タイミングなどは随時変更可能であ
ることは言うまでもない。マイクロコンピュータのその
他の機能ブロックについても何等制約されない。
The internal configuration of the CPU, for example, an internal bus or A
It goes without saying that the LU configuration and operation timing can be changed at any time. The other functional blocks of the microcomputer are not restricted at all.

【0192】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるマイク
ロコンピュータに適用した場合について説明したが、そ
れに限定されるものではなく、その他のマイクロコンピ
ュータまたはデータ処理装置も適用可能であり、本発明
は少なくとも、命令を解読して処理し、演算処理を行な
うデータ処理装置に適用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to a microcomputer which is the application field of the background has been described. However, the present invention is not limited to this. A processing device is also applicable, and the present invention can be applied to at least a data processing device that decodes and processes instructions and performs arithmetic processing.

【0193】[0193]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0194】すなわち、アドレス空間上のデータを読み
込んで、この所望のビットの状態を検出し、汎用レジス
タの所定のビット(例えば、ビット0)に格納するとと
もに、この汎用レジスタのその他のビットを所定の状態
(例えば0)とする命令(BLDS命令)を有すること
により、機器制御用マイクロコンピュータにおいて、C
言語などの高級言語でプログラムを作成した場合など
で、ビット操作(特にビットの状態をパラメータなどと
して保存する場合)の命令コード長を短縮し、実行時間
の短縮を実現することができる。上記において、汎用レ
ジスタではなく、所望のアドレス空間上に格納する命令
(BLDMOV命令)を持つことにより、更に、命令コ
ード長、実行時間の短縮を図ることができる。任意ビッ
ト間のビット転送命令(BMOV命令)を持つことによ
り、命令コード長、実行時間の短縮と、RAMなどのメ
モリの使用効率を向上することができる。
That is, the data in the address space is read, the state of the desired bit is detected and stored in a predetermined bit (for example, bit 0) of the general-purpose register. The instruction (BLDS instruction) for setting the state (e.g., 0) of the
For example, when a program is created in a high-level language such as a language, the instruction code length of bit manipulation (particularly, when the bit state is stored as a parameter or the like) can be reduced, and the execution time can be reduced. In the above, by having an instruction (BLDMOV instruction) for storing in a desired address space instead of the general-purpose register, the instruction code length and the execution time can be further reduced. By having a bit transfer instruction (BMOV instruction) between arbitrary bits, the instruction code length and the execution time can be reduced, and the use efficiency of a memory such as a RAM can be improved.

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

【図1】本発明に係るデータ処理装置の一例であるCP
Uの命令セットに含まれるビット転送命令(BLDS、
BSTS、BLDMOV、BMOV)の全体的な説明図
である。
FIG. 1 shows a CP as an example of a data processing device according to the present invention.
The bit transfer instruction (BLDS,
FIG. 3 is an overall explanatory diagram of BSTS, BLDMOV, BMOV).

【図2】本発明に係るデータ処理装置の一例であるCP
Uに内蔵されている汎用レジスタ及び制御レジスタの構
成例を示す説明図である。
FIG. 2 is an example of a data processing device according to the present invention;
FIG. 3 is an explanatory diagram showing a configuration example of a general-purpose register and a control register incorporated in U.

【図3】ビット0固定転送命令であるビット転送命令
(BLDS、BSTS、BLDMOV)及び任意ビット
間のビット転送命令(BMOV)の命令フォーマット図
である。
FIG. 3 is an instruction format diagram of a bit transfer instruction (BLDS, BSTS, BLDMOV) as a bit 0 fixed transfer instruction and a bit transfer instruction (BMOV) between arbitrary bits.

【図4】本発明に係るデータ処理装置の一例であるCP
Uの一例を示すブロック図である。
FIG. 4 shows a CP as an example of a data processing device according to the present invention.
It is a block diagram showing an example of U.

【図5】算術論理演算器のビット転送命令に関係する部
分を例示するブロック図である。
FIG. 5 is a block diagram illustrating a portion related to a bit transfer instruction of the arithmetic and logic unit;

【図6】テンポラリデータレジスタの一例を示すブロッ
ク図である。
FIG. 6 is a block diagram illustrating an example of a temporary data register.

【図7】ビット転送命令の第1の例(BLD #7,@
FFFFFE)の実行タイミングを例示するタイミング
チャートである。
FIG. 7 shows a first example of a bit transfer instruction (BLD # 7, {
5 is a timing chart illustrating the execution timing of (FFFFFE).

【図8】ビット転送命令の第2の例(BLDMOV #
6,@FFFFFD,@FFFF00)の実行タイミン
グを例示するタイミングチャートである。
FIG. 8 shows a second example of a bit transfer instruction (BLDMOV #
6 is a timing chart illustrating the execution timing of (#FFFFFD, # FFFF00).

【図9】ビット転送命令の第3の例(BST #5,@
FFFF10)の実行タイミングを例示するタイミング
チャートである。
FIG. 9 shows a third example of a bit transfer instruction (BST # 5, {
6 is a timing chart illustrating the execution timing of FFFF10).

【図10】ビット転送命令の第4の例(BMOV #
6,@FFFFFC,#5,@FFFF21)の実行タ
イミングを例示するタイミングチャートである。
FIG. 10 shows a fourth example of a bit transfer instruction (BMOV #
6 is a timing chart illustrating the execution timing of (#FFFFFC, # 5, # FFFF21).

【図11】ビット転送命令の第5の例(BMOV #
4,@FFFFFB,#3,R2L)の実行タイミング
を例示するタイミングチャートである。
FIG. 11 shows a fifth example of a bit transfer instruction (BMOV #
4, {FFFFFB, # 3, R2L) is a timing chart illustrating the execution timing.

【図12】ビット転送命令の第6の例(BMOV #
2,R3H,#1,@FFFF32)の実行タイミング
を例示するタイミングチャートである。
FIG. 12 shows a sixth example of the bit transfer instruction (BMOV #
2, R3H, # 1, $ FFFF32).

【図13】ビット転送命令の第7の例(BMOV #
7,R4H,#6,R5L)の実行タイミングを例示す
るタイミングチャートである。
FIG. 13 shows a seventh example of the bit transfer instruction (BMOV #
7, R4H, # 6, R5L).

【図14】本発明に係るデータ処理装置の一例であるマ
イクロコンピュータを示すブロック図である。
FIG. 14 is a block diagram showing a microcomputer as an example of a data processing device according to the present invention.

【図15】本発明に係るデータ処理装置の一例であるC
PUの開発環境の概略を示す説明図である。
FIG. 15 is an example of a data processing device according to the present invention;
FIG. 2 is an explanatory diagram illustrating an outline of a PU development environment.

【図16】本発明に係るデータ処理装置の一例であるC
PUのシステム開発装置におけるビットアキュムレータ
の指定方法を例示する説明図である。
FIG. 16 is an example of a data processing device according to the present invention;
FIG. 4 is an explanatory diagram illustrating a method of specifying a bit accumulator in a PU system development device.

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

1 CPU 2 命令制御部 3 実行部 DEC 命令デコーダ ER0〜ER7 汎用レジスタ MA アドレスバッファ ALU 算術論理演算器 10 デコーダ 11 セレクタ 12 入力セレクタ 13 入力セレクタ 14 論理演算回路 15 ゼロ検出回路 16 出力セレクタ TRD テンポラリデータレジスタ 20 デコーダ 21 入力セレクタ 22 レジスタ部 23 出力セレクタ CCR コンディションコードレジスタ PC プログラムカウンタ 30 マイクロコンピュータ DESCRIPTION OF SYMBOLS 1 CPU 2 Instruction control part 3 Execution part DEC Instruction decoder ER0-ER7 General-purpose register MA Address buffer ALU Arithmetic and logical operation unit 10 Decoder 11 Selector 12 Input selector 13 Input selector 14 Logical operation circuit 15 Zero detection circuit 16 Output selector TRD Temporary data register Reference Signs List 20 decoder 21 input selector 22 register section 23 output selector CCR condition code register PC program counter 30 microcomputer

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 読み込んだ命令コードを命令制御手段で
解読し、その命令を命令実行手段で実行するデータ処理
装置であって、 前記命令実行手段は、命令実行に利用されるレジスタ手
段及び演算手段を有し、 前記命令制御手段は第1の所定の命令を解読すると、命
令実行手段に、アドレス空間上のデータを読み込ませ、
前記データの所望のビットの状態を検出させ、前記レジ
スタ手段を所定の状態に制御するものであり、 前記レジスタ手段の所定の状態は、前記レジスタ手段の
所定のビットに前記データの所望のビットの状態が反映
されるともに、前記レジスタ手段のその他のビットが一
定の値にされる状態であることを特徴とするデータ処理
装置。
1. A data processing device which decodes a read instruction code by an instruction control means and executes the instruction by an instruction execution means, wherein the instruction execution means is a register means and an arithmetic means used for executing an instruction. The instruction control means, when decoding the first predetermined instruction, causes the instruction execution means to read data in the address space,
The state of a desired bit of the data is detected, and the register means is controlled to a predetermined state. The predetermined state of the register means is such that a predetermined bit of the data is stored in a predetermined bit of the register means. The data processing device is characterized in that the state is reflected and the other bits of the register means are set to constant values.
【請求項2】 前記命令制御手段は第2の所定の命令を
解読すると、命令実行手段に、アドレス空間上のデータ
を読み込ませ、前記データの所望のビットの状態を検出
させ、アドレス空間上の別のデータを所定の状態に制御
するものであり、 前記アドレス空間上の別のデータの所定の状態は、当該
別のデータの所定のビットに前記データの所望のビット
の状態が反映されるともに、当該別のデータのその他の
ビットが一定の値にされる状態であることを特徴とする
請求項1記載のデータ処理装置。
2. When the instruction control means decodes a second predetermined instruction, the instruction control means causes the instruction execution means to read data on an address space, detect a state of a desired bit of the data, and Controlling another data to a predetermined state, the predetermined state of the other data in the address space reflects a state of a desired bit of the data in a predetermined bit of the another data. 2. The data processing apparatus according to claim 1, wherein the other bits of the other data are set to a constant value.
【請求項3】 前記レジスタ手段として、フラグを格納
する状態レジスタ手段と汎用レジスタ手段とを含み、 前記データの所望のビットの状態を反映させる前記レジ
スタ手段として前記状態レジスタ手段又は汎用レジスタ
手段との何れを対象とするかを指示する手段を有して成
るものであることを特徴とする請求項1又は2記載のデ
ータ処理装置。
3. The register means includes a status register means for storing a flag and a general-purpose register means, and the register means for reflecting a state of a desired bit of the data includes the status register means or the general-purpose register means. 3. The data processing apparatus according to claim 1, further comprising means for instructing which one is to be targeted.
【請求項4】 前記命令制御手段は第3の所定の命令を
解読すると、命令実行手段に、レジスタ手段又はアドレ
ス空間上のデータを読み込ませ、前記データの所望のビ
ットの状態を検出させ、検出した状態を、別のレジスタ
手段又はアドレス空間上の別のデータの所望のビットの
状態に反映させる制御を行なうものであることを特徴と
する請求項1乃至3の何れか1項記載のデータ処理装
置。
4. When the instruction control means decodes a third predetermined instruction, the instruction control means causes the instruction execution means to read data in a register means or an address space, and detects a state of a desired bit of the data. 4. The data processing as claimed in claim 1, wherein the control is performed to reflect the state of the bit to a desired bit state of another data in another register means or address space. apparatus.
【請求項5】 前記命令実行部はテンポラリデータラッ
チ手段を有し、このテンポラリデータラッチ手段は、所
望のビットの状態を出力する機能、所望のビットのみの
入力を行なう機能の少なくとも一方を有し、前記テンポ
ラリデータラッチ手段の出力が前記演算手段の入力に接
続可能にされて成るものであることを特徴とする請求項
4記載のデータ処理装置。
5. The instruction execution unit has a temporary data latch unit, and the temporary data latch unit has at least one of a function of outputting a state of a desired bit and a function of inputting only a desired bit. 5. The data processing apparatus according to claim 4, wherein an output of said temporary data latch means is connectable to an input of said arithmetic means.
JP2000161137A 2000-05-26 2000-05-26 Data processing device Withdrawn JP2001337821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000161137A JP2001337821A (en) 2000-05-26 2000-05-26 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000161137A JP2001337821A (en) 2000-05-26 2000-05-26 Data processing device

Publications (1)

Publication Number Publication Date
JP2001337821A true JP2001337821A (en) 2001-12-07

Family

ID=18665210

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000161137A Withdrawn JP2001337821A (en) 2000-05-26 2000-05-26 Data processing device

Country Status (1)

Country Link
JP (1) JP2001337821A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100346291C (en) * 2005-12-02 2007-10-31 浙江大学 Method and device for coutrolling block transfer instruction for multi address space

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100346291C (en) * 2005-12-02 2007-10-31 浙江大学 Method and device for coutrolling block transfer instruction for multi address space

Similar Documents

Publication Publication Date Title
TWI476597B (en) Data processing apparatus and semiconductor integrated circuit device
JP2003085000A (en) Trace information production device and its method
JP4004915B2 (en) Data processing device
JP2001202243A (en) Data processor
JP2006313561A (en) Data processor
JP4073721B2 (en) Data processing device
JP3786575B2 (en) Data processing device
JP3727395B2 (en) Microcomputer
JP2001337821A (en) Data processing device
JP3841820B2 (en) Microcomputer
JP3839835B2 (en) Data processing apparatus and microcomputer
JP3760093B2 (en) Microcomputer
JP2504235B2 (en) Data processing device
JP4545777B2 (en) Data processing device
JP3740321B2 (en) Data processing device
JP4284559B2 (en) Microprocessor, microcomputer, electronic equipment
JP4498338B2 (en) Data processing device
JP4029016B2 (en) Data processing device
JP2861560B2 (en) Data processing device
JP2002132499A (en) Data processing apparatus and recording medium
JP3097602B2 (en) Data processing device
JP3765782B2 (en) Microcomputer
JP4382076B2 (en) Data processing device
JP2001297002A (en) Data processor
JP3733137B2 (en) Microcomputer

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070807