JP2006313561A - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
JP2006313561A
JP2006313561A JP2006189410A JP2006189410A JP2006313561A JP 2006313561 A JP2006313561 A JP 2006313561A JP 2006189410 A JP2006189410 A JP 2006189410A JP 2006189410 A JP2006189410 A JP 2006189410A JP 2006313561 A JP2006313561 A JP 2006313561A
Authority
JP
Japan
Prior art keywords
instruction
register
data
cpu
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006189410A
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2006189410A priority Critical patent/JP2006313561A/en
Publication of JP2006313561A publication Critical patent/JP2006313561A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To achieve branching and subroutine branching by minimizing an increase in logical/physical scales, maintaining compatibility with existing CPUs, and determining the state of the bits of data at an arbitrary address in a memory. <P>SOLUTION: For commands for branching according to the state of the bits of data in a memory, an operation field for prescribing an operation is divided into a plurality of portions for achieving by separate words on the basic unit of a command code, and the word is shared with the code of another command that can be used independently or one portion of the code of another command. The first word of the command code transfers data between a latching means (TRD) that has not been released in terms of a program and a memory. The second word determines the state of the desired bits of the latching means for branching. The latching means has a means (38) for determining the state of the specified bit, thus determining the state of a prescribed bit without reading out to an ALU, or the like. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、マイクロコンピュータ、マイクロプロセッサ、データプロセッサ、CPU(セントラル・プロセッシング・ユニット)等のデータ処理装置に係り、詳しくは、レジスタアーキテクチャ、上位互換性、演算性能の拡張等に関し、例えば、シングルチップマイクロコンピュータにおけるソフトウェア資産の有効活用と演算性能の拡張、使い勝手の向上等に適用して有効な技術に関するものである。   The present invention relates to a data processing apparatus such as a microcomputer, a microprocessor, a data processor, and a CPU (Central Processing Unit), and more particularly to a register architecture, upward compatibility, expansion of arithmetic performance, etc. The present invention relates to a technology that is effective when applied to effective utilization of software assets in microcomputers, expansion of computing performance, improvement of usability, and the like.

半導体集積回路化されたマイクロコンピュータは、アドレス空間の拡張や、命令セットの拡大、高速化などが図られてきた。マイクロコンピュータのCPU(中央処理装置)は、ソフトウェアによって、その機能が定義されているから、アドレス空間の拡張や、命令セット拡大、高速化などを図ったマイクロコンピュータにおいても、既存のマイクロコンピュータのソフトウェア資産を有効に利用できることが望ましい。   A microcomputer integrated with a semiconductor integrated circuit has been attempted to expand an address space, expand an instruction set, and increase speed. Since the functions of the CPU (central processing unit) of the microcomputer are defined by software, the software of the existing microcomputer can be used in microcomputers that have expanded the address space, expanded the instruction set, and increased the speed. It is desirable that assets can be used effectively.

このため、オブジェクトレベルで互換性を保ちつつ、アドレス空間の拡張や、命令セット拡大を実現した例として、例えば、特開平6−51981号公報に記載のマイクロコンピュータ等がある。この中で、いわゆるRISC(Reduced Instruction Set Computer)アーキテクチャのようなロードストア型アーキテクチャを採用することが、命令セットの拡張を図る上で有効であることが示されている。   For this reason, as an example of realizing address space expansion and instruction set expansion while maintaining compatibility at the object level, for example, there is a microcomputer described in JP-A-6-51981. Among these, it has been shown that adopting a load store type architecture such as a so-called RISC (Reduced Instruction Set Computer) architecture is effective in extending the instruction set.

ロードストア型アーキテクチャでは、演算処理は、CPUの汎用レジスタを用いて行なう。すなわち、メモリ上のデータを直接的に用いて演算は行なわず、一旦メモリ上のデータを汎用レジスタに転送し、転送されたデータに演算を行なった後、汎用レジスタ上の演算結果をメモリ上に書き戻す。したがって、その処理で使用していない汎用レジスタがあれば、当該汎用レジスタにメモリ上のデータを転送すればよい。しかしながら、汎用レジスタの数には限りがあり、マイクロコンピュータ内部の処理状況によっては、全ての汎用レジスタを使用している場合もある。全ての汎用レジスタを使用している場合、換言すれば、全ての汎用レジスタの内容が保持されなければならないとき、前記メモリ上のデータに対する演算を行なう前に、汎用レジスタの内容をスタック領域などに退避してから、所要の処理を行ない、この処理を終了した後は、中断した処理を再開する為に、前記退避した汎用レジスタの内容を復帰しなければならない。   In the load store type architecture, arithmetic processing is performed using a general-purpose register of the CPU. In other words, the data on the memory is not directly used for the operation, but the data on the memory is once transferred to the general-purpose register, the operation is performed on the transferred data, and the operation result on the general-purpose register is stored on the memory. Write back. Therefore, if there is a general-purpose register that is not used in the processing, the data on the memory may be transferred to the general-purpose register. However, the number of general-purpose registers is limited, and all general-purpose registers may be used depending on the processing status inside the microcomputer. When all the general purpose registers are used, in other words, when the contents of all the general purpose registers must be retained, the contents of the general purpose registers are stored in the stack area before performing the operation on the data on the memory. After saving, the necessary processing is performed, and after this processing is completed, the contents of the saved general-purpose register must be restored in order to resume the interrupted processing.

特開平6−51981号公報JP-A-6-51981

《検討課題A》
本発明者は、検討課題Aとして互換性を維持して、ソフトウェア資産を有効に利用できるようにしつつ、CPUの汎用レジスタを増加することを検討した。尚、この検討課題Aに関する事項は、本願における国内優先権主張の第1の基礎出願である特願平11−123450号の明細書に既に開示した内容であるが、未だ公知ではない。この検討課題Aについて述べる。
<< Exercise A >>
The present inventor considered increasing the number of general-purpose registers of the CPU while maintaining compatibility and enabling effective use of software assets as the examination subject A. The matter relating to the examination subject A is already disclosed in the specification of Japanese Patent Application No. 11-123450, which is the first basic application claiming domestic priority in the present application, but is not yet known. This examination subject A will be described.

前記ロードストアアーキテクチャを採用したCPUにおいては、データ処理はCPUの汎用レジスタが中心になるから、汎用レジスタが多いことは都合がよい。これによって、プログラムの容易性や高速化を図ることができる。   In a CPU adopting the load store architecture, since data processing is centered on general-purpose registers of the CPU, it is convenient that there are many general-purpose registers. As a result, the program can be facilitated and speeded up.

しかしながら、何れの汎用レジスタに対して処理を実行するかは、一般に、命令コードで指定するから、汎用レジスタ数に対応したレジスタ指定フィールドを命令コード中に保持することが必要である。例えば、汎用レジスタ16本に対しては、レジスタ指定フィールド4ビットを必要とする。汎用レジスタを増加しようとすれば、レジスタ指定フィールドが増加する。汎用レジスタを4倍の64本とすれば、レジスタ指定フィールド6ビットが必要になる。処理対象は一般に2つ(ソースとデスティネーション)のデータになるから、レジスタ指定フィールドは2倍のビット数が必要になる。   However, which general register is to be processed is generally designated by an instruction code, so it is necessary to hold a register designation field corresponding to the number of general purpose registers in the instruction code. For example, for 16 general purpose registers, 4 bits are required for the register designation field. If an attempt is made to increase the general-purpose registers, the register designation field increases. If the number of general-purpose registers is four times 64, 6 bits for the register designation field are required. Since the processing target is generally two pieces of data (source and destination), the register designation field requires twice as many bits.

命令の基本単位を例えば16ビット(以下ワードと呼ぶ)とすれば、レジスタ指定フィールドで占有されるビット数のわりあいが多くなり、結局、命令コード長を増加させなければならなくなる。命令コードを長くすれば、処理速度を低下させることにつながってしまう。CPUは命令をリードして実行するが、リードすべき命令のワード数(ビット数)が大きくなれば、命令自体のリード回数も増加するからである。また、レジスタ指定フィールドを拡大することは、既存のCPUの既存の命令と相容れず、既存のCPUとの互換性を保つことを困難にしてしまう。   If the basic unit of an instruction is, for example, 16 bits (hereinafter referred to as a word), the number of bits occupied in the register designation field increases, and eventually the instruction code length must be increased. If the instruction code is lengthened, the processing speed is reduced. This is because the CPU reads and executes instructions, but the number of instructions read increases as the number of words (number of bits) of the instruction to be read increases. Also, enlarging the register designation field is incompatible with the existing instructions of the existing CPU and makes it difficult to maintain compatibility with the existing CPU.

汎用レジスタを見掛上増やす技術として、汎用レジスタをバンクと呼ばれるグループに分け、いずれかのバンクを排他的に選択するようにする、レジスタバンク方式がある。いずれのバンクを選択するかは、制御レジスタや制御命令などによって指定する。このため、命令コードには、バンク内の汎用レジスタに対応するレジスタ指定フィールドのみを持ち、命令コード長の増加を抑止できる。しかし、前記レジスタバンクを切り替えるための命令が必要になり、また、プログラム作成に当っては、どのバンクを選択しているかを意識しなければならず、プログラムの容易性を損いやすい。同時に使用できる汎用レジスタ数は増えていないので、データ量の多いタスクや少ないタスクなどがある場合に、相互に汎用レジスタの割当てを融通し合うなどのことがし難い。   As a technique for apparently increasing the general-purpose registers, there is a register bank system in which the general-purpose registers are divided into groups called banks and any one of the banks is exclusively selected. Which bank is selected is specified by a control register or a control instruction. Therefore, the instruction code has only a register designation field corresponding to the general-purpose register in the bank, and an increase in the instruction code length can be suppressed. However, an instruction for switching the register bank is required, and when creating a program, it is necessary to be aware of which bank is selected, and the ease of programming tends to be impaired. Since the number of general-purpose registers that can be used at the same time has not increased, it is difficult to interchange general-purpose register assignments when there are tasks with a large amount of data or tasks with a small amount of data.

検討課題Aに関する本発明の目的は、上位互換性を維持しつつ、汎用レジスタの数を増加させることができるデータ処理装置を提供することにある。   An object of the present invention related to the examination subject A is to provide a data processing apparatus capable of increasing the number of general-purpose registers while maintaining upward compatibility.

検討課題Aに関する本発明の別の目的は、全体的な命令コードを増加させることなく、汎用レジスタ数を増加させることができるデータ処理装置を提供することにある。   Another object of the present invention relating to the examination subject A is to provide a data processing apparatus capable of increasing the number of general-purpose registers without increasing the overall instruction code.

検討課題Aに関する本発明のその他の目的は、ソフトウェア資産に対して上位互換性を維持しつつ、汎用レジスタ数の増加によるプログラム作成の容易化とCPUの処理性能の向上とを実現できるデータ処理装置を提供することにある。   Another object of the present invention relating to the examination subject A is a data processing device capable of realizing easy program creation and improved CPU processing performance by increasing the number of general-purpose registers while maintaining upward compatibility with software assets. Is to provide.

《検討課題B》
本発明者は、検討課題Bとして、ロードストア型等のアーキテクチャに対する互換性を維持してそのソフトウェア資産を有効に利用(ソフトウェア資産に対する上位互換を達成)できるようにし、また、ロードストアアーキテクチャ若しくはRISCアーキテクチャが動作速度の改善に有利であるというような、既存のCPUの利点を保ちながら、メモリ上のデータを直接的に演算可能とすることについて検討した。尚、この検討課題Bに関する事項は、本願における国内優先権主張の第2の基礎出願である特願平11−151890号の明細書に既に開示したが、その内容は未だ公知ではない。この検討課題Bについて述べる。
<< Exercise B >>
The present inventor makes it possible to maintain compatibility with a load store type architecture and the like so as to effectively use the software asset (achieve upward compatibility with the software asset) as a study subject B. We examined how data on the memory can be directly calculated while maintaining the advantages of the existing CPU such that the architecture is advantageous for improving the operation speed. The matters concerning the examination subject B have already been disclosed in the specification of Japanese Patent Application No. 11-151890, which is the second basic application claiming domestic priority in the present application, but the contents are not yet known. This examination subject B will be described.

メモリ上のデータを直接的に演算可能とすることによって得られると考えられる利点は以下の通りである。   The advantages considered to be obtained by making the data on the memory directly operable are as follows.

汎用レジスタにデータをロードして演算を行なうだけでなく、汎用レジスタへのデータロードを経ることなくメモリ上のデータに対して演算が可能であれば、CPU若しくはマイクロコンピュータが使用可能な全てのデータ、換言すれば、マイクロコンピュータのユーザがプログラム上で指定可能な全てのデータに対して、演算が可能になるから、マイクロコンピュータの使い勝手、即ち機能が向上することになる。   All data that can be used by the CPU or microcomputer as long as it can operate on the data in the memory without loading the data into the general-purpose register and performing the operation. In other words, since all the data that can be specified on the program by the microcomputer user can be operated, the usability, that is, the function of the microcomputer is improved.

この場合、CPUが実行する命令は、データの所在と、その処理内容を指定する。データの所在を指定する仕方をアドッレシングモードと呼ぶ。特定のアドッレシングモードでのみメモリ上のデータの演算を可能にするのでは、プログラミング上の制約が発生し、使い易さを十分に向上し得ない。既存のCPUでデータをアクセスするアドレッシングモードの任意の組合せによってメモリ上のデータを演算できることが望ましいと考えられる。   In this case, the instruction executed by the CPU specifies the location of data and the processing content. A method for designating the location of data is called an addressing mode. If calculation of data on the memory is enabled only in a specific addressing mode, programming restrictions occur and the ease of use cannot be sufficiently improved. It would be desirable to be able to compute data on the memory by any combination of addressing modes that access data with an existing CPU.

また、メモリ上のデータを直接演算可能とすることができたとしても、使用頻度の高いデータは汎用レジスタ上に配置して処理することが望ましい。汎用レジスタは、物理的にCPUの一部として構成されるから、メモリに比べて高速にアクセスでき、メモリ上のデータに比べて高速に処理できる。使用頻度の低いデータはメモリ上に配置したまま、処理すればよい。CPUの処理に直接関係のない汎用レジスタの退避/復帰を行なわなくてよい。それらによって、CPUの処理速度を全体として向上させることができると考えられる。   Even if the data on the memory can be directly calculated, it is desirable to process the frequently used data on a general-purpose register. Since the general-purpose register is physically configured as part of the CPU, it can be accessed at a higher speed than the memory and can be processed at a higher speed than the data on the memory. Data that is used infrequently may be processed while being placed on the memory. There is no need to save / restore general-purpose registers that are not directly related to CPU processing. As a result, the processing speed of the CPU can be improved as a whole.

通常、CPUやマイクロコンピュータによって処理されるデータの量は、CPUの汎用レジスタの数よりも多い。また、タスクの数は複数存在し、これを時分割で実行することになるから、タスクを切り替えたとき、メモリ上のデータを直接的に演算できれば、退避/復帰したりすることなく、メモリに対して即座に処理を実行することが可能になる。退避・復帰の処理を伴いながらも汎用レジスタを用いて演算を高速に行なう処理手法と織り交ぜながら、都合のよい手法を選択することができる。同様に、割込み処理の時も、汎用レジスタを退避したりすることなく、即座にメモリに対して処理を実行することが可能になり、割込みに応答して所望の処理を行なうまでの応答時間を短縮することも可能になる。割込みの応答時間を短縮することによって、種々の機器を制御する場合の時間的な精度、いわゆるリアルタイム性を向上することが可能になる。   Usually, the amount of data processed by the CPU or microcomputer is larger than the number of general-purpose registers of the CPU. In addition, since there are multiple tasks and these are executed in a time-sharing manner, if the data on the memory can be directly calculated when the task is switched, the data can be saved in the memory without being saved or restored. On the other hand, it becomes possible to execute processing immediately. A convenient method can be selected while intermingling with a processing method of performing a high-speed operation using a general-purpose register while accompanying a save / restore process. Similarly, during interrupt processing, it is possible to immediately execute processing on the memory without saving the general-purpose registers, and the response time until the desired processing is performed in response to the interrupt can be increased. It can also be shortened. By shortening the response time of interruption, it is possible to improve the time accuracy when controlling various devices, so-called real-time property.

同一の処理ルーチンをループする(繰り返す)ようなプログラムを作成した場合、ループ内の演算処理に必要な汎用レジスタを確保し、また、全体的なプログラム容量を縮小したり、処理時間を短縮したりするために、ループ外で使用するデータを割り当てるレジスタを確保したりすることによって、汎用レジスタに余裕がない場合も、随時、メモリに対して演算処理を行なうことが可能になる。これによって、プログラムの作成が容易になる。また、ループ内の処理を短縮することによって、全体的には、繰り返し回数に比例して処理時間を短縮することが可能になると、予想される。   If a program that loops (repeats) the same processing routine is created, general-purpose registers necessary for arithmetic processing in the loop are secured, the overall program capacity is reduced, and the processing time is shortened. Therefore, by securing a register for allocating data to be used outside the loop, it becomes possible to perform arithmetic processing on the memory at any time even when the general-purpose register has no room. This facilitates program creation. Further, it is expected that the processing time can be shortened in proportion to the number of repetitions by shortening the processing in the loop.

また、Cコンパイラなどの開発装置の開発には、かかる種々の条件を考慮する必要があり、メモリに対する演算を可能とすることによって、所望のCコンパイラの性能を達成するために必要な開発期間や資源を節約することも可能になると考えられる。   In developing a development apparatus such as a C compiler, it is necessary to consider such various conditions, and by enabling operations on a memory, a development period and time required to achieve a desired performance of the C compiler It is possible to save resources.

また、上記のような、機器の高速化や高機能化、小型化は、アドレス空間が比較的小さく命令セットが比較的小さいCPU若しくはマイクロコンピュータにおいても要求されるから、前記特開平6−51981号公報などに記載されるアドレス空間の広いCPUとアドレス空間の狭いCPUが存在する場合には、その双方に対してメモリ上のデータに対する演算を追加することが望ましい。   Further, the above-mentioned speeding up, high functionality, and miniaturization of devices are also required in a CPU or microcomputer having a relatively small address space and a relatively small instruction set. When there is a CPU with a wide address space and a CPU with a narrow address space described in the publication, it is desirable to add an operation for data in the memory to both of them.

しかしながら、前記ソフトウェア資産に対する上位互換の達成と、メモリのデータを直接的に演算可能とするに当たって、以下の問題点のあることが本発明者によって明らかにされた。   However, the present inventor has revealed that there are the following problems in achieving upward compatibility with the software assets and enabling direct calculation of memory data.

既存の命令セットは、その仕様内で最適化されているから、メモリ上のデータを直接的に演算可能にする種々の演算等の処理に新規の命令コードを割り当てる余地は少ない。すなわち、加算や論理積などの所望の演算について、データをアクセスするアドレッシングモードの任意の組合せでメモリ上のデータを演算できるようにするというような、新規の命令コードを、割り付けることは現実には考え難い。   Since the existing instruction set is optimized within the specifications, there is little room for assigning a new instruction code to processing such as various operations that can directly calculate data on the memory. In other words, for a desired operation such as addition or logical product, it is actually not possible to assign a new instruction code such that the data on the memory can be operated in any combination of addressing modes for accessing the data. Hard to think.

また、新規命令コードや新規アドレシングモードの追加によって命令コードの体系を変更することは、既存のCPUにおける既存の命令と相容れず、既存のCPUとの互換性を保つことが困難になってしまう。また、既存のCPUのメリットを損なってしまう。   Also, changing the instruction code system by adding a new instruction code or a new addressing mode is incompatible with existing instructions in the existing CPU, and it becomes difficult to maintain compatibility with the existing CPU. . Moreover, the merit of the existing CPU is lost.

また、マイクロコンピュータを使用したシステムを開発する場合には、エミュレータと呼ばれる開発装置が用いられる。エミュレータには、マイクロコンピュータの機能を包含するエミュレーション用プロセッサが搭載されており、エミュレーション用プロセッサは、マイクロコンピュータの動作状態をエミュレータによって解析可能にするためのエミュレーション用信号を出力する。エミュレータ及びエミュレーション用プロセッサについては、特開平8−263290号公報に記載されている。前述のメモリ上のデータを直接演算可能とするためにマイクロコンピュータの構成を変更するとき、前記エミュレーション用信号も変更になれば、エミュレータのハードウェア自体を変更しなければならず、エミュレータ自体も新たに開発しなければならなくなって、マイクロコンピュータの開発装置若しくは開発環境の提供も遅くなるという問題点が明らかにされた。   Further, when developing a system using a microcomputer, a development device called an emulator is used. The emulator includes an emulation processor including a microcomputer function, and the emulation processor outputs an emulation signal for enabling the emulator to analyze the operation state of the microcomputer. An emulator and an emulation processor are described in JP-A-8-263290. When changing the configuration of the microcomputer so that the data in the memory can be directly operated, if the emulation signal is also changed, the hardware of the emulator itself must be changed, and the emulator itself is also new. However, it has become clear that there is a problem that the provision of a microcomputer development device or development environment becomes slow.

検討課題Bに関する本発明の目的は、論理的・物理的規模の増大を最小限とし、ロード・ストア型の命令セットを持つ既存のCPU若しくはマイクロコンピュータ等と互換性を維持しつつ、見掛け上、メモリ上のデータに対する直接的な演算を可能とするデータ処理装置を提供することにある。   The purpose of the present invention related to the examination subject B is to minimize the increase in logical and physical scale, and maintain compatibility with an existing CPU or microcomputer having a load / store type instruction set. It is an object of the present invention to provide a data processing device that enables direct computation on data on a memory.

検討課題Bに関する本発明の別の目的は、見掛け上、メモリ上のデータに対する演算を可能とすることによって、プログラミングを容易にすると共に、不所望の汎用レジスタの退避/復帰を抑止して、CPUの処理性能を向上させることによる。   Another object of the present invention related to the examination subject B is to make it possible to perform operations on data on the memory, thereby facilitating programming and suppressing undesired general-purpose registers from being saved / returned. By improving the processing performance.

《検討課題C》
本発明者は、前記検討課題Aとして検討した前記ソフトウェア資産に対する上位互換と、前記検討課題Bとして検討したメモリのデータを直接的に演算可能とすることを実現するに当たり、更に検討課題Cとして以下を明らかにした。尚、この検討課題Cに関する事項は、本願における国内優先権主張の第3の基礎出願である特願平11−191608号の明細書に既に開示したが、その内容は未だ公知ではない。この検討課題Cについて述べる。
<< Exercise C >>
In order to realize the upward compatibility with the software asset examined as the examination subject A and the ability to directly calculate the data of the memory examined as the examination subject B, the present inventor further describes the following examination subject C as Was revealed. The matters relating to the examination subject C have already been disclosed in the specification of Japanese Patent Application No. 11-191608, which is the third basic application claiming domestic priority in the present application, but the contents are not yet known. This examination subject C will be described.

既存の命令セットは、その仕様内で最適化されているから、メモリ上のデータを直接的に演算可能にする種々の演算等の処理に新規の命令コードを割り当てる余地は少ない。すなわち、加算や論理積などの所望の演算について、データをアクセスするアドレッシングモードの任意の組合せでメモリ上のデータを演算できるようにするというような、新規の命令コードを、割り付けることは現実には考え難い。   Since the existing instruction set is optimized within the specifications, there is little room for assigning a new instruction code to processing such as various operations that can directly calculate data on the memory. In other words, for a desired operation such as addition or logical product, it is actually not possible to assign a new instruction code such that the data on the memory can be operated in any combination of addressing modes for accessing the data. Hard to think.

また、新規命令コードや新規アドレシングモードの追加によって命令コードの体系を変更することは、既存のCPUにおける既存の命令と相容れず、既存のCPUとの互換性を保つことが困難になってしまう。また、既存のCPUのメリットを損なってしまう。   Also, changing the instruction code system by adding a new instruction code or a new addressing mode is incompatible with existing instructions in the existing CPU, and it becomes difficult to maintain compatibility with the existing CPU. . Moreover, the merit of the existing CPU is lost.

そこで本発明者は、既存の、メモリ・レジスタ間の転送命令の単数または複数、レジスタ・レジスタ間の演算命令、の内、複数の命令コードを組合せ、これを結合させる前置命令コードを用いて、メモリ上の演算を可能にすることの有用性を先に見出した。これによれば、メモリ・レジスタ間の転送命令、レジスタ・レジスタ間の演算命令などの命令コードは既存のものであるから、単独では従来同様に動作し、既存の命令実行を阻害することがない。また、既存の命令のみを使用していれば、既存のソフトウェア資産を有効に利用できる。汎用レジスタ方式やロードストアアーキテクチャなどの既存のCPUが持つメリットを損なうことなく、前記演算性能を拡張することができる。   Therefore, the present inventor uses a pre-instruction code that combines and combines a plurality of instruction codes among existing one or more transfer instructions between memory and registers and arithmetic instructions between registers and registers. First, we found the usefulness of enabling operations on memory. According to this, since the instruction codes such as the transfer instruction between the memory and the register and the operation instruction between the register and the register are already existing, the operation code alone does not hinder the execution of the existing instruction. . Also, if only existing instructions are used, existing software assets can be used effectively. The arithmetic performance can be expanded without losing the merits of existing CPUs such as general-purpose register system and load / store architecture.

更に本発明者は、応用分野の広いマイクロコンピュータに対する多種多様の要求についても検討した。例えば、アドレス空間の広い応用分野とアドレス空間の小さい応用分野、高級言語によるプログラミングを主に用いる応用分野とアセンブリ言語によるプログラミングを主に用いる応用分野、データ処理が重要な応用分野とビット操作などの制御が必要な応用分野、或いは、処理性能が必要な応用分野と処理性能より費用低減が必要な応用分野などがあり、これらに対して、一貫したアーキテクチャによるCPU(中央処理装置)を提供し、アセンブラ、Cコンパイラなどのソフトウェア開発装置(クロスソフトウェア)などの開発装置を共通に利用したりできるようにすることが望ましい。   Furthermore, the present inventor also examined various requirements for microcomputers having a wide application field. For example, an application field with a wide address space and an application field with a small address space, an application field mainly using programming in a high-level language, an application field mainly using programming in assembly language, an application field in which data processing is important, bit manipulation, etc. There are application fields that require control, application fields that require processing performance, and application fields that require lower cost than processing performance. For these, we provide a CPU (Central Processing Unit) with a consistent architecture, It is desirable to be able to commonly use development devices such as software development devices (cross software) such as assemblers and C compilers.

そこで、本発明者は、下位互換性をもつCPUについて検討した。前記の通り、本発明者による先の提案によれば、既存の、アドレス空間の小さいCPUに対しても、互換性を維持しながら汎用レジスタを追加したり、メモリに対する演算を追加することができる。機能を追加していく場合には、例えば、費用低減の追求などといった、前記のマイクロコンピュータに対する多種多様な要求に十分には応えられるようにする考慮の必要性が本発明者によって見出された。   Therefore, the present inventor studied a CPU having backward compatibility. As described above, according to the previous proposal by the present inventor, it is possible to add a general-purpose register or an operation for a memory while maintaining compatibility even with an existing CPU having a small address space. . In the case of adding functions, the present inventor has found a need to consider so as to sufficiently meet various requirements for the microcomputer, such as pursuing cost reduction. .

また、アセンブリ言語によるプログラミングでは、CPUの命令セットに依存する部分が大きく、また、使用者の経験などによる好みといったものも存在するから、一つの命令セットでは、全ての要求に応えていくことはできない。例えば、別のCPUや、使用者の好み合った命令セットを持つCPUであれば移行しやすいが、同じ命令セットを持ったCPUでは、限界が生じてしまう。   Also, in assembly language programming, there is a large part that depends on the CPU instruction set, and there are also preferences such as the user's experience, so it is not possible to respond to all requests with one instruction set. Can not. For example, another CPU or a CPU having a command set that suits the user can easily migrate, but a CPU having the same command set has a limit.

マイクロコンピュータ或いはCPUのアーキテクチャには、汎用レジスタ方式、アキュムレータ方式などがあるから、それぞれに類似した命令セットを持つCPUを持てば、大部分の使用者の命令セットについての要求には応えられると考えられる。少なくとも、一つの命令セットであるよりは、異なる種類の命令セットを持つCPUを用意することにより、対応できる範囲を飛躍的に大きくできる。   There are general-purpose register system and accumulator system in the microcomputer or CPU architecture, so if you have a CPU with an instruction set similar to each of them, it will be possible to meet the instruction set requirements of most users. It is done. By preparing a CPU having at least one type of instruction set rather than at least one instruction set, the applicable range can be greatly increased.

このとき、これらのCPUは、独立したものを多数用意しても、互換性やソフトウェアの移植性が損なわれては、使用者にとっては、ソフトウェアの移植ができず、ソフトウェアを変更したりすることになってしまい、全体的な開発費用を不所望に増加させてしまったり、開発期間を不所望に増大させてしまいやすい。一方、CPU乃至はマイクロコンピュータの提供者にとっては、独立したCPUでは、使用する技術も異なってしまい、一つのCPUで得られた技術を他のCPUに適用でき難くなったりして、開発効率を低下させ、機能や性能の向上を図り難くしてしまう。   At this time, even if a large number of independent CPUs are prepared, if compatibility and software portability are impaired, software cannot be ported for the user and the software may be changed. This tends to undesirably increase the overall development cost and undesirably increase the development period. On the other hand, for a CPU or a microcomputer provider, the technology used is different for an independent CPU, and it becomes difficult to apply the technology obtained with one CPU to another CPU, thereby improving the development efficiency. It is difficult to improve the function and performance.

また、マイクロコンピュータを使用したシステムを開発する場合には、ソフトウェア開発装置及びエミュレータと呼ばれる開発装置が用いられる。   When developing a system using a microcomputer, a development device called a software development device and an emulator is used.

アセンブラやCコンパイラ、シミュレータデバッガなどのソフトウェア開発装置については、前記のような互換性を持った複数のCPUを、互いに一方が他方を包含する命令セットを持たないようなCPUも含めて、共通に利用できることが望ましい、ということが本発明者によって明らかにされた。利用者も、ソフトウェア開発装置を共通にして、異なるCPUに適用できれば、CPUを変更する際に、不所望な費用を発生させなくてよい。提供者も、一つの開発装置を開発すればよく、開発効率を向上できるし、適宜、開発装置の機能の向上や、使い勝手の向上などを図り易い。アセンブリ言語によるプログラミングのしやすさを享受しつつ、順次、高級言語へ移行することも可能になる。   For software development devices such as assemblers, C compilers, simulator debuggers, etc., a plurality of compatible CPUs such as those described above, including CPUs that do not have an instruction set that includes the other, are commonly used. The inventor has shown that it is desirable to be able to use it. If the user can also apply the software development apparatus in common to different CPUs, it is not necessary to generate undesired expenses when changing the CPU. The provider only needs to develop one development device, so that the development efficiency can be improved, and the functions of the development device and the usability can be easily improved as appropriate. While enjoying the ease of programming in assembly language, it becomes possible to move to higher-level languages sequentially.

前記特開平9−198272号公報には、特に一方が、他方の命令セットやレジスタ構成を包含するような複数のCPUに対応可能なエミュレータ及びエミュレーション用プロセッサについての記述があるが、前記の通り、このような複数のCPUでは、応用分野などの多様な要求に十分に応えられない。一方が他方の命令セット等を包含しないような複数のCPUに対して、両方の機能を包含する上位のCPUを用意することも考えられるが、全く異なる複数のCPUについては、命令コードが異なったり、アドレス空間や実効アドレス計算方法が異なったりして、これを包含する上位のCPUを構成することは困難である。また、可能であったとしても、このために大きな開発資源が必要と考えられ、開発に必要な各種資源を節約するといった目的を達成できない。さらに、上位のCPUが、異なる複数のCPUの機能を包含するがために、冗長な回路を持つようになり、実際の製品に用いることが困難になってしまうし、個別のCPUに切り替えて使用するのでは、新規のCPUとは言えず、応用分野などの多様な要求に応えるといった目的を達成できない。   In JP-A-9-198272, there is a description of an emulator and an emulation processor that are compatible with a plurality of CPUs, one of which includes the other instruction set and register configuration. Such a plurality of CPUs cannot sufficiently meet various requirements such as application fields. It may be possible to prepare a higher-level CPU that includes both functions for a plurality of CPUs, one of which does not include the instruction set of the other, but the instruction codes may be different for completely different CPUs. Since the address space and effective address calculation method are different, it is difficult to configure an upper CPU that includes the address space and effective address calculation method. Moreover, even if possible, it is considered that a large development resource is necessary for this purpose, and the purpose of saving various resources necessary for development cannot be achieved. Furthermore, since the host CPU includes functions of a plurality of different CPUs, it has redundant circuits, making it difficult to use in actual products, and switching to individual CPUs. Therefore, it cannot be said that it is a new CPU, and the purpose of responding to various requests such as application fields cannot be achieved.

検討課題Cに関する本発明の目的は、第1に、応用分野や使用者の広範な要求に応えることができるデータ処理装置を提供することにある。具体的には、半導体集積回路としての製造費用を低減して、ひいては、使用者の半導体集積回路についての費用を低減すること、応用分野のソフトウェア上の要求に応え易くすること、又はアセンブリ言語によるプログラミングも容易にするなど、使用者のマイクロコンピュータに対する好みに合わせたり、或いは、他のCPUから移行し易くすること、を実現することである。   An object of the present invention related to the examination subject C is to provide a data processing apparatus that can meet a wide range of requirements of application fields and users. Specifically, the manufacturing cost as a semiconductor integrated circuit is reduced, and hence the cost of the user for the semiconductor integrated circuit is reduced, the software requirement of the application field is easily met, or the assembly language is used. To make it easy to make programming, or to make it easy to migrate from another CPU according to the user's preference for the microcomputer.

検討課題Cに関する本発明の目的は、第2に、総体的なマイクロコンピュータのようなデータ処理装置製品群の開発費用を低減し、開発効率を向上することである。換言すれば、個別の応用分野やシステムに適した複数のCPUを提供するとともに、複数のCPUの総体的な開発費用を低減したり、開発効率を向上したりすることである。具体的には、互換性やソフトウェア資産の継承性を維持し、使用者のソフトウェア開発効率を向上すること、機能や性能の向上の要求に応え、更に継続して、機能や性能の向上の要求に応え易くすること、CPUの移行に当たって、使用者の不所望の費用を抑止すること、ソフトウェア開発装置やエミュレータなどの開発環境を共通に利用可能にして使用者の不所望の費用の増大を抑止すること、又は、開発環境の開発効率を向上すると共に適宜改善していくことを容易に実現すること、である。   Secondly, the object of the present invention related to the examination subject C is to reduce the development cost of a data processing apparatus product group such as an overall microcomputer and to improve the development efficiency. In other words, it is to provide a plurality of CPUs suitable for individual application fields and systems, reduce the overall development cost of the plurality of CPUs, and improve the development efficiency. Specifically, to maintain compatibility and inheritance of software assets, improve the software development efficiency of users, respond to requests for improvements in functions and performance, and continue to request improvements in functions and performance To prevent the user's undesired expenses when migrating the CPU, and the development environment such as software development devices and emulators can be used in common to prevent the user's undesired expenses from increasing Or to easily improve the development efficiency of the development environment and improve it as appropriate.

検討課題Cに関する本発明の目的は、第3に、プログラム容量は比較的大きいが、データ容量は比較的小さい、シングルチップマイクロコンピュータなどに好適なアドレス空間を持ったCPUのようなデータ処理装置、即ち、アドレス空間は広く、論理的な規模を縮小したCPUのようなデータ処理装置を提供することである。   Third, the object of the present invention related to the examination subject C is to provide a data processing apparatus such as a CPU having an address space suitable for a single chip microcomputer or the like having a relatively large program capacity but a relatively small data capacity. That is, it is to provide a data processing device such as a CPU having a wide address space and a reduced logical scale.

《検討課題D》
本発明者は、検討課題Bに関連する新たな検討課題Dとして、分岐命令の観点より、命令コード長の短縮や処理性能の向上に寄与する複合的な命令について検討した。この検討課題Dについて述べる。
<< Examination subject D >>
The present inventor examined a complex instruction that contributes to shortening the instruction code length and improving the processing performance from the viewpoint of a branch instruction, as a new examination problem D related to the examination problem B. This examination subject D is described.

一般的なマイクロコンピュータシステムにおいて、CPUの処理は、外部入力状態に適合するようになされる。これは、入出力ポートの状態に応じたり、これらに基づいて、内蔵RAMなどに保持したビットの状態に応じて、プログラムを分岐することによってなされる。   In a general microcomputer system, the processing of the CPU is adapted to the external input state. This is done by branching the program according to the state of the input / output port or based on the state of the bit held in the built-in RAM or the like.

このような外部入力状態に対応したCPUの処理を実現するための手段として、USP4334268号に記載されてるように、所謂ビットテスト・アンド・ブランチなどの命令を持つデータプロセッサがある。これにおいては、8ビットの絶対アドレスと3ビットのビット番号で、テストするビットを指定すると共に、分岐条件が前記指定ビットの論理値“1”状態又は論理値“0”状態の何れであるのかを1ビットで指定し、更に、8ビットのディスプレースメントで、分岐先のアドレスを指定する。この場合、3バイト長の命令コードでは、命令の指定を4ビットで行わなければならない。この例では、命令コードの先頭4ビットが論理値“0”になっているものがビットテスト・アンド・ブランチである。したがって、これ以外の命令は先頭4ビットを値1〜Fのとしなければならず、全体的な命令コード長の増加を招き易い。   As means for realizing the processing of the CPU corresponding to such an external input state, there is a data processor having an instruction such as so-called bit test and branch as described in US Pat. No. 4,334,268. In this case, the bit to be tested is designated by an 8-bit absolute address and a 3-bit bit number, and whether the branch condition is the logical value “1” state or the logical value “0” state of the designated bit. Is specified by 1 bit, and the branch destination address is specified by an 8-bit displacement. In this case, in the case of a 3-byte instruction code, the instruction must be specified by 4 bits. In this example, a bit test-and-branch is one in which the first 4 bits of the instruction code have a logical value “0”. Therefore, the other instructions must have the first 4 bits having values 1 to F, which tends to increase the overall instruction code length.

このような命令は、指定ビットのリードと判定、及び分岐アドレスの生成など、命令実行制御が複雑で論理規模の増加を招き易く、また、不所望の論理回路の遅延によって、動作周波数の向上の障害になり易い事が本発明者によって明らかにされた。   Such an instruction is complicated in instruction execution control such as read / determination of a designated bit and generation of a branch address, and tends to increase the logic scale, and the operating frequency is improved by delay of an undesired logic circuit. It has been made clear by the present inventor that it is likely to be an obstacle.

更に、8ビット絶対アドレスで指定できるのは、256バイトに限定されるから、マイクロコンピュータの高機能化に伴って、内部I/Oレジスタなどが増加されるときに、指定可能な範囲に所望のビットが存在しなかったり、また、マイクロコンピュータの仕様設計上、アドレス配置が困難になったりしてしまう。すなわち、マイクロコンピュータは汎用的に利用可能とされるが、応用分野や使用者毎に判定対象となるビットが複数に亘り、相違されることになり、判定対象となるビットに対する所望の組合せの全ての要求に応えることは難しい。   Furthermore, since it is limited to 256 bytes that can be specified by an 8-bit absolute address, when the number of internal I / O registers is increased as the microcomputer becomes more sophisticated, a desired range can be specified. Bits do not exist, and address arrangement becomes difficult due to the design specification of the microcomputer. In other words, the microcomputer can be used for general purposes, but there are a plurality of different bits to be judged for each application field or user, and all the desired combinations for the bits to be judged are all different. It is difficult to meet the demands.

また、制御が複雑になると、8ビットの相対アドレスでは、分岐できない場合が生じてくる。当該命令の存在するアドレス又は次の命令の存在するアドレスを基準に、+127〜−128バイトの範囲でしか分岐できないから、判定対象のビットが論理値“1”のとき、または論理値“0”のときに実行する処理プログラムの少なくとも一方(分岐条件が成立しない場合に実行する処理プログラム)は、127バイト未満にする必要がある。これが満足できない場合は、別の分岐命令をも用いて、2段階の分岐命令の実行によって、所要のアドレスに分岐しなければならない。これはプログラムを複雑化し、処理速度も低下させてしまう、ということが本発明者によって明らかにされた。   Further, when the control is complicated, there are cases where branching cannot be performed with an 8-bit relative address. Since branching is possible only within the range of +127 to −128 bytes with reference to the address where the instruction exists or the address where the next instruction exists, when the bit to be judged is the logical value “1” or the logical value “0” At least one of the processing programs executed at this time (the processing program executed when the branch condition is not satisfied) needs to be less than 127 bytes. If this is not satisfactory, another branch instruction must be used to branch to the required address by executing a two-stage branch instruction. It has been clarified by the present inventors that this complicates the program and reduces the processing speed.

そうかといって、絶対アドレスやディスプレースメントを16ビットなどとすると、必然的に命令コード長の増加を招き、処理速度も低下するし、命令実行制御も更に複雑になる。絶対アドレスとディスプレースメントのビット長の組合せを複数にしようとすると、命令実行制御が更に複雑になる。これらは、追加すべき命令の種類を増やすことになり、既存のCPUの上位互換性を維持することを困難にしてしまう。既存のCPUの利点(論理構成の簡潔さや高速性など)を維持することを困難にしてしまう。   On the other hand, if the absolute address or displacement is set to 16 bits, the instruction code length is inevitably increased, the processing speed is lowered, and the instruction execution control is further complicated. If there are a plurality of combinations of absolute address and displacement bit length, the instruction execution control becomes more complicated. These increase the types of instructions to be added, making it difficult to maintain upward compatibility of existing CPUs. It makes it difficult to maintain the advantages of existing CPUs (such as simplicity of logic configuration and high speed).

検討事項Dに関する本発明の目的は、論理的・物理的規模の増大を最小限とし、既存のCPUと互換性を維持しつつ、メモリ上の任意のアドレスのデータのビットの状態を判定して、分岐及びサブルーチン分岐を可能にすることにある。更に、CPUの使い勝手の向上、命令コード長の短縮、及び処理性能の向上を実現することを目的とする。   The object of the present invention regarding the consideration D is to determine the bit state of data at an arbitrary address on the memory while minimizing an increase in logical and physical scale and maintaining compatibility with an existing CPU. It is to enable branching and subroutine branching. It is another object of the present invention to improve the usability of the CPU, shorten the instruction code length, and improve the processing performance.

《検討課題E》
本発明者は、検討課題Eとして、単一の命令で複数の汎用レジスタ等に対してリード/ライトを行うようにすることについて検討した。尚、この検討課題Eに関する事項は、本願における国内優先権主張の第4の基礎出願である特願平11−320518号の明細書に既に開示したが、その内容は未だ公知ではない。この検討課題Eについて述べる。
<< Examination subject E >>
The present inventor studied as a study subject E that reading / writing is performed on a plurality of general-purpose registers or the like with a single instruction. In addition, although the matter regarding this examination subject E has already been disclosed in the specification of Japanese Patent Application No. 11-320518, which is the fourth basic application claiming domestic priority in this application, the contents thereof are not yet known. This examination subject E is described.

データ転送時のパケットコマンドなどの情報は、複数の情報の集合で、例えば16バイトなどであって、CPUのデータ処理単位よりは大きい。CPUは、これに含まれる個別の情報(コマンド、転送バイト数、転送ロケーションなど)をリードして、解析する。例えば、コマンドは8ビット、転送バイト数は32ビット、転送ロケーション(アドレス)は32ビットなどとされ、これらの個別の情報は、多くの場合、CPUの操作可能なデータ長である。   Information such as a packet command at the time of data transfer is a set of a plurality of pieces of information, for example, 16 bytes, which is larger than the data processing unit of the CPU. The CPU reads and analyzes individual information (command, number of transfer bytes, transfer location, etc.) included therein. For example, the command is 8 bits, the number of transfer bytes is 32 bits, the transfer location (address) is 32 bits, etc., and these individual pieces of information are often data lengths that can be manipulated by the CPU.

また、プリンタの印刷データなどは、CPUの操作するデータ長より大きい。これらは個別のビット(ドット、ピクセルなど)の集合である。これを操作する場合には、算術的な処理ではなく、ビット単位の処理であり、論理的な処理が主に必要である。かかるデータを処理する場合には、CPUの操作するデータの単位に複数回に分けて行なう。即ち、メモリからデータをリードし、汎用レジスタ上で処理を行い、結果をメモリへライトする処理を行なうことを繰り返す。   The print data of the printer is longer than the data length operated by the CPU. These are a collection of individual bits (dots, pixels, etc.). When this is operated, it is not an arithmetic process but a bit unit process, and a logical process is mainly necessary. When processing such data, it is divided into a plurality of data units operated by the CPU. That is, the process of reading data from the memory, performing processing on the general-purpose register, and writing the result to the memory is repeated.

本発明者は、汎用レジスタの利用態様を更に検討した。前記パケットコマンドや印刷データはワードのようなCPUによるデータ処理のデータ単位より大きい。このようなCPUによるデータ処理のデータ単位より大きいデータ単位についても、一括してレジスタからリード或いはレジスタにライトできるようにすれば、データ処理の高速化を図る上で好都合であることを本発明者は見出した。具体的には、いわゆるフォンノイマン型のCPUにおいては、転送命令の実行にあたっては、命令コードをリードし、これをデコードし、データをリード/ライトする必要があるから、バイト或いはワード単位でそのようなデータのレジスタ転送を複数回繰り返すよりは、単一の命令で、複数の汎用レジスタのリード/ライトを行なうようにすれば、データ転送の為に命令コードをリードする回数を低減することができるからである。   The present inventor further examined the use mode of the general-purpose register. The packet command and print data are larger than a data unit of data processing by the CPU such as a word. If the data unit larger than the data unit of the data processing by the CPU can be read from the register or written to the register at a time, it is advantageous for speeding up the data processing. Found. Specifically, in a so-called von Neumann type CPU, when executing a transfer instruction, it is necessary to read an instruction code, decode it, and read / write data. Rather than repeating multiple data register transfers multiple times, the number of times the instruction code is read for data transfer can be reduced by reading / writing multiple general-purpose registers with a single instruction. Because.

更に、前記省略可能なワードによって汎用レジスタを拡張する技術と組み合わせれば、それによって汎用レジスタを拡張して、複数の汎用レジスタを一括してリード/ライトするためにそれらレジスタを空けることも容易になることを見出した。   Furthermore, when combined with the technology for extending general-purpose registers with the abbreviated words, it is easy to expand general-purpose registers and thereby free up a plurality of general-purpose registers for reading / writing in a batch. I found out that

一方、本発明者らが先に提案した特開平8−263290号公報に記載のCPUは、命令を実行する実行手段を制御するための制御手段に対して指定可能な複数の汎用レジスタの組み合わせを固定にし、それら複数の汎用レジスタのスタックに対する退避/復帰命令を有し、前記複数の汎用レジスタを順次待避/復帰するようにしている。これは、サブルーチンや例外処理などの、処理の切れ目で、それ以前の処理の状態を保存することを目的とする処理に限られている。従って、アドレッシングモードも、スタックポインタのプリデクリメント(待避)/ポストインクリメント(復帰)に限定されている。また、汎用レジスタの待避/復帰毎に、アドレス演算器を用いてアドレス計算を行なっている。   On the other hand, the CPU described in Japanese Patent Application Laid-Open No. 8-263290 previously proposed by the present inventors uses a combination of a plurality of general-purpose registers that can be specified for the control means for controlling the execution means for executing instructions. The plurality of general-purpose registers are sequentially saved / restored by having a save / return instruction for the stack of the plurality of general-purpose registers. This is limited to processing for the purpose of saving the state of the previous processing at a processing break, such as a subroutine or exception processing. Therefore, the addressing mode is also limited to pre-decrement (save) / post-increment (return) of the stack pointer. In addition, address calculation is performed using an address calculator every time the general-purpose register is saved / restored.

前記特開平8−263290号公報に記載の技術を他のアドレッシングモードに適用しようとすると、例えば、4本の汎用レジスタとメモリの間の転送命令では、レジスタ間接のリードの場合、2番目以降の汎用レジスタ毎に、アドレスレジスタの内容に+4、+8、+12のアドレス演算処理を行なって実効アドレスを生成する必要がある。逆に、ライトの場合、最後以外の汎用レジスタ毎に、アドレスレジスタの内容に−12、−8、−4の演算処理を行なって実効アドレスを生成する必要がある。このため、レジスタ毎に実効アドレスの演算が必要になるので、不所望な内部動作ステートが発生してしまう。   If the technique described in Japanese Patent Laid-Open No. 8-263290 is applied to another addressing mode, for example, in the case of a register indirect read in a transfer instruction between four general-purpose registers and a memory, the second and later For each general-purpose register, it is necessary to generate an effective address by performing +4, +8, and +12 address arithmetic processing on the contents of the address register. On the other hand, in the case of writing, it is necessary to generate an effective address by performing arithmetic processing of -12, -8, and -4 on the contents of the address register for each general-purpose register other than the last. For this reason, an effective address calculation is required for each register, and an undesired internal operation state occurs.

更に、ディスプレースメント付きレジスタ間接では、ディスプレースメントとアドレスレジスタの内容を加算した結果を内部に保持した上で、この加算結果に上記レジスタ間接同様のアドレス計算を行なう必要がある。これらは、CPUの内部動作を複雑にし、論理的規模の増大を招き易い。   Further, in the register indirect with displacement, it is necessary to hold the result of adding the contents of the displacement and the address register inside, and to perform the same address calculation as the register indirect on the addition result. These complicate the internal operation of the CPU and tend to increase the logical scale.

一般に、マイクロコンピュータは、汎用的に使用できる(1種類のチップで複数の応用分野に対応できる)ことが、その開発効率などの点で望ましい。特に、CPUについては、アセンブラやCコンパイラといったソフトウェア開発装置、及びインサーキットエミュレータといったハードウェア開発装置が必要であるから、マイクロコンピュータのアーキテクチャの変更は容易ではないし、また、変更する場合も、既存のCPUとの互換性を保ち、上記ソフトウェア乃至ハードウェア開発装置を共通に利用できるようにし、開発効率を向上することが望ましい。   In general, it is desirable in terms of development efficiency and the like that a microcomputer can be used for general purposes (one chip can handle a plurality of application fields). In particular, since a CPU requires a software development device such as an assembler or a C compiler and a hardware development device such as an in-circuit emulator, it is not easy to change the architecture of the microcomputer. It is desirable to maintain compatibility with the CPU, to make the software or hardware development apparatus available in common, and to improve development efficiency.

なお、ブロック転送命令などといった、複数単位のデータをメモリ上で連続的に転送する命令を命令セットにマイクロコンピュータもある。このような命令では、転送データは、CPUの汎用レジスタに格納されないので、当該データに対して、直接操作できなかったり、少なくとも、汎用レジスタに対するほど高速には操作できない。   There is also a microcomputer in which an instruction set, such as a block transfer instruction, is an instruction set for continuously transferring a plurality of units of data on a memory. With such an instruction, the transfer data is not stored in the general-purpose register of the CPU, so that the data cannot be directly manipulated, or at least as fast as the general-purpose register.

検討課題Eに関する本発明の目的は、マイクロコンピュータなどのデータ処理装置またはデータ処理システムにおいて、その論理的規模の増加を最小限にしつつ、CPUの処理するデータ長、例えば、バイト、ワード、ロングワードなどより大きいデータを処理する必要がある場合に、CPU処理プログラムの短縮、CPUによるデータ処理速度の高速化を実現することにある。詳しくは、本発明は、データのリード/ライトに対して、命令のリードの頻度を低減して、データ処理の高速化を図ることができるようにしようとするものである。   The object of the present invention related to the examination subject E is to reduce the logical scale of the data processing apparatus or data processing system such as a microcomputer while minimizing the logical size, for example, byte, word, long word. For example, when it is necessary to process larger data, the CPU processing program is shortened and the data processing speed of the CPU is increased. More specifically, the present invention is intended to reduce the frequency of instruction read for data read / write so as to increase the data processing speed.

検討課題Eに関する本発明の別の目的は、既存CPUのソフトウェア資産を有効に利用でき、新たなシステムの開発効率を向上させることができ、既存のCPUのシステム発装置を流用でき、開発環境をいち早く手依拠することが可能なデータ処理装置を提供することにある。   Another object of the present invention relating to the examination subject E is that the software resources of the existing CPU can be used effectively, the development efficiency of a new system can be improved, the system generator of the existing CPU can be diverted, and the development environment can be It is an object of the present invention to provide a data processing apparatus that can be quickly relied upon.

検討課題Eに関する本発明の更に別の目的は、既存のCPUに対して汎用レジスタ数の増加をソフトウェアで指定でき、これを利用して、プログラム作成の容易化と、レジスタリード・レジスタライト動作の高率化によってCPUの処理性能を向上させることができるデータ処理装置を提供することにある。   Still another object of the present invention relating to the examination subject E is that the increase in the number of general-purpose registers can be specified by software for an existing CPU, and this can be used to facilitate program creation and register read / write operations. An object of the present invention is to provide a data processing apparatus capable of improving the processing performance of a CPU by increasing the rate.

検討課題Eに関する本発明のその他の目的は、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、オブジェクトレベルで互換性を保ちつつ、上記CPU処理プログラムの短縮、CPUによる処理の高速化等の目的を達成することができるデータ処理装置を提供することにある。   Another object of the present invention relating to the examination problem E is to maintain compatibility at the object level, and when there is a CPU having a wide address space and a CPU having a small address space, the CPU is maintained while maintaining compatibility at the object level. An object of the present invention is to provide a data processing apparatus capable of achieving the objectives such as shortening of a processing program and high-speed processing by a CPU.

上記検討課題A乃至検討課題Eに関する本願発明は、データ処理装置の演算性能の拡張と使い勝手の向上という点において、解決しようとする共通の課題を有している。また、高速であるが、数に限りがある汎用レジスタのデータの待避/復帰などを行なうことなく、処理を可能にするという共通の課題を有している。   The present invention relating to the above-described examination problems A to E has a common problem to be solved in terms of expansion of calculation performance and improvement in usability of the data processing apparatus. Further, there is a common problem that processing is possible without saving / restoring data of general-purpose registers, which are high-speed but limited in number.

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

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

《検討課題Aの解決手段》
この検討課題Aに関する解決手段として、レジスタを指定するレジスタ指定情報を、2つの部分に分割する。この2つの部分を命令コードの基本単位上の別々の基本単位に配置する。一方の命令コードを省略可能とし、省略可能な命令コードを省略すると、所定レジスタ指定情報を暗黙的に想定してレジスタ選択動作を行うようにする。
<< Solutions for Examination A>
As means for solving the problem A, register designation information for designating a register is divided into two parts. These two parts are arranged in different basic units on the basic unit of the instruction code. If one instruction code is omissible and the omissible instruction code is omitted, the register selection operation is performed by implicitly assuming predetermined register designation information.

省略可能な命令コードは、レジスタ指定情報の一部を保持するためのフィールドを有し、演算の種類などは指定しないような命令コードにすれば良い。例えば、省略不可能な命令コードを、既存のCPUと共通にし、省略可能な命令コードを既存のCPUの未定義のワードに割当てればよい。   The instruction code that can be omitted may be an instruction code that has a field for holding a part of the register designation information and does not designate the type of operation. For example, an instruction code that cannot be omitted may be shared with an existing CPU, and the instruction code that can be omitted may be assigned to an undefined word of the existing CPU.

省略可能な命令コードに含まれるレジスタ指定フィールドの情報を保持する手段を設け、前記省略可能な命令が実行されると、前記省略可能な命令コードに含まれるレジスタ指定フィールドの情報を前記保持手段に格納する。更に、命令の実行終了時に、前記保持手段を、前記暗黙的な指定に対応する所定の値に設定する。   Means for holding register designation field information included in an optional instruction code is provided, and when the optional instruction is executed, information in the register designation field included in the optional instruction code is stored in the holding means. Store. Further, at the end of execution of the instruction, the holding means is set to a predetermined value corresponding to the implicit designation.

上記した手段によれば、暗黙的に指定可能な汎用レジスタ(既存の汎用レジスタ)のみを使用していれば、省略可能の命令コードを省略できるから、命令コード長を増加させることがない。少なくとも従来同等の汎用レジスタを使用する場合は、従来同等の命令コードでよい。命令コード長を増加させないことよって、処理速度を低下させることがない。   According to the above-described means, if only the general-purpose register that can be specified implicitly (existing general-purpose register) is used, the instruction code that can be omitted can be omitted, and the instruction code length is not increased. If at least a conventional equivalent general-purpose register is used, a conventional equivalent instruction code may be used. By not increasing the instruction code length, the processing speed is not reduced.

前記省略可能な命令コードを付加することによって、命令によって直接汎用レジスタの全てを選択できるから、プロラムの容易性を損うことなく、利用可能な汎用レジスタの数を増やすことができる。また、任意の量の汎用レジスタの一部を、所望のタスク毎や所望の割込み処理などに確保しておく(他のタスクや処理では使用しない)ことによって、前記タスクや割込み処理において汎用レジスタを待避したりする必要がなく、高速化が図れる。また、前記タスクや割込み処理に確保する汎用レジスタ数は任意にできるから、タスクや処理の間で、使用する汎用レジスタを相互に融通し合うことも容易である。   By adding the optional instruction code, all of the general purpose registers can be directly selected by the instruction, so that the number of available general purpose registers can be increased without impairing the ease of programming. In addition, by securing a part of an arbitrary amount of general-purpose registers for each desired task or desired interrupt processing (not used in other tasks or processing), the general-purpose registers can be set in the task or interrupt processing. There is no need to evacuate and speed up can be achieved. In addition, since the number of general-purpose registers reserved for the task and interrupt processing can be arbitrarily set, it is easy to interchange the general-purpose registers to be used between tasks and processing.

前記省略可能な命令コードを付加することによって、指定できる汎用レジスタのアクセスは、RAMなどのメモリのアクセスより、一般に高速にできるから、汎用レジスタ数を増加することにより、高速に処理できるデータ量を増加させ、ひいてはCPUの処理速度を向上できる。また、いわゆるロードストア型の命令セットを持ち、メモリの内容に対して直接演算できないようなプロセッサについては、汎用レジスタを増加することにより、直接処理できるデータ量を増加でき、また、メモリのアクセス頻度を低減することができ、処理速度を向上することができる。   By adding the optional instruction code, the access to the general-purpose register that can be specified is generally faster than the access to the memory such as RAM. Therefore, by increasing the number of general-purpose registers, the amount of data that can be processed at a high speed This increases the processing speed of the CPU. For processors that have a so-called load / store type instruction set and cannot directly operate on the contents of memory, the amount of data that can be directly processed can be increased by increasing the number of general-purpose registers. Can be reduced, and the processing speed can be improved.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUで、前記省略可能な命令コードを付加できれば、下位互換性をもつ、アドレス空間の小さいCPUにも前記ワードを付加できることになるから、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUに汎用レジスタを追加できる。オブジェクトレベルで互換性を保つことによる利点と汎用レジスタを追加することの利点の双方を享受することができる。   When there is a CPU with a wide address space and a CPU with a small address space while maintaining compatibility at the object level, if the CPU can have a wide address space and the optional instruction code can be added, it has backward compatibility. Since the word can be added to a CPU having a small address space, general-purpose registers can be added to a CPU having a wide address space and a CPU having a small address space while maintaining compatibility at the object level. You can enjoy both the benefits of maintaining compatibility at the object level and the benefits of adding general purpose registers.

上記手段の更に詳細な態様について言及する。命令コードを読み込んで動作し、データまたはアドレスを格納可能なレジスタ(ER0〜ER31)を複数個持つデータ処理装置は、命令コードを保持する第1の命令コード保持手段(IR1)及び第2の命令コード保持手段(IR2)と、命令コードをデコードする命令デコード手段(DEC)と、前記レジスタを選択する選択手段(RSEL)とを含む。前記第1の命令コード保持手段の出力は、前記第2の命令コード保持手段、前記命令デコード手段及び前記レジスタ選択手段に結合され、前記第2の命令コード保持手段の出力は、レジスタ選択手段に結合され、前記命令デコード手段の出力は、レジスタ選択手段及び前記第2の命令コード保持手段に結合され、前記命令デコード手段の前記第2の命令コード保持手段への出力は、前記第2の命令コード保持手段に対するラッチ信号(LGRCL)と、所定の値へのセット信号(RSLGR)を含む。前記第2の命令コード保持手段に対するラッチ信号は、前記命令デコード手段が所定の命令コードをデコードしたとき発生し、前記第2の命令コード保持手段に対する所定の値へのセット信号は、前記所定の命令コードによって指定されたレジスタを用いる処理が終了された後にセット動作が行われる様に発生する。   Reference will be made to more detailed aspects of the above means. A data processing device that operates by reading an instruction code and has a plurality of registers (ER0 to ER31) capable of storing data or addresses includes a first instruction code holding means (IR1) that holds the instruction code, and a second instruction Code holding means (IR2), instruction decoding means (DEC) for decoding the instruction code, and selection means (RSEL) for selecting the register are included. The output of the first instruction code holding means is coupled to the second instruction code holding means, the instruction decoding means and the register selection means, and the output of the second instruction code holding means is sent to the register selection means. And the output of the instruction decode means is coupled to a register selection means and the second instruction code holding means, and the output of the instruction decode means to the second instruction code holding means is the second instruction A latch signal (LGRCL) for the code holding means and a set signal (RSLGR) to a predetermined value are included. The latch signal for the second instruction code holding means is generated when the instruction decoding means decodes a predetermined instruction code. The set signal to the predetermined value for the second instruction code holding means is the predetermined signal. This occurs so that the set operation is performed after the processing using the register specified by the instruction code is completed.

前記第2の命令コード保持手段に対する前記所定の値へのセット信号は、例えば、前記命令デコード手段が、命令の実行終了に呼応して発生すればよい。あるいは、前記所定の値を保持するためのデータ保持手段を更に含め、そのデータ保持手段の出力を前記第2の命令コード保持手段に結合し、前記所定の値へのセット信号の発生に呼応して、前記第2の命令コード保持手段が、前記データ保持手段の値に応じた値にセットされるようにしてもよい。   The set signal to the predetermined value for the second instruction code holding means may be generated, for example, in response to the end of execution of the instruction by the instruction decoding means. Alternatively, it further includes data holding means for holding the predetermined value, and the output of the data holding means is coupled to the second instruction code holding means in response to generation of a set signal to the predetermined value. Then, the second instruction code holding means may be set to a value corresponding to the value of the data holding means.

《検討事項Bの解決手段》
本願発明は前記検討課題Bに関する解決手段を与えるものである。検討課題Bに関する解決手段として、既存の、メモリ・レジスタ間の転送命令や、レジスタ・レジスタ間の演算命令の内、複数の命令コードを組合せ、例えば、これを結合させる前置命令コードを用いて、メモリ上の演算を可能にする。要するに、所定の前置命令コードが付加された場合、これに続く複数の命令コードを1つの命令として解釈し、実行する。ここで、1つの命令とは、例えばリセット以外の要因で処理が分断されない、或いは、リセットなどの特定の要因を除いて途中で割り込み(例外処理)を受け付けない、等のように定義することができる。このとき、CPU内の、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段を、汎用レジスタに代えて、若しくは汎用レジスタと共に利用することが、メモリ上のデータに対する直接的な演算(若しくは直接的なデータ転送)を可能とする。ここで、メモリ上のデータに対する直接的な演算とは、前記命令コードには明示されないデータラッチ手段へメモリからデータをロードし、当該データラッチ手段にロードしたデータを用いて行なう演算処理である。また、メモリとの間の直接的なデータ転送とは、前記命令コードには明示されないデータラッチ手段へメモリからデータをロードし、当該データラッチ手段のデータを前記メモリにストアする処理である。
<< Solutions to Consideration B >>
The present invention provides means for solving the examination problem B. As a means for solving the examination problem B, a combination of a plurality of instruction codes among existing transfer instructions between memory and registers and operation instructions between registers and registers, for example, using a pre-instruction code for combining them , Allowing operations on memory. In short, when a predetermined prefix instruction code is added, a plurality of instruction codes following this are interpreted as one instruction and executed. Here, one instruction may be defined such that processing is not interrupted due to factors other than reset, or interrupts (exception processing) are not accepted midway except for specific factors such as reset. it can. At this time, it is possible to use a latch means that is not released in the program, such as a temporary register in the CPU, instead of the general-purpose register or together with the general-purpose register, for direct calculation (or direct Data transfer). Here, the direct operation on the data on the memory is an operation process in which data is loaded from the memory to the data latch means not explicitly shown in the instruction code, and is performed using the data loaded on the data latch means. The direct data transfer to and from the memory is a process of loading data from the memory into data latch means not specified in the instruction code and storing the data in the data latch means in the memory.

詳しくは、前記前置命令コードに続いて、第1番目に、メモリ・レジスタ間転送命令コードを実行する場合は、汎用レジスタではなく、CPU内の、テンポラリレジスタの様な、プログラム上解放されていない第1のラッチ手段とメモリの間でデータ転送を行なう。更に、第2番目として、引き続きレジスタ・レジスタ間の演算命令コードを実行する場合は、演算対象の内の単数または複数のデータを前記第1のラッチ手段から読み出すようにする。ここで、プログラム上解放されていないラッチ手段とは、プログラム上ユーザが指定できないラッチ手段、CPU若しくはマイクロコンピュータ上においてユーザから見えないテンポラリレジスタやバッファレジスタを意味する。そのようなラッチ手段は、プログラム上解放されていないから、当然その記憶情報が退避されることは想定されておらず、多くの場合、演算の途中結果などを格納するのに用いることが想定されており、1命令実行中にその使用状態を終えることが前提になっている。したがって、その前提の下では、前記ラッチ手段を使うとき退避を全く考えなくてもよい。その前提を保証する為に、前置命令コードとこれに続く所定の命令を1命令とみなし、途中に割り込みなどが入らないように考慮され、ラッチ手段に対する退避の必要性を排除している。   Specifically, following the pre-instruction code, first, when executing a memory-register transfer instruction code, it is not a general-purpose register but released in the program, such as a temporary register in the CPU. Data transfer is performed between the first latch means and the memory that are not present. Further, as a second example, when an operation instruction code between registers is continuously executed, one or a plurality of data to be calculated is read from the first latch means. Here, the latch means that is not released on the program means a latch means that cannot be specified by the user on the program, a temporary register or a buffer register that cannot be seen by the user on the CPU or microcomputer. Since such a latch means is not released in the program, it is naturally not assumed that the stored information is saved, and in many cases, it is assumed to be used for storing an intermediate result of the operation. It is assumed that the use state is finished during execution of one instruction. Therefore, under that premise, there is no need to consider evacuation when using the latch means. In order to guarantee the premise, the pre-instruction code and a predetermined instruction following the pre-instruction code are regarded as one instruction, so that an interrupt or the like is not entered midway, and the necessity of saving to the latch means is eliminated.

前記第2番目の演算命令コードが、演算結果をメモリに格納する処理を要求する命令コードの場合には、前記転送命令コードで使用したメモリのアドレスは、別のテンポラリレジスタなどの別のラッチ手段(第2のラッチ手段)に格納する。前記演算命令の演算結果は前記第1のラッチ手段に格納する。引き続き、メモリ・レジスタ間の転送命令コードをマイクロコンピュータ自ら生成し、前記アドレスを格納した第2のラッチ手段の内容をアドレスとして、前記演算結果を格納した第1のラッチ手段の内容をデータとして、メモリへの書込みを行なう。   When the second operation instruction code is an instruction code for requesting processing for storing the operation result in the memory, the memory address used in the transfer instruction code is another latch means such as another temporary register. (Second latch means). The operation result of the operation instruction is stored in the first latch means. Subsequently, the microcomputer itself generates a transfer instruction code between the memory and the register, the contents of the second latch means storing the address as the address, the contents of the first latch means storing the operation result as data, Write to memory.

更に説明を加える。前置命令コードによって1命令とみなされる命令が、メモリ上のデータと汎用レジスタ上のデータの演算を行い、結果を汎用レジスタ上に格納する命令の場合には、前置命令コード、メモリ・レジスタ転送命令コード、演算命令コードを実行し、メモリ・レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、演算命令コードは、前記ラッチ手段に格納したデータと汎用レジスタ上のデータとの演算を行い、結果を汎用レジスタに格納する。   Further explanation will be added. If the instruction that is regarded as one instruction by the prefix instruction code performs an operation on the data on the memory and the data on the general register, and stores the result on the general register, the prefix instruction code, the memory register The transfer instruction code and the operation instruction code are executed. When the memory / register transfer instruction code is executed, the transfer data is stored in the latch means, not the general-purpose register, and the operation instruction code is stored in the latch means and the data stored in the latch means. Calculates the above data and stores the result in a general-purpose register.

前置命令コードによって1命令とみなされる命令が、汎用レジスタ上のデータとメモリ上のデータの演算を行い、結果をメモリ上に格納する命令の場合には、前置命令コード、メモリ・レジスタ転送命令コード、演算命令コード、及び内部で生成されたメモリ・レジスタ転送命令コードを実行し、メモリ・レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、演算命令コードは、前記ラッチ手段に格納したデータと汎用レジスタ上のデータとの演算を行い、結果をラッチ手段に格納する。メモリ・レジスタ転送命令コードは、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。インクリメントなどのように、1つのメモリ上のデータに対する演算を行なう場合もこれと同様にする。また、メモリ・レジスタ転送命令コード実行時には、換言すれば、1つの命令とみなされる命令による処理の途中には、演算結果等を反映するフラグの変化を抑止し、前の演算命令による演算結果のフラグの状態を保持する。この理由は以下の通りである。演算命令コードの実行においては前の演算命令の実行によってフラグに反映された状態を参照しなければならない場合が有り、このとき、転送命令若しくは転送命令コードの実行によっても前記フラグの状態変化を全て許容した場合には不都合を生ずるからである。更に詳しくは当該命令としてのフラグの変化と、転送命令自体のフラグの変化が異なることによって不都合を生じさせないということである。具体的には、その演算が算術演算であるとき、算術演算結果で生じたオーバフローフラグが転送命令コードによってクリアされたりしないようにするということである。   If the instruction that is regarded as one instruction by the prefix instruction code is an instruction that performs operation on the data in the general-purpose register and the data in the memory and stores the result in the memory, the prefix instruction code and the memory register transfer Execute instruction code, operation instruction code, and internally generated memory / register transfer instruction code. When executing memory / register transfer instruction code, store transfer data in latch means instead of general-purpose registers. Performs an operation on the data stored in the latch means and the data on the general-purpose register, and stores the result in the latch means. The memory / register transfer instruction code writes to the memory using the contents of the latch means storing the address as an address and the contents of the latch means storing the operation result as data. This is the same when an operation is performed on data in one memory, such as increment. In addition, when executing the memory / register transfer instruction code, in other words, during the processing by the instruction regarded as one instruction, the change of the flag reflecting the operation result is suppressed, and the operation result by the previous operation instruction is suppressed. Holds the flag state. The reason is as follows. In the execution of the operation instruction code, it is sometimes necessary to refer to the state reflected in the flag by the execution of the previous operation instruction. At this time, all the state changes of the flag are also caused by the execution of the transfer instruction or the transfer instruction code. This is because if allowed, inconvenience occurs. More specifically, there is no inconvenience caused by a change in the flag as the instruction and a change in the flag in the transfer instruction itself. Specifically, when the operation is an arithmetic operation, an overflow flag generated as a result of the arithmetic operation is prevented from being cleared by the transfer instruction code.

前置命令コードによって1命令とみなされる命令が、メモリ上の2つのデータを用いて演算し、演算結果をメモリ上に格納する命令である場合には、前置命令コード、第1、第2のメモリ・レジスタ転送命令コード、演算命令コード、及び内部で生成したメモリ・レジスタ転送命令コードを実行し、第1、第2のメモリ・レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、演算命令コードは、前記ラッチ手段に格納したデータの演算を行い、結果をラッチ手段に格納する。メモリ・レジスタ転送命令コードは、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   When the instruction that is regarded as one instruction by the prefix instruction code is an instruction that performs an operation using two data on the memory and stores the calculation result on the memory, the prefix instruction code, first, second Memory register transfer instruction code, operation instruction code, and internally generated memory register transfer instruction code are executed. When executing the first and second memory register transfer instruction codes, transfer data is not a general-purpose register. Is stored in the latch means, and the operation instruction code calculates the data stored in the latch means and stores the result in the latch means. The memory / register transfer instruction code writes to the memory using the contents of the latch means storing the address as an address and the contents of the latch means storing the operation result as data.

一方、前置命令コードによって1命令とみなされる命令が、メモリ上のデータを、別のメモリに転送する命令の場合には、前置命令コード、メモリ・レジスタ転送命令コード、メモリ・レジスタ転送命令コードを実行し、メモリ・レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、メモリ・レジスタ転送命令コードは、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   On the other hand, when the instruction that is regarded as one instruction by the prefix instruction code is an instruction that transfers data in the memory to another memory, the prefix instruction code, the memory register transfer instruction code, the memory register transfer instruction When executing the code and executing the memory / register transfer instruction code, the transfer data is stored in the latch means instead of the general-purpose register. The memory / register transfer instruction code uses the contents of the latch means storing the operation result as data. , Write to memory.

前置命令コードによって1命令とみなされる命令が、イミディエイトデータとメモリ上のデータとの演算の場合は、概略、汎用レジスタ上のデータとメモリ上のデータの演算を行い、結果をメモリ上に格納する命令と同様にできる。   When the instruction that is regarded as one instruction by the prefix instruction code is an operation of immediate data and data on the memory, generally, the data on the general-purpose register and the data on the memory are calculated, and the result is stored in the memory. Can be done in the same way as an

前置命令コードによって1命令とみなされる命令が、イミディエイトデータを、メモリに転送する命令の場合には、前置命令コード、イミディエイト・レジスタ転送命令コード、メモリ・レジスタ転送命令コードを実行し、イミディエイト・レジスタ転送命令コードの実行時には、汎用レジスタではなく、イミディエイトデータをラッチ手段に格納し、メモリ・レジスタ転送命令コードは、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   If the instruction that is regarded as one instruction by the prefix instruction code is an instruction that transfers immediate data to the memory, the prefix instruction code, immediate register transfer instruction code, and memory register transfer instruction code are executed, and the immediate is executed. When register transfer instruction code is executed, immediate data is stored in the latch means instead of general-purpose registers, and the memory register transfer instruction code is written to the memory using the contents of the latch means storing the operation results as data. Do.

複数の命令コードを組合せて一連のものとして実行する場合には、それぞれの命令コードの間に、割込みなどの不所望の処理が挿入されることを禁止する。そのための制御信号は前記前置命令コードをデコードして生成すればよい。前置命令コードには、そのほかのデータサイズなどの情報を持たせることも可能である。   When a plurality of instruction codes are combined and executed as a series, it is prohibited to insert an undesired process such as an interrupt between the instruction codes. The control signal for this purpose may be generated by decoding the prefix instruction code. The prefix instruction code can also have other information such as data size.

前置命令コードにひき続いて、メモリ−レジスタ転送命令コードを実行する場合、独立したメモリ−レジスタ転送命令の命令コードと全く同一の命令コードである必要はなく、アドレッシングモードといったメモリの指定方法を示すビットのみを共通にし、その他のビットは適宜変更することができる。   When the memory-register transfer instruction code is executed following the prefix instruction code, the instruction code need not be exactly the same as the instruction code of the independent memory-register transfer instruction. Only the bits shown can be shared, and the other bits can be changed as appropriate.

上記した手段によれば、メモリ・レジスタ間の転送命令、レジスタ・レジスタ間の演算命令などの命令コードは既存のものであるから、単独では従来同様に動作し、既存の命令実行を阻害することがない。また、既存の命令のみを使用していれば、既存のソフトウェア資産を有効に利用できる。   According to the above means, since the instruction codes such as the transfer instruction between the memory and the register and the operation instruction between the register and the register are the existing ones, the operation code alone works as before and obstructs the execution of the existing instructions. There is no. Also, if only existing instructions are used, existing software assets can be used effectively.

汎用レジスタ方式やロード・ストア・アーキテクチャなどの既存のCPUが持つメリットを損なうことなく、前記演算性能を拡張することができる。   The arithmetic performance can be expanded without losing the merits of existing CPUs such as general-purpose register system and load / store architecture.

前記前置命令コードは、アドレッシングモードや演算の内容によらず共通に使用できるから、追加する命令コードを最低限にすることができる。また、前置命令コードに、そのほかのデータサイズなどの情報を持たせることによって、全体的な命令コード長を短縮できる。   Since the prefix instruction code can be used in common regardless of the addressing mode and the content of the operation, the instruction code to be added can be minimized. Further, by providing the prefix instruction code with other information such as data size, the overall instruction code length can be shortened.

メモリからラッチ手段へのデータ読み込み、演算、ラッチ手段の内容に基づくメモリへのライトは既存の命令と、使用するレジスタが相違なるのみであるから、既存の命令動作を大きく変更することなく、利用できる。これによって、メモリ上のデータへの演算を可能にすることによる論理規模の増加を最小限にすることができる。   Data read from memory to latch means, operation, and write to memory based on the contents of latch means are different from existing instructions and used registers. it can. As a result, an increase in the logical scale due to the operation on the data on the memory can be minimized.

メモリ上のデータを直接的に演算可能とすることによって、直接処理できるデータ量を増加でき、また、汎用レジスタの退避/復帰などを省くことができ、処理速度を向上することができる。   By making the data in the memory directly operable, the amount of data that can be directly processed can be increased, saving / restoring of general-purpose registers can be omitted, and the processing speed can be improved.

メモリ上のデータと汎用レジスタ上のデータの演算を行い、結果を汎用レジスタ上に格納する命令の場合は、前置命令コードを含むため、メモリ・レジスタ転送命令コード、演算命令コードを個別に実行した場合の合計の処理時間より遅いが、汎用レジスタの退避や復帰を行なわないので、全体的な処理時間は向上することができる。また、メモリ上のデータと汎用レジスタ上のデータの演算を行い、結果をメモリ上に格納する命令の場合は、レジスタ・メモリ転送命令コードを内部で発生し、命令コードのリードを行なわないこと、前記別のラッチ手段(第2のラッチ手段)を利用して、リード時に計算したメモリアドレスを再利用可能とすること、によって、メモリ・レジスタ転送命令コード、演算命令コード、レジスタ・メモリ転送命令コードを個別に実行した場合の合計の処理時間よりも処理時間を短縮することができる。   In the case of an instruction that performs an operation on the data in the memory and the data in the general-purpose register and stores the result in the general-purpose register, since it includes a prefix instruction code, the memory register transfer instruction code and the operation instruction code are executed separately. However, since the general-purpose register is not saved or restored, the overall processing time can be improved. In addition, in the case of an instruction that performs an operation on the data on the memory and the data on the general-purpose register and stores the result in the memory, the register / memory transfer instruction code is generated internally and the instruction code is not read. By using the other latch means (second latch means), the memory address calculated at the time of reading can be reused, so that the memory register transfer instruction code, the operation instruction code, the register memory transfer instruction code The processing time can be shortened compared to the total processing time when the processes are executed individually.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUで、前記前置命令コードを付加し、存在する転送命令、演算命令を組合せることによって、下位互換性をもつ、アドレス空間の小さいCPUでもメモリ上のデータに対する直接的な演算を可能にできる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUでもメモリ上のデータを直接的に演算可能にできる。オブジェクトレベルで互換性を保つことによる利点とメモリ上のデータを直接的に演算可能にすることの利点の双方を享受することができる。   When there is a CPU with a wide address space and a CPU with a small address space while maintaining compatibility at the object level, the CPU has a wide address space, and the pre-instruction code is added to the existing transfer instruction and operation instruction. By combining these, even a CPU having a backward compatibility and a small address space can be directly operated on the data in the memory. In other words, by using the same method, while maintaining compatibility at the object level, a CPU having a wide address space and a CPU having a small address space can directly calculate data on the memory. It is possible to enjoy both the advantages of maintaining compatibility at the object level and the advantages of allowing the data on the memory to be directly operated.

既存の命令を組合せ、新規の命令機能を実現しているので、命令セットの更なる拡張や、更なる高速化に当たって、既存のCPUに対して新たなる課題を生じることが少ない。換言すれば、既存のCPUに対して、更なる命令セットの拡張や、更なる高速化を行なう技術が存在する(発明された)場合には、本発明を適用して、既存のCPUに対して命令セットを拡大したCPUに対しても、同様の技術を適用することができる。新規の命令機能を実現するために用いている、既存の命令のそれぞれに、前記技術を適用して、再度組合せればよい。前置命令コードは動作が単純であり、また、既存の命令に類似した動作とすることによって、変更は容易である。   Since a new instruction function is realized by combining existing instructions, new problems are rarely caused to the existing CPU when the instruction set is further expanded and further speeded up. In other words, if there is a technique for further expanding the instruction set or further speeding up (invented) for an existing CPU, the present invention is applied to the existing CPU. The same technique can be applied to a CPU whose instruction set is expanded. The technique may be applied to each of the existing instructions used for realizing the new instruction function and combined again. The prefix instruction code has a simple operation and can be easily changed by making the operation similar to an existing instruction.

また、既存の命令を組合せ、新規の命令機能を実現しているので、既存のCPUとエミュレーション用インタフェースを共通化することができ、ひいては、同じエミュレータのハードウェアを共通に利用できる。エミュレータのハードウェアを共通化することによって、早く開発環境を整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   Further, since the new instruction function is realized by combining the existing instructions, the existing CPU and the emulation interface can be shared, and the hardware of the same emulator can be used in common. By making the emulator hardware common, it is possible to quickly establish a development environment and minimize the resources required for emulator development.

《検討事項Cの解決手段》
前記検討課題Cに関する解決手段として、〔1〕レジスタ構成、又は命令とアドレッシングモードとの組合せ、或いは前記双方の点に関し、一方が他方を包含しないような異なる命令セットを含む複数のデータ処理装置例えば複数の下位CPUを想定する。このとき、一方が他方の命令セットを包含しない、複数の下位CPUに対して、何れの下位CPUをも包含する命令セットを持った上位のCPUを構成して提供する。
<< Solutions to Consideration C >>
As a means for solving the examination subject C, [1] a plurality of data processing devices including a register configuration, a combination of an instruction and an addressing mode, or a different instruction set in which one does not include the other regarding both points. Assume a plurality of lower CPUs. At this time, an upper CPU having an instruction set including any lower CPU is configured and provided to a plurality of lower CPUs, one of which does not include the other instruction set.

開発に当たっては、既存のCPU(前記下位CPUの一つ)に対して、汎用レジスタの構成を拡張し、また、命令とアドレッシングモードの組合せを拡張した、上位のCPUを開発する。前記下位CPUは前記上位CPUのサブセットの構成若しくは命令セットを持つことになる。前記汎用レジスタの拡張、命令とアドレッシングモードの組合せの拡張については後述する。   In development, an upper CPU is developed in which the configuration of general-purpose registers and the combination of instructions and addressing modes are expanded with respect to an existing CPU (one of the lower CPUs). The lower CPU has a subset configuration or instruction set of the upper CPU. The extension of the general-purpose register and the extension of the combination of the instruction and addressing mode will be described later.

更に、前記上位CPUの別のサブセットの態様を以って、下位CPUの他方を実現する。   Further, the other of the lower CPUs is realized in the form of another subset of the upper CPUs.

前記のように異なる命令セットを含む複数の下位CPUと、適宜適当な上位CPUとを提供することによって、応用分野のソフトウェア上の要求に応えたり、利用者の様々な好みに応えたり、更に別のCPUのアセンブリ言語によるプログラムからも、比較的近い命令セットのCPUを選択可能にでき、高位のCPUへの移行を容易にすることができる。   By providing a plurality of lower CPUs including different instruction sets as described above and appropriate upper CPUs as appropriate, the software requirements of application fields can be met, the user's various preferences can be met, Even from a CPU assembly language program, it is possible to select a CPU having a relatively close instruction set, and to facilitate the transition to a higher-level CPU.

前記の、一方が他方の命令セットを包含しない、複数の下位CPUに対して、いずれのCPUをも包含する命令セットを持った上位のCPUを準備することにより、ソフトウェア資産の有効利用を可能にしつつ、性能/機能の向上したCPUを用意することができる。ソフトウェア資産の有効利用によって、使用者のソフトウェア開発の開発効率を向上することができる。   By preparing an upper CPU having an instruction set including all CPUs for a plurality of lower CPUs, one of which does not include the other instruction set, it is possible to effectively use software assets. However, a CPU with improved performance / function can be prepared. Effective utilization of software assets can improve the development efficiency of software development for users.

開発に当たっては、既存の下位CPUに対して、汎用レジスタ乃至は、命令とアドレッシングモードの組合せを拡張した上位CPUを開発し、このサブセットを持つ別の下位のCPUを開発することによって、上位CPUの論理的規模の増大を最小限にしつつ、性能・機能・使い勝手などを向上することができると共に、前記別の下位CPUの開発を容易にし、開発効率を向上できる。前記上位のCPUの、更に上位のCPUを開発する場合には、前記上位のCPUに対する互換性を維持すれば、前記複数のCPUとの互換性を、自動的に維持することができるから、ソフトウェア資産の有効利用を実現しつつ、将来的な機能や性能の向上を図ったCPUを実現し易くなる。   In development, an upper CPU in which a combination of general-purpose registers or instructions and addressing modes is expanded with respect to an existing lower CPU, and another lower CPU having this subset is developed. While minimizing an increase in logical scale, it is possible to improve performance, function, usability, etc., and to facilitate the development of the other lower CPU, thereby improving development efficiency. When developing an upper CPU of the upper CPU, compatibility with the plurality of CPUs can be automatically maintained if compatibility with the upper CPU is maintained. It becomes easy to realize a CPU that improves future functions and performance while realizing effective use of assets.

下位CPUのために開発されたプログラムは、少なくとも、ソースプログラムのレベル(アセンブリ言語での記述レベル)で本発明に係る上位CPUに利用可能になる。なお、ここで下位CPUとは、そのレジスタ構成並びにその命令セットが本発明に係る上位CPUなどのCPUのレジスタ構成及び命令セットに包含されるようなCPUをいう。   The program developed for the lower CPU becomes available to the upper CPU according to the present invention at least at the level of the source program (description level in assembly language). Here, the lower CPU refers to a CPU whose register configuration and instruction set are included in the register configuration and instruction set of a CPU such as an upper CPU according to the present invention.

更に、オブジェクトプログラムレベルでの上位互換を実現するには、有効なアドレスのビット数と、ベクタ及びスタックの単位サイズとを、前記レジスタの利用形態に応じて切り替える動作モード、例えばマキシマムモードとミニマムモードを用意しておけばよい。ミニマムモードにおいてCPUは少なくとも一つの下位CPUと全く同様に動作する。マキシマムモードにおいてCPUはそれに備えられた最大限の機能を以って上位CPUとして動作される。   Furthermore, in order to realize upward compatibility at the object program level, an operation mode for switching the number of bits of the effective address and the unit size of the vector and the stack according to the use form of the register, for example, maximum mode and minimum mode. Should be prepared. In the minimum mode, the CPU operates in exactly the same way as at least one lower CPU. In the maximum mode, the CPU operates as an upper CPU with the maximum functions provided for it.

〔2〕汎用レジスタを拡張するためには、前記検討課題Aに関する手段で述べたように、レジスタを指定するレジスタ指定情報を、2つの部分に分割する。この2つの部分を命令コードの基本単位上の別々の基本単位に配置する。一方の命令コードを省略可能とし、省略可能な命令コードを省略すると、所定レジスタ指定情報を暗黙的に想定してレジスタ選択動作を行うようにする。   [2] In order to extend the general-purpose register, as described in the means for the examination subject A, the register designation information for designating the register is divided into two parts. These two parts are arranged in different basic units on the basic unit of the instruction code. If one instruction code is omissible and the omissible instruction code is omitted, the register selection operation is performed by implicitly assuming predetermined register designation information.

〔3〕命令とアドレッシングモードの組合せを拡張するためには、前記検討課題Bに関する手段で述べたように、既存の、メモリ・レジスタ間の転送命令やレジスタ・レジスタ間の演算命令の内、複数の命令コードを組合せ、例えばこれを結合させる前置命令コードを用いて、メモリのデータを直接的に用いた演算を可能にする。要するに、所定の前置命令コードが付加された場合、これに続く複数の命令コードを1つの命令として解釈し、実行する。   [3] In order to expand the combinations of instructions and addressing modes, as described in the means related to the examination subject B, a plurality of existing transfer instructions between memory and registers and arithmetic instructions between registers and registers are included. For example, by using a pre-instruction code for combining the instruction codes, for example, a combination of these instruction codes, an operation using the data in the memory directly is enabled. In short, when a predetermined prefix instruction code is added, a plurality of instruction codes following this are interpreted as one instruction and executed.

〔4〕アドレス空間が広く、論理的な規模を縮小したCPUを実現するには、アドレス空間全体に対応するビット長のプログラムカウンタを設けて、プログラム用としてはアドレス空間全体、少なくとも大部分をリニアに利用可能にするとともに、比較的小規模なデータを扱える程度に、データ転送のアドレッシングモードを縮小したり、転送データのデータサイズを限定して、データアクセス時に、使用できるアドレス空間を小さくし、かかるアドレス空間を2つに分割する。   [4] In order to realize a CPU with a wide address space and a reduced logical scale, a program counter having a bit length corresponding to the entire address space is provided, and for the program, the entire address space, at least most of which is linear In addition, the addressing mode of data transfer can be reduced to such an extent that relatively small data can be handled, or the data size of transfer data is limited to reduce the usable address space during data access. Such an address space is divided into two.

前記によれば、アドレス空間全体に対応するビット長のプログラムカウンタを設けて、プログラム用としてはアドレス空間全体、少なくとも大部分をリニアに利用可能にするとともに、比較的小規模なデータを扱える程度に、データ転送のアドレッシングモードを縮小したり、転送データのデータサイズを限定したりして、所望の応用分野などでの使い勝手を損なわずに、論理的規模を縮小できる。   According to the above, a program counter having a bit length corresponding to the entire address space is provided so that the entire address space, at least most, can be used linearly for programming, and relatively small data can be handled. By reducing the addressing mode of data transfer or limiting the data size of transfer data, the logical scale can be reduced without impairing usability in a desired application field.

データアクセス時に、使用できるアドレス空間を小さくし、かかるアドレス空間を2つに分割することによって、使い勝手を損なわずに、上位CPUとのアドレス空間上の互換性を維持するとともに、上位CPUに実効アドレス計算方法などを切り替える動作モードを予め用意しておくことにより、ソフトウェア上の互換性を維持することができる。   By reducing the address space that can be used during data access and dividing the address space into two, it maintains compatibility in the address space with the upper CPU without impairing usability, and the effective address is assigned to the upper CPU. Software compatibility can be maintained by preparing an operation mode for switching the calculation method and the like in advance.

プログラム用のアドレス空間を広げることにより、C言語などの高級言語を使用したプログラミングなどに対する適性を向上できる。また、スタックポインタを切替え可能にすることによって、OSなどのタスク管理時のスタックの容量の不所望の増加を抑止できる。内蔵のメモリなどのみを用いて動作するシングルチップマイクロコンピュータ乃至マイクロコンピュータシステムでも、高級言語やOSなどを容易に利用可能にし、使用者のソフトウェアの開発効率を向上することができる。   By expanding the address space for the program, suitability for programming using a high-level language such as C language can be improved. In addition, by making the stack pointer switchable, an undesired increase in the capacity of the stack during task management such as an OS can be suppressed. Even in a single-chip microcomputer or microcomputer system that operates using only a built-in memory or the like, a high-level language, an OS, or the like can be easily used, and the software development efficiency of the user can be improved.

〔5〕また、開発装置については、前記上位のCPUの命令セットについてのソフトウェア開発装置を用意し、更に、一方が他方の命令セットを包含しない、複数のCPUに対しても共通に利用可能にし、利用者がCPUを選択できるようにする。   [5] As for the development device, a software development device for the instruction set of the upper CPU is prepared, and it can be used in common for a plurality of CPUs, one of which does not include the other instruction set. The user can select the CPU.

ソフトウェア開発装置上で、アセンブリ言語などの、汎用的な機能を持つ汎用レジスタの記述を、複数種類許すようにする。   On the software development device, multiple types of general-purpose registers such as assembly language having general-purpose functions are allowed.

エミュレータについては、搭載するエミュレーション用プロセッサのエミュレーション用インタフェースを共通化する。CPUの解析を行なうために、エミュレータ上で、対象のCPUを選択する手段を設ける。特に、逆アセンブラの対象CPUを選択可能にする。   As for the emulator, the emulation interface of the mounted emulation processor is made common. In order to analyze the CPU, means for selecting the target CPU is provided on the emulator. In particular, the target CPU of the disassembler can be selected.

前記上位CPUの命令セットについてのソフトウェア開発装置を用意し、更に、一方が他方の命令セットを包含しない、複数のCPUに対しても共通に利用可能にし、利用者がCPUを選択できるようにすることによって、ソフトウェア開発装置の開発効率を向上することができる。使用者にとっては、前記、複数のCPUを使用してもソフトウェア開発装置が共通であるから、不所望な費用を発生させなくてよい。前記、複数のCPUの内の一つのCPUから、別のCPUへの移行が容易になり、開発効率を向上することができる。   A software development apparatus for the instruction set of the upper CPU is prepared. Further, the software development apparatus can be commonly used for a plurality of CPUs, one of which does not include the other instruction set, and the user can select the CPU. As a result, the development efficiency of the software development apparatus can be improved. For the user, even if a plurality of CPUs are used, since the software development apparatus is common, it is not necessary to generate undesired costs. The transition from one CPU of the plurality of CPUs to another CPU is facilitated, and the development efficiency can be improved.

また、上位CPUと下位CPUとエミュレーション用インタフェースを共通化することができ、また、上位CPUのエミュレーション用論理回路を開発することによって、これを下位CPUにも利用でき、エミュレーション用プロセッサを含めた開発効率を向上できる。また、同じエミュレータのハードウェアを共通でき、これによって、逸早く開発環境を整えることができるとともに、また、エミュレータの開発に必要な資源を最小限にすることができる。エミュレータに搭載する逆アセンブラは、上位CPUのものを開発するとともに、エミュレータ上で対象のCPUを選択する手段を設けることによって、実質的に一つの逆アセンブラでよいことになるから、開発効率を更に向上できる。   In addition, the emulation interface can be shared with the upper CPU and lower CPU, and by developing the logic circuit for emulation of the upper CPU, it can be used for the lower CPU, and development including the emulation processor Efficiency can be improved. In addition, the hardware of the same emulator can be shared, so that the development environment can be quickly established and the resources required for emulator development can be minimized. As the disassembler installed in the emulator is developed for the host CPU and means for selecting the target CPU on the emulator is provided, one disassembler can be practically used. It can be improved.

〔6〕検討課題Cに関して以上に述べた手段を、互換性、エミュレーション用プロセッサ、エミュレータ、ソフトウェア開発装置、上位CPUのようなデータ処理装置、下位CPUのようなデータ処理装置の観点より整理することができる。   [6] Organize the means described above with respect to the examination subject C from the viewpoint of compatibility, a processor for emulation, an emulator, a software development device, a data processing device such as a higher CPU, and a data processing device such as a lower CPU. Can do.

〔6−1〕互換性の観点のデータ処理装置は、命令を所定の手順にしたがって実行するものであって、第1の別のデータ処理装置の命令実行機能を包含することによって当該第1の別のマイクロコンピュータの命令コードと同一の命令コードを実行可能であり、第2の別のデータ処理装置の命令実行機能を包含することによって当該第2の別のデータ処理装置の命令コードと同一の命令コードを実行可能である。そして、前記第1の別のデータ処理装置の命令実行機能に包含されず、前記第2の別のデータ処理装置の命令実行機能に包含されるところの、オペランド指定とオペレーション指定との双方又は何れか一方に関し、複数の前記指定を組み合わせた命令と、前記第2の別のデータ処理装置の命令実行機能に包含されず、前記第1の別のデータ処理装置の命令実行機能に包含されるところの、オペランド指定とオペレーション指定との双方又は何れか一方に関し、複数の前記指定を組み合わせた命令と、を実行する命令実行手段を含む。   [6-1] The data processing apparatus in terms of compatibility executes instructions according to a predetermined procedure, and includes the instruction execution function of the first other data processing apparatus, thereby including the first It is possible to execute the same instruction code as the instruction code of another microcomputer, and the same instruction code as the second other data processing apparatus by including the instruction execution function of the second other data processing apparatus The instruction code can be executed. And either or both of the operand designation and the operation designation that are not included in the instruction execution function of the first other data processing apparatus but are included in the instruction execution function of the second other data processing apparatus. On the other hand, it is not included in the instruction execution function of the first other data processing apparatus, but included in the instruction execution function of the first other data processing apparatus, and not included in the instruction execution function of the second other data processing apparatus. Instruction execution means for executing a plurality of instructions combining the above-mentioned designations with respect to either or both of the operand designation and the operation designation.

前記オペランド指定は、例えば、実効アドレスの演算、汎用レジスタ、又はアドレス空間に関する指定である。   The operand designation is, for example, designation relating to an effective address calculation, a general-purpose register, or an address space.

前記データ処理装置が、有効なアドレスのビット数とベクタ及びスタックの単位サイズとが相違される第1動作モードと第2の動作モードとを切替え可能に有するなら、前記第1の動作モードにおける有効なアドレスのビット数と、ベクタ及びスタックの単位サイズは、前記第1の別のデータ処理装置と同等である。前記第2の動作モードにおける有効なアドレスのビット数と、ベクタ及びスタックの単位サイズは、前記第2の別のデータ処理装置と同等である。   If the data processing device can switch between the first operation mode and the second operation mode in which the number of bits of the effective address and the unit size of the vector and the stack are different, the effective in the first operation mode The number of bits of the correct address and the unit size of the vector and stack are the same as those of the first other data processing apparatus. The number of valid address bits and the unit size of the vector and stack in the second operation mode are the same as those of the second other data processing apparatus.

互換性に着目した更に別の観点のデータ処理装置は、命令を所定の手順にしたがって実行するデータ処理装置であって、データ情報の保持には全体又は2分割した領域を利用可能であり、且つ、2分割された下位側のビット数よりも多いビット数を以ってアドレス情報の保持にも利用可能な汎用レジスタを複数有する。命令実行手段は、前記2分割した下位側のビット数に相当する汎用レジスタを、所定の複数有する第1の別のデータ処理装置の命令のコードと同一ビット数の命令のコードを実行可能なように当該第1の別のデータ処理装置の命令実行機能を包含した上で、前記2分割可能な汎用レジスタの全体を利用する命令を実行し、また、前記2分割可能な汎用レジスタを前記所定の複数よりも少ない数だけ有する第2の別のデータ処理装置の命令のコードと同一ビット数の命令コードを実行可能なように当該第2の別のデータ処理装置の命令実行機能を包含する。   A data processing device according to still another aspect focusing on compatibility is a data processing device that executes instructions according to a predetermined procedure, and the entire or two-divided area can be used for holding data information, and A plurality of general-purpose registers that can be used for holding address information with a number of bits larger than the number of lower-order bits divided into two. The instruction execution means can execute an instruction code having the same number of bits as the instruction code of the first different data processing apparatus having a predetermined plurality of general-purpose registers corresponding to the number of lower bits divided into two. Including the instruction execution function of the first other data processing apparatus, executing an instruction that uses the entire general register that can be divided into two, The instruction execution function of the second other data processing apparatus is included so that an instruction code having the same number of bits as the code of the instruction of the second other data processing apparatus having a smaller number than the plurality can be executed.

互換性に着目したデータ処理装置の開発方法の観点によると、第1のデータ処理装置における未定義の命令のコードを前置命令コードとし、前記前置命令コードは、これに続く、第1のデータ処理装置の命令コードの定義を変更して、第1のデータ処理装置では定義されていない、オペランド指定とオペレーション指定との双方又は何れか一方に関し、複数の前記指定を組合せた命令を定義することにより、前記第1のデータ処理装置の命令を包含する命令を有する第2のデータ処理装置の命令を実現する。前記第2のデータ処理装置の命令の一部によって第3のデータ処理装置の命令を実現する。   According to the viewpoint of the development method of the data processing device focusing on the compatibility, the code of the undefined instruction in the first data processing device is used as the prefix instruction code, and the prefix instruction code is the first By changing the definition of the instruction code of the data processing apparatus, an instruction combining a plurality of the above specifications is defined with respect to operand specification and / or operation specification that are not defined in the first data processing apparatus. Thus, the second data processing apparatus instruction having the instruction including the instruction of the first data processing apparatus is realized. The instruction of the third data processing apparatus is realized by a part of the instruction of the second data processing apparatus.

前記前置命令コードは、例えば、これに続く命令コードによって指定される汎用レジスタの指定を変更可能にするものである。また、別の前置命令コードは、これに続く転送命令コードと、別の転送命令のコードまたは演算命令のコードの内の2つ以上の命令コードによって、メモリ上のデータの操作を定義するものである。   The prefix instruction code, for example, makes it possible to change the designation of the general-purpose register designated by the instruction code that follows. Another prefix instruction code defines an operation of data on the memory by a transfer instruction code following this and two or more instruction codes of another transfer instruction code or an operation instruction code. It is.

〔6−2〕エミュレーション用プロセッサの観点によると、前記互換性の観点で説明したデータ処理装置と、エミュレーションインタフェースとを含み、前記データ処理装置の命令実行によって、前記第1、第2の別のデータ処理装置の命令実行を代行可能なようにエミュレーション用プロセッサを構成する。   [6-2] According to the viewpoint of the processor for emulation, the data processor described in terms of the compatibility and the emulation interface are included, and the first and second different ones are executed by executing instructions of the data processor. An emulation processor is configured so that the instruction execution of the data processing apparatus can be performed.

〔6−3〕エミュレータの観点によると、前記エミュレーション用プロセッサを搭載し、ユーザプログラムを実行するエミュレーション用プロセッサにその内部状態を制御させる為の制御プログラムを格納可能なエミュレーションプログラム領域と、エミュレーションプログラム領域に前記制御プログラムを格納するコントロールプロセッサとを含んでエミュレータを構成する。   [6-3] From the viewpoint of the emulator, an emulation program area in which the emulation processor is mounted and a control program for controlling the internal state of the emulation processor for executing the user program can be stored; And the control processor for storing the control program.

エミュレーション用プロセッサは、前記制御プログラムに従った内部の設定状態に応じて前記第1、第2の別のデータ処理装置の命令実行を代行させることが可能である。   The emulation processor can execute the instruction execution of the first and second other data processing devices in accordance with the internal setting state according to the control program.

〔6−4〕ソフトウェア開発装置(クロスソフトウェア)の観点によると、生成すべきプログラムの対象となるデータ処理装置を選択する手段を設け、前記前記互換性の観点で説明したデータ処理装置、第1の別のデータ処理装置又は第2の別のデータ処理装置のプログラムを生成可能にソフトウェア開発装置を構成する。   [6-4] According to the viewpoint of the software development apparatus (cross software), there is provided means for selecting a data processing apparatus that is a target of the program to be generated, and the data processing apparatus described in the above-mentioned compatibility viewpoint, The software development apparatus is configured to be able to generate a program for the other data processing apparatus or the second another data processing apparatus.

〔6−5〕上位CPUの観点によると、データ処理装置は、データまたはアドレスを格納可能なレジスタを複数個備え、命令コードを読み込んで制御手段で解読して動作する。前記命令コードは基本単位から構成され、前記レジスタを指定するレジスタ指定情報は複数の命令コード基本単位に分割して保持させることが可能にされる。メモリとレジスタ間のデータ転送を行なう転送命令コードと、レジスタ上のデータに対して演算を行なう演算命令コードとを命令セットに含む。前記制御手段は、前記命令コードが保有する前記レジスタ指定情報の解読結果に基づいてレジスタを選択し、分割された一方のレジスタ指定情報を持つ前置命令コードが省略された場合には、省略されたレジスタ指定情報に代わって所定のレジスタ指定情報を暗黙的に想定してレジスタを選択し、また、前置命令コードと、前記転送命令コードと、前記演算命令コードとを、順次読み込んで、一つの命令として解釈し、メモリ上のデータに対する直接的な演算を実行させる。   [6-5] From the viewpoint of the host CPU, the data processing apparatus includes a plurality of registers capable of storing data or addresses, and operates by reading the instruction code and decoding it by the control means. The instruction code is composed of basic units, and register designation information for designating the registers can be divided and held in a plurality of instruction code basic units. The instruction set includes a transfer instruction code for performing data transfer between the memory and the register and an operation instruction code for performing an operation on the data on the register. The control means selects a register based on a decoding result of the register designation information held by the instruction code, and is omitted when a front instruction code having one divided register designation information is omitted. A register is selected by implicitly assuming predetermined register designation information instead of the designated register designation information, and the prefix instruction code, the transfer instruction code, and the operation instruction code are sequentially read and It is interpreted as one instruction, and direct operation is performed on the data in the memory.

前記メモリ上のデータに対する直接的な演算とは、例えば、前記命令コードには明示されないデータラッチ手段へメモリからデータをロードし、当該データラッチ手段にロードしたデータを用いて行なう演算処理である。   The direct operation on the data in the memory is, for example, an operation process in which data is loaded from the memory into data latch means not explicitly shown in the instruction code and is performed using the data loaded into the data latch means.

また、上位CPUの別の観点によるデータ処理装置は、データまたはアドレスを格納可能なレジスタを複数個備え、命令コードを読み込んで制御手段で解読して動作する。前記命令コードは基本単位から構成され、前記レジスタを指定するレジスタ指定情報は複数の命令コード基本単位に分割して保持させることが可能にされる。メモリとレジスタ間のデータ転送を行なう転送命令コードを命令セットに含む。前記制御手段は、前記命令コードが保有する前記レジスタ指定情報の解読結果に基づいてレジスタを選択し、分割された一方のレジスタ指定情報を持つ前置命令コードが省略された場合には、省略されたレジスタ指定情報に代わって所定のレジスタ指定情報を暗黙的に想定してレジスタを選択し、また、前置命令コードと、前記転送命令コードと、別の転送命令コードとを、順次読み込んで、一つの命令として解釈し、メモリとの間の直接的なデータ転送を実行させる。   A data processing device according to another aspect of the host CPU includes a plurality of registers capable of storing data or addresses, and operates by reading an instruction code and decoding it by a control means. The instruction code is composed of basic units, and register designation information for designating the registers can be divided and held in a plurality of instruction code basic units. A transfer instruction code for transferring data between the memory and the register is included in the instruction set. The control means selects a register based on a decoding result of the register designation information held by the instruction code, and is omitted when a front instruction code having one divided register designation information is omitted. Instead of register specification information, a register is selected by implicitly assuming predetermined register specification information, and a prefix instruction code, the transfer instruction code, and another transfer instruction code are read sequentially, Interpret as a single instruction, and perform direct data transfer to and from memory.

前記メモリとの間の直接的なデータ転送とは、例えば、前記命令コードには明示されないデータラッチ手段へメモリからデータをロードし、当該データラッチ手段のデータを前記メモリにストアする処理である。   The direct data transfer to and from the memory is, for example, a process of loading data from the memory into data latch means not specified in the instruction code and storing the data in the data latch means in the memory.

〔6−6〕下位CPUの観点によるデータ処理装置は、アドレス空間のビット数に相応するビット数のプログラムカウント手段と、データ情報の保持には全体又は2分割した領域を利用可能であり、且つ、2分割された前記一方のビット数よりも多いビット数を以ってアドレス情報の保持にも利用可能な複数の汎用レジスタと、命令実行手段とを有する。前記命令実行手段は、データ情報の保持に前記汎用レジスタの全体を利用する命令と、前記汎用レジスタと別の記憶装置との間のデータ転送命令とを実行可能であって、前記データ転送命令の転送データのビット数を、前記汎用レジスタの2分割した前記一方のビット数以下とすることが可能であり、また、アドレス空間上のデータを指定するためのアドレッシングモードの一部をアドレス空間上で複数に分離された部分で有効とする。   [6-6] The data processing apparatus from the viewpoint of the lower CPU can use the program count means having the number of bits corresponding to the number of bits in the address space, and the whole or two divided areas can be used to hold the data information. A plurality of general-purpose registers that can be used for holding address information with a number of bits larger than the number of bits divided into two, and an instruction execution unit; The instruction execution means can execute an instruction that uses the entire general-purpose register to hold data information and a data transfer instruction between the general-purpose register and another storage device. The number of bits of transfer data can be made equal to or less than the number of bits divided into two of the general-purpose register, and a part of the addressing mode for designating data on the address space can be set on the address space. It is effective in a part separated into multiple parts.

前記アドレス空間上で複数に分離された一方の部分には、命令実行の開始アドレスを指定するベクタを含め、他方の部分には、リード・ライト可能な別の記憶装置のアドレスをマッピング可能である。   One part separated into a plurality of parts in the address space can include a vector for designating an instruction execution start address, and the other part can be mapped to an address of another storage device that can be read / written. .

《検討課題Dの解決手段》
前記検討課題Dに関する解決手段として、メモリ上のデータのビットの状態に応じた分岐を行なう命令を、動作を規定するフィールド(オペレーションフィールド)を複数に分割し、これを命令コードの基本単位上の別のワードで実現し、かかるワードを、独立して使用可能な別の命令の命令コード、乃至、別の命令の命令コードの一部と共通にする。かかる命令コードの第1のワードは、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段とメモリの間でデータ転送を行なう。第2のワードは、前記ラッチ手段の所望のビットの状態を判定して分岐を行なう。上記テンポラリレジスタの様なラッチ手段には、指定されたビットの状態を判定する手段を設け、ALUなどに読み出したりすることなく、所定のビットの状態を判定できるようにする。上記命令コードの第1のワードは、コンディションコードなどの変化を禁止し、また、その終了時点で割込み例外処理を禁止するようにする。
<< Solution to Study Problem D >>
As a means for solving the examination problem D, an instruction for branching according to a bit state of data on a memory is divided into a plurality of fields (operation fields) for defining an operation, which are divided into basic units of an instruction code. It is realized by another word, and the word is made common to an instruction code of another instruction that can be used independently or a part of an instruction code of another instruction. The first word of the instruction code performs data transfer between the latch means which is not released in the program, such as a temporary register, and the memory. The second word branches by determining the state of the desired bit of the latch means. The latch means such as the temporary register is provided with means for determining the state of a designated bit so that the state of a predetermined bit can be determined without reading it to an ALU or the like. The first word of the instruction code prohibits the change of the condition code or the like, and prohibits the interrupt exception processing at the end time.

第1の例は、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段とメモリの間でデータ転送を行なう転送命令コード(第1のワード)と、条件分岐命令コード(第2のワード)を組合せて、上記転送命令コードに続いて、上記条件分岐命令を実行する場合には、条件を、コンディションコードに代えて、ビット番号と当該ビットの状態とするようにし、メモリ上のデータのビットの状態に応じた分岐を可能にする。更に、上記転送命令コードは、ビットテスト命令などの一部と共通化するとよい。   The first example is a transfer instruction code (first word) for transferring data between a latch means that is not released in the program, such as a temporary register, and a memory, and a conditional branch instruction code (second word). When the conditional branch instruction is executed following the transfer instruction code, the condition is set to the bit number and the state of the bit instead of the condition code, and the bit of the data on the memory Allows branching according to the state of Furthermore, the transfer instruction code may be shared with a part of a bit test instruction or the like.

第1の例の別の観点では、ビットテスト命令などの命令コードと共通の、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段とメモリの間でデータ転送を行なう転送命令コードと、条件分岐命令の命令コードを組合せて、アドレス空間上のデータの所定のビットの状態を判定して分岐する分岐命令を実現する。   In another aspect of the first example, a transfer instruction code for transferring data between a latch means not released in the program and a memory, such as a temporary register, common to an instruction code such as a bit test instruction, and a condition A branch instruction that branches by determining the state of a predetermined bit of data in the address space is realized by combining instruction codes of branch instructions.

第2の例は、既存の、メモリ−レジスタ間の転送を行なう命令コード、条件分岐命令を組合せ、これを結合させる前置命令コードを持って、メモリ上のデータのビットの状態に応じた分岐を可能にする。即ち、前記前置命令コードに続いて、メモリ−レジスタ間命令を実行する場合は、汎用レジスタではなく、CPU内の、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段とメモリの間でデータ転送を行なう。   The second example is a combination of an existing instruction code for transferring between a memory and a register, a conditional branch instruction, and a pre-instruction code for combining them, and branching according to the state of the bit of data on the memory. Enable. That is, when a memory-register instruction is executed following the pre-instruction code, it is not a general-purpose register, but between a latch means such as a temporary register in the CPU that is not released in the program and the memory. Perform data transfer.

上記第2の例は、未だ公知でない本発明者の先願に記載されている、ソースをメモリ上のデータとした命令の実現方法と、共通化し、演算命令コードを、分岐命令コードに置き換えることによって、実現することができる。   The second example described above is common with the method of realizing an instruction using the data in the memory as described in the prior application of the present inventor, which is not yet known, and replaces the operation instruction code with a branch instruction code. Can be realized.

詳細には、メモリ上のデータと汎用レジスタ上のデータの演算を行い、結果を汎用レジスタ上に格納する命令の場合には、前置命令コード、メモリ−レジスタ転送命令コード、演算命令コードを実行し、メモリ−レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、演算命令コードは、前記ラッチ手段に格納したデータと汎用レジスタ上のデータとの演算を行い、結果を汎用レジスタに格納する。   Specifically, in the case of an instruction that performs an operation on the data in the memory and the data on the general-purpose register and stores the result in the general-purpose register, the prefix instruction code, the memory-register transfer instruction code, and the operation instruction code are executed. When the memory-register transfer instruction code is executed, the transfer data is stored in the latch means instead of the general-purpose register, and the operation instruction code performs an operation between the data stored in the latch means and the data on the general-purpose register, Store the result in a general-purpose register.

汎用レジスタ上のデータとメモリ上のデータの演算を行い、結果をメモリ上に格納する命令の場合には、前置命令コード、メモリ−レジスタ転送命令コード、演算命令コード、及び内部で生成したメモリ−レジスタ転送命令コードを実行し、メモリ−レジスタ転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納する。演算命令コードは、前記ラッチ手段に格納したデータと汎用レジスタ上のデータとの演算を行い、演算結果をラッチ手段に格納する。メモリ−レジスタ転送命令コードは、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。インクリメントなどのように、1つのメモリ上のデータに対する演算を行なう場合もこれと同様にする。また、メモリ−レジスタ転送命令コード実行時には、フラグの変化を抑止し、演算結果のフラグの変化を保持する。   In the case of an instruction that performs an operation on data in a general-purpose register and data in a memory and stores the result in the memory, a prefix instruction code, a memory-register transfer instruction code, an operation instruction code, and an internally generated memory The register transfer instruction code is executed, and when the memory-register transfer instruction code is executed, the transfer data is stored in the latch means instead of the general-purpose register. The operation instruction code performs an operation on the data stored in the latch means and the data on the general-purpose register, and stores the operation result in the latch means. The memory-register transfer instruction code writes to the memory using the contents of the latch means storing the address as an address and the contents of the latch means storing the operation result as data. This is the same when an operation is performed on data in one memory, such as increment. Further, when the memory-register transfer instruction code is executed, the change of the flag is suppressed and the change of the flag of the operation result is held.

2つのメモリ上のデータの演算を行い、結果をメモリ上に格納する命令の場合には、前置命令コード、第1、第2のメモリ・レジスタ間転送命令コード、演算命令コード、及び内部で生成したメモリ・レジスタ間転送命令コードを実行し、第1、第2のメモリ・レジスタ間転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納する。演算命令コードは、前記ラッチ手段に格納したデータの演算を行い、結果をラッチ手段に格納する。メモリ・レジスタ間転送命令コードは、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   In the case of an instruction that performs an operation on data in two memories and stores the result in the memory, a prefix instruction code, first and second memory / register transfer instruction code, an operation instruction code, and an internal The generated memory / register transfer instruction code is executed, and when the first and second memory / register transfer instruction codes are executed, the transfer data is stored in the latch means instead of the general-purpose register. The operation instruction code calculates the data stored in the latch means and stores the result in the latch means. The memory / register transfer instruction code writes to the memory using the contents of the latch means storing the address as an address and the contents of the latch means storing the operation result as data.

一方、メモリ上のデータを、別のメモリに転送する命令の場合には、前置命令コード、メモリ・レジスタ間転送命令コード、メモリ・レジスタ間転送命令コードを実行し、メモリ・レジスタ間転送命令コードの実行時には、汎用レジスタではなく、転送データをラッチ手段に格納し、メモリ・レジスタ間転送命令コードは、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   On the other hand, in the case of an instruction that transfers data in the memory to another memory, the pre-instruction code, the memory / register transfer instruction code, and the memory / register transfer instruction code are executed, and the memory / register transfer instruction is executed. When the code is executed, the transfer data is stored in the latch means instead of the general-purpose register, and the memory / register transfer instruction code writes the contents of the latch means storing the calculation result to the memory as data.

イミディエイトデータとメモリ上のデータとの演算の場合は、概略汎用レジスタ上のデータとメモリ上のデータの演算を行い、結果をメモリ上に格納する命令と同様にできる。   In the case of the calculation of immediate data and data on the memory, the calculation can be performed in the same manner as an instruction for performing calculation on data on the general-purpose register and data on the memory and storing the result in the memory.

イミディエイトデータを、メモリに転送する命令の場合には、前置命令コード、イミディエイト・レジスタ間転送命令コード、メモリ・レジスタ間転送命令コードを実行し、イミディエイト・レジスタ間転送命令コードの実行時には、汎用レジスタではなく、イミディエイトデータをラッチ手段に格納し、メモリ・レジスタ間転送命令コードは、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   In the case of an instruction that transfers immediate data to the memory, the prefix instruction code, the immediate register-to-register transfer instruction code, and the memory-to-register transfer instruction code are executed. Immediate data, not a register, is stored in the latch means, and the memory / register transfer instruction code writes data to the memory using the contents of the latch means storing the operation result as data.

上記した手段によれば、第1のワード、第2のワード(条件分岐命令)などの命令コードは既存のものであるから、単独では従来同様に動作し、既存の命令実行を阻害することがない。また、既存の命令のみを使用していれば、既存のソフトウェア資産を有効に利用できる。汎用レジスタやロードストアアーキテクチャなどの既存のCPUのメリットを損なうことがない。第1のワード、第2のワード(条件分岐命令)に、それぞれ、絶対アドレスのビット長、ディスプレースメントのビット長などに複数の種類があれば、同じ方法によって、これらを組合せることができる。これらの組合せを可能にすることによって、プログラム上の制約をなくし、使い勝手を向上することができる。また、同じ方法によって、サブルーチン分岐命令と組合せることが可能となり、使い勝手を向上することができる。   According to the above-mentioned means, since the instruction codes such as the first word and the second word (conditional branch instruction) are already existing, they can operate in the same manner as before and inhibit the execution of existing instructions. Absent. Also, if only existing instructions are used, existing software assets can be used effectively. The advantages of existing CPUs such as general-purpose registers and load / store architecture are not impaired. If the first word and the second word (conditional branch instruction) have a plurality of types in the bit length of the absolute address, the bit length of the displacement, etc., these can be combined by the same method. By making these combinations possible, program restrictions can be eliminated and usability can be improved. Moreover, it becomes possible to combine with a subroutine branch instruction by the same method, and usability can be improved.

テンポラリレジスタの様なラッチ手段には、指定されたビットの状態を判定する手段を設け、ALUなどに読み出したりすることなく、所定のビットの状態を判定できるようにすることにより、条件分岐命令の全体的な動作を変更することなく、実現できるから、変更する部分を小さくし、また論理的規模の増加を最小限にすることができる。   A latch means such as a temporary register is provided with means for judging the state of a designated bit, and by making it possible to judge the state of a predetermined bit without reading it to an ALU or the like, the conditional branch instruction Since it can be realized without changing the overall operation, the portion to be changed can be reduced, and the increase in logical scale can be minimized.

前記前置命令コードは、アドレッシングモードや演算の内容によらず共通に使用できるから、追加する命令コードを最低限にすることができる。また、前置命令コードに、そのほかのデータサイズなどの情報を持たせることによって、全体的な命令コード長を短縮できる。   Since the prefix instruction code can be used in common regardless of the addressing mode and the content of the operation, the instruction code to be added can be minimized. Further, by providing the prefix instruction code with other information such as data size, the overall instruction code length can be shortened.

メモリからラッチ手段へのデータ読み込み、演算、ラッチ手段の内容に基づくメモリへのライトは既存の命令と、使用するレジスタが相違なるのみであるから、既存の命令動作を大きく変更することなく、利用できる。これによって、メモリ上のデータへの演算を可能にすることによる論理規模の増加を最小限にすることができる。   Data read from memory to latch means, operation, and write to memory based on the contents of latch means are different from existing instructions and used registers. it can. As a result, an increase in the logical scale due to the operation on the data on the memory can be minimized.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUで、前記命令を実現することで、下位互換性をもつ、アドレス空間の小さいCPUでもメモリ上のデータの演算を可能にできる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUでもメモリ上のデータの演算を可能にできる。オブジェクトレベルで互換性を保つことによる利点とメモリ上のデータの演算を可能にすることの利点の双方を享受することができる。   When there is a CPU having a wide address space and a CPU having a small address space while maintaining compatibility at the object level, the address space having a backward compatibility is realized by realizing the instruction with a CPU having a wide address space. Even with a small CPU, data on the memory can be calculated. In other words, by using the same method, it is possible to calculate data on the memory even with a CPU having a wide address space and a CPU having a small address space while maintaining compatibility at the object level. It is possible to enjoy both the advantages of maintaining compatibility at the object level and the advantages of enabling computation of data on the memory.

既存の命令を組合せ、新規の命令機能を実現しているので、命令セットの更なる拡張や、更なる高速化に当たって、既存のCPUに対して新たなる課題を生じることが少ない。換言すれば、既存のCPUに対して、更なる命令セットの拡張や、更なる高速化を行なう技術が存在し、若しくは新たに開発された場合には、本発明を適用して、既存のCPUに対して命令セットを拡大したCPUに対しても、同様の技術を適用することができる。新規の命令機能を実現するために用いている、既存の命令のそれぞれに、前記技術を適用して、再度組合せればよい。前置命令コードは動作が単純であり、また、既存の命令に類似した動作とすることによって、変更は容易である。   Since a new instruction function is realized by combining existing instructions, new problems are rarely caused to the existing CPU when the instruction set is further expanded and further speeded up. In other words, if there is a technique for further expanding the instruction set and further speeding up the existing CPU or newly developed, the present invention is applied to the existing CPU. However, the same technique can be applied to a CPU whose instruction set is expanded. The technique may be applied to each of the existing instructions used for realizing the new instruction function and combined again. The prefix instruction code has a simple operation and can be easily changed by making the operation similar to an existing instruction.

また、既存の命令を組合せ、新規の命令機能を実現しているので、既存のCPUとエミュレーション用インタフェースを共通化することができ、ひいては、同じエミュレータのハードウェアを共通できる。エミュレータのハードウェアを共通化することによって、逸早く開発環境を整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   In addition, since the new instruction function is realized by combining the existing instructions, the existing CPU and the emulation interface can be shared, and the hardware of the same emulator can be shared. By making the emulator hardware common, the development environment can be quickly established, and the resources required for emulator development can be minimized.

前述の検討課題B及びDを、まとめれば、前置コードとデータを読み込む転送命令コードと、処理を指定する命令コード(転送命令コード:メモリ間転送の場合、演算命令コード:メモリ間演算の場合、分岐命令コード:ビット条件分岐命令)を組合せて、新規の命令コードを定義するものである。既に、前置コードとデータを読み込む転送命令コードを組合せた命令コード(メモリからテンポラリレジスタなどへのリード、と制御信号の発生)を有する場合は、これと処理を指定する命令コードを組合せて、新規の命令コードを定義するものである。   To summarize the above-mentioned examination subjects B and D, a transfer instruction code for reading a prefix code and data, and an instruction code for specifying processing (transfer instruction code: in case of transfer between memories, operation instruction code: in case of calculation between memories) , Branch instruction code: bit condition branch instruction) to define a new instruction code. If you already have an instruction code (read from memory to a temporary register and generation of a control signal) that combines a prefix code and a transfer instruction code that reads data, combine this with an instruction code that specifies processing, It defines a new instruction code.

《検討課題Eの解決手段》
前記検討課題Eに関する解決手段として、〔1〕データ処理装置は、命令を実行する実行手段を制御する制御手段に対して指定可能な複数の汎用レジスタの組み合わせを固定にし、当該組み合わせが固定の複数の汎用レジスタとアドレス空間上のアドレスとの間でデータ転送を行う為の転送命令を命令セットに含んでいる。これによって、汎用レジスタのビット長より大きいデータであっても、容易に扱うことができ、使い勝手を向上するとともに、データのリード/ライトに対して、命令のリードの頻度を低減して、データ処理の高速化を図ることができる。
<< Solutions for Study Problem E >>
As a means for solving the examination subject E, [1] the data processing device fixes a combination of a plurality of general-purpose registers that can be specified to a control unit that controls an execution unit that executes an instruction, and the combination is fixed The instruction set includes a transfer instruction for transferring data between the general-purpose register and the address in the address space. As a result, even data larger than the bit length of a general-purpose register can be handled easily, improving usability, and reducing the frequency of instruction reads for data read / write, and data processing Can be speeded up.

アドレス演算器による上記転送命令の実効アドレスの計算は1回だけとし、アドレスバッファにインクリメントまたはデクリメント機能とインクリメント結果を保持する機能を持たせることにより、命令動作を単純にし、既存の転送命令の制御と共通化を図ることができ、命令デコーダ等の論理的な規模の増加を最小限にすることができる。また、種々のアドレッシングモードに共通に、利用することができる。   The effective address of the above transfer instruction is calculated only once by the address calculator, and the address buffer has an increment or decrement function and a function to hold the increment result, thereby simplifying the instruction operation and controlling the existing transfer instruction. And an increase in the logical scale of an instruction decoder or the like can be minimized. Further, it can be used in common for various addressing modes.

〔2〕汎用レジスタが分割可能で、かつ分割した部分に機能上の相違がある場合などには、汎用レジスタ全体を使用する転送命令と、分割された一部分を使用する転送命令とを備えるとよい。これにより、データ処理上、使用し易い汎用レジスタとの転送ができるから、その処理を容易にし、高速化することができる。   [2] When the general-purpose register can be divided and there is a functional difference between the divided parts, a transfer instruction that uses the entire general-purpose register and a transfer instruction that uses the divided part may be provided. . As a result, data can be transferred to a general-purpose register that is easy to use in data processing, so that processing can be facilitated and speeded up.

〔3〕汎用レジスタに対する演算命令などの実行ステート数などが、汎用レジスタ毎に相違する場合などには、所定の組合せの複数の汎用レジスタと、別の複数の汎用レジスタとの転送命令を備えるとよい。このとき、汎用レジスタを増加し、汎用レジスタを指定するレジスタ指定フィールドを、2つの部分に分割し、この2つの部分を命令コードの基本単位上の別のワードに配置するとともに、一方のワードを省略可能とし、省略可能なワードを省略すると、暗黙的に所定のレジスタ指定情報が指定されるようにしてもよい。省略可能なワードには、レジスタ指定フィールドの一部のみを持つようにし、演算の種類などは指定しないようにする。省略可能なワードに含まれるレジスタ指定フィールドを保持する手段を設け、前記省略可能なワードが実行されると、前記省略可能なワードに含まれるレジスタ指定フィールドを前記保持手段に格納する。更に、命令の実行終了時に、前記保持手段を、前記暗黙的な指定に対応する所定の値に設定する。省略不可能なワードを、既存のCPUと共通にし、省略可能なワードを既存のCPUの未定義のワードに割当てるとよい。   [3] When the number of execution states such as operation instructions for a general-purpose register is different for each general-purpose register, a transfer instruction between a plurality of general-purpose registers in a predetermined combination and another general-purpose register is provided. Good. At this time, the number of general-purpose registers is increased, the register designation field for designating the general-purpose register is divided into two parts, these two parts are arranged in different words on the basic unit of the instruction code, and one word is assigned. If the omissible word is omitted and the omissible word is omitted, predetermined register designation information may be implicitly designated. An optional word has only a part of the register specification field and does not specify the type of operation. Means for holding a register designation field included in an optional word is provided, and when the optional word is executed, the register designation field included in the optional word is stored in the holding means. Further, at the end of execution of the instruction, the holding means is set to a predetermined value corresponding to the implicit designation. A non-omissible word may be shared with an existing CPU, and an omissible word may be assigned to an undefined word of the existing CPU.

暗黙的に指定可能な汎用レジスタ(例えば既存の下位CPUの汎用レジスタ)のみを使用していれば、省略可能なワードを省略できるから、命令コードを増加させることがない(少なくとも従来同等の汎用レジスタを使用する場合は、従来同等の命令コードでよい)。命令コードを増加させないことよって、処理速度を低下させることがない。   If only the general-purpose register that can be specified implicitly (for example, the general-purpose register of the existing lower CPU) is used, the omissible word can be omitted, so that the instruction code is not increased (at least the conventional equivalent general-purpose register) When using, an equivalent instruction code may be used). By not increasing the instruction code, the processing speed is not reduced.

前記省略可能なワードを付加することによって、命令によって直接汎用レジスタの全てを選択できるから、プロラムの容易性を損う部分が少ない。また、任意の量の汎用レジスタの一部を、所望のタスク毎や所望の割込み処理などに確保しておく(他のタスクや処理では使用しない)ことによって、前記タスクや割込み処理において汎用レジスタを待避したりする必要がなく、高速化が図れる。また、前記タスクや割込み処理に確保する汎用レジスタ数は任意にできるから、タスクや処理の間で、使用する汎用レジスタを相互に融通し合うことも容易である。   By adding the omissible word, all general purpose registers can be directly selected by an instruction, so that there are few parts that impair the ease of programming. In addition, by securing a part of an arbitrary amount of general-purpose registers for each desired task or desired interrupt processing (not used in other tasks or processing), the general-purpose registers can be set in the task or interrupt processing. There is no need to evacuate and speed up can be achieved. In addition, since the number of general-purpose registers reserved for the task and interrupt processing can be arbitrarily set, it is easy to interchange the general-purpose registers to be used between tasks and processing.

前記ワードを付加することによって、指定できる汎用レジスタのアクセスは、RAMなどのメモリのアクセスより、一般に高速にできるから、汎用レジスタ数を増加するとともに、複数の汎用レジスタとメモリとの転送を高速に実行可能にすることにより、CPUの処理速度を向上できる。また、いわゆるロードストア型の命令セットを持ち、メモリの内容に対して直接演算できないようなプロセッサについては、直接処理できるデータ量を増加でき、また、メモリのアクセスを高速化することができ、処理速度を向上することができる。   By adding the word, the access to the general-purpose register that can be specified can generally be made faster than the access to the memory such as the RAM. Therefore, the number of general-purpose registers is increased and the transfer between the plurality of general-purpose registers and the memory is performed at high speed. By making it executable, the processing speed of the CPU can be improved. For processors that have a so-called load store type instruction set and cannot directly operate on the memory contents, the amount of data that can be directly processed can be increased, and the memory access speed can be increased. Speed can be improved.

〔4〕オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUにおいて、アドレス空間に対応する汎用レジスタに対する上記転送命令と、アドレス空間の小さいCPUのアドレス空間に対応するサイズ(例えば16ビット)の汎用レジスタに対する上記転送命令とを備える。   [4] When there is a CPU having a wide address space and a CPU having a small address space while maintaining compatibility at the object level, the transfer instruction for the general-purpose register corresponding to the address space in the CPU having a wide address space; And the transfer instruction for a general-purpose register having a size (for example, 16 bits) corresponding to the address space of the CPU having a small address space.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUにおいて、アドレス空間に対応するサイズ(例えば32ビット)の汎用レジスタに対する上記転送命令と、アドレス空間の小さいCPUのアドレス空間に対応するサイズ(例えば16ビット)の汎用レジスタに対する上記転送命令とを備えることによって、後者のサイズの上記転送命令を、下位互換性をもつ、アドレス空間の小さいCPUでも容易に実現可能にできる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUでも複数汎用レジスタの転送命令を実現可能にできる。オブジェクトレベルで互換性を保つことによる利点と前記転送命令を追加することの利点の双方を享受することができる。   When there is a CPU with a wide address space and a CPU with a small address space while maintaining compatibility at the object level, the above-described general-purpose register having a size (for example, 32 bits) corresponding to the address space in a CPU with a wide address space. By providing the transfer instruction and the transfer instruction for a general-purpose register having a size (for example, 16 bits) corresponding to the address space of the CPU having a small address space, the latter transfer instruction can be converted into an address having backward compatibility. Even a CPU with a small space can be easily realized. In other words, by using the same method, it is possible to realize a transfer instruction for a plurality of general-purpose registers even with a CPU having a large address space and a CPU having a small address space while maintaining compatibility at the object level. Both the advantage of maintaining compatibility at the object level and the advantage of adding the transfer instruction can be enjoyed.

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

すなわち、検討課題Bに関する解決手段によれば、論理的・物理的規模の増大を最小限とし、ロード・ストア型の命令セットを持つ既存のCPU若しくはマイクロコンピュータ等と互換性を維持しつつ、見掛け上、メモリ上のデータに対する直接的な演算を可能とすることができる。   That is, according to the solution related to the examination problem B, it is possible to minimize the increase in logical and physical scale, and maintain compatibility with an existing CPU or microcomputer having a load / store type instruction set. In addition, it is possible to perform a direct operation on the data on the memory.

さらに、見掛け上、メモリ上のデータに対する演算を可能とすることによって、プログラミングを容易にすると共に、不所望の汎用レジスタの退避/復帰を抑止して、CPUの処理性能を向上させることができる。   Furthermore, apparently by allowing operations on data in the memory, programming can be facilitated and undesired general-purpose registers can be prevented from being saved / restored to improve the CPU processing performance.

《検討課題A乃至Cの解決手段に関する実施の形態》
先ず、前記検討課題A乃至Cの解決手段に関する発明の具体例を説明する。図2には、本発明に係るデータ処理装置の一例であるシングルチップマイクロコンピュータが示される。
<< Embodiment relating to means for solving examination problems A to C >>
First, a specific example of the invention relating to the means for solving the examination problems A to C will be described. FIG. 2 shows a single chip microcomputer which is an example of a data processing apparatus according to the present invention.

同図に示されるシングルチップマイクロコンピュータ1は、全体の制御を司るCPU2、割込コントローラ(INT)3、CPU2の処理プログラムなどを格納するメモリであるROM4、前記CPU2の作業領域並びにデータの一時記憶に用いられるメモリであるRAM5、タイマ〔A〕6、タイマ〔B〕7、シリアルコミュニケーションインタフェース(SCI)8、A/D変換器9、第1乃至第9入出力ポート(IOP〔1〕〜IOP〔9〕)11〜19、クロック発振器(CPG)20、システムコントローラ(SYSC)21及びDMAC(ダイレクトメモリアクセスコントローラ)33の機能ブロック乃至はモジュールから構成され、公知の半導体製造技術により単結晶シリコンのような1つの半導体基板上に形成される。CPUCR22はシステムコントローラ21に配置されたコントロールレジスタである。   A single-chip microcomputer 1 shown in FIG. 1 includes a CPU 2 that controls the entire system, an interrupt controller (INT) 3, a ROM 4 that is a memory for storing processing programs of the CPU 2, a work area of the CPU 2, and temporary storage of data. RAM 5, timer [A] 6, timer [B] 7, serial communication interface (SCI) 8, A / D converter 9, first to ninth input / output ports (IOP [1] to IOP) [9]) It is composed of functional blocks or modules of 11 to 19, a clock generator (CPG) 20, a system controller (SYSC) 21, and a DMAC (direct memory access controller) 33. It is formed on one such semiconductor substrate. The CPUCR 22 is a control register disposed in the system controller 21.

前記CPU2は主にROM4から命令をフェッチし、これを解読して演算動作や制御動作を行う。前記DMAC33はCPU2とバス30を共有し、CPU2から設定されたデータ転送制御条件に従って、CPU2に代わってデータ転送制御を行う事ができる。DREQはマイクロコンピュータ1の外部からDMAC33に与えられるデータ転送要求信号である。DMAC33はデータ転送要求信号DREQによるデータ転送要求を受け付けるとき、データ転送要求承認信号DACKを要求元に返す。   The CPU 2 mainly fetches instructions from the ROM 4 and decodes them to perform arithmetic operations and control operations. The DMAC 33 shares the bus 30 with the CPU 2 and can perform data transfer control on behalf of the CPU 2 in accordance with the data transfer control conditions set by the CPU 2. DREQ is a data transfer request signal given to the DMAC 33 from the outside of the microcomputer 1. When the DMAC 33 accepts a data transfer request based on the data transfer request signal DREQ, the DMAC 33 returns a data transfer request acknowledge signal DACK to the request source.

かかるシングルチップマイクロコンピュータ1は、電源端子として、グランドレベル(Vss)、電源電圧レベル(Vcc)、アナロググランドレベル(AVss)、アナログ電源電圧レベル(AVcc)、アナログ基準電圧(Vref)の入力端子を有する。そして、専用制御端子として、リセット(RES)、スタンバイ(STBY)、モード制御(MD0、MD1、MD2)、クロック入力(EXTAL、XTAL)等の各端子を有する。   The single-chip microcomputer 1 has 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) as power supply terminals. Have. As dedicated control terminals, there are terminals for reset (RES), standby (STBY), mode control (MD0, MD1, MD2), clock input (EXTAL, XTAL), and the like.

シングルチップマイクロコンピュータ1は、前記CPG20の端子EXTAL、XTALに接続される水晶発振子またはEXTAL端子に入力される外部クロックに基づいて生成される基準クロック(システムクロック)に同期して、動作を行う。この基準クロックの1周期をステートと呼ぶ。   The single chip microcomputer 1 operates in synchronization with a reference clock (system clock) generated based on a crystal oscillator connected to the terminals EXTAL and XTAL of the CPG 20 or an external clock input to the EXTAL terminal. . One cycle of this reference clock is called a state.

シングルチップマイクロコンピュータ1の機能ブロックは、内部バス30によって相互に接続さる。シングルチップマイクロコンピュータ1は、バスの制御を行なう、図示を省略したバスコントローラを内蔵している。内部バス30は内部アドレスバス・内部データバスの他、リード信号・ライト信号等のコントロールバスを含み、コントロールバスはさらにバスサイズ信号を含んだり、これらをコード化したバスコマンドなどとしてもよい。或いはシステムクロックなどを含んでもよい。   The functional blocks of the single chip microcomputer 1 are connected to each other by an internal bus 30. The single chip microcomputer 1 includes a bus controller (not shown) that controls the bus. The internal bus 30 may include a control bus such as a read signal and a write signal in addition to the internal address bus and internal data bus, and the control bus may further include a bus size signal or a bus command in which these are encoded. Alternatively, a system clock or the like may be included.

特に図示はしないが、内部アドレスバスはその位相によって、IAB、PABの2種類があり、内部データバスもその位相によって、IDB、PDBが存在する。例えば、リードの場合、IABの後、PABは0.5ステート遅延する。PABとPDBは同期している。PDBの後、IDBは0.5ステート遅延する。IABとPAB、IDBとPDBのインタフェースは、前記バスコントローラが行なう。   Although not specifically shown, there are two types of internal address buses, IAB and PAB, depending on the phase, and the internal data bus also has IDBs and PDBs depending on the phase. For example, in the case of a read, after IAB, the PAB is delayed by 0.5 state. PAB and PDB are synchronized. After the PDB, the IDB is delayed by 0.5 states. The bus controller performs the interface between IAB and PAB and IDB and PDB.

かかる機能ブロックやモジュールは内部バス30を介して、CPU2によってリード/ライトさる。内部バス30のデータバス幅は16ビットとする。CPU2は、内蔵ROM4、RAM5を1ステートでリード/ライトすることができる。   Such functional blocks and modules are read / written by the CPU 2 via the internal bus 30. The data bus width of the internal bus 30 is 16 bits. The CPU 2 can read / write the built-in ROM 4 and RAM 5 in one state.

なお、タイマ〔A〕6、タイマ〔B〕7、SCI8、A/D変換器9、IOP〔1〕11〜IOP〔9〕19、CPG20が有す制御レジスタを総称して、内部I/Oレジスタと呼ぶ。   The control registers of timer [A] 6, timer [B] 7, SCI 8, A / D converter 9, IOP [1] 11 to IOP [9] 19, and CPG 20 are collectively referred to as internal I / O. It is called a register.

各入出力ポート11〜19は、アドレスバス、データバス、バス制御信号、あるいはタイマ6,7、SCI8、A/D変換器9の入出力端子と兼用されている。すなわち、タイマ6、7、SCI8、A/D変換器9は、それぞれ入力信号を有し、入出力ポートと兼用にされた端子を介して、外部と入出力されるものである。例えばIOP〔5〕、IOP〔6〕、IOP〔7〕は、タイマ6,7の入出力端子と兼用され、IOP〔8〕はSCI8の入出力端子と兼用にされている。アナログデータの入力端子は、IOP〔9〕と兼用にされている。   Each of the input / output ports 11 to 19 is also used as an address bus, data bus, bus control signal, or input / output terminals of the timers 6 and 7, the SCI 8, and the A / D converter 9. That is, the timers 6 and 7, the SCI 8, and the A / D converter 9 each have an input signal, and are input / output from / to the outside via a terminal also used as an input / output port. For example, IOP [5], IOP [6], and IOP [7] are also used as input / output terminals of timers 6 and 7, and IOP [8] is also used as an input / output terminal of SCI8. The analog data input terminal is also used as IOP [9].

かかるシングルチップマイクロコンピュータ1にリセット信号RESが与えられると、CPU2を始めとし、シングルチップマイクロコンピュータ1はリセット状態になる。このリセットが解除されると、CPU2は所定のアドレスからスタートアドレスをリードして、このスタートアドレスから命令のリードを開始するリセット例外処理を行う。この後、CPU2は逐次、ROM4などから命令をリードし、解読して、その解読内容に基づいてデータの処理或はRAM5、タイマ6,7等とのデータ転送を行う。即ち、CPU2は、入出力ポート11〜19等から入力されるデータ、或はSCI8などから入力される指示を参照しつつ、ROM4などに記憶されている命令に基づいて処理を行い、その結果に基づいて、入出力ポート11〜19、タイマ6,7等を使用しつて、外部に信号を出力し、各種外部接続機器の制御を行う。   When the reset signal RES is given to the single chip microcomputer 1, the single chip microcomputer 1 including the CPU 2 is reset. When the reset is released, the CPU 2 reads a start address from a predetermined address, and performs a reset exception process that starts reading an instruction from the start address. Thereafter, the CPU 2 sequentially reads and decodes instructions from the ROM 4 and the like, and processes data or transfers data to the RAM 5 and the timers 6 and 7 based on the decoded contents. That is, the CPU 2 refers to data input from the input / output ports 11 to 19 or the like, or an instruction input from the SCI 8 or the like, and performs processing based on a command stored in the ROM 4 or the like. Based on the input / output ports 11 to 19, timers 6 and 7, etc., signals are output to the outside to control various externally connected devices.

タイマ6,7、SCI8、外部信号などの状態を割込み信号として、CPU2に伝達することができる。割込信号は、A/D変換器9、タイマ〔A〕6、タイマ〔B〕7、SCI8、入出力ポート11〜19が出力し、割込コントローラ3はこれを入力して、所定のレジスタなどの指定に基づいて、CPU2に割込要求信号31を与える。割込要因が発生すると、CPU割込要求が発生され、CPU2は実行中の処理を中断して、例外処理状態を経て、所定の処理ルーチンに分岐し、所望の処理を行い、割込要因をクリアしたりする。所定の処理ルーチンの最後には、通常復帰命令が実行され、この命令を実行することによって前記中断した処理を再開する。   The states of the timers 6 and 7, the SCI 8, and external signals can be transmitted to the CPU 2 as interrupt signals. The interrupt signal is output from the A / D converter 9, the timer [A] 6, the timer [B] 7, the SCI 8, and the input / output ports 11 to 19, and the interrupt controller 3 inputs the interrupt signal to a predetermined register. An interrupt request signal 31 is given to the CPU 2 based on the designation of. When an interrupt factor occurs, a CPU interrupt request is generated, and the CPU 2 interrupts the processing being executed, goes through an exception processing state, branches to a predetermined processing routine, performs a desired process, and sets the interrupt factor. Or clear it. At the end of the predetermined processing routine, a normal return instruction is executed, and the interrupted process is resumed by executing this instruction.

図3には、本発明の適用された前記CPU2の汎用レジスタ及びコントロールレジスタの構成例(プログラミングモデル)として上位のCPU2のプログラミングモデルが示される。   FIG. 3 shows a programming model of the host CPU 2 as a configuration example (programming model) of the general-purpose registers and control registers of the CPU 2 to which the present invention is applied.

CPU2は、32ビット長の汎用レジスタを32本持っている。汎用レジスタER0〜ER31は、すべて同機能を持っており、アドレスレジスタとしてもデータレジスタとしても使用することができる。   The CPU 2 has 32 general-purpose registers having a 32-bit length. The general-purpose registers ER0 to ER31 all have the same function, and can be used as an address register or a data register.

データレジスタとしてしては32ビット(ロングワード)、16ビット(ワード)および8ビット(バイト)のレジスタとして使用きる。アドレスレジスタおよび32ビットレジスタとしては、一括して汎用レジスタER(ER0〜ER31)として使用する。16ビットレジスタとしては、汎用レジスタERを分割して汎用レジスタE(E0〜E31)、汎用レジスタR(R0〜R31)として使用する。これらは同等の機能を持っており、16ビットジスタを最大64本まで使用することができる。8ビットレジスタとしては、汎用レジスタRを分割して汎用レジスタRH(R0H〜R31H)、汎用レジスタRL(R0L〜R31L)として使用する。これらは同等の機能を持っており、8ビットレジスタを最大64本まで使用することができる。各レジスタ独立に使用方法を選択することができる。   As a data register, it can be used as a 32-bit (long word), 16-bit (word), and 8-bit (byte) register. The address register and the 32-bit register are used as general registers ER (ER0 to ER31) at once. As 16-bit registers, the general-purpose register ER is divided and used as general-purpose registers E (E0 to E31) and general-purpose registers R (R0 to R31). These have equivalent functions, and up to 64 16-bit registers can be used. As an 8-bit register, the general-purpose register R is divided and used as general-purpose registers RH (R0H to R31H) and general-purpose registers RL (R0L to R31L). These have equivalent functions, and up to 64 8-bit registers can be used. The usage method can be selected independently for each register.

汎用レジスタER7、ER15、ER23、ER31には、汎用レジスタとしての機能に加えて、スタックポインタ(SP)としての機能が割り当てられており、例外処理やサブルーチン分岐などで暗黙的に使用される。例外処理は前記割込み処理を含む。図示されない制御レジスタなどの設定によって、サブルーチン分岐用のスタックポインタと、例外処理用のスタックポインタを、独立して選択することができる。   The general-purpose registers ER7, ER15, ER23, and ER31 are assigned a function as a stack pointer (SP) in addition to a function as a general-purpose register, and are used implicitly in exception processing, subroutine branching, and the like. Exception handling includes the interrupt handling. A stack pointer for subroutine branching and a stack pointer for exception handling can be independently selected by setting a control register (not shown).

なお、内部論理構成上はER0〜ER7をグループ0、ER8〜ER15をグループ1、ER16〜ER23をグループ2、ER24〜ER31をグループ3としている。グループ0が既存のCPU(下位のCPU)と同一とされる。   In terms of the internal logical configuration, ER0 to ER7 are group 0, ER8 to ER15 are group 1, ER16 to ER23 are group 2, and ER24 to ER31 are group 3. Group 0 is the same as the existing CPU (lower CPU).

それらの汎用レジスタは、プログラミング仕様上は相違なく、すべて同等に使用できる。少なくとも、アセンブリ言語で書く場合には、グループを意識せず、例えば、R0H、E8、R16、ER31、などと記述できる。例えば平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』のアセンブラフォーマットに従って記述すれば、“MOV.L ER0,ER31”或いは、“ADD.W E8,R16”などとレジスタ番号のみで記述できる。   These general-purpose registers can be used equally without any difference in programming specifications. At least, when writing in assembly language, it can be described as, for example, R0H, E8, R16, ER31, etc. without regard to the group. For example, if written according to the assembler format of “H8S / 2600 Series H8S / 2000 Series Programming Manual” published by Hitachi, Ltd. in March 1995, “MOV.L ER0, ER31” or “ADD.W E8, R16” And can be described only by register numbers.

図3において、PCで示されるものは24ビットのカウンタ(プログラムカウンタ)で、CPU2が次に実行する命令のアドレスを示す。特に制限されないが、CPU2の命令は、全て2バイト(ワード)を単位としているため、最下位ビットは無効であり、命令リード時には最下位ビットは0とみなされる。   In FIG. 3, what is indicated by PC is a 24-bit counter (program counter), which indicates the address of an instruction to be executed next by the CPU 2. Although not particularly limited, since all instructions of the CPU 2 are 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.

CCRで示されるものは8ビットのレジスタ(コンディションコードレジスタ)で、CPU2の内部状態を示している。割込みマスクビット(I)とハーフキャリ(H)、ネガティブ(N)、ゼロ(Z)、オーバフロー(V)、キャリ(C)の各フラグを含む8ビットで構成されている。   What is indicated by CCR is an 8-bit register (condition code register) indicating the internal state of the CPU 2. It consists of 8 bits including interrupt mask bit (I) and half carry (H), negative (N), zero (Z), overflow (V) and carry (C) flags.

EXRで示されるものは8ビットのレジスタで、割込みなどの例外処理の制御を行なう。割込みマスクビット(I2〜I0)とトレース(T)の各ビットを含んでいる。   What is indicated by EXR is an 8-bit register that controls exception processing such as interrupts. It includes interrupt mask bits (I2 to I0) and trace (T).

汎用レジスタ上のデータ構成例、メモリ空間上のデータ構成、アドレッシングモードと実効アドレスの計算方法などについては、平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』記載のCPUと同様であり、アドレス空間16MB(乃至データ用4GB)を利用できる。マキシマムモード/ミニマムモード(前記平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』の記載ではアドバンスト/ノーマルモード)を持って、それぞれ、アドレス空間64kバイト/16Mバイト(乃至データ用4Gバイト)を選択できる。   Examples of data structure on general-purpose registers, data structure on memory space, addressing mode and effective address calculation method, etc. "H8S / 2600 Series H8S / 2000 Series Programming Manual" published by Hitachi, Ltd. Similar to the described CPU, an address space of 16 MB (or data 4 GB) can be used. Maximum mode / minimum mode (advanced / normal mode in the description of “H8S / 2600 series H8S / 2000 series programming manual” published by Hitachi, Ltd. in March 1995), address space of 64 kbytes / 16 M respectively. Byte (or data 4G bytes) can be selected.

図4にはCPU2に対する第1の下位互換のCPUのプログラミングモデルが示される。同図に示されるプログラミングモデルは、平成元年7月(株)日立製作所発行『H8/300シリーズプログラミングマニュアル』記載のCPUと同様である。   FIG. 4 shows a first backward compatible CPU programming model for CPU2. The programming model shown in the figure is the same as the CPU described in “H8 / 300 Series Programming Manual” issued by Hitachi, Ltd. in July 1989.

第1の下位互換のCPUは、16ビット長の汎用レジスタを8本持っている。汎用レジスタは、全て同機能を持っており、アドレスレジスタとしてもデータレジスタとしても使用することができる。   The first backward compatible CPU has eight 16-bit general purpose registers. All general purpose registers have the same function and can be used as both address registers and data registers.

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

汎用レジスタR7には、前記同様に、汎用レジスタとしての機能に加えて、スタックポインタ(SP)としての機能が割り当てられており、例外処理やサブルーチン分岐などで暗黙的に使用される。   As described above, the general-purpose register R7 is assigned a function as a stack pointer (SP) in addition to a function as a general-purpose register, and is used implicitly in exception processing, subroutine branching, and the like.

アドレス空間として、64kバイトのアドレス空間を利用でき、ベクタやスタックの構造などが前記上位CPUのミニマムモードと同等の動作になる。   As an address space, a 64-kbyte address space can be used, and the vector and stack structure are equivalent to the minimum mode of the host CPU.

前記図3のプログラミングモデルを有する上位のCPU2は、図4の第1の下位互換のCPUの汎用レジスタ及び命令セットを包含している。すなわち、上位CPU2が第1の下位CPUと互換を保つ為に、詳細を後述するように、汎用レジスタの拡張、命令セットやアドレシングモードの組み合わせの拡張が行われている。   The upper CPU 2 having the programming model of FIG. 3 includes the general purpose registers and instruction set of the first backward compatible CPU of FIG. That is, in order to keep the upper CPU 2 compatible with the first lower CPU, as will be described in detail later, expansion of general-purpose registers and expansion of combinations of instruction sets and addressing modes are performed.

図5にはCPU2に対する第2の下位互換のCPUのプログラミングモデルが示される。   FIG. 5 shows a second backward compatible CPU programming model for CPU2.

前記図3のプログラミングモデルを有する上位のCPU2は、図5の第2の下位互換(下位互換を単に下位とも称する)のCPUの汎用レジスタ及び命令セットを包含している。すなわち、上位CPU2が第1の下位CPUと互換を保つ為に、詳細を後述するように、汎用レジスタの拡張、命令セットやアドレシングモードの組み合わせの拡張が行われている。一方、図4の第1の下位CPUに対しては、図5の第2の下位CPUは、汎用レジスタ、命令セットを包含したり、包含されたりしない関係を有する。例えば、図4の第1の下位CPUに対して、図5の第2の下位CPUは汎用レジスタのビット長が大きいし、図5の第2の下位CPUに対して、図4の第1の下位CPUは汎用レジスタの本数が大きい。   The upper CPU 2 having the programming model of FIG. 3 includes the general purpose registers and instruction set of the second backward compatible (lower compatibility is also simply referred to as lower) CPU of FIG. That is, in order to keep the upper CPU 2 compatible with the first lower CPU, as will be described in detail later, expansion of general-purpose registers and expansion of combinations of instruction sets and addressing modes are performed. On the other hand, with respect to the first lower CPU in FIG. 4, the second lower CPU in FIG. 5 has a relationship of including or not including general-purpose registers and instruction sets. For example, the second lower CPU in FIG. 5 has a larger general register bit length than the first lower CPU in FIG. 4, and the first lower CPU in FIG. The lower CPU has a large number of general purpose registers.

第2の下位互換のCPUは、32ビット長の汎用レジスタを4本持っている。汎用レジスタは、全て同機能を持っており、アドレスレジスタとしてもデータレジスタとしても使用することができる。   The second backward compatible CPU has four general-purpose registers having a 32-bit length. All general purpose registers have the same function and can be used as both address registers and data registers.

データレジスタとしてしては32ビット、16ビットおよび8ビットレジスタとして使用きる。アドレスレジスタおよび32ビットレジスタとしては、一括して汎用レジスタER(ER0、ER1、ER7、ER15)として使用する。16ビットレジスタとしては、汎用レジスタERを分割して汎用レジスタE(E0、E1、E7、E15)、汎用レジスタR(R0、R1、R7、R15)として使用する。これらは同等の機能を持っており、16ビットレジスタを最大8本まで使用することができる。8ビットレジスタとしては、汎用レジスタRを分割して汎用レジスタRH(R0H、R1H、R7H、R15H)、汎用レジスタRL(R0L、R1L、R7L、R15L)として使用する。これらは同等の機能を持っており、8ビットレジスタを最大8本まで使用することができる。各レジスタ独立に使用方法を選択することができる。   As a data register, it can be used as a 32-bit, 16-bit and 8-bit register. As an address register and a 32-bit register, they are collectively used as general purpose registers ER (ER0, ER1, ER7, ER15). As a 16-bit register, the general-purpose register ER is divided and used as general-purpose registers E (E0, E1, E7, E15) and general-purpose registers R (R0, R1, R7, R15). These have equivalent functions, and up to eight 16-bit registers can be used. As an 8-bit register, the general-purpose register R is divided and used as a general-purpose register RH (R0H, R1H, R7H, R15H) and a general-purpose register RL (R0L, R1L, R7L, R15L). These have equivalent functions, and up to eight 8-bit registers can be used. The usage method can be selected independently for each register.

汎用レジスタER7、ER15には、汎用レジスタとしての機能に加えて、スタックポインタ(SP)としての機能が割り当てられており、例外処理やサブルーチン分岐などで暗黙的に使用される。前記同様に、図示されない制御レジスタなどの設定によって、サブルーチン分岐用のスタックポインタと、例外処理用のスタックポインタを、独立して選択することができる。   The general-purpose registers ER7 and ER15 are assigned a function as a stack pointer (SP) in addition to a function as a general-purpose register, and are used implicitly in exception processing, subroutine branching, and the like. In the same manner as described above, the stack pointer for subroutine branching and the stack pointer for exception handling can be independently selected by setting a control register (not shown).

汎用レジスタのビット長などは、前記上位CPU2と同等であり、同等のアドレス空間16Mバイト(乃至データ用4Gバイト)を利用できる。第2の下位CPUはマキシマムモードに相当するモードのみを持つ。   The bit length of the general-purpose register is the same as that of the upper CPU 2, and an equivalent address space of 16 Mbytes (or data 4 Gbytes) can be used. The second lower CPU has only a mode corresponding to the maximum mode.

なお、プログラム上、ER0、R0、R0H、R0L、ER1、R1、R1H、R1Lはそれぞれ、EAX、AX、AH、AL、EBX、BX、BH、BLとしても記述できるようにしている。これらは、汎用レジスタの機能を示すものではなく、本発明とは関係のない、更に別のCPUの記述に合わせたものである。このため、前記更に別のCPUでは単独で使用できないE0、E1は、そのままの記述のみを用いる。この場合、例えば、“ADD.W E1,BX”と、“ADD.W E1,R1”は同一の命令コードに対応する。   In the program, ER0, R0, R0H, R0L, ER1, R1, R1H, and R1L can be described as EAX, AX, AH, AL, EBX, BX, BH, and BL, respectively. These do not indicate the function of the general-purpose register, but are adapted to the description of another CPU that is not related to the present invention. For this reason, only the description as it is is used for E0 and E1 which cannot be used independently by the further CPU. In this case, for example, “ADD.W E1, BX” and “ADD.W E1, R1” correspond to the same instruction code.

図6にはCPUのアドレス空間が示される。なお、シングルチップマイクロコンピュータのアドレスマップとしては、ROMは0番地から、一方、RAM及び内部I/OレジスタはH’FFFFまたはH’FFFFFF番地まで、それぞれアドレス空間の両端になるように配置されるようにする。   FIG. 6 shows the address space of the CPU. As the address map of the single chip microcomputer, ROM is arranged from address 0, while RAM and internal I / O registers are arranged at both ends of the address space from address H'FFFF or address H'FFFFFF. Like that.

上位のCPU2は、前記の通り、16MBのアドレス空間のマキシマムモードと64kBのアドレス空間のミニマムモードを持つ。マキシマムモード/ミニマムモードの選択はモード選択信号MD0〜MD2の状態によって決定される。   As described above, the host CPU 2 has a 16 MB address space maximum mode and a 64 kB address space minimum mode. The selection of the maximum mode / minimum mode is determined by the state of the mode selection signals MD0 to MD2.

マキシマムモードでは、絶対アドレス24ビット(上位に8ビットの予約ビットを付加して、命令コード中は32ビット)で全空間を、絶対アドレス16ビットで0〜 H’7FFF及びH’FF8000〜H’FFFFFFを指定する。   In the maximum mode, the absolute space is 24 bits (8 reserved bits are added at the top, 32 bits in the instruction code), and the entire space is represented by 0 to H'7FFF and H'FF8000 to H 'with 16 bits of absolute address. Specify FFFFFF.

また、例外処理時のベクタは24ビット(メモリ上は32ビットとされ、上位8ビットは無視される)、サブルーチン分岐などにおいて待避/復帰されるPCも24ビットとされる。   In addition, the vector for exception processing is 24 bits (32 bits on the memory and the upper 8 bits are ignored), and the PC saved / restored in a subroutine branch is also 24 bits.

ミニマムモードでは、絶対アドレスとレジスタ間接のアドッレシングモードのいずれも、下位16ビットのみを使用し、上位ビットは無視する。例外処理時のベクタは16ビット、サブルーチン分岐などにおいて待避/復帰されるPCも16ビットとされる。   In the minimum mode, both the absolute address and the register indirect addressing mode use only the lower 16 bits and ignore the upper bits. The vector for exception processing is 16 bits, and the PC saved / restored in a subroutine branch is also 16 bits.

第1の下位CPUは、ミニマムモードに相当する64kBのアドレス空間を持つ。絶対アドレスは16ビットのみを持ち、また、レジスタ間接では16ビットレジスタで、それぞれ全空間を指定する。例外処理時のベクタは16ビット、サブルーチン分岐などにおいて待避/復帰されるPCも16ビットとされる。   The first lower CPU has an address space of 64 kB corresponding to the minimum mode. An absolute address has only 16 bits, and in the register indirect, a 16-bit register designates the entire space. The vector for exception processing is 16 bits, and the PC saved / restored in a subroutine branch is also 16 bits.

第2の下位CPUは、マキシマムモードに相当する16MBのアドレス空間を持つ。絶対アドレスは16ビットのみを持ち、0〜 H’7FFF及びH’FF8000〜H’FFFFFFを指定する。一方、レジスタ間接では32ビットレジスタで、全空間を指定する。絶対アドレスは16ビットでは、RAMと内部I/Oレジスタを合わせて32kBまで、及びROMを32kBまで指定できる。内蔵RAMと内部I/Oレジスタを合わせて32kBの容量は、バスを拡張しない応用分野はこのシングルチップマイクロコンピュータでは十分な容量といえる。また、内蔵RAMと内部I/Oレジスタを合わせて32kBを超える場合には、それ自体の論理的・物理的規模が大きくなるから、敢えて論理的規模の小さい下位CPUを使用する必要性は少なく、上位CPUを使うのが適当と言える。少なくとも、第2の下位CPUを使用して、絶対アドレスで指定できないRAM乃至内部I/Oレジスタを設けて、論理的・物理的規模の縮小を追求するか、上位CPUを使用して、全ての空間を絶対アドレスで指定可能にして、使い勝手を追求するかを選択することができる。   The second lower CPU has a 16 MB address space corresponding to the maximum mode. The absolute address has only 16 bits and designates 0-H'7FFF and H'FF8000-H'FFFFFF. On the other hand, in the register indirect, the entire space is specified by a 32-bit register. When the absolute address is 16 bits, the RAM and internal I / O registers can be specified up to 32 kB, and the ROM can be specified up to 32 kB. The capacity of 32 kB including the built-in RAM and the internal I / O register can be said to be sufficient for this single-chip microcomputer in an application field where the bus is not expanded. Also, if the combined RAM and internal I / O registers exceed 32 kB, the logical and physical scale of the built-in RAM itself increases, so there is little need to use a lower CPU with a small logical scale. It can be said that it is appropriate to use an upper CPU. At least use the second lower CPU to provide RAM or internal I / O registers that cannot be specified by absolute addresses, and pursue the reduction of the logical and physical scale, or use the upper CPU to The space can be specified by an absolute address, and it is possible to select whether to pursue usability.

絶対アドレス16ビットで指定できるROMのアドレスが限定されてしまうが、ROMに割り当てる定数などについては、Cコンパイラなどで記述した場合も、モジュール間最適化で、再配置することができる。なお、モジュール間最適化は、各プログラムモジュールをリンクする際に、メモリ配置や関数の呼び出し関係に依存した最適化を行なうものであり、平成9年8月(株)日立製作所発行『H8S,H8/300シリーズCコンパイラユーザーズマニュアル』(第4版)などに記載されている。   Although the ROM addresses that can be specified by the absolute address of 16 bits are limited, constants assigned to the ROM can be rearranged by inter-module optimization even when they are described by a C compiler or the like. The inter-module optimization performs optimization depending on the memory allocation and the function calling relationship when linking each program module, and is issued by Hitachi, Ltd. in August 1997, “H8S, H8”. / 300 Series C Compiler User's Manual (4th edition).

なお、例外処理時のベクタは24ビット(メモリ上は32ビットとされ、上位8ビットは無視される)、サブルーチン分岐などにおいて待避/復帰されるPCも24ビットとされる。   The vector for exception processing is 24 bits (32 bits on the memory and the upper 8 bits are ignored), and the PC saved / restored at a subroutine branch is also 24 bits.

図7及び図8には実効アドレスの計算方法として、上位CPU2のマキシマムモードにおける実効アドレス計算方法が例示されている。   7 and 8 illustrate the effective address calculation method in the maximum mode of the host CPU 2 as the effective address calculation method.

図7の(1)に示されるレジスタ間接では命令コード中にレジスタを指定する部分を含み、この命令コードで指定された汎用レジスタERの内容の合計32ビットをアドレスとしてメモリ上のアドレスを指定する。アドレスは24ビットでよいため、上位8ビットは無視する。   The register indirect shown in (1) of FIG. 7 includes a part for designating a register in the instruction code, and designates an address on the memory by using a total of 32 bits of the contents of the general-purpose register ER designated by the instruction code as an address. . Since the address may be 24 bits, the upper 8 bits are ignored.

図7の(2)、(3)に示されるディスプレースメント付レジスタ間接は、前記レジスタ間接と同様に得られた32ビットのアドレスに、命令コード中に含まれるディスプレースメントを加算した結果をアドレスとしてメモリ上のアドレスを指定する。加算結果はアドレスの指定のみに使用され、汎用レジスタERの内容には反映されない。特に制限はされないものの、ディスプレースメントは32ビットまたは16ビットであり、16ビットディスプレースメントは加算する場合には上位16ビットは符号拡張される。すなわち、ディスプレースメントの上位16ビットは16ビットディスプレースメントのビット15と同じ値であるとして加算が行われる。この場合、32ビットディスプレースメントの上位8ビットは、予約領域とされ、無視される。   In the register indirect with displacement shown in (2) and (3) of FIG. 7, the result obtained by adding the displacement included in the instruction code to the 32-bit address obtained in the same manner as the register indirect is used as the address. Specify an address in memory. The addition result is used only for address designation and is not reflected in the contents of the general-purpose register ER. Although there is no particular limitation, the displacement is 32 bits or 16 bits, and when the 16-bit displacement is added, the upper 16 bits are sign-extended. That is, the addition is performed on the assumption that the upper 16 bits of the displacement have the same value as bit 15 of the 16-bit displacement. In this case, the upper 8 bits of the 32-bit displacement are reserved and ignored.

図7の(4)に示されるポストインクリメントレジスタ間接は、前記レジスタ間接と同様に得られた32ビットのアドレスでメモリ上のアドレスを指定する。その後、このアドレスに1または2または4を加算し、その加算結果が汎用レジスタERに格納される。メモリ上のバイトデータを指定する場合1が、ワードデータを指定する場合2が、アドレスデータを指定する場合4が、それぞれ加算される。加算結果の上位8ビットも拡張レジスタに格納される。   The post-increment register indirect shown in (4) of FIG. 7 designates an address on the memory with a 32-bit address obtained in the same manner as the register indirect. Thereafter, 1 or 2 or 4 is added to this address, and the addition result is stored in the general-purpose register ER. 1 is designated when byte data on the memory is designated, 2 is designated when word data is designated, and 4 is designated when address data is designated. The upper 8 bits of the addition result are also stored in the extension register.

図7の(5)に示されるプリデクリメントレジスタ間接は、前記レジスタ間接と同様に得られた32ビットのアドレスから1または2または4を減算した結果の24ビットのアドレスでメモリ上のアドレスを指定する。その後、その減算結果が汎用レジスタERに格納される。メモリ上のバイトデータを指定する場合1が、ワードデータを指定する場合2が、アドレスデータを指定する場合4が、それぞれ減算される。前記同様に、アドレスが24ビットでよい場合には、特に制限はされないものの、減算結果の上位8ビットも拡張レジスタに格納される。   In the pre-decrement register indirect shown in (5) of FIG. 7, the address on the memory is designated by a 24-bit address obtained by subtracting 1 or 2 or 4 from the 32-bit address obtained in the same manner as the register indirect. To do. Thereafter, the subtraction result is stored in the general-purpose register ER. 1 is designated when byte data on the memory is designated, 2 is designated when word data is designated, and 4 is designated when address data is designated. Similarly to the above, when the address may be 24 bits, the upper 8 bits of the subtraction result are also stored in the extension register, although there is no particular limitation.

図8の(6)、(7)、(8)に示される絶対アドレスは命令コード中に含まれる、8ビット、16ビットまたは24ビットの絶対アドレスをアドレスとしてメモリ上のアドレスを指定する。8ビット絶対アドレスは、上位16ビットが1拡張される。すなわちアドレスのビット23〜8は全ビット1とされる。従って使用可能なアドレスはH’FFFF00〜H’FFFFFFの256バイトである。また、16ビット絶対アドレスは、上位8ビットが符号拡張される。すなわち、16ビット絶対アドレスのビット15が0であればアドレスのビット23〜16は全ビット0とされ、ビット15が1であればアドレスのビット23〜16は全ビット1とされる。従って使用可能なアドレスはH’000000〜H’007FFF及びH’FF8000〜H’FFFFFFの64kバイトである。   The absolute addresses shown in (6), (7), and (8) of FIG. 8 designate an address on the memory by using an 8-bit, 16-bit, or 24-bit absolute address included in the instruction code as an address. The upper 16 bits of the 8-bit absolute address are extended by one. That is, bits 23 to 8 of the address are all 1 bits. Therefore, usable addresses are 256 bytes of H'FFFF00 to H'FFFFFF. In the 16-bit absolute address, the upper 8 bits are sign-extended. That is, if bit 15 of the 16-bit absolute address is 0, bits 23 to 16 of the address are all 0s, and if bit 15 is 1, bits 23 to 16 of the address are all 1s. Accordingly, usable addresses are 64 kbytes of H'000000 to H'007FFF and H'FF8000 to H'FFFFFF.

図8の(9)、(10)に示されるプログラムカウンタ相対は、プログラムカウンタの内容の24ビットのアドレスに命令コード中に含まれるディスプレースメントを加算した結果をアドレスとしてメモリ上のアドレスを指定する。加算結果はプログラムカウンタに格納される。特に制限はされないものの、ディスプレースメントは16ビットまたは8ビットであり、これらのディスプレースメントは加算する場合には上位8ビットまたは16ビットは符号拡張される。すなわち、ディスプレースメントの上位8ビットは16ビットディスプレースメントのビット15と、または上位16ビットは8ビットディスプレースメントのビット7と同じ値であるとみなして加算が行われる。プログラムカウンタ相対は分岐命令のみで使用される。   In the program counter relative shown in (9) and (10) of FIG. 8, the address on the memory is designated by using the result of adding the displacement included in the instruction code to the 24-bit address of the contents of the program counter. . The addition result is stored in the program counter. Although there is no particular limitation, the displacement is 16 bits or 8 bits, and when these displacements are added, the upper 8 bits or 16 bits are sign-extended. That is, the addition is performed assuming that the upper 8 bits of the displacement are the same as the bit 15 of the 16-bit displacement, or the upper 16 bits are the same as the bit 7 of the 8-bit displacement. Program counter relative is used only for branch instructions.

尚、ミニマムモードでは、実効アドレスの上位8ビットが無視される。前記の他にイミディエイト、レジスタ直接、メモリ間接などのアドレッシングモードを実行するが、これらは本発明に直接は関係しないので詳細な説明は省略する。   In the minimum mode, the upper 8 bits of the effective address are ignored. In addition to the above, addressing modes such as immediate, register direct, and memory indirect are executed, but since these are not directly related to the present invention, detailed description thereof is omitted.

第1の下位CPUのデータ転送命令では、レジスタ間接、16ビットディスプレースメント付レジスタ間接、ポストインクリメント/プリデクリメントレジスタ間接、8/16ビット絶対アドレス、が使用可能である。実効アドレスの計算方法は上位CPU2と同様であるが、上位8ビットが無視され、下位16ビットが有効である。   In the data transfer instruction of the first lower CPU, register indirect, register indirect with 16-bit displacement, post-increment / pre-decrement register indirect, and 8 / 16-bit absolute address can be used. The calculation method of the effective address is the same as that of the upper CPU 2, but the upper 8 bits are ignored and the lower 16 bits are valid.

第2の下位CPUのデータ転送命令では、レジスタ間接、16ビットディスプレースメント付レジスタ間接、ポストインクリメント/プリデクリメントレジスタ間接、8/16ビット絶対アドレス、が使用可能である。なお、絶対アドレス24ビットは分岐命令で使用可能とされる。   In the data transfer instruction of the second lower CPU, register indirect, register indirect with 16-bit displacement, post-increment / pre-decrement register indirect, and 8 / 16-bit absolute address can be used. The 24-bit absolute address can be used in a branch instruction.

図9には本発明に係るCPU2の機械語の命令フォーマットが例示されている。前記第1の下位CPU、第2の下位CPUの命令セットは上位CPU2の命令セットのサブセットとされる。   FIG. 9 illustrates a machine language instruction format of the CPU 2 according to the present invention. The instruction set of the first lower CPU and the second lower CPU is a subset of the instruction set of the upper CPU 2.

CPU2の命令は、2バイト(ワード)を単位にしている。各命令はオペレーションフィード(op)、レジスタフィールド(r、gr)、EA拡張部(EA)、およびコンディションフィールド(cc)を含む。特に制限はされないものの、前記平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』記載のCPUと同じ命令フォーマットとしている。   The instruction of the CPU 2 is in units of 2 bytes (word). Each instruction includes an operation feed (op), a register field (r, gr), an EA extension (EA), and a condition field (cc). Although not particularly limited, the instruction format is the same as the CPU described in “H8S / 2600 Series H8S / 2000 Series Programming Manual” published by Hitachi, Ltd. in March 1995.

オペレーションフィールド(op)は、命令の機能を表し、アドレッシングモードの指定オペランドの処理内容を指定する。命令の先頭4ビットを必ず含む。2つのオペレーションフィールドを持つ場合もある。   The operation field (op) represents the function of the instruction, and specifies the processing contents of the specified operand in the addressing mode. Always include the first 4 bits of the instruction. There may be two operation fields.

レジスタフィールド(r、gr)は汎用レジスタを指定する。レジスタフィールド(r)はアドレスレジスタのとき3ビット、データレジスタのとき3ビット(32ビットレジスタ)または4ビット(8または16ビットレジスタ)である。2つのレジスタフィールドを持つ場合、またはレジスタフィールドを持たない場合もある。   The register fields (r, gr) specify general purpose registers. The register field (r) is 3 bits for the address register and 3 bits (32 bit register) or 4 bits (8 or 16 bit register) for the data register. There may be two register fields or no register fields.

レジスタフィールド(gr)はグループ0〜グループ3の何れのレジスタセットを選択するかを指定する情報を保持することになる。レジスタフィールド(gr)は4ビット存在するが、図3のレジスタ構成に従えば、特に制限はされないものの、下位2ビットを有効にする。レジスタフィールド(gr)を含むワードは省略可能とされ、省略された場合は、0が与えられたものと想定され、グループ0のレジスタセットが指定されたものと見做され、レジスタフィールド(r)で指定されるレジスタはレジスタ番号が0〜7とされ、汎用レジスタER0〜ER7が選択できる。   The register field (gr) holds information specifying which register set of group 0 to group 3 is selected. The register field (gr) has 4 bits, but according to the register configuration of FIG. 3, the lower 2 bits are validated although not particularly limited. The word including the register field (gr) can be omitted. If omitted, it is assumed that 0 is given, and it is considered that the register set of group 0 is specified, and the register field (r) The registers specified by are assigned register numbers 0 to 7, and general-purpose registers ER0 to ER7 can be selected.

例えば、レジスタ番号n=gr[1:0]<<3+r[2:0]で求められる(<<3は3ビット左シフトを示す)。即ち、grを上位とし、rの下位3ビットr[2:0]を下位とした5ビットで指定される番号のレジスタを指定する。例えば、gr=0、r=1の場合はレジスタ番号n=1、となり、gr=2、r=3の場合はレジスタ番号n=19、となる。このレジスタ番号nに対応する汎用レジスタERnの、命令コードのサイズを指定する部分や、r[3]の内容によって、レジスタE、レジスタR、レジスタRH、レジスタRLが指定される。例えば、データサイズがロングワード、ワード、バイトの何れであるかは命令コードのオペレーションフィールドの所定のビットで指定される。データサイズがワード又はバイトのとき、利用するレジスタ位置はr[3]で指定される。r[3]は、rの下位から4ビット目のビットデータを意味する。データサイズがワードのときr[3]=1のときはレジスタEを指定し、r[3]=0のときはレジスタRを意味する。データサイズがバイトのときr[3]=1のときはレジスタRLを指定し、r[3]=0のときはレジスタRHを意味する。   For example, it is obtained by register number n = gr [1: 0] << 3 + r [2: 0] (<< 3 indicates a 3-bit left shift). That is, a register having a number designated by 5 bits is designated, with gr being the higher order and the lower 3 bits r [2: 0] of r being the lower order. For example, when gr = 0 and r = 1, the register number n = 1, and when gr = 2 and r = 3, the register number n = 19. The register E, the register R, the register RH, and the register RL are designated by the portion that designates the size of the instruction code of the general-purpose register ERn corresponding to the register number n and the contents of r [3]. For example, whether the data size is a long word, a word, or a byte is specified by a predetermined bit in the operation field of the instruction code. When the data size is word or byte, the register position to be used is specified by r [3]. r [3] means bit data of the fourth bit from the lower order of r. When the data size is word, the register E is designated when r [3] = 1, and the register R is designated when r [3] = 0. When the data size is byte, r [3] = 1 designates the register RL, and when r [3] = 0, the register RH is designated.

尚、gr1、r1はソースレジスタまたはアドレスレジスタのレジスタ指定フィールドを意味し、gr2、r2はデスティネーションレジスタまたはデータレジスタのレジスタ指定フィールドを意味する。gr1(命令コードの基本ワード中のビット7〜4)はr1(命令コードの基本ワード中のビット7〜4またはビット6〜4)に、gr2(命令コードの基本ワード中のビット3〜0)はr2(命令コードの基本ワード中のビット11〜8またはビット3〜0)に対応する。   In addition, gr1 and r1 mean a register designation field of a source register or an address register, and gr2 and r2 mean a register designation field of a destination register or a data register. gr1 (bits 7 to 4 in the basic word of the instruction code) is replaced with r1 (bits 7 to 4 or 6 to 4 in the basic word of the instruction code) and gr2 (bits 3 to 0 in the basic word of the instruction code) Corresponds to r2 (bits 11 to 8 or bits 3 to 0 in the basic word of the instruction code).

EA拡張部(EA)は、イミディエイトデータ、絶対アドレスまたはディスプレースメントを指定する。8ビット、16ビット、または32ビットである。   The EA extension unit (EA) specifies immediate data, an absolute address, or a displacement. It is 8 bits, 16 bits, or 32 bits.

コンディションフィールド(cc)は条件分岐命令(Bcc命令)の分岐条件を指定する。   The condition field (cc) specifies the branch condition of the conditional branch instruction (Bcc instruction).

図9にはCPU2の機械語の命令フォーマットを示している。レジスタフィールド(gr)を持つ前置命令コード(レジスタ拡張用前置命令コード)を省略すると、既存の命令コードになるようになっている。レジスタフィールド(gr)をグループ指定フィールド(gr)とも記す。例えば、図9の(2)に例示される命令コード“H'0901”を単独で使用する場合、ADD.W R0,R1となり、図9の(3)に例示されるように、それに、グループ指定フィールドを持つ前置命令コード“H'0012”を付加すると、命令コード“ H'00120901”は、 ADD.W R8,R17となる。   FIG. 9 shows a machine language instruction format of the CPU 2. If a prefix instruction code (register extension prefix instruction code) having a register field (gr) is omitted, an existing instruction code is obtained. The register field (gr) is also referred to as a group designation field (gr). For example, when the instruction code “H′0901” exemplified in (2) of FIG. W R0 and R1, and as illustrated in (3) of FIG. 9, when a prefix instruction code “H'0012” having a group designation field is added thereto, the instruction code “H′00120901” is added to ADD. W R8, R17.

また、暗黙的に使用されるグループ0のレジスタセットを指定する前置命令レコード“H'0000”は、特に制限されないが、NOP(無操作)命令とされている。 命令コード“H'00xx”(xxは01〜FF)は、レジスタセットのグループを指定し、連続する次の命令コードを実行する(割込みを禁止する)他は、NOP命令と同様に、PCのインクリメントを行い、最小のステート数で実行される。   The prefix instruction record “H′0000” that specifies the register set of group 0 that is used implicitly is not particularly limited, but is a NOP (no operation) instruction. The instruction code “H'00xx” (xx is 01 to FF) designates a group of register sets and executes the next consecutive instruction code (inhibits interrupts), as in the case of the NOP instruction. It is incremented and executed with the minimum number of states.

グループ指定フィールド(gr)は、4ビットあるので、論理的には汎用レジスタグループを16に拡張することができる。この場合では32ビット汎用レジスタ128本(または16ビット汎用レジスタ256本)を利用できる。   Since the group designation field (gr) has 4 bits, the general-purpose register group can be logically expanded to 16. In this case, 128 32-bit general registers (or 256 16-bit general registers) can be used.

グループ指定フィールド(gr)に対応するオペレーションフィールドは複数種類あってもよい。例えば、単純にレジスタ指定のみを行うものと、そのほかの機能(データサイズなど)を切り換える機能とを併せ持つオペレーションコードとを用意してもよい。   There may be a plurality of operation fields corresponding to the group designation field (gr). For example, an operation code having both a function for simply specifying a register and a function for switching other functions (such as data size) may be prepared.

上位CPU2の命令コードのサブセットを、前記第1の下位CPU、第2の下位CPUは持つ。具体的には、前記第1の下位CPUは、レジスタ指定フィールド(gr)を持たない。前記第2の下位CPUは、スタックポインタER15を指定するときのみ、レジスタ指定フィールド(gr)を使用する。   The first lower CPU and the second lower CPU have a subset of the instruction code of the upper CPU 2. Specifically, the first lower CPU does not have a register designation field (gr). The second lower CPU uses the register designation field (gr) only when designating the stack pointer ER15.

図10にはCPU2のメモリに対する転送命令の詳細な命令フォーマットを例示する。   FIG. 10 illustrates a detailed instruction format of a transfer instruction for the memory of the CPU 2.

ここでは、レジスタ間接、ポストインクリメント/プリデクリメントレジスタ間接、16ビットディスプレースメント付きレジスタ間接、16ビット絶対アドレスについて示す。このほかのアドレッシングモードも持つが、詳細な説明は省略する。   Here, register indirect, post-increment / pre-decrement register indirect, register indirect with 16-bit displacement, and 16-bit absolute address are shown. Although other addressing modes are also provided, detailed description thereof is omitted.

レジスタ間接(@ERn)は、命令コードのレジスタフィールド(r)で指定されるアドレスレジスタ(ERn)の内容をアドスとしてメモリ上のオペランドを指定する。   Register indirect (@ERn) designates an operand on the memory with the contents of the address register (ERn) designated in the register field (r) of the instruction code as an address.

ディスプレースメント付きレジスタ間接(@(d:16,ERn))は、命令コードのレジスタフィールド(r)で指定されるアドレスレジスタ(ERn)の内容に命令コード中に含まれる16ビットディスプレースメント(d)を加算した内容をアドレスとしてメモリ上のオペランドを指定する。加算に際して、16ビットディスプレースメントは符号拡張される。   The register indirect with displacement (@ (d: 16, ERn)) is a 16-bit displacement (d) included in the instruction code in the contents of the address register (ERn) specified by the register field (r) of the instruction code. The operand in the memory is specified using the content of the addition as an address. Upon addition, the 16-bit displacement is sign extended.

ポストインクリメントレジスタ間接(@ERn+)は、命令コードのレジスタフィールドで指定されるアドレスレジスタ(ERn)の内容をアドスとしてメモリ上のオペランドを指定する。その後、アドレスレジスタの内容に1、2または4が加算され、加算結果がアドレスレジスタに格納される。バイサイズでは1、ワードサイズでは2、ロングワードサイズでは4がそれぞれ加算される。   The post-increment register indirect (@ ERn +) designates an operand on the memory with the contents of the address register (ERn) designated in the register field of the instruction code as an address. Thereafter, 1, 2 or 4 is added to the contents of the address register, and the addition result is stored in the address register. 1 is added for the bisize, 2 for the word size, and 4 for the longword size.

プリデクリメントレジスタ間接(@−ERn)は、命令コードのレジスタフィールドで指定されるアドレスレジスタ(ERn)の内容から1,2又は4を減算した内容をアドレスとしてメモリ上のオペランドを指定する。その後、減算結果がアドレスレジスタに格納される。バイトサイズでは1、ワーサイズでは2、ロングワードサイズでは4がそれぞれ減算される。   In the pre-decrement register indirect (@ -ERn), an operand on the memory is designated with the contents obtained by subtracting 1, 2 or 4 from the contents of the address register (ERn) designated in the register field of the instruction code. Thereafter, the subtraction result is stored in the address register. 1 is subtracted for the byte size, 2 for the word size, and 4 for the longword size.

絶対アドレス(@aa:16)は、命令コード中に含まれる絶対アドレス(aa)で、メモリ上のオペランドを指定する。特に制限はされないものの、16ビット絶対アドレスの場合、上位16ビットは符号拡張される。この場合ビット8〜10がアドレッシングモードを指定するフィールドになっている。   The absolute address (@aa: 16) is an absolute address (aa) included in the instruction code and designates an operand on the memory. Although not particularly limited, in the case of a 16-bit absolute address, the upper 16 bits are sign-extended. In this case, bits 8 to 10 are fields for specifying an addressing mode.

図11乃至図14には上位CPU2によるメモリに対する直接的な演算命令の命令フォーマットにおける命令コードの組合せが例示される。メモリに対する直接的な演算命令とは、既存の命令セットに対して拡張された演算命令である。同図に示される命令フォーマットは、命令拡張用前置命令コードを先頭に、転送命令のコード、演算命令のコード等が付加された、1命令として処理されるべき命令のフォーマットである。尚、図示はしないが、第1の下位CPU、第2の下位CPUは上位CPU2の命令セットのサブセットの命令セットを有する。   FIG. 11 to FIG. 14 illustrate combinations of instruction codes in the instruction format of direct operation instructions for the memory by the upper CPU 2. The direct arithmetic instruction for the memory is an arithmetic instruction extended with respect to the existing instruction set. The instruction format shown in the figure is a format of an instruction to be processed as one instruction to which a prefix instruction code for instruction extension is added and a transfer instruction code, an operation instruction code, and the like are added. Although not shown, the first lower CPU and the second lower CPU have an instruction set that is a subset of the instruction set of the upper CPU 2.

前記メモリに対する直接的な演算命令は、制御コード(命令拡張用前置命令コード)、EA1コード、EA2コード、及び演算コードの組合せによって構成される。   The direct operation instruction for the memory is composed of a combination of a control code (instruction extension instruction code), an EA1 code, an EA2 code, and an operation code.

EA1、EA2は、図10に示される各アドレッシングモードの転送命令の命令コードと同一にされる。転送方向はリード方向、使用しないレジスタフィールド(r2)は、特に制限はされないが、0とする。   EA1 and EA2 are made the same as the instruction code of the transfer instruction in each addressing mode shown in FIG. The transfer direction is the read direction, and the unused register field (r2) is set to 0, although not particularly limited.

演算コードは、汎用レジスタ間の演算命令の命令コードと同一にされる。EA1コード、EA2コード、演算コードの組合せは意味があるものについては任意にできる。即ち、所望の処理の内容に従って、EA1コード、EA2コード、演算コードの必要なものを組合せる。   The operation code is the same as the instruction code of the operation instruction between the general-purpose registers. The combination of the EA1 code, the EA2 code, and the operation code can be arbitrarily set as long as it has meaning. That is, the necessary EA1 code, EA2 code, and operation code are combined in accordance with the contents of desired processing.

例えば、インクリメント処理などは、デスティネーション側データだけしか必要としないから、ソース側データをリードするためのEA1コードは不要である。したがって、インクリメント処理のフォーマットは、前置命令コード、EA2コード、演算コードを組合せて構成される。   For example, only the destination side data is necessary for the increment processing and the like, and therefore the EA1 code for reading the source side data is not necessary. Therefore, the format of the increment process is configured by combining the prefix instruction code, the EA2 code, and the operation code.

加算処理などは、ソース側、デスティネーション側の、メモリを使用する方のEA1,EA2を組合せればよい。ソース側のみをメモリ上のデータとする場合(例えば、ADD.W @ER1,R0)は、命令拡張用前置命令コード、EA1コード(MOV.W @ER1,Rxと同一。Rxは意味を持たないが、前記の通りR0とする)、演算コード(ADD.W Rx,R0と同一)を組合せる。デスティネーション側のみをメモリ上のデータとする場合は(ADD.W R1,@ER0)、命令拡張用前置命令コード、EA2コード、演算コードを組合せる。ソース側、デスティネーション側の両方をメモリ上のデータとする場合(ADD.W @ER1,@ER0)は、図11に例示されるように、命令拡張用前置命令コード、EA1、EA2コード、演算コードを組合せる。なお、ソース側、デスティネーション側の両方を汎用レジスタ上のデータとする場合(ADD.W R1,R0)は、既存の命令であり、演算コードのみでよい。換言すれば、前置命令コードは不要である。   For the addition processing or the like, it is only necessary to combine EA1 and EA2 on the source side and the destination side that use the memory. When only the source side is data on the memory (for example, ADD.W @ ER1, R0), the instruction extension prefix instruction code and EA1 code (same as MOV.W @ ER1, Rx. Rx has meaning) As described above, R0) is combined with an operation code (same as ADD.W Rx, R0). When only the destination side is data on the memory (ADD.WR1, @ ER0), the instruction extension prefix instruction code, the EA2 code, and the operation code are combined. When both the source side and the destination side are data on the memory (ADD.W @ ER1, @ ER0), as shown in FIG. 11, the instruction code for instruction expansion, EA1, EA2 code, Combine operation codes. Note that when both the source side and the destination side are data on general-purpose registers (ADD.WR1, R0), they are existing instructions and only an operation code is required. In other words, no prefix instruction code is required.

イミディエイトデータとメモリ上のデータとの演算(例えば、ADD.W #xx,@ER1)も、同様であるが、イミディエイトデータはソース側とされるから、図13に例示されるようにEA1コードは必要なく、また、演算コードとして、レジスタ間演算の代わりに、イミディエイト・レジスタ間の演算コード(ADD.W #xx,Rxと同一)を用いる。   The operation of the immediate data and the data on the memory (for example, ADD.W #xx, @ ER1) is the same, but since the immediate data is on the source side, the EA1 code is as shown in FIG. It is not necessary, and an operation code between immediate registers (same as ADD.W #xx, Rx) is used as an operation code instead of the operation between registers.

メモリ間の転送命令(例えば、MOV.W @ER1,@aa:16)は、前記メモリ間の演算同様に、命令拡張用前置命令コード、EA1コード、EA2コード、及びレジスタ間の転送命令コードを組合せてもよいが、この例では、図12に例示されるように命令拡張用前置命令コード、EA1コード(MOV.W @ER1,Rxと同一)、EA2コード(MOV.W Rx,@aa:16と同一)を組合せる。演算コードは不要とし、EA1コードの転送方向はリード方向、EA2コードの転送方向はライト方向とする。これによって、命令コード長を短縮(演算コード分)し、実行ステート数(演算コードのリード、デスティネーション側データのリード)も短縮できる。   A transfer instruction between memories (for example, MOV.W @ ER1, @aa: 16) is a pre-instruction code for instruction expansion, an EA1 code, an EA2 code, and a transfer instruction code between registers, like the operation between the memories. However, in this example, as shown in FIG. 12, an instruction extension prefix instruction code, EA1 code (same as MOV.W @ ER1, Rx), EA2 code (MOV.W Rx, @ aa: same as 16). No operation code is required, the transfer direction of the EA1 code is the read direction, and the transfer direction of the EA2 code is the write direction. As a result, the instruction code length can be shortened (for the operation code), and the number of execution states (operation code read, destination side data read) can be shortened.

イミディエイトデータのメモリへの転送(例えば、 MOV.W #xx,@ER1)は、前記イミディエイトデータとメモリ上のデータとの演算同様に、命令拡張用前置命令コード、EA2コード、演算コードを組合せてもよいが、ここでの例では、図14に例示されるように命令拡張用前置命令コード、イミディエイト・レジスタ間の転送命令コード(MOV.W #xx,Rxと同一)、EA2コード(MOV.W Rx,@aa:16と同一)を組合せる。これによって、実行ステート数(デスティネーション側データのリード)も短縮できる。   Transfer of immediate data to memory (for example, MOV.W #xx, @ ER1) is a combination of an instruction extension prefix instruction code, an EA2 code, and an operation code, similar to the operation of the immediate data and the data on the memory. However, in this example, as shown in FIG. 14, a front instruction code for instruction expansion, an instruction code for transfer between immediate registers (same as MOV.W #xx, Rx), EA2 code ( MOV.W Rx, @aa: same as 16). As a result, the number of execution states (reading of data on the destination side) can also be shortened.

図15には命令拡張用前置命令コード(制御コード)のフォーマットが例示される。同図に示される命令拡張用前置命令コードはソース側、デスティネーション側がメモリであるか否かを夫々示す為のビットを有している。対応ビットが例えば論理値“1”であればメモリ、論理値“0”であれば汎用レジスタを指定するものとする。EA1とEA2の転送命令コードは同一としているため、ソース側がメモリであれば、デスティネーション側に拘らず、命令拡張用前置命令コードに続くものが、EA1コードと判断される。一方、ソース側が汎用レジスタとされ、デスティネーション側がメモリであれば、EA2コードと判断される。そのほか、ロングワードサイズを示す情報を持っている。   FIG. 15 illustrates a format of a pre-instruction code (control code) for instruction extension. The instruction extension pre-instruction code shown in the figure has a bit for indicating whether or not the source side and the destination side are memories. For example, if the corresponding bit is a logical value “1”, a memory is specified, and if the corresponding bit is a logical value “0”, a general-purpose register is specified. Since the transfer instruction codes of EA1 and EA2 are the same, if the source side is a memory, the one following the instruction extension prefix instruction code is determined to be the EA1 code regardless of the destination side. On the other hand, if the source side is a general-purpose register and the destination side is a memory, it is determined as an EA2 code. In addition, it has information indicating the longword size.

また、EA1、EA2の転送命令コードの動作を変更させる情報を持っている。例えば、ポストインクリメント/プリデクリメントレジスタ間接が、メモリのリード/ライトの方向によって一義的に指定されてしまう場合、即ち、ポストインクリメントはライト時、プリデクリメントはリード時などと固定されている命令セットの場合、前記変更情報によって、リード時にポストインクリメント動作を行なったり、ライト時にプリデクリメントを行なったりすることを可能にしている。   It also has information for changing the operation of the transfer instruction codes of EA1 and EA2. For example, when post-increment / pre-decrement register indirection is uniquely specified by the memory read / write direction, that is, post-increment is fixed at the time of writing, pre-decrement is at the time of reading, etc. In this case, the change information makes it possible to perform a post-increment operation at the time of reading and pre-decrement at the time of writing.

図16及び図17にはCPUのアドレッシングモードの組合せについて示される。図16はデータ転送命令について示し、図17は加算命令について示す。加算以外の演算命令も、加算命令と同様にされる。   16 and 17 show combinations of CPU addressing modes. FIG. 16 shows the data transfer instruction, and FIG. 17 shows the addition instruction. Operation instructions other than addition are the same as the addition instruction.

図16及び図17の“ソース”の各欄における上段、中段、下段には、それぞれ、上位CPU2、第1の下位CPU、第2の下位CPUの、それぞれ、実行可能なデータサイズが示されている。Bはバイト(8ビット)、Wはワード(16ビット)、Lはロングワード(32ビット)を意味する。   The upper, middle, and lower stages in each column of “Source” in FIGS. 16 and 17 show the executable data sizes of the upper CPU 2, the first lower CPU, and the second lower CPU, respectively. Yes. B means byte (8 bits), W means word (16 bits), and L means long word (32 bits).

アドレッシングモードには図16及び図17に示された他に、分岐命令のみに使用する、プログラムカウンタ相対や、メモリ間接のアドレッシングモードもあるが、ここでは図示を省略している。   In addition to the addressing modes shown in FIGS. 16 and 17, there are also program counter relative and memory indirect addressing modes used only for branch instructions, but these are not shown here.

上位のCPU2は、データ転送命令、加算命令ともに、ソース/デスティネーションとデータサイズのアドレッシングモードの組合せを任意にできる。但し、8ビット絶対アドレスについては、短縮形としての特性上、また、16ビット単位の命令コードの特性上、バイトサイズのみが実行可能である。   The host CPU 2 can arbitrarily combine the source / destination and data size addressing modes for both the data transfer instruction and the addition instruction. However, with regard to the 8-bit absolute address, only the byte size can be executed due to the characteristics of the abbreviated form and the characteristics of the 16-bit unit instruction code.

第1の下位CPUは、アドレッシングモードは、アドレス空間64kBであることに対応して限定され、32ビットディスプレースメント付レジスタ間接、32ビット絶対アドレスは実行できない。データサイズは、バイト及びワードである。データ転送命令は、ソース側またはデスティネーション側の一方が、レジスタ直接の場合のみ実行可能である。また、加算命令は、ソース側はイミディエイトまたは汎用レジスタ、デスティネーション側は汎用レジスタに限定されている。即ち、メモリのリード/ライトはデータ転送命令で行い、データの処理は汎用レジスタ上で行なう、いわゆるロードストア型の命令セットを持つ。   The first lower CPU is limited to the addressing mode corresponding to the address space of 64 kB, and cannot execute the register indirect with 32-bit displacement and the 32-bit absolute address. Data size is in bytes and words. The data transfer instruction can be executed only when one of the source side and the destination side is a register directly. The addition instruction is limited to an immediate or general-purpose register on the source side and a general-purpose register on the destination side. That is, the memory has a so-called load / store type instruction set in which reading / writing of a memory is performed by a data transfer instruction and data processing is performed by a general-purpose register.

第2の下位CPUは、アドレス空間16MBであるものの、プログラムの大容量化に対応することを主目的とし、大規模データの高速処理などが必要とされないような応用分野を考え、アドレッシングモードについては、32ビットディスプレースメント付レジスタ間接、32ビット絶対アドレスは実行できない。データサイズは、メモリ上のデータを指定する場合、バイト及びワードである。ソース側がイミディエイトまたは汎用レジスタ、デスティネーション側が汎用レジスタの場合に限り、ロングワードも可能である。   Although the second lower CPU has an address space of 16 MB, the main purpose is to cope with an increase in the capacity of the program, and considering an application field in which high-speed processing of large-scale data is not required, Register indirect with 32-bit displacement and 32-bit absolute address cannot be executed. The data size is a byte and a word when specifying data on the memory. Longwords are possible only if the source side is an immediate or general purpose register and the destination side is a general purpose register.

第2の下位CPUにおいては、汎用レジスタの本数は少ないものの、データ転送命令、加算命令ともに、ソース/デスティネーションのアドレッシングモードの組合せを任意にできる。汎用レジスタとメモリ間の転送命令のデータサイズは、マイクロコンピュータの機能ブロックのデータサイズが8ビット乃至16ビット長であったり、内部データバスが16ビットであったり、またシングルチップマイクロコンピュータの応用されるマイクロコンピュータシステムに必要な分解能などの特性上、16ビット(ワード)または8ビット(バイト)でよい応用分野を考え、32ビット(ロングワード)は持たない。当然、32ビット(ロングワード)のデータについては、16ビット(ワード)のデータ転送を2回行なうことによって、実現できる。   In the second lower CPU, although the number of general-purpose registers is small, any combination of the source / destination addressing modes can be used for both the data transfer instruction and the addition instruction. The data size of the transfer instruction between the general-purpose register and the memory is 8 to 16 bits long for the functional block data of the microcomputer, the internal data bus is 16 bits, and the single chip microcomputer is applied. Considering application fields that may be 16 bits (words) or 8 bits (bytes) due to characteristics such as resolution required for a microcomputer system, they do not have 32 bits (longwords). Naturally, 32-bit (long word) data can be realized by performing 16-bit (word) data transfer twice.

一方、第2の下位CPUでは、汎用レジスタが32ビット構成であり、CPUの内部構成が32ビットであるため、メモリ上のデータのリード/ライトを行なう必要のない、イミディエイト及びレジスタ直接については、32ビット(ロングワード)も実行可能としている。   On the other hand, in the second lower CPU, since the general-purpose register has a 32-bit configuration and the internal configuration of the CPU is 32-bit, there is no need to read / write data on the memory. 32-bit (long word) is also executable.

以上の、上位CPU、第1の下位CPU2、第2の下位CPUは、例えば以下の通り、応用分野やマイクロコンピュータシステムの要求に合わせて選択できる。   The upper CPU, the first lower CPU 2 and the second lower CPU can be selected according to the application field and the requirements of the microcomputer system, for example, as follows.

シングルチップマイクロコンピュータに内蔵されている機能モジュール、即ち、ROM、RAM、タイマA、タイマB、SCI、A/D変換器、入出力ポートのみを使用して動作するようなマイクロコンピュータシステムについては、プログラム容量が60kB程度(RAM、内部I/Oレジスタを合わせて64kB)以下であれば、第1の下位CPUを内蔵するのが都合がよい。   Regarding a functional system built in a single-chip microcomputer, that is, a microcomputer system that operates using only ROM, RAM, timer A, timer B, SCI, A / D converter, input / output port, If the program capacity is about 60 kB or less (64 kB including RAM and internal I / O registers), it is convenient to incorporate the first lower CPU.

また、プログラム容量がログラム容量が60kB程度(RAM、内部I/Oレジスタを合わせて64kB)以上であれば、第2の下位CPUを内蔵するのが都合がよい。データとして扱うのは、RAM、内部I/Oレジスタ、及び一部のROMであり、アドレス空間の一部(H’8000〜H’FF7FFF)に、データ転送/演算命令でのアクセスに制約があっても、この部分はROM及び未使用の領域とされるから、問題ない。むしろ、CPUの不必要な機能を削除して、論理的規模を縮小し、費用を縮小する方が望ましい。   If the program capacity is about 60 kB or more (64 kB in total including RAM and internal I / O registers), it is convenient to incorporate a second lower CPU. The RAM, internal I / O registers, and some ROM are handled as data, and part of the address space (H'8000 to H'FF7FFF) has restrictions on access by data transfer / arithmetic instructions. However, since this part is a ROM and an unused area, there is no problem. Rather, it is desirable to delete unnecessary functions of the CPU to reduce the logical scale and reduce the cost.

かかるシングルチップマイクロコンピュータに内蔵されている機能モジュールのみを使用して動作するようなマイクロコンピュータシステムとしては、カメラなどがあり、例えば、平成6年11月写真工業社発行『写真工業』pp58〜71に記載がある。なお、プログラム容量が大きいことは、そのマイクロコンピュータシステムの機能が高いことを示すと言える。   As a microcomputer system that operates using only a functional module built in such a single-chip microcomputer, there is a camera. For example, “Photo Industry” published in November 1994, “Photo Industry” pp 58-71. There is a description. It can be said that a large program capacity indicates that the function of the microcomputer system is high.

或いは、シングルチップマイクロコンピュータに内蔵されている機能モジュールに加えて、比較的少ないアドレスを有する専用半導体集積回路などを、シングルチップマイクロコンピュータの外部バスに接続して動作するようなマイクロコンピュータシステムも同様であり、この例としては、光ディスクドライブなどがあり、例えば、平成8年2月日立マイコンシステム社発行『日立マイコン技報』pp38〜39に記載がある。   Alternatively, a microcomputer system that operates by connecting a dedicated semiconductor integrated circuit having a relatively small address to an external bus of a single chip microcomputer in addition to a functional module built in the single chip microcomputer is also the same. An example of this is an optical disk drive, which is described in, for example, “Hitachi Microcomputer Technical Bulletin” pp38-39 published by Hitachi Microcomputer Systems in February 1996.

一方、シングルチップマイクロコンピュータに内蔵されている機能モジュール、即ち、ROM、RAM、タイマA、タイマB、SCI、A/D変換器、入出力ポート以外に、プログラム格納用のROMや、データ格納用のDRAM、キャラクタジェネレートROM(CGROM)や、入出力回路や制御回路などを接続して動作するような場合は、大規模なデータを扱うことになり、例えば配列の処理なども考えられるので、全アドレス空間を制限なく使用可能な上位CPU2を内蔵するのが都合がよい。また、外部のメモリなどを効率的に利用するための高機能のバスコントローラや、高速のデータ転送を行なうためのDMAコントローラなども必要とされるから、相対的に論理的規模の大きい上位CPU2を使用しても、全体的な論理的規模に対する影響が小さいと考えられる。かかるマイクロコンピュータシステムとしては、プリンタなどがある。   On the other hand, in addition to the functional modules built into the single-chip microcomputer, that is, ROM, RAM, timer A, timer B, SCI, A / D converter, input / output port, program storage ROM and data storage DRAM, character generation ROM (CGROM), input / output circuit, control circuit, etc. are connected to operate and handle a large amount of data. For example, array processing can be considered. It is convenient to incorporate an upper CPU 2 that can use the entire address space without restriction. In addition, since a high-function bus controller for efficiently using an external memory or the like and a DMA controller for performing high-speed data transfer are also required, an upper CPU 2 having a relatively large logical scale is required. Even if used, the impact on the overall logical scale is considered to be small. Such a microcomputer system includes a printer.

図1には上位CPU2の詳細な一例が示される。このCPU2は制御部CONTと実行部EXECから構成される。IDB、IABは前記内部バス30に含まれる内部データバス、内部アドレスバスである。   FIG. 1 shows a detailed example of the host CPU 2. The CPU 2 includes a control unit CONT and an execution unit EXEC. IDB and IAB are an internal data bus and an internal address bus included in the internal bus 30.

制御部CONTは、命令レジスタIR1、命令レジスタIR2、命令変更部CHG、命令デコーダDEC、レジスタセレクタRSEL、割込み制御部INTCを有する。特に制御部CONTは、命令拡張用前置命令コードの有無に応じた第1の制御、レジスタ拡張用前置命令コードの有無に応じた第2の制御を行なうようになっている。第1の制御は、メモリデータの直接的演算処理制御であり、命令拡張用前置命令コードに後続するデータ転送命令等の複数の命令コードを1個の命令として処理することにより、メモリ上のデータを直接的に演算可能とする制御を行なう。第2の制御は、上位互換を考慮したレジスタ指定制御であり、一方では拡張された汎用レジスタをレジスタ拡張用前置命令コードを用いて指定するようにし、他方では、省略可能なレジスタ指定フィールドgr(gr1、gr2)が省略されたとき省略不可能なレジスタ指定フィールドr(r1、r2)によるレジスタ指定を暗黙的にレジスタグループ0に含まれるレジスタ指定とみなす制御を行なう。   The control unit CONT includes an instruction register IR1, an instruction register IR2, an instruction change unit CHG, an instruction decoder DEC, a register selector RSEL, and an interrupt control unit INTC. In particular, the control unit CONT performs a first control according to the presence / absence of an instruction extension pre-instruction code and a second control according to the presence / absence of a register extension pre-instruction code. The first control is direct arithmetic processing control of memory data, and by processing a plurality of instruction codes such as a data transfer instruction following an instruction extension pre-instruction code as one instruction, Control to enable direct calculation of data. The second control is a register designation control in consideration of upward compatibility. On the one hand, an extended general-purpose register is designated using a register instruction prefix instruction code, and on the other hand, an optional register designation field gr is designated. When (gr1, gr2) is omitted, control is performed so that register specification by the register specification field r (r1, r2), which cannot be omitted, is implicitly regarded as register specification included in the register group 0.

前記命令デコーダDECは、例えば、マイクロROM或はPLA(Programmable Logic Array)または布線論理で構成される。命令デコーダDECの出力の一部が命令デコーダDECにフィードバックされている。そのようなフィードバック信号は、各命令コード内の遷移に用いるステージコード(TMG)と、命令コード間に用いる制御信号(MODS、MODD)を含む。命令デコーダにおける前記第1の制御の全体的な機能を概説すれば、命令拡張用前置命令コードは制御信号(MODS、MODD)を発生し、EA1コード、EA2コードは、前記制御信号を参照しつつ動作し、更に制御信号を発生したりする。演算コードも制御信号を参照して、データの入出力元/先を切替え、演算処理を行なう。制御信号に従って内部で命令コードも発生する。   The instruction decoder DEC is configured by, for example, a micro ROM, PLA (Programmable Logic Array), or a wiring logic. Part of the output of the instruction decoder DEC is fed back to the instruction decoder DEC. Such a feedback signal includes a stage code (TMG) used for transition in each instruction code and a control signal (MODS, MODD) used between instruction codes. An overview of the overall function of the first control in the instruction decoder is as follows. The instruction code for instruction extension generates a control signal (MODS, MODD), and the EA1 code and EA2 code refer to the control signal. And generating a control signal. The operation code also refers to the control signal to switch the data input / output source / destination and perform the operation processing. An instruction code is also generated internally in accordance with the control signal.

命令デコーダDECのそのような第1の制御機能を更に詳述する。図1には命令デコーダDECの一部の機能を概念的に示しており、命令拡張用前記前置命令コード(pf)の解読論理200は、制御信号(mod: MODS、MODDを含む)、割込みマスク信号(mskint)を出力する。そのほかは、NOP(無操作)命令などと同じでよく、実質的な動作を何も行なわない。要するに、制御信号modは、後続の命令コードが命令拡張用前置命令コードに付加された命令コードであることを明示する信号として位置付けられる。   Such a first control function of the instruction decoder DEC will be described in further detail. FIG. 1 conceptually shows a part of the function of the instruction decoder DEC. The decoding logic 200 of the instruction code (pf) for instruction extension includes a control signal (including mod: MODS and MODD), an interrupt A mask signal (mskint) is output. Other than that, it may be the same as a NOP (no operation) command, and does not perform any substantial operation. In short, the control signal mod is positioned as a signal that clearly indicates that the subsequent instruction code is an instruction code added to the instruction expansion front instruction code.

転送命令コード(mov)の解読論理201は、ステートコード信号(nxttmg)、割込みマスク信号(mskint)、汎用レジスタライト信号(Rdwr)、テンポラリレジスタライト信号(TRDwr)を出力する。これらの信号の状態は、前記制御信号(mod:MODS、MODD)によって相違される。例えば、MODS=1のときはテンポラリレジスタライト信号(TRDwr)が、 MODS=0のときは汎用レジスタライト信号(Rdwr)が、それぞれ選択される。そのほかの動作は、メモリ・汎用レジスタ間の転送命令の場合と同様とされる。   The transfer instruction code (mov) decoding logic 201 outputs a state code signal (nxttmg), an interrupt mask signal (mskint), a general-purpose register write signal (Rdwr), and a temporary register write signal (TRDwr). The states of these signals are different depending on the control signals (mod: MODS, MODD). For example, the temporary register write signal (TRDwr) is selected when MODS = 1, and the general-purpose register write signal (Rdwr) is selected when MODS = 0. Other operations are the same as those in the case of the transfer instruction between the memory and the general-purpose register.

演算命令コード(exe)の解読論理202は、割込みマスク信号(mskint)、ソース汎用レジスタリード信号(Rsrd)、デスティネーション汎用レジスタリード信号(Rdrd)、デスティネーション汎用レジスタライト信号(Rdwr)、リードデータバッファリード信号(RDBrd)、テンポラリレジスタリード信号(TRDrd)、テンポラリレジスタライト信号(TRDwr)を出力する。信号Rsrdはソースレジスタとして汎用レジスタをリード、Rdrdはディスティネーションレジスタとして汎用レジスタをリード、Rdwrはディスティネーションレジスタとして汎用レジスタをライト、することを指示する。信号RDBrdは実行部EXECの後述するリードデータバッファをリード、信号TRDrdは後述する実行部EXECのテンポラリレジスタをリード、信号TRDwrは後述する実行部EXECの後述するテンポラリレジスタをライト、することを指示する。それらの信号の状態は、前記制御信号(mod:MODS、MODD)によって相違される。即ち、ソース汎用レジスタリード信号(Rsrd)とテンポラリレジスタリード信号(TRDrd)、デスティネーション汎用レジスタリード信号(Rdrd)とリードデータバッファリード信号(RDBrd)、デスティネーション汎用レジスタライト信号(Rdwr)とテンポラリレジスタライト信号(TRDwr)、がそれぞれ排他的に選択され、汎用レジスタを使用するかテンポラリレジスタ等のラッチ手段を使用するかを選択する。また、デスティネーション側メモリの場合は、CPU内部でライト型転送命令を実行するのと同等の動作を行なうための命令コードを発生させる信号(mkmov)を出力する。そのほかの動作は、汎用レジスタに対する演算命令と同様にされる。   The decoding logic 202 of the operation instruction code (exe) includes an interrupt mask signal (mskint), a source general-purpose register read signal (Rsrd), a destination general-purpose register read signal (Rdrd), a destination general-purpose register write signal (Rdwr), and read data A buffer read signal (RDBrd), a temporary register read signal (TRDrd), and a temporary register write signal (TRDwr) are output. The signal Rsrd reads the general register as the source register, Rdrd reads the general register as the destination register, and Rdwr instructs to write the general register as the destination register. The signal RDBrd reads a read data buffer (to be described later) of the execution unit EXEC, the signal TRDrd reads a temporary register of the execution unit EXEC (to be described later), and the signal TRDwr instructs to write a temporary register (to be described later) of the execution unit EXEC (to be described later). . The states of these signals are different depending on the control signal (mod: MODS, MODD). That is, the source general-purpose register read signal (Rsrd) and the temporary register read signal (TRDrd), the destination general-purpose register read signal (Rdrd) and the read data buffer read signal (RDBrd), the destination general-purpose register write signal (Rdwr) and the temporary register The write signal (TRDwr) is selected exclusively to select whether to use a general purpose register or a latch means such as a temporary register. In the case of the destination-side memory, a signal (mkmov) for generating an instruction code for performing an operation equivalent to executing a write transfer instruction in the CPU is output. Other operations are the same as the operation instruction for the general-purpose register.

命令レジスタIR1、IR2は、リードした命令を一旦格納する。命令デコーダDECには命令レジスタIR1に格納された命令コードが供給されることになる。命令変更部CHGは、リードした命令以外の命令コードを、命令デコーダDECに与える場合に動作し、そのほかの場合は、命令レジスタIR1の内容を命令デコーダDECに与える。リードした命令以外の命令コードは、割込み制御部INTCの指示によって、割込みなどの例外処理を実行するとき、或いは、命令デコーダDECのからの制御信号mkmovによる指示によって前記内部でライト型転送命令と同等の動作を行なう命令コードを発生させるとき、などに用いる。即ち、デスティネーション側をメモリ上のデータとする場合に、EA2コードで生成したアドレスでメモリライト動作を行なう為の命令コードをCPU内部で自動生成して、命令デコーダDECに供給することによって、本発明の命令の命令コード長を短縮し、実行ステート数も短縮できる。   The instruction registers IR1 and IR2 temporarily store the read instruction. The instruction code stored in the instruction register IR1 is supplied to the instruction decoder DEC. The instruction changing unit CHG operates when an instruction code other than the read instruction is given to the instruction decoder DEC, and in other cases, the contents of the instruction register IR1 are given to the instruction decoder DEC. The instruction code other than the read instruction is equivalent to the write-type transfer instruction internally when exception processing such as an interrupt is executed according to an instruction from the interrupt control unit INTC or according to an instruction based on a control signal mkmov from the instruction decoder DEC. This is used to generate an instruction code for performing the above operation. That is, when the destination side is data on the memory, an instruction code for performing a memory write operation with an address generated by the EA2 code is automatically generated in the CPU and supplied to the instruction decoder DEC. The instruction code length of the instruction of the invention can be shortened, and the number of execution states can be shortened.

割込み制御部INTCは、図2の割込みコントローラ(INT)3の出力する割込み要求信号31を受け付ける。また、命令デコーダDECの出力する割込みマスク信号mskintを参照して、割込みがマスクされていなければ、命令変更部CHGに割込みを指示する。この場合、命令変更部CHGは、割り込み例外処理の為の所定の命令コードをそのハードウェアに従って生成する。   The interrupt control unit INTC receives the interrupt request signal 31 output from the interrupt controller (INT) 3 in FIG. Further, referring to the interrupt mask signal mskint output from the instruction decoder DEC, if the interrupt is not masked, the interrupt is instructed to the instruction change unit CHG. In this case, the instruction change unit CHG generates a predetermined instruction code for interrupt exception handling according to the hardware.

図11乃至図14で説明したように、複数の命令コードを一連のものとして実行する場合には、それぞれの命令コードが割込みマスクを制御信号mskintを介して指示して、所定の組合せの命令コードの実行が途切れないようにされる。   As described with reference to FIGS. 11 to 14, when a plurality of instruction codes are executed as a series, each instruction code indicates an interrupt mask via the control signal mskint, and a predetermined combination of instruction codes. Will not be interrupted.

レジスタセレクタRSELは、命令デコーダDECからの信号Rsrd,Rdrd,Rdwr等による指示、命令コード中に含まれるレジスタフィールドr1、r2、gr1、gr2の情報に基づいて、汎用レジスタを選択する。   The register selector RSEL selects a general-purpose register based on an instruction from the instruction decoder DEC using signals Rsrd, Rdrd, Rdwr, and the like, and information on register fields r1, r2, gr1, and gr2 included in the instruction code.

実行部EXECには、汎用レジスタER0〜ER7、プログラムカウンタPC、コンディションコードレジスタCCR、テンポラリレジスタTRA、TRD、算術論理演算器ALU、インクリメンタINC、リードデータバッファRDB、ライトデータバッファWDB、アドレスバッファABを含む。これらのブロックは内部バスGB、DB、WBによって相互に接続されている。   The execution unit EXEC includes general-purpose registers ER0 to ER7, a program counter PC, a condition code register CCR, temporary registers TRA and TRD, an arithmetic logic unit ALU, an incrementer INC, a read data buffer RDB, a write data buffer WDB, and an address buffer AB. including. These blocks are connected to each other by internal buses GB, DB, and WB.

前記実行部EXECに含まれる前記レジスタの内、図3にも示される汎用レジスタER0〜ER31、プログラムカウンタPC、コンディションコードレジスタCCR以外は、プログラミング上は参照できず、CPU2の内部の動作にのみ用いられる。即ち、リードデータバッファRDB、ライトデータバッファWDB、アドレスバッファABなどは、内部バスIAB、IDBとのインタフェースをとるために、一時的にデータをラッチする。テンポラリレジスタTRA、TRDは、マイクロコンピュータ内部の動作に適宜用いられ、例えば演算の途中結果などを一時的に貯える。   Of the registers included in the execution unit EXEC, those other than the general-purpose registers ER0 to ER31, the program counter PC, and the condition code register CCR, which are also shown in FIG. 3, cannot be referred to in programming, and are used only for the internal operation of the CPU 2. It is done. That is, the read data buffer RDB, the write data buffer WDB, the address buffer AB, and the like temporarily latch data in order to interface with the internal buses IAB and IDB. The temporary registers TRA and TRD are appropriately used for the internal operation of the microcomputer, and temporarily store, for example, intermediate results of operations.

リードデータバッファRDBは、ROM4、RAM5、内部I/Oレジスタ、或は図示はされない外部メモリから、リードした命令コードやデータを一時的に格納する。ライトデータバッファWDBはROM4、RAM5、内部I/Oレジスタ、或は外部メモリへのライトデータを一時的に格納する。   The read data buffer RDB temporarily stores instruction codes and data read from the ROM 4, RAM 5, internal I / O registers, or external memory (not shown). The write data buffer WDB temporarily stores write data to the ROM 4, RAM 5, internal I / O register, or external memory.

アドレスバッファABは、CPU2がリード/ライトするアドレスを一時的に格納する他に、格納した内容に対するインクリメント機能を有している。インクリメント機能を有するアドレスバッファは特開平4−333153号公報などに記載されている。   The address buffer AB temporarily stores an address to be read / written by the CPU 2 and has an increment function for the stored contents. An address buffer having an increment function is described in JP-A-4-333153.

前記算術論理演算器ALUは、命令によって指定される各種の演算や実効アドレスの計算などに用いられる。前記インクリメンタINCは、主にプログラムカウンタPCの加算に用いられる。また、尚、図1では実行部EXECは汎用レジスタER0〜ER31を単位として算術論理演算器ALUやインクリメンタINCが設けられていように図示されているが、実際は、汎用レジスタのE(16ビット)、H(8ビット)、L(8ビット)の各分割部分毎に分割されて設けられている。   The arithmetic logic unit ALU is used for various operations specified by instructions and effective address calculation. The incrementer INC is mainly used for addition of the program counter PC. In FIG. 1, the execution unit EXEC is shown as having an arithmetic logic unit ALU and an incrementer INC in units of general-purpose registers ER0 to ER31. However, in reality, E (16 bits) of the general-purpose register is shown. , H (8 bits), and L (8 bits) are divided and provided.

前記命令拡張用前置命令コードに後続する命令コードを用いてメモリ上のデータを直接的に演算する場合には、テンポラリレジスタTRA、TRD及びリードデータバッファRDBなどを用いる。テンポラリレジスタTRAは、デスティネーション側データがメモリになる演算命令の場合に、デスティネーションアドレスのリード時にリードアドレス(実効アドレス)を格納し、データのデスティネーション側メモリへのライト時に、デスティネーションアドレス(リードアドレスと同じアドレス)を出力する。   When the data on the memory is directly calculated using an instruction code subsequent to the instruction extension pre-instruction code, temporary registers TRA and TRD, a read data buffer RDB, and the like are used. The temporary register TRA stores a read address (effective address) when the destination address is read when the destination side data is an operation instruction for the memory, and a destination address (when the data is written to the destination side memory). Output the same address as the read address).

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

リードデータバッファRDBは、更に、デスティネーション側データがメモリになる演算命令の場合に、デスティネーション側データを一時格納し、演算コードの実行時にソース側データを出力する。   The read data buffer RDB further stores the destination side data temporarily in the case of an operation instruction in which the destination side data becomes a memory, and outputs the source side data when the operation code is executed.

前記レジスタTRA、TRD、RDB等は既存の命令実行においても適宜利用されるが、その詳細な内容は本発明とは直接関係ないので説明を省略する。   The registers TRA, TRD, RDB, etc. are used as appropriate in the execution of existing instructions. However, the detailed contents thereof are not directly related to the present invention, and the description thereof will be omitted.

CPU2は前記第2の制御を実現するために、前述のように2個の命令レジスタIR1,IR2を有している。レジスタセレクタRSELには、前記命令デコーダDECの出力信号、命令レジスタIR1,IR2の出力信号、そして前記SYSC21に含まれる内部I/Oレジスタ(CPUCR)22の出力信号が供給される。   The CPU 2 has the two instruction registers IR1 and IR2 as described above in order to realize the second control. The register selector RSEL is supplied with the output signal of the instruction decoder DEC, the output signals of the instruction registers IR1 and IR2, and the output signal of the internal I / O register (CPUCR) 22 included in the SYSC 21.

前記命令レジスタIR1は内部データバスIDBから命令が供給される。前記命令レジスタIR1の出力は、もう一つの命令レジスタIR2に、前記命令変更部CHGを介して命令デコーダDECに、そして、前記レジスタセレクタRSELに結合される。前記命令レジスタIR2の出力は前記レジスタセレクタRSELに結合される。前記命令デコーダDECの出力はレジスタセレクタRSEL及び前記命令レジスタIR2に結合される。命令デコーダDECは命令レジスタIR1にフェッチされた命令のオペレーションフィールドのオペレーションコードを解読する。命令レジスタIR1にフェッチされた命令コードが前記レジスタ拡張用前置命令コードであるとき、命令デコーダDECがこれを解読することによって、当該レジスタ拡張用前置命令のレジスタグループ指定フィールド(gr)のレジスタ指定情報を命令レジスタIR2にラッチさせる。その時のラッチ信号は命令デコーダDECから出力される。命令レジスタIR2にラッチされたレジスタフィールド指定情報、及び続けて命令レジスタIR1にフェッチされた後続の命令に含まれるレジスタフィールド(r)のレジスタ指定情報は、レジスタセレクタRSELで解読され、それら情報で直接的に指定されたレジスタグループの中のレジスタが選択され、選択されたレジスタを利用して当該後続の命令が実行される。この命令実行後、前記命令デコーダDECは前記命令レジスタIR2のラッチ情報を全ビット値“0”(レジスタグループ0の指定情報)にクリアするためのセット信号を命令レジスタIR2に供給する。したがって、その後に、レジスタ拡張用前置命令コードを省いた命令が命令レジスタIR1にフェッチされても、命令レジスタIR2の出力はレジスタグループ0の指定情報を維持する結果、レジスタセレクタRSELは暗黙的にレジスタグループ0が指定されていると見做して、命令レジスタ31からのレジスタ指定情報に従ったレジスタをレジスタグループ0から選択する。   The instruction register IR1 is supplied with an instruction from the internal data bus IDB. The output of the instruction register IR1 is coupled to another instruction register IR2, to the instruction decoder DEC via the instruction changer CHG, and to the register selector RSEL. The output of the instruction register IR2 is coupled to the register selector RSEL. The output of the instruction decoder DEC is coupled to a register selector RSEL and the instruction register IR2. The instruction decoder DEC decodes the operation code in the operation field of the instruction fetched into the instruction register IR1. When the instruction code fetched to the instruction register IR1 is the register extension pre-instruction code, the instruction decoder DEC decodes the instruction code to register in the register group designation field (gr) of the register extension pre-instruction. The specified information is latched in the instruction register IR2. The latch signal at that time is output from the instruction decoder DEC. The register field designation information latched in the instruction register IR2 and the register designation information of the register field (r) included in the subsequent instruction fetched in the instruction register IR1 are decoded by the register selector RSEL and directly used as the information. A register in the designated register group is selected, and the subsequent instruction is executed using the selected register. After executing this instruction, the instruction decoder DEC supplies a set signal to the instruction register IR2 for clearing the latch information of the instruction register IR2 to all bit values “0” (register group 0 designation information). Therefore, even if an instruction without the register extension prefix instruction code is fetched to the instruction register IR1 thereafter, the output of the instruction register IR2 maintains the designation information of the register group 0. As a result, the register selector RSEL implicitly Assuming that the register group 0 is designated, a register according to the register designation information from the instruction register 31 is selected from the register group 0.

前記第2の下位CPUは、図1の構成から、その命令セットに必要のない機能ブロックや論理回路を削除して開発することができる。汎用レジスタはER0、ER1、ER7、ER15のみとし、レジスタセレクタRSELも、これに対応して削除することができる。アドレスバッファのインクリメント機能も、メモリに対するロングワードサイズのデータ転送命令を削除したことに対応して、削除できる。   The second lower CPU can be developed by deleting functional blocks and logic circuits that are not necessary for the instruction set from the configuration of FIG. The general-purpose registers are only ER0, ER1, ER7, and ER15, and the register selector RSEL can be deleted correspondingly. The address buffer increment function can also be deleted in response to the deletion of a long word size data transfer instruction for the memory.

命令デコーダDECも、32ビットディスプレースメント付レジスタ間接、32ビット絶対アドレス、メモリ間接などを削除して、これに必要な論理回路を削除できる。かかるアドレッシングモードによる命令は、長い命令コードを持ち、必然的に、実行ステート数も大きくなるし、また、ロングワードサイズのデータ転送命令なども、内部データバスが16ビットであることに対応して、2回のワードサイズデータ転送を行なうことになどして、制御論理も複雑になりやすいから、これらのアドレッシングモードやロングワードサイズデータ転送命令を削除できれば、論理的規模の縮小を図ることができる。   The instruction decoder DEC can also delete a 32-bit displacement indirect register indirect, 32-bit absolute address, memory indirect, etc., and delete a logic circuit necessary for this. An instruction in such an addressing mode has a long instruction code, inevitably increases the number of execution states, and long word size data transfer instructions and the like correspond to the internal data bus having 16 bits. Since the control logic is likely to be complicated by performing two word size data transfers, the logical scale can be reduced if these addressing modes and long word size data transfer instructions can be deleted. .

論理回路の削除に当たっては、汎用レジスタなどの、不必要な機能ブロックを削除し、削除された機能ブロックが出力している信号は非活性のレベルに固定し、また、削除されたブロックが入力している信号は、非接続または解放とすればよい。残りの論理回路は、前記の通り、非活性レベルへの固定や、非接続または解放とした状態で、論理再合成を行なえば、自動的に論理的規模の縮小を実現できる。どのような方法を採るにしても、上位CPUのサブセットとすることにより、新規の開発を行なうより、開発効率を向上できる。   When deleting a logic circuit, unnecessary function blocks such as general-purpose registers are deleted, the signal output by the deleted function block is fixed to the inactive level, and the deleted block is input. The signal that is connected may be disconnected or released. As described above, the logical scale can be automatically reduced if the remaining logic circuits are fixed to the inactive level, or are reconnected in a state of being disconnected or released. Whatever method is adopted, the development efficiency can be improved by using a subset of the upper CPU as compared with a new development.

図18には前記レジスタセレクタRSELの一部と命令レジスタIR2の詳細なブロック図が示される。   FIG. 18 shows a detailed block diagram of a part of the register selector RSEL and the instruction register IR2.

命令レジスタIR2は、保持手段としてのラッチ回路(LGR1)321及びラッチ回路(LGR2)322を有する。これらラッチ回路(LGR1、LGR2)321,322は、前述の通りレジスタグループ指定フィールドgr1、gr2のレジスタグループ指定情報をラッチする。   The instruction register IR2 includes a latch circuit (LGR1) 321 and a latch circuit (LGR2) 322 as holding means. These latch circuits (LGR1, LGR2) 321, 322 latch the register group designation information in the register group designation fields gr1, gr2, as described above.

図18に従えば、前記ラッチ回路321,322は、いわゆるリセット付きD型フリップフロップによって構成されている。リセット信号RSLGRとして、命令デコーダDECから指定される命令実行終了信号RSLGRを入力する。ラッチクロックとして、命令デコーダDECから指定されるLGRCLを入力し、また、データとして、命令レジスタIR1が保持する命令コードのビット7〜4、3〜0(グループ4個の場合は、ビット5、4、1、0のみでもよい)を入力する。ラッチクロックLGRCLは、レジスタグループを指定する命令コード(省略可能なレジスタ拡張用前置命令コード)を実行したときに活性状態になって、そのときのレジスタフィールド(gr)である、ビット7〜4、3〜0をラッチさせる。ラッチ回路321,322は、命令の実行終了時点で、命令デコーダDECからの制御信号(リセット信号RSLGR)に基づいて、所定の値に設定される。本実施例では、全ビット値“0”にクリアされる。   According to FIG. 18, the latch circuits 321 and 322 are constituted by so-called reset type D flip-flops. An instruction execution end signal RSLGR designated from the instruction decoder DEC is input as the reset signal RSLGR. LGRCL designated from the instruction decoder DEC is input as a latch clock, and bits 7 to 4 and 3 to 0 of the instruction code held in the instruction register IR1 as data (in the case of four groups, bits 5 and 4 1 or 0) may be input. The latch clock LGRCL becomes active when an instruction code designating a register group (an optional instruction code for register extension) is executed, and bits 7 to 4 are register fields (gr) at that time. , 3 to 0 are latched. The latch circuits 321 and 322 are set to predetermined values based on the control signal (reset signal RSLGR) from the instruction decoder DEC at the end of execution of the instruction. In this embodiment, all bit values are cleared to “0”.

汎用レジスタグループを指定するレジスタ拡張用前置命令コードを持たない命令は、ラッチ回路(LGR1、LGR2)321、322が値“0”にクリアされたままになっているから、命令実行が行われるとき、レジスタグループ0の汎用レジスタが指定されることになる。   Instructions that do not have a register extension prefix instruction code that designates a general-purpose register group are executed because the latch circuits (LGR1, LGR2) 321, 322 remain cleared to the value “0”. At this time, a general-purpose register of the register group 0 is designated.

レジスタセレクタRSELのデスティネーションレジスタ指定側には、ラッチ回路(LGR2)322から出力されるレジスタグループ指定フィールド(gr2)の情報を保持するラッチ回路331と、命令レジスタIR1から出力されるレジスタ指定フィールド(r2)の情報をラッチするラッチ回路332が設けられている。それらラッチ回路331,332は、システムクロックφの反転クロックφ#でラッチされるようになっており、ソースレジスタの選択動作より遅くデスティネーションレジスタの選択動作が行なわれる。これによって、デスティネーション側のレジスタ指定情報のラッチタイミング即ちデスティネーションレジスタ選択タイミングがソースレジスタ選択タイミングよりも0.5ステート遅くなるようにされる。ソースレジスタはアドレスレジスタとして先行して選択され、デスティネーションレジスタはデータの書込みのために遅れて選択されることが可能になっている。   On the destination register designation side of the register selector RSEL, there are a latch circuit 331 for holding information of a register group designation field (gr2) output from the latch circuit (LGR2) 322, and a register designation field (from the instruction register IR1). A latch circuit 332 that latches the information of r2) is provided. The latch circuits 331 and 332 are latched by the inverted clock φ # of the system clock φ, and the destination register selection operation is performed later than the source register selection operation. As a result, the latch timing of the register designation information on the destination side, that is, the destination register selection timing is delayed by 0.5 state from the source register selection timing. The source register is selected in advance as an address register, and the destination register can be selected later for writing data.

図19及び図20には汎用レジスタER8に相当するレジスタセレクタRSELの論理記述の一部が例示されている。図20の記述は図19の後に続く残りの論理記述である。   19 and 20 illustrate a part of the logical description of the register selector RSEL corresponding to the general-purpose register ER8. The description of FIG. 20 is the remaining logical description following FIG.

図19及び図20に示された論理記述は、RTL(Register Transfer Level)若しくはHDL(Hardware Description Language)記述と呼ばれ、公知の論理合成ツールによって、論理回路に論理展開できる。HDLはIEEE1364として標準化されている。これに示される論理記述の構文は、ケース(case)文に準拠しており、always@の次の()内で定義された値若しくは信号に変化が有ったとき、それ以下の記述行の処理を行う、という記述内容になっている。尚、記号「!」は論理的な和を示し、「&」は論理的な積を示す。「3’b001」は3ビット長の001を意味する。   The logic descriptions shown in FIGS. 19 and 20 are called RTL (Register Transfer Level) or HDL (Hardware Description Language) description, and can be logically expanded into a logic circuit by a known logic synthesis tool. HDL is standardized as IEEE 1364. The syntax of the logical description shown here conforms to the case statement, and when there is a change in the value or signal defined in () next to alwayss @, The description is to process. The symbol “!” Represents a logical sum, and “&” represents a logical product. “3′b001” means 001 having a 3-bit length.

前記論理記述は、always@(gr1,r1,gr2,r2)beginで始まるレジスタ選択記述部分、always@(rs8 or rsgb or rsdb or wbrs or rd8 or rdgb or rddb or wbrd)beginで始まるバス選択記述部分、always@(wbr8 or r2[3] or byte or word or long)beginで始まるレジスタサイズ指定記述部分に大別される。   The logical description is a register selection description part beginning with alwayss @ (gr1, r1, gr2, r2) begin, an always @ (rs8 or rsgb or rsdb or wbrs or rd8 or rddbb or rddb or wbrd) bus description part. , Alwayss @ (wbr8 or r2 [3] or byte or word or long) is broadly classified into a register size designation description part beginning with begin.

前記レジスタ選択記述部分では、レジスタフィールドr[2:0]=0、レジスタフィールドgr[1:0]=1のとき、汎用レジスタER8を選択する記述となっている。   The register selection description part is a description for selecting the general-purpose register ER8 when the register field r [2: 0] = 0 and the register field gr [1: 0] = 1.

即ち、ソースレジスタのグループフィールドがgr1=1(gr1=4'b0001)でソースレジスタのレジスタフィールドがr1=0(r1=3'b000)のときレジスタER8をソースレジスタとして選択するための信号rs8が活性化される(rs8=1)。そうでなければ、信号rs8は非活性状態を維持する(rs8=0)。   That is, when the group field of the source register is gr1 = 1 (gr1 = 4′b0001) and the register field of the source register is r1 = 0 (r1 = 3′b000), the signal rs8 for selecting the register ER8 as the source register is Activated (rs8 = 1). Otherwise, the signal rs8 remains inactive (rs8 = 0).

また、デスティネーションレジスタのグループフィールドがgr2=1(gr2=4'b0001)でデスティネーションレジスタのレジスタフィールドがr2=0(r2=3'b000)のときレジスタER8をデスティネーションレジスタとして選択するための信号rd8が活性化される(rd8=1)。そうでなければ、信号rd8は非活性状態を維持する(rd8=0)。   When the group field of the destination register is gr2 = 1 (gr2 = 4′b0001) and the register field of the destination register is r2 = 0 (r2 = 3′b000), the register ER8 is selected as the destination register. The signal rd8 is activated (rd8 = 1). Otherwise, the signal rd8 remains inactive (rd8 = 0).

前記バス選択記述部分のalways文におけるrsgbはソースレジスタの内容をバスGBに出力することを指示する信号、rsdbはソースレジスタの内容をバスDBに出力することを指示する信号、wbrsはバスWBの内容をソースレジスタに出力することを指示する信号、rdgbはデスティネーションレジスタの内容をバスGBに出力することを指示する信号、rddbはデスティネーションレジスタの内容をバスDBに出力することを指示する信号、wbrdはバスWBの内容をデスティネーションレジスタに出力することを指示する信号である。   In the always statement of the bus selection description part, rsgb is a signal for instructing to output the contents of the source register to the bus GB, rsdb is a signal instructing to output the contents of the source register to the bus DB, and wbrs is a signal of the bus WB. A signal instructing to output the contents to the source register, rdgb is a signal instructing to output the contents of the destination register to the bus GB, and rdb is a signal instructing to output the contents of the destination register to the bus DB , Wbrd are signals instructing to output the contents of the bus WB to the destination register.

命令デコーダ(DEC)33によって、ソースレジスタを指示するレジスタ指定フィールド(gr1、r1)のレジスタの内容を内部バスGBへ出力することが指示された(rsgb=1)ときに信号rs8が活性化されている場合、又は、デスティネーションレジスタを指示するレジスタ指定フィールド(gr2、r2)のレジスタの内容を内部バスGBへ出力することが指示された(rdgb=1)ときに信号rd8が活性化されている場合、汎用レジスタER8から内部バスGBへのデータ出力を指示する信号r8gbが活性化される(r8gb=1)。   The signal rs8 is activated when the instruction decoder (DEC) 33 is instructed to output the contents of the registers in the register specification fields (gr1, r1) indicating the source register to the internal bus GB (rsgb = 1). Or the signal rd8 is activated when it is instructed to output the contents of the registers in the register specification fields (gr2, r2) indicating the destination register to the internal bus GB (rdgb = 1). If there is, the signal r8gb instructing data output from the general-purpose register ER8 to the internal bus GB is activated (r8gb = 1).

同様に、命令デコーダDECによって、ソースレジスタを指示するレジスタ指定フィールド(gr1、r1))のレジスタの内容を内部バスDBへ出力することが指示された(rsdb=1)ときに信号rs8が活性化されている場合、又は、デスティネーションレジスタを指示するレジスタ指定フィールド(gr2、r2)のレジスタの内容を内部バスDBへ出力することが指示された(rddb=1)ときに信号rd8が活性化されている場合、汎用レジスタER8から内部バスDBへの出力を指示する信号r8dbが活性化される(r8db=1)。   Similarly, the signal rs8 is activated when the instruction decoder DEC instructs to output the contents of the register in the register specification field (gr1, r1) indicating the source register to the internal bus DB (rsdb = 1). The signal rd8 is activated when it is instructed to output the register contents of the register designation fields (gr2, r2) indicating the destination register to the internal bus DB (rddb = 1). In this case, the signal r8db for instructing output from the general-purpose register ER8 to the internal bus DB is activated (r8db = 1).

更に、命令デコーダDECによって、ソースレジスタを指示するレジスタ指定フィールド(gr1、r1)のレジスタへ内部バスWBからデータを入力させることが指示された(wbrs=1)ときに信号rs8が活性化されている場合、又は、デスティネーションレジスタを指示するレジスタ指定フィールド(gr2、r2)のレジスタへ内部バスWBからデータを入力させることが指示された(wbrd=1)ときに信号rd8が活性化されている場合、汎用レジスタER8へ内部バスWBからの入力を指示する信号wbr8が活性化される(wbr8=1)。   Further, when the instruction decoder DEC instructs to input data from the internal bus WB to the register in the register designation field (gr1, r1) indicating the source register (wbrs = 1), the signal rs8 is activated. Or the signal rd8 is activated when it is instructed to input data from the internal bus WB to the register in the register designation field (gr2, r2) indicating the destination register (wbrd = 1). In this case, the signal wbr8 that instructs the general-purpose register ER8 to input from the internal bus WB is activated (wbr8 = 1).

前記レジスタサイズ選択の論理記述部分のalways文において、r2[3]はレジスタフィールドr2の下位から4ビット目の値を意味する。   In the always statement in the logical description part of the register size selection, r2 [3] means the value of the fourth bit from the lower order of the register field r2.

汎用レジスタER8へ内部バスWBからデータの入力が指示された場合、データサイズがロングワードサイズ(long=1)であれば、汎用レジスタERとして32ビットで書込まれる(wb8e=wb8h=wb8l=1)。信号wb8eは図3の16ビット分のレジスタE部分の入力ゲート信号、信号wb8hは図3の8ビット分のレジスタRH部分の入力ゲート信号、信号wb8lは図3の8ビット分のレジスタRL部分の入力ゲート信号を意味する。   When data input from the internal bus WB is instructed to the general-purpose register ER8, if the data size is a long word size (long = 1), the general-purpose register ER is written in 32 bits (wb8e = wb8h = wb8l = 1) ). The signal wb8e is the input gate signal of the 16-bit register E portion of FIG. 3, the signal wb8h is the input gate signal of the 8-bit register RH portion of FIG. 3, and the signal wb8l is the 8-bit register RL portion of FIG. Means input gate signal.

また、ワードサイズ(word=1)の場合、r2のビット3の値に対応して、汎用レジスタEとして16ビットで書込まれる(wb8e=1、wb8h=wb8l=0)か、汎用レジスタR(RH,RL)として16ビットで書込まれる(wb8e=0、wb8h=wb8l=1)かが指定される。更に、バイトサイズの場合、r2のビット3の値に対応して、汎用レジスタRHとして8ビットで書込まれる(wb8e=0、wb8h=1、wb8l=0)か、汎用レジスタRLとして8ビットで書込まれる(wb8e=wb8h=0、wb8l=1)かが指定される。   In the case of the word size (word = 1), the general-purpose register E is written in 16 bits corresponding to the value of bit 3 of r2 (wb8e = 1, wb8h = wb8l = 0) or the general-purpose register R ( (RH, RL) is specified as 16 bits (wb8e = 0, wb8h = wb8l = 1). Further, in the case of byte size, corresponding to the value of bit 3 of r2, 8 bits are written as general register RH (wb8e = 0, wb8h = 1, wb8l = 0), or 8 bits as general register RL. It is specified whether to write (wb8e = wb8h = 0, wb8l = 1).

そのほかのレジスタ番号についても前記論理記述におけるgr、rの部分が相違するだけで、そのほかは同様とされる。レジスタセレクタ34は前記既存の下位CPUのレジスタセレクタに対して、grのデコード論理が追加され、また、新規の汎用レジスタER8〜ER31に対応する部分のデコード論理が追加されたことになる。   Other register numbers are the same except for the portions of gr and r in the logical description. In the register selector 34, the decode logic of gr is added to the register selector of the existing lower CPU, and the decode logic corresponding to the new general-purpose registers ER8 to ER31 is added.

レジスタセレクタ34の出力先を、grの内容に従って、汎用レジスタ8本単位で切り分けるだけなので、任意の命令に対して、同様の方法で、指定可能な汎用レジスタ本数を増やすことが可能になる。   Since the output destination of the register selector 34 is simply divided in units of eight general-purpose registers in accordance with the contents of gr, the number of general-purpose registers that can be specified can be increased in the same way for any instruction.

図21及び図22にはスタックポインタにも使用可能なレジスタER7に関するレジスタセレクタの選択論理の一例を論理記述で示す。図22の記述は図21の後に続く残りの論理記述である。記述形態は図19、図20と同じである。特に制限はされないものの、sspgrはサブルーチン分岐命令用のスタックポインタとして使用するレジスタのグループを指定する情報とされ、ispgrは例外処理用のスタックポインタのとして使用するレジスタのグループを指定する情報とされる。それらの情報sspgr、ispgrはシステムコントローラ(SYSC)21に含まれる制御レジスタ(CPUCR)22からレジスタセレクタRSELに供給される。   FIG. 21 and FIG. 22 show an example of register selector selection logic related to the register ER7 that can also be used as a stack pointer in a logical description. The description of FIG. 22 is the remaining logical description following FIG. The description form is the same as in FIGS. Although not particularly limited, sspgr is information specifying a group of registers used as a stack pointer for a subroutine branch instruction, and ispgr is information specifying a group of registers used as a stack pointer for exception handling. . The information sspgr and ispgr are supplied from the control register (CPUCR) 22 included in the system controller (SYSC) 21 to the register selector RSEL.

前記図19と同様のレジスタ選択のための論理記述の他、命令デコーダからの制御信号(sspgb、wbssp、ispgb、wbisp)と、スタックポインタ指定制御ビットsspgr、ispgrによって、レジスタ選択信号を生成する。信号sspgbはサブルーチン用スタックポインタに利用されるレジスタの値をバスGBに出力することを指示し、信号wbsspはバスWBからサブルーチン用スタックポインタに利用されるレジスタにデータを供給することを指示し、信号ispgbは例外処理用スタックポインタに利用されるレジスタの値をバスGBに出力することを指示し、信号wbispはバスWBから例外処理用スタックポインタに利用されるレジスタにデータを供給することを指示する。従来、サブルーチン分岐と割込み例外処理のスタックポインタとを独立に設けていた場合には、これをサブルーチン分岐用( sspgb、wbssp )、割込み例外処理用(ispgb、wbisp)とに分離して、命令デコーダを構成する必要がある。これは本来別々の処理に対する機能をまとめていたものを分離するようにしたものであるので、論理的な規模の増大などは少ない。   In addition to the logical description for register selection similar to FIG. 19, a register selection signal is generated by control signals (sspgb, wbssp, ispgb, wbisp) from the instruction decoder and stack pointer designation control bits sspgr, ispgr. The signal sspgb instructs to output the value of the register used for the subroutine stack pointer to the bus GB, the signal wbssp instructs to supply data from the bus WB to the register used for the subroutine stack pointer, The signal ispgb instructs to output the value of the register used for the exception handling stack pointer to the bus GB, and the signal wbisp instructs to supply data from the bus WB to the register used for the exception handling stack pointer. To do. Conventionally, when a subroutine branch and a stack pointer for interrupt exception processing are provided independently, they are separated into subroutine branch (sspgb, wbssp) and interrupt exception processing (ispgb, wbisp), and an instruction decoder. Need to be configured. In this method, functions that are originally collected for different processes are separated from each other, so that there is little increase in logical scale.

これ以外に例外処理のスタックポインタとなり得るレジスタER15、ER23,ER31も同様に構成することができる。即ち、レジスタER15は、sspgr=1またはispgr=1のとき選択される。同様に、レジスタER23は、sspgr=2またはispgr=2のとき選択され、レジスタER31は、sspgr=3またはispgr=3のとき選択される。   In addition to this, the registers ER15, ER23, and ER31 that can serve as exception processing stack pointers can be similarly configured. That is, the register ER15 is selected when sspgr = 1 or ispgr = 1. Similarly, the register ER23 is selected when sspgr = 2 or ispgr = 2, and the register ER31 is selected when sspgr = 3 or ispgr = 3.

制御レジスタ(CPUCR)22の構成は、公知の技術であるので詳細な説明は省略する。制御レジスタ(CPUCR)22はリセット時にレジスタグループ0が選択される(sspgr=ispgr=0)ようにするとよい。   Since the configuration of the control register (CPUCR) 22 is a known technique, a detailed description thereof is omitted. The control register (CPUCR) 22 is preferably selected so that register group 0 is selected at reset (sspgr = ispgr = 0).

また、カレントグループ選択ビットを設けるようにしてもよい。即ち、レジスタ拡張用前置命令コードが付加されない場合、レジスタグループ0とせずに、スタックポインタグループ選択ビットと同様の制御レジスタに前記カレントグループ選択ビットを設け、RSLGR信号によって、前記カレントグループ選択ビットの内容を命令レジスタIR2(LGR1、LGR2)にロードするようにする。   Also, a current group selection bit may be provided. That is, when the register extension prefix instruction code is not added, the current group selection bit is provided in the control register similar to the stack pointer group selection bit instead of register group 0, and the current group selection bit is set by the RSLGR signal. The contents are loaded into the instruction register IR2 (LGR1, LGR2).

カレントグループ選択ビットに0以外が設定されている場合、NOP命令(H'0000)は、レジスタグループ0の前置命令コードとされる。この命令コードの実行後は、割込みを受付けたりすることなく、次の命令コードを実行するようにすればよい。   When a value other than 0 is set in the current group selection bit, the NOP instruction (H′0000) is used as a prefix instruction code for register group 0. After execution of this instruction code, the next instruction code may be executed without accepting an interrupt.

レジスタグループ0を指定するために、H'0000を使用することになり、既存のNOP命令と同じコードであり、NOP命令は使用しないようにすればよい。NOP命令の代りに、BRA $+2などを使用するようにすればよい(「$+2」はその命令の存在するアドレスに対して2番地先、即ち次の命令のアドレスであることを示す)。   In order to specify the register group 0, H'0000 is used, which is the same code as the existing NOP instruction, and the NOP instruction should not be used. Instead of the NOP instruction, BRA $ + 2 or the like may be used ("$ + 2" indicates the address of the second address, that is, the address of the next instruction) with respect to the address where the instruction exists.

各時点でのプログラムの実行内容によって、主に使用する汎用レジスタの対象は異なるから、主に使用するグループの処理を高速にし、ひいてはCPUの処理速度を向上することができる。例えば、レジスタグループ3の汎用レジスタを所定の割込み処理に割り当て、他の処理では使用しない様にしておき、当該割込みが発生したときに、カレントグループを3に変更して、レジスタ拡張用前置命令コードなしで、汎用レジスタグループ3に対する処理を高速に実行することができる。   Since the target of the general-purpose register to be mainly used differs depending on the execution contents of the program at each time point, it is possible to increase the processing speed of the group to be mainly used, and to improve the processing speed of the CPU. For example, the general-purpose register of register group 3 is assigned to a predetermined interrupt process and is not used in other processes, and when the interrupt occurs, the current group is changed to 3, and a register extension prefix instruction The processing for the general register group 3 can be executed at high speed without code.

例えば、割込み優先順位を4レベルとした場合、通常、割込みのネストは4階層になる。即ち、割込みの優先順位を3(高位)〜0(低位)とした場合、同じ優先順位の割込みは同時には受け付けないから、最初に優先順位0の割込みはマスクされ、メインプログラム実行途中に優先順位1の割込みが発生し、この処理途中に優先順位2の割込みが発生し、この処理途中に優先順位3の割込みが発生した場合が、最大のネスト4になる。   For example, when the interrupt priority is set to 4 levels, interrupt nesting usually has 4 levels. That is, if the interrupt priority is 3 (high) to 0 (low), interrupts with the same priority will not be accepted at the same time, so interrupts with priority 0 will be masked first, and priority will be given during the execution of the main program. 1 interrupt occurs, a priority 2 interrupt occurs in the middle of this processing, and a priority 3 interrupt occurs in the middle of this processing, the maximum nest 4 occurs.

例えば、グループ3を優先順位3の割込み用の処理に確保し、グループ2を優先順位2の割込み用の処理に確保しておき、そのほかの割込みと一般の処理ではグループ0と1を使用するようにプログラムを組めば、優先順位3の割込み発生時には、汎用レジスタを待避することなく、汎用レジスタグループ3を使用できるから、割込み応答速度を向上することができる。優先順位2の割込み発生時も同様にでき、より優先度の高い割込み処理を高速に処理することができる。   For example, group 3 is reserved for interrupt 3 priority processing, group 2 is reserved for interrupt 2 priority processing, and groups 0 and 1 are used for other interrupts and general processing. If a program is built in the general-purpose register group 3, the general-purpose register group 3 can be used without saving the general-purpose registers when an interrupt of priority 3 occurs, so that the interrupt response speed can be improved. The same can be done when an interrupt of priority 2 occurs, and interrupt processing with higher priority can be processed at high speed.

オペレーティングシステム(OS)などによって、CPUの処理を制御する場合、CPUの処理はいわゆるタスクに分割され、各タスクは独立に管理される。例えば、スタック領域も各タスク毎に独立に管理することになる。   When the CPU processing is controlled by an operating system (OS) or the like, the CPU processing is divided into so-called tasks, and each task is managed independently. For example, the stack area is also managed independently for each task.

タスクを切り替える場合、スタック領域も切り替えることになり、従来は、使用中のスタックポインタの内容を待避し、スタックポインタの内容を更新しなければならない。更新する場合には、当該タスクが前回待避したスタックポインタの内容を復帰する必要がある。   When the task is switched, the stack area is also switched. Conventionally, the contents of the stack pointer in use must be saved and the contents of the stack pointer must be updated. In the case of updating, it is necessary to restore the contents of the stack pointer saved by the task last time.

かかるタスク切替えの場合、前記の例では、前記レジスタ(CPUCR)22の内容を書き換えるのみでよい。切り替える前のスタックポインタの内容は保持することができるから、待避したり、復帰したりする必要がない。CPUの処理に直接影響のない処理を省くことによって、実質的な処理性能を向上することができる。   In the case of such task switching, in the above example, only the contents of the register (CPUCR) 22 need be rewritten. Since the contents of the stack pointer before switching can be retained, there is no need to save or restore. Substantial processing performance can be improved by omitting processing that does not directly affect the processing of the CPU.

また、割込みはタスクの実行と独立に発生し、タスクからは予期できない。各タスクで割込みを許可している場合は、発生し得る多重割込みの数分(一般には、割込み優先順位の数に相当する)スタック領域を確保しなければならない。従来は、これを各タスク毎に行なければならず、スタック使用量を不所望に増加させていた。本実施例においては、例外処理用のスタックポインタを用いて、例外処理用のスタックを独立して管理できるから、各タスクは割込み用のスタック領域を確保する必要がない。これによって、スタックの使用量を抑止することができる。スタックはRAMで構成され、また、シングルチップマイクロコンピュータにおいては内蔵できるRAMの容量はチップサイズなどによって制限されるから、例外処理用のスタックポインタを使用可能にすることによって、シングルチップマイクロコンピュータにおいてもOSの適用を容易にする。   An interrupt occurs independently of task execution and cannot be predicted from the task. When interrupts are permitted in each task, a stack area (generally corresponding to the number of interrupt priorities) as many as possible multiple interrupts must be secured. In the past, this had to be done for each task, which undesirably increased stack usage. In this embodiment, the exception handling stack can be independently managed by using the exception handling stack pointer, so that each task does not need to secure an interrupt stack area. Thus, the stack usage can be suppressed. The stack is composed of RAM, and the capacity of RAM that can be built in a single-chip microcomputer is limited by the chip size, etc., so by enabling the use of a stack pointer for exception handling, even in a single-chip microcomputer. Make OS easier to apply.

また、制御レジスタ(CPUCR)22の初期値を、レジスタグループ0に相当するようにし、初期状態で、既存の下位CPUと同一のスタックポインタの使用方法を可能とすることにより、既存のソフトウェア資産も有効に利用できる。   In addition, by making the initial value of the control register (CPUCR) 22 correspond to the register group 0 and making it possible to use the same stack pointer as that of the existing lower CPU in the initial state, existing software assets can also be used. It can be used effectively.

ER7、ER15、ER23、ER31をスタックポインタとして使用しない場合は、その他の汎用レジスタとして使用できるから、利用効率や使い勝手を向上できる。   When ER7, ER15, ER23, and ER31 are not used as stack pointers, they can be used as other general-purpose registers, thereby improving utilization efficiency and usability.

図23乃至図25には前記命令デコーダDECに含まれる転送命令コード(mov)の解読論理201を論理記述で例示する。図23乃至図25に示された論理記述は、図19と同じRTL(Register Transfer Level)若しくはHDL(Hardware Description Language)によって記述されている。尚、記号「!」は論理的な和を示し、「&」は論理的な積を示す。「3’b001」は3ビット長のバイナリデータ001を意味する。IR[8]はインストラクションレジスタIRの最下位から9ビット目の論理値を意味する。   23 to 25 exemplify the logic 201 for decoding the transfer instruction code (mov) included in the instruction decoder DEC. The logical descriptions shown in FIGS. 23 to 25 are described in the same RTL (Register Transfer Level) or HDL (Hardware Description Language) as in FIG. The symbol “!” Represents a logical sum, and “&” represents a logical product. “3′b001” means binary data 001 having a 3-bit length. IR [8] means the 9th bit logical value from the least significant bit of the instruction register IR.

図23乃至図25の論理記述は、16ビット絶対アドレスによるワードサイズの転送命令(MOV.W @aa:16,Rn)のコードを解読するための論理記述に相当する。図23乃至図25の論理記述において、casex(IR)の次行に記述された16’b0110_101?_??00_????がその転送命令のコードを意味する。IR[8]=0のときバイトサイズ、 IR[8]=1のときワードサイズ、IR[7]=0のときメモリ→汎用レジスタ(リード型)、IR[7]=1のとき汎用レジスタ→メモリ(ライト型)、の転送を意味する。その命令を、独立した転送命令として実行するか、メモリ上のデータに対する直接的な処理命令の一部として実行するかは、信号MODS、MODDの値によって指示される。即ち、図23乃至図25の論理記述では、ステートコードTMGに従って制御信号を生成するようになっており、現時点でのステートコードTMGの値とその時のMODS、MODDの値等にしたがって、次のステートコードNEXTTMGの値を決定するようになっている。MODS、MODD信号によって、独立した転送命令として実行するか、メモリ上のデータに対する直接的な処理命令の一部として実行するかの制御が大別されることになる。具体的には、MODS=MODD=0の場合は、独立した転送命令として実行される。既存の転送命令と同様の動作になる。特に図示していない部分については、独立した転送命令と同様にできる。   The logical descriptions in FIGS. 23 to 25 correspond to logical descriptions for decoding a code of a word size transfer instruction (MOV.W @aa: 16, Rn) using a 16-bit absolute address. In the logical description of FIGS. 23 to 25, 16'b0110_101? Described in the next line of the caseex (IR)? _? ? 00_? ? ? ? Means the code of the transfer instruction. Byte size when IR [8] = 0, Word size when IR [8] = 1, Memory when IR [7] = 0 → General-purpose register (read type), General-purpose register when IR [7] = 1 It means transfer of memory (write type). Whether the instruction is executed as an independent transfer instruction or as part of a direct processing instruction for data on the memory is indicated by the values of the signals MODS and MODD. 23 to 25, the control signal is generated according to the state code TMG, and the next state is determined according to the current state code TMG value and the MODS and MODD values at that time. The value of the code NEXTTMG is determined. The control of whether to execute as an independent transfer instruction or as part of a direct processing instruction for data on the memory is roughly classified by the MODS and MODD signals. Specifically, when MODS = MODD = 0, it is executed as an independent transfer instruction. The operation is the same as that of an existing transfer command. In particular, a portion not shown can be made in the same manner as an independent transfer command.

MODS=1の場合は、ソース側データのリード動作として実行される。リードデータは、汎用レジスタに書込まず、テンポラリレジスタTRDに書込む。   When MODS = 1, it is executed as a read operation of the source side data. Read data is not written in the general-purpose register, but is written in the temporary register TRD.

MODD=1で、MODS=0またはMODSE=1の場合は、デスティネーション側データのリード動作として実行される。リードアドレスを、テンポラリレジスタTRAに書込む。リードデータは、リードデータバッファRDBに取り込んだ後、1ステート早く実行を終了する。なお、MODSEはソース側のリード型転送命令コードの実行が終了したことを示す信号であり、解読論理201で生成される。   When MODD = 1 and MODS = 0 or MODSE = 1, the data is executed as a destination-side data read operation. The read address is written to temporary register TRA. After the read data is taken into the read data buffer RDB, execution is completed one state earlier. MODSE is a signal indicating that the execution of the read transfer instruction code on the source side is completed, and is generated by the decoding logic 201.

リードデータのテンポラリレジスタTRDへの書込み及びリードアドレスのテンポラリレジスタTRAへの書込みは、いずれの場合も区別なく、実行してもよい(利用されることはなくても、動作に影響しない。区別しないことによって、論理的な無駄を省くことができる)。   The writing of the read data to the temporary register TRD and the writing of the read address to the temporary register TRA may be executed without distinction in any case (the operation is not affected even if it is not used. Can save logical waste).

従って、独立した転送命令(既存の転送命令)に比較して、MODS=1のとき、汎用レジスタへの書込み禁止、MODD=1のとき、1ステート短縮の相違が存在するのみにできる。論理的な規模の増加を最小限とすることができる。   Therefore, as compared with an independent transfer instruction (existing transfer instruction), writing to the general-purpose register is prohibited when MODS = 1, and only one-state shortening difference exists when MODD = 1. The increase in logical scale can be minimized.

なお、図15に示される通り、命令拡張用前置命令コードのロングワードサイズの指定によって、MODS、MODDと同様に、ロングワードサイズがLNG信号によって指示される。   As shown in FIG. 15, the long word size is designated by the LNG signal in the same manner as the MODS and the MODD by designating the long word size of the instruction extension prefix instruction code.

また、図において、小文字の信号は、命令デコーダDECで生成され、出力される信号とし、大文字の信号は命令デコーダDECに入力された信号とする。   In the figure, a lowercase signal is a signal generated and output by the instruction decoder DEC, and an uppercase signal is a signal input to the instruction decoder DEC.

図23に示される論理記述の第1の部分(1−1)でステートコードTMGが生成される。ステートコードTMGは1→2→3と進行するが、デスティネーション側データのリード動作(MODD=1でMODS=0またはMODSE=1)の場合TMGは1→2で終了するようになっている。   The state code TMG is generated in the first part (1-1) of the logical description shown in FIG. The state code TMG proceeds from 1 → 2 → 3. However, in the case of the destination side data read operation (MODD = 1, MODS = 0 or MODSE = 1), the TMG ends in 1 → 2.

なお、NEXTTMG[5]=0の場合における次ステートコードは単純に下位ビットの値になっている。NEXTTMG[5]=1の場合における次ステートコードは5’b00001とされる様に構成されている。   Note that the next state code in the case of NEXTTMG [5] = 0 is simply the value of the lower bits. The next state code in the case of NEXTTMG [5] = 1 is configured to be 5'b00001.

図23に示される論理記述の第2の部分(1−2)でバス制御を行なう。nop=0はバスアクセス開始、 nop=1はバスアクセス禁止を指示する。data=0は命令リード、data=1はデータアクセスを指示する。long=1はロングワードサイズ、 long=0のとき、byte=0はワードサイズ、byte=1はバイトサイズを指示する。 write=0はリード、 write =1はライトを指示する。   Bus control is performed in the second part (1-2) of the logical description shown in FIG. When nop = 0, bus access is started, and when nop = 1, bus access is prohibited. Data = 0 indicates an instruction read, and data = 1 indicates a data access. long = 1 indicates a long word size, and when long = 0, byte = 0 indicates a word size, and byte = 1 indicates a byte size. “write = 0” indicates a read, and “write = 1” indicates a write.

本転送命令の場合、ステートコード1、3で命令リードを行い、ステートコード2で、データアクセスを行なうようになっている。データアクセスのリード/ライトはIR[7]によって指示される。命令リードの場合は所定のタイミングで内部データバスIDBの内容がインストラクションレジスタIRとリードデータバッファRDBに格納される。データリードの場合は所定のタイミングで内部データバスIDBの内容がリードデータバッファRDBに格納される。データライトの場合は所定のタイミングでライトデータバッファWDBの内容が内部データバスIDBに出力される。   In the case of this transfer instruction, instruction read is performed using state codes 1 and 3 and data access is performed using state code 2. Data access read / write is instructed by IR [7]. In the case of instruction read, the contents of the internal data bus IDB are stored in the instruction register IR and the read data buffer RDB at a predetermined timing. In the case of data read, the contents of the internal data bus IDB are stored in the read data buffer RDB at a predetermined timing. In the case of data write, the contents of the write data buffer WDB are output to the internal data bus IDB at a predetermined timing.

図24に示される論理記述の第3の部分(1−3)で実効アドレスを計算する。本転送命令の場合、ステートコード2(=5’b00010)で、リードデータバッファRDBに保持している命令コードのEA拡張部16ビットを、dbrext信号によって32ビットに符号拡張した上、内部バスGBに出力する。バスGBの内容はアドレスバッファABに毎ステート格納されるようにされており、特に制御は必要ない。   The effective address is calculated in the third part (1-3) of the logical description shown in FIG. In the case of this transfer instruction, the EA extension 16 bits of the instruction code held in the read data buffer RDB is sign-extended to 32 bits by the dbrext signal with the state code 2 (= 5′b00010), and then the internal bus GB. Output to. The contents of the bus GB are stored in the address buffer AB every state, and no particular control is required.

図24に示される論理記述の第4の部分(1−4)で、転送データを制御する。リード型(IR[7]=0)の場合は、ステートコード3で、リードデータをリードデータバッファRDBからバスDBへ出力し、MODS=0の場合は汎用レジスタへ、MODS=1の場合はテンポラリレジスタTRDへ格納する。   The fourth part (1-4) of the logical description shown in FIG. 24 controls the transfer data. In the case of the read type (IR [7] = 0), the read data is output from the read data buffer RDB to the bus DB with the state code 3. When MODS = 0, it is sent to the general-purpose register. When MODS = 1, it is temporary. Store in register TRD.

ライト型(IR[7]=1)の場合は、ステートコード2で、 MODS=0の場合は汎用レジスタから、MODS=1の場合はテンポラリレジスタTRDから内部バスDBへ出力し、いずれの場合もライトデータバッファWDBを経由して、内部データバスIDBに出力する。   In the case of the write type (IR [7] = 1), state code 2 is output from the general-purpose register when MODS = 0, and is output from the temporary register TRD to the internal bus DB when MODS = 1. The data is output to the internal data bus IDB via the write data buffer WDB.

図25に示される論理記述の第5の部分(1−5)で、割込みマスク信号を制御する。また、ソース側のデータのリードが終了した場合には、制御信号MODSEを発生する。   The interrupt mask signal is controlled in the fifth part (1-5) of the logical description shown in FIG. Further, when the reading of the data on the source side is completed, the control signal MODSE is generated.

図23及び図25においてMODS=1またはMODD=1の場合には入力されたオペレーションレコードの一部が転送命令と異なる様にしてもよい。例えばオペコードのビット15は別の定義に使用する様にしてもよい。   23 and 25, when MODS = 1 or MODD = 1, a part of the input operation record may be different from the transfer command. For example, bit 15 of the opcode may be used for another definition.

論理規模の縮小のためにはアドレッシングモードなどのメモリの指定方法を決めるビット(オペコードのビット8〜10)は共通にする。   In order to reduce the logical scale, the bits (opcode bits 8 to 10) for determining the memory designation method such as the addressing mode are made common.

図26及び図27には前記命令デコーダDECに含まれる演算命令コード(exe)の解読論理202を論理記述で例示する。図26及び図27の双方によって示される論理記述は、レジスタ間加算命令(ADD.W Rm,Rn)のコードを解読する為の論理記述に相当する。   FIG. 26 and FIG. 27 illustrate the decoding logic 202 of the operation instruction code (exe) included in the instruction decoder DEC by a logical description. The logical description shown by both FIG. 26 and FIG. 27 corresponds to the logical description for decoding the code of the inter-register addition instruction (ADD.W Rm, Rn).

前記同様に、独立した転送命令として実行するか、メモリ上のデータに対する処理命令の一部として実行するかは、MODS、MODD信号によって指示される。特に図示していない部分(ALUの制御など)については、独立した演算命令と同様にできる。   Similarly to the above, whether to execute as an independent transfer instruction or as a part of a processing instruction for data on the memory is instructed by the MODS and MODD signals. In particular, a portion not shown (ALU control or the like) can be performed in the same manner as an independent operation instruction.

図26に示される論理記述の第1の部分(2−1)でステートコードTMGが生成される。ステートコードTMGは1(=5’b00001)で終了する。図26に示される論理記述の第2の部分(2−2)でバス制御を行なう。ステートコード1で命令リードを終了する。   The state code TMG is generated in the first part (2-1) of the logical description shown in FIG. The state code TMG ends with 1 (= 5'b00001). Bus control is performed in the second part (2-2) of the logical description shown in FIG. The instruction read ends with state code 1.

図27に示される論理記述の第3の部分(2−3)で、演算データを制御する。MODS=0の場合には、ソース側データを汎用レジスタとし、汎用レジスタの内容をDBに読み出す(rsdb)。MODS=1の場合には、ソース側データをメモリとし、テンポラリレジスタTRDの内容をDBに読み出す(trddb)。   Operation data is controlled by the third part (2-3) of the logical description shown in FIG. When MODS = 0, the source side data is used as a general-purpose register, and the contents of the general-purpose register are read out to the DB (rsdb). When MODS = 1, the source side data is used as a memory, and the contents of the temporary register TRD are read out to the DB (trdb).

MODD=0の場合には、デスティネーション側データを汎用レジスタとし、汎用レジスタの内容をGBに読み出す(rdgb)とともに、演算結果を汎用レジスタに書込む(wbrd)。MODD=1の場合には、デスティネーション側データをメモリとし、リードデータバッファの内容をバスDBに読み出す(rdbdb)とともに、演算結果をテンポラリレジスタTRDに書込む(wbtrd)。   When MODED = 0, the destination side data is used as a general-purpose register, the contents of the general-purpose register are read to GB (rdgb), and the operation result is written to the general-purpose register (wbrd). When MODED = 1, the destination side data is used as a memory, the contents of the read data buffer are read to the bus DB (rdbdb), and the operation result is written to the temporary register TRD (wbtrd).

図27に示される論理記述の第4の部分(2−4)で、割込みマスク信号を制御する。また、デスティネーション側がメモリの場合には、制御信号mkmovを発生して、ライト型転送命令と同等の動作を行なう命令コードの発生を、命令変更部CHGに指示する。また、ロングワードサイズ信号LNG、バイトサイズ信号BYTEを継続する。   In the fourth part (2-4) of the logical description shown in FIG. 27, the interrupt mask signal is controlled. When the destination side is a memory, a control signal mkmov is generated to instruct the instruction change unit CHG to generate an instruction code that performs the same operation as the write type transfer instruction. Further, the long word size signal LNG and the byte size signal BYTE are continued.

図28乃至図30には前記命令デコーダDECに含まれる演算命令コード(exe)の解読論理202のうち、内部で生成されるライト型転送命令と同等の動作を行なう命令コードを生成する論理の論理記述が例示されている。   28 to 30 show logic logic for generating an instruction code that performs an operation equivalent to the internally generated write-type transfer instruction among the decoding logic 202 of the operation instruction code (exe) included in the instruction decoder DEC. The description is illustrated.

前記内部で生成されるライト型転送命令と同等の動作を行なう命令コードは、常に同一の動作を行なうものとし、MODSやMODDの制御信号は参照していない。   The instruction code that performs the same operation as the internally generated write-type transfer instruction always performs the same operation, and does not refer to the MODS or MODD control signals.

図28に示される論理記述の第1の部分(3−1)でステートコードTMGが生成される。ステートコードTMGは1→3と進行する。図28に示される論理記述の第2の部分(3−2)でバス制御を行なう。ステートコード1(=5’b00001)で、データライトを行い、ステートコード3(=5’b00011)で命令リードを行なう。データサイズは演算命令コードの発生した、制御信号LNG、BYTEによって指示される。   The state code TMG is generated in the first part (3-1) of the logical description shown in FIG. The state code TMG proceeds from 1 to 3. Bus control is performed in the second part (3-2) of the logical description shown in FIG. Data write is performed with state code 1 (= 5'b00001), and instruction read is performed with state code 3 (= 5'b00011). The data size is indicated by control signals LNG and BYTE generated by the operation instruction code.

図29に示す論理記述の第3の部分(3−3)で実効アドレスを再利用する。ステートコード1で、テンポラリレジスタTRAに保持している実効アドレスを、内部バスGBに出力する。図29に示す論理記述の第4の部分(3−4)で、転送データを制御する。ステートコード3で、テンポラリレジスタTRDから内部バスDBへ出力し、ライトデータバッファWDBを経由して、内部データバスIDBに出力する。   The effective address is reused in the third part (3-3) of the logical description shown in FIG. With the state code 1, the effective address held in the temporary register TRA is output to the internal bus GB. The transfer data is controlled by the fourth part (3-4) of the logical description shown in FIG. With the state code 3, the data is output from the temporary register TRD to the internal bus DB, and is output to the internal data bus IDB via the write data buffer WDB.

図30に示される論理記述の第5の部分(3−5)で、制御信号はいずれも初期化する。割込みも許可し、割込みが要求すれば、引き続き割込み例外処理を行なうことができる。   In the fifth part (3-5) of the logical description shown in FIG. 30, all control signals are initialized. Interrupts are also permitted, and if an interrupt is requested, interrupt exception handling can be continued.

命令拡張用前置命令コード(pf)を解読する論理回路の論理記述については特に図示しないが、図15の命令拡張用前置命令コードの解読結果に応じたmodやmskintなどの制御信号を生成し、MODS,MODD等によって図23乃至図30に例示されるような論理動作を制御し、命令デコーダDEC全体として、メモリのデータに対する直接的な演算制御を可能にする。   The logic description of the logic circuit that decodes the instruction extension prefix instruction code (pf) is not particularly shown, but generates control signals such as mod and mskint according to the decoding result of the instruction extension prefix instruction code of FIG. Then, the logic operation as exemplified in FIGS. 23 to 30 is controlled by MODS, MODD, etc., and the instruction decoder DEC as a whole can directly control the operation of the data in the memory.

図31にはレジスタ拡張用前置命令コードを伴わない第1の加算命令(ADD.L ER0,ER1)の実行タイミングが示される。   FIG. 31 shows the execution timing of the first addition instruction (ADD.L ER0, ER1) without the register extension prefix instruction code.

ADD.L ER0,ER1は、グループ0の汎用レジスタのみを使用するので、汎用レジスグループを指定するレジスタ拡張用前置命令コードを必要とせず、前記既存の下位CPU、例えば、前記平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』に記載のCPUと同じ1ワードの命令とされる。   ADD. Since LER0 and ER1 use only general-purpose registers of group 0, they do not require a register extension prefix instruction code for specifying a general-purpose register group. For example, the existing lower CPU, for example, the March 1995 ( The instruction is the same one word as the CPU described in “H8S / 2600 Series H8S / 2000 Series Programming Manual” issued by Hitachi, Ltd.

特に制限はされないものの、内部データバス(IDB)は16ビットであって、内蔵ROM4、RAM5のリード/ライトを1ステートで行うことができるものとして説明する。また、CPUは命令フェッチ、デコード、実行の3段パイプラインで命令を実行するものとする。   Although not particularly limited, the internal data bus (IDB) is 16 bits, and it will be described that the built-in ROM 4 and RAM 5 can be read / written in one state. The CPU executes instructions in a three-stage pipeline of instruction fetch, decode, and execution.

サイクルT0のスロットC2(φ#同期:クロック信号φの反転クロックであるφ#同期)で、CPU2のアドレスバッファABからアドレスがバスIABに出力される。また、命令デコーダDECから、命令フェッチ(if)を示す、バスコマンド(BCMD)が出力される。   In slot C2 of cycle T0 (φ # synchronization: φ # synchronization that is an inverted clock of the clock signal φ), an address is output from the address buffer AB of the CPU 2 to the bus IAB. Further, a bus command (BCMD) indicating instruction fetch (if) is output from the instruction decoder DEC.

サイクルT1のスロットC1(φ同期)で、アドレスバスIABの内容が周辺アドレスバス(PAB)に出力され、バスコマンドに基づき、リードサイクルが開始され、周辺データバス(PDB)にデータが出力される。スロットC2で周辺データバス(PDB)のリードデータが内部データバスIDBに得られ、これをサイクルT2のスロットC1で命令レジスタIR1にラッチする。以上の動作は以前の命令の実行の制御によって行われる。前記周辺データバス(PDB)及び周辺アドレスバス(PAB)は内部データバス(IDB)及び内部アドレスバス(IAB)に接続された周辺回路用の図示を省略するバスである。内蔵ROM4、RAM5はそのモジュール内で周辺アドレスバス、周辺データバス相当の動作を行う。   In slot C1 (φ synchronous) of cycle T1, the contents of the address bus IAB are output to the peripheral address bus (PAB), a read cycle is started based on the bus command, and data is output to the peripheral data bus (PDB). . In slot C2, the peripheral data bus (PDB) read data is obtained on the internal data bus IDB, and is latched in the instruction register IR1 in slot C1 of cycle T2. The above operation is performed by controlling the execution of the previous instruction. The peripheral data bus (PDB) and the peripheral address bus (PAB) are not shown for peripheral circuits connected to the internal data bus (IDB) and the internal address bus (IAB). The built-in ROM 4 and RAM 5 perform operations corresponding to the peripheral address bus and the peripheral data bus in the module.

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、サイクルT2のスロットC1で命令コードが制御部CONTの命令デコーダDECに入力されて、命令の内容が解読される。命令デコーダDECは、解読結果に従って、制御信号を出力して、各部の制御を行う。命令の一部(レジスタ指定フィールドの情報:SEL1)がレジスタセレクタRSELに与えられる。図においてソース側レジスタ指定フィールドの情報SEL1=0、デスティネーション側レジスタ指定フィールドの情報SEL2=1になっている。SEL1は、図18のRSELのr1[3:0]、SEL2は、r2[3:0]に相当する。   When the execution of the immediately preceding instruction is completed, when the execution of the instruction is started earliest, the instruction code is input to the instruction decoder DEC of the control unit CONT in the slot C1 of the cycle T2, and the content of the instruction is decoded. . The instruction decoder DEC outputs a control signal according to the decoding result to control each part. Part of the instruction (register designation field information: SEL1) is given to the register selector RSEL. In the figure, the source side register designation field information SEL1 = 0 and the destination side register designation field information SEL2 = 1. SEL1 corresponds to r1 [3: 0] of RSEL in FIG. 18, and SEL2 corresponds to r2 [3: 0].

レジスタ間演算命令では、サイクルT2のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスIABにアドレス信号が出力される。レジスタセレクタ34に制御信号を与える。このとき、ラッチ回路(LGR1、LGR2)321,322が何れも0にクリアされているので、レジスタフィールドSEL1、SEL2からの信号と制御部CONTの出力する制御信号A(Rs−DB、Rd−GB)とに基づいて、レジスタ選択信号B(R0−DB、R1−GB)が生成される。   In the inter-register operation instruction, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC in the slot C2 of the cycle T2. An address signal is output from address buffer AB to address IAB. A control signal is given to the register selector 34. At this time, since the latch circuits (LGR1, LGR2) 321 and 322 are all cleared to 0, the signals from the register fields SEL1 and SEL2 and the control signal A (Rs-DB, Rd-GB) output from the control unit CONT. ), A register selection signal B (R0-DB, R1-GB) is generated.

サイクルT3から、次の次の命令がリードされる。サイクルT3のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。入力信号SEL2と制御信号B(WB−Rd)とに基づいて、レジスタ選択信号C(selectC:WB−R1)が生成される。前記レジスタ選択信号Bはレジスタを選択して、ソース側、デスティネーション側のレジスタ(Rs、Rd)のデータを算術論理演算器ALUに入力する。算術論理演算器ALUの演算内容は制御部CONTが制御信号C(controlC)によって指示する。加算・論理演算・シフトなどは1クロックで演算を行うことができる。例えば、前記命令では32ビットの加算を行う。次の命令の制御部CONTへのロードを指示する。   From cycle T3, the next next instruction is read. In slot C1 of cycle T3, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. A register selection signal C (selectC: WB-R1) is generated based on the input signal SEL2 and the control signal B (WB-Rd). The register selection signal B selects a register, and inputs the data of the source side and destination side registers (Rs, Rd) to the arithmetic logic unit ALU. The operation content of the arithmetic logic unit ALU is instructed by the control unit CONT by the control signal C (control C). Addition, logical operation, shift, etc. can be performed in one clock. For example, the instruction performs a 32-bit addition. Instructs the control unit CONT to load the next instruction.

制御信号B(RSLGR)によって、ラッチ回路(LGR1、LGR2)321,322のクリアが指示される。ラッチ回路(LGR1)321はサイクルT3のスロットC1で、ラッチ回路(LGR2)322はサイクルT3のスロットC2でクリアされた結果が伝達される。   Clearing of the latch circuits (LGR1, LGR2) 321, 322 is instructed by the control signal B (RSLGR). The latch circuit (LGR1) 321 transmits the result cleared in the slot C1 of the cycle T3, and the latch circuit (LGR2) 322 transmits the result cleared in the slot C2 of the cycle T3.

サイクルT3のスロットC2で、算術論理演算器ALUの演算結果が、内部バスWBを経由して、レジスタ選択信号が選択したデスティネーション側のレジスタ(ER1)にライトされる。図示はされないが、制御信号Cによって、コンディションコードレジスタCCRの更新を行う。   In slot C2 of cycle T3, the calculation result of the arithmetic logic unit ALU is written to the destination register (ER1) selected by the register selection signal via the internal bus WB. Although not shown, the condition code register CCR is updated by the control signal C.

図31の例ではレジスタグループ0同士のレジスタ間演算は実質的に1ステートで実行されている。   In the example of FIG. 31, the inter-register operation between the register groups 0 is substantially executed in one state.

図32にはレジスタ拡張用前置命令コードが付加された第2の加算命令(ADD.L ER8,ER1)の実行タイミングを示す。   FIG. 32 shows the execution timing of the second addition instruction (ADD.L ER8, ER1) to which the register extension prefix instruction code is added.

汎用レジスタグループを指定するレジスタ拡張用前置命令コードを付加して2ワード命令とする。第2ワードは前記ADD.L R0,R1と同一である。すなわち、gr1=1であるため、同じr1=0に対して、レジスタ番号n=8と解釈される。   A 2-word instruction is added by adding a register extension prefix instruction code designating a general-purpose register group. The second word is the ADD. It is the same as L R0 and R1. That is, because gr1 = 1, the register number n = 8 is interpreted for the same r1 = 0.

サイクルT0のスロットC2で、CPU2のアドレスバッファABかアドレスがアドレスバスIABに出力される。   In slot C2 of cycle T0, the address buffer AB of CPU 2 or the address is output to the address bus IAB.

サイクルT1のスロットC1(φ同期)で、アドレスバスIABの内容が周辺アドレスバス(PAB)に出力され、リードサイクルが開始される。スロットC2でリードデータが内部データバスIDBに得られ、これをサイクルT2のスロットC1で命令レジスタIR1にラッチする。これは、レジスタグループフィールドを持つ省略可能なレジスタ拡張用前置命令コードのワードである。   In slot C1 (φ synchronization) of cycle T1, the contents of the address bus IAB are output to the peripheral address bus (PAB), and a read cycle is started. Read data is obtained on the internal data bus IDB in the slot C2, and is latched in the instruction register IR1 in the slot C1 of the cycle T2. This is an optional register extension prefix instruction code word with a register group field.

引き続き、サイクルT2のスロットC2で次のアドレス(+2された内容)がアドレスバスIABに出力され、このリードデータがサイクルT3のスロットC1で命令レジスタIRにラッチされる。以上の動作は以前の命令の実行の制御によって行われ、相対的な関係が異なる場合もある。   Subsequently, the next address (the content that is +2) is output to the address bus IAB in the slot C2 of the cycle T2, and this read data is latched in the instruction register IR in the slot C1 of the cycle T3. The above operation is performed by controlling the execution of the previous instruction, and the relative relationship may be different.

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、サイクルT2のスロットC1で命令コード(レジスタ拡張用前置命令コード)が制御部CONTに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。グループフィールドラッチ信号LGRCLが発行されて、レジスタグループ指定フィールド(IR1のビット7〜0)がラッチ回路(LGR1、LGR2)321,322にラッチされる。   When the execution of the immediately preceding instruction is completed, when the execution of the instruction is started earliest, the instruction code (register extension pre-instruction code) is input to the control unit CONT in the slot C1 of cycle T2, and the instruction The contents are deciphered. According to the result of decoding, a control signal is output to control each part. The group field latch signal LGRCL is issued, and the register group designation field (bits 7 to 0 of IR1) is latched by the latch circuits (LGR1, LGR2) 321 and 322.

サイクルT2のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレス信号がアドレスバスIABに出力される。   In slot C2 of cycle T2, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address signal is output from address buffer AB to address bus IAB.

サイクルT3から、次の次の命令がリードされる。サイクルT3のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。第1ワードと第2ワード以降が分割されないための制御信号B(controlB)で連続命令信号(割込み禁止信号:continue=mskint)を割込み受け付け回路に出力する。本信号によって、割込み要求などが発生していても、命令の実行を継続することができる。また、ラッチ回路(LGR1、LGR)321,322の内容が保持される。   From cycle T3, the next next instruction is read. In slot C1 of cycle T3, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. A continuous command signal (interrupt inhibition signal: continue = mskint) is output to the interrupt acceptance circuit by the control signal B (control B) for not dividing the first word and the second word. Even if an interrupt request or the like is generated, the execution of the instruction can be continued by this signal. The contents of the latch circuits (LGR1, LGR) 321 and 322 are held.

一方、サイクルT2のスロットC1で命令コード(加算命令を指示)が命令デコーダ(DEC)33に入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。LGR1=1及びLGR2=0であるため、SEL1(及びSEL2)と命令デコーダDECの出力する制御信号A(Rs−DB、Rd−GB)とに基づいて、レジスタ選択信号B(R8−DB、R1−GB)が生成される。これ以外の第2ワードによる動作は第1の加算命令(ADD.L ER0,ER1)と同一にできる。第1の加算命令同様に、制御信号B(RSLGR)によって、ラッチ回路(LGR1、LGR2)321,322のクリアが指示される。ラッチ回路(LGR1)321はサイクルT4のスロットC1で、ラッチ回路(LGR2)322はサイクルT4のスロットC2でクリアされた結果が伝達される。   On the other hand, an instruction code (instructing an addition instruction) is input to the instruction decoder (DEC) 33 in the slot C1 of the cycle T2, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since LGR1 = 1 and LGR2 = 0, the register selection signal B (R8-DB, R1) is selected based on SEL1 (and SEL2) and the control signal A (Rs-DB, Rd-GB) output from the instruction decoder DEC. -GB) is generated. Other operations based on the second word can be made the same as those of the first addition instruction (ADD.L ER0, ER1). Similar to the first addition instruction, the control signal B (RSLGR) instructs the latch circuits (LGR1, LGR2) 321 and 322 to be cleared. The latch circuit (LGR1) 321 transmits the result cleared in the slot C1 of the cycle T4, and the latch circuit (LGR2) 322 transmits the result cleared in the slot C2 of the cycle T4.

第1ワード(レジスタ拡張用の前置命令コード)に対応するラッチ回路(LGR1、LGR2)321,322のラッチ信号、連続命令信号を出力以外は、命令デコーダDECの内容を、既存のCPUの命令デコーダと同等にできる。命令デコーダDECのレジスタ拡張用前置命令コードに対応する部分は、相対的に小さいことは言うまでもない。すなわち、論理的な規模の追加を最小限にできる。また、命令デコーダDECの大部分を既存のCPUの命令デコーダと同等にできるから、従来の設計資産を有効に利用することができる。   Other than outputting latch signals and continuous instruction signals of the latch circuits (LGR1, LGR2) 321 and 322 corresponding to the first word (prefix instruction code for register expansion), the contents of the instruction decoder DEC are stored in the existing CPU instructions. Can be equivalent to a decoder. Needless to say, the portion of the instruction decoder DEC corresponding to the register extension prefix instruction code is relatively small. That is, the addition of logical scale can be minimized. In addition, since most of the instruction decoder DEC can be equivalent to the instruction decoder of the existing CPU, the conventional design assets can be used effectively.

また、そのほかの命令についても、同様のレジスタ拡張用前置命令コードを付加することによって、汎用レジスタのいずれも指定できる。前記命令コードはレジスタ指定フィールドを持つ命令コードの命令について適用できる。   For other instructions, any general-purpose register can be specified by adding the same register extension prefix instruction code. The instruction code can be applied to an instruction having an instruction code having a register designation field.

図33にはメモリ・レジスタ型の加算命令(ADD.W @aa:16,R9)の実行タイミングを示す。すなわち、レジスタグループフィールドを持つレジスタ拡張用前置命令コード、メモリ・レジスタ型演算の命令拡張用前置命令コード、MOV.W @aa:16,R0に相当する命令コード、ADD.W R0,R1に相当する命令コードを組合せて1命令とみなされる命令を実行したときのタイミングが示される。   FIG. 33 shows the execution timing of a memory register type addition instruction (ADD.W @aa: 16, R9). That is, a register extension prefix instruction code having a register group field, an instruction extension prefix instruction code for a memory / register type operation, MOV. W @aa: 16, the instruction code corresponding to R0, ADD. The timing when an instruction regarded as one instruction is executed by combining instruction codes corresponding to W R0 and R1 is shown.

レジスタグループフィールドを持つレジスタ拡張用前置命令コードは、グループ1の汎用レジスタを指定するように、H’0001とされる。すなわち、gr2=1であるため、同じr2=1に対して、レジスタ番号n=9と解釈される。   A register extension prefix instruction code having a register group field is set to H'0001 so as to designate a general register of group 1. That is, since gr2 = 1, the register number n = 9 is interpreted for the same r2 = 1.

また、メモリ・レジスタ型の命令拡張用前置命令コードは、図15に従い、H’0108とされ、MODS信号によって、ソース側がメモリであることを指示する。本命令では、直接の関係はないが、EA1命令コードの実行時には、gr1とr1が組み合わされて、汎用レジスタが選択される。また、演算命令コードの実行時には、gr2とr2が組み合わされて、汎用レジスタが選択される。   Also, the memory instruction type instruction extension prefix instruction code is H'0108 according to FIG. 15, and the MODS signal indicates that the source side is a memory. Although this instruction has no direct relationship, when the EA1 instruction code is executed, the general-purpose register is selected by combining gr1 and r1. Further, when the operation instruction code is executed, the general-purpose register is selected by combining gr2 and r2.

転送命令コードは、既存の転送命令と同様に、メモリのリードを行なうが、前置命令コードによるソース側をメモリとする指示に基づき、リードデータをテンポラリレジスタTRDに格納する。ソース側をメモリとする指示を継続する。   The transfer instruction code reads the memory as in the case of the existing transfer instruction, but stores the read data in the temporary register TRD based on the instruction to set the source side as the memory by the prefix instruction code. Continue the instruction to use the source side as memory.

演算命令コードは、ソース側をメモリとする指示に従い、ソース側データを汎用レジスタではなく、テンポラリレジスタ(TRD)から読み出す。そのほかの動作は、既存の演算命令と同様になる。   The operation instruction code reads the source-side data from the temporary register (TRD) instead of the general-purpose register in accordance with an instruction to set the source side as a memory. Other operations are the same as those of the existing operation instruction.

サイクルT0のスロットC2(φ#同期。#は反転論理を示す)で、CPU2のアドレスバッファABからアドレスがIABに出力される。   In slot C2 of cycle T0 (φ # synchronization; # indicates inverted logic), the address is output from the address buffer AB of the CPU 2 to the IAB.

サイクルT1のスロットC1(φ同期)で、IABの内容がPABに出力され、リードサイクルが開始される。サイクルT1のスロットC2でリードデータが内部データバスに得られ、これをサイクルT2のスロットC1でIR(IR1)にラッチする。これは、レジスタグループフィールドを持つ省略可能な命令ワード(レジスタ拡張用前置命令コード)である。   In slot C1 (φ synchronization) of cycle T1, the contents of IAB are output to PAB, and a read cycle is started. In slot C2 of cycle T1, read data is obtained on the internal data bus, and this is latched into IR (IR1) in slot C1 of cycle T2. This is an optional instruction word (a register instruction prefix instruction code) having a register group field.

引き続き、サイクルT2のスロットC2で次のアドレス(+2された内容)がIABに出力され、このリードデータがサイクルT3のスロットC1でIR(IR1)にラッチされる。以上の動作は以前の命令の実行の制御によって行われ、相対的な関係が異なる場合もある。   Subsequently, the next address (the content that has been +2) is output to IAB in slot C2 of cycle T2, and this read data is latched in IR (IR1) in slot C1 of cycle T3. The above operation is performed by controlling the execution of the previous instruction, and the relative relationship may be different.

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、サイクルT2のスロットC1で命令コード(レジスタ拡張用前置命令コード)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。グループフィールドラッチ信号LGRCLが発行されて、レジスタグループ指定フィールド(IR1のビット7〜0)がラッチLGR1、LGR2にラッチされる。   When the execution of the immediately preceding instruction is completed, when the execution of the instruction is started earliest, an instruction code (register extension pre-instruction code) is input to the instruction decoder DEC in the slot C1 of cycle T2, and the instruction The contents are deciphered. According to the result of decoding, a control signal is output to control each part. A group field latch signal LGRCL is issued, and the register group designation field (bits 1 to 0 of IR1) is latched in the latches LGR1 and LGR2.

サイクルT2のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレス情報が出力される。   In slot C2 of cycle T2, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. Address information is output from the address buffer AB to the address bus IAB.

サイクルT1のスロットC2で、CPU2のアドレスバッファABかアドレス情報がアドレスバスIABに出力される。   In the slot C2 of the cycle T1, the address buffer AB of the CPU 2 or the address information is output to the address bus IAB.

サイクルT2のスロットC1(φ同期)で、アドレスバスIABの内容がPABに出力され、リードサイクルが開始される。サイクルT2のスロットC2でリードデータが内部データバスに得られ、これをサイクルT2のスロットC1でIRにラッチする。これは、メモリに対する演算を示す命令拡張用前置命令コード(pf)である。   In slot C1 (φ synchronization) of cycle T2, the contents of address bus IAB are output to PAB, and a read cycle is started. Read data is obtained on the internal data bus in slot C2 of cycle T2, and is latched into IR in slot C1 of cycle T2. This is a pre-instruction code (pf) for instruction expansion indicating an operation on the memory.

サイクルT3のスロットC2で次のアドレス(+2された内容)がアドレスバスIABに出力され、このリードデータがサイクルT4のスロットC1で命令レジスタIR(IR1)にラッチされる(MOV命令の第1ワード(mov−1))。   In slot C2 of cycle T3, the next address (the content that is +2) is output to the address bus IAB, and this read data is latched in the instruction register IR (IR1) in slot C1 of cycle T4 (the first word of the MOV instruction). (Mov-1)).

サイクルT3のスロットC1で命令コード(命令拡張用前置命令コードpf)がデコーダDECに入力されて、命令の内容が解読され、かかる命令拡張用前置命令コードの場合には、ソース側データがメモリ上に存在することを指示する。即ち、制御信号CとしてMODS信号を1にセットし、デコーダDECにフィードバックする。   In slot C1 of cycle T3, the instruction code (instruction extension pre-instruction code pf) is input to the decoder DEC, the contents of the instruction are decoded, and in the case of such an instruction extension pre-instruction code, the source side data is Indicates that it exists in memory. That is, the MODS signal is set to 1 as the control signal C and fed back to the decoder DEC.

サイクルT3のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレス情報がアドレスバスIABに出力される。   In slot C2 of cycle T3, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. Address information is output from the address buffer AB to the address bus IAB.

サイクルT4のスロットC1で命令コード(MOV命令の第1ワード(mov−1))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。絶対アドレスのアドレッシングモードであるので、引き続き、EA拡張部である絶対アドレスをリードした後、この絶対アドレスに基づき、ソースデータのリードを行い、リード結果をテンポラリレジスタTRDに格納する。   In slot C1 of cycle T4, the instruction code (first word (mov-1) of MOV instruction) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since the absolute address addressing mode is used, the absolute address, which is the EA extension unit, is subsequently read, the source data is read based on the absolute address, and the read result is stored in the temporary register TRD.

サイクルT4のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。サイクルT4のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレス情報がアドレスバスIABに出力される。   In slot C1 of cycle T4, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. In slot C2 of cycle T4, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. Address information is output from the address buffer AB to the address bus IAB.

サイクルT4から、リードサイクルが開始され、このリードデータがサイクルT5のスロットC1でリードデータバッファRDBにラッチされる(MOV命令の第2ワード(mov−2)、即ち、EA拡張部である絶対アドレス)。   From cycle T4, a read cycle is started, and this read data is latched in the read data buffer RDB in slot C1 of cycle T5 (the second word (mov-2) of the MOV instruction, that is, an absolute address that is an EA extension). ).

サイクルT5のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。サイクルT5のスロットC2で、リードデータバッファRDBの内容(絶対アドレス)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレス情報がアドレスバスIABに出力される。   In slot C1 of cycle T5, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. In slot C2 of cycle T5, the contents (absolute address) of the read data buffer RDB are read to the internal bus GB and input to the address buffer AB. Address information is output from the address buffer AB to the address bus IAB.

サイクルT6から、ソースデータがリードされる。また、サイクルT5のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレス情報がアドレスバスIABに出力される。   Source data is read from cycle T6. In slot C2 of cycle T5, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. Address information is output from the address buffer AB to the address bus IAB.

サイクルT7のスロットC1で前記リードデータ(ソースデータ)が、リードデータバッファRDBに格納される。更に、リードデータバッファRDBから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。   The read data (source data) is stored in the read data buffer RDB in the slot C1 of the cycle T7. Further, the data is output from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated.

サイクルT7のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、信号MODSが1にセットされているので、汎用レジスタではなく、テンポラリレジスタTRDに格納される。   In slot C2 of cycle T7, the read data is output from the arithmetic logic unit ALU to the internal bus WB, and the signal MODS is set to 1. Therefore, the read data is stored not in the general-purpose register but in the temporary register TRD.

サイクルT7のスロットC1で、命令コード(ADD命令(add))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。信号MODSが1にセットされているので、ソース側データを汎用レジスタではなく、テンポラリレジスタTRDから読み出す。デスティネーション側は、汎用レジスタから読み出し、演算結果は汎用レジスタに格納する。   In slot C1 of cycle T7, an instruction code (ADD instruction (add)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since the signal MODS is set to 1, the source side data is read from the temporary register TRD instead of the general purpose register. The destination side reads from the general-purpose register and stores the operation result in the general-purpose register.

サイクルT7のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレス情報がアドレスバスIABに出力される。   In slot C2 of cycle T7, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. Address information is output from the address buffer AB to the address bus IAB.

サイクルT8のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。また、デスティネーション側は変更なく、レジスタグループフィールド(gr2=1)と、レジスタフィールド(r2=1)に従って、汎用レジスタ(ER9)から、デスティネーションデータが内部バスGBに出力され、ソース側データが、信号MODSに従って、テンポラリレジスタTRDから内部バスDBに出力され、いずれも算術論理演算器ALUに入力される。算術論理演算器ALUは加算動作とされる。   In slot C1 of cycle T8, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. Further, the destination side is not changed, and the destination data is output from the general-purpose register (ER9) to the internal bus GB according to the register group field (gr2 = 1) and the register field (r2 = 1), and the source side data is changed. In accordance with the signal MODS, the data is output from the temporary register TRD to the internal bus DB, and both are input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is set to an addition operation.

サイクルT8のスロットC2で、演算結果が、算術論理演算器ALUから内部バスWBに出力され、汎用レジスタ(ER9)に格納される。   In slot C2 of cycle T8, the operation result is output from the arithmetic logic unit ALU to the internal bus WB and stored in the general-purpose register (ER9).

なお、第1ワードと第2ワード以降が分割されないための制御信号Bで連続命令信号を出力する。本信号によって、割込み要求などが発生していても、命令の実行を継続することができる。   In addition, a continuous command signal is output with a control signal B for preventing the first word and the second word and thereafter from being divided. Even if an interrupt request or the like is generated, the execution of the instruction can be continued by this signal.

即ち、命令拡張用前置命令コードに対応する信号MODSの出力と連続命令信号の出力、転送命令コードに対応する信号MODSに従ったデータ格納先の選択と連続命令信号の出力、加算命令コードに対する信号MODSに従ったデータ読み出し元の選択以外は、命令デコーダDECの論理構成を、下位CPUの命令デコーダと同等にできる。これらに対応する部分は、相対的に小さいことは言うまでもない。すなわち、論理的な規模の追加と変更を最小限にできる。また、命令デコーダDECの大部分を既存下位CPUの命令デコーダと同等にできるから、従来の設計資産を有効に利用することができる。   That is, the output of the signal MODS corresponding to the instruction instruction prefix instruction and the output of the continuous instruction signal, the selection of the data storage destination according to the signal MODS corresponding to the transfer instruction code, the output of the continuous instruction signal, and the addition instruction code Except for the selection of the data reading source according to the signal MODS, the logical configuration of the instruction decoder DEC can be made equivalent to that of the instruction decoder of the lower CPU. Needless to say, the portions corresponding to these are relatively small. That is, logical additions and changes can be minimized. In addition, since most of the instruction decoder DEC can be made equivalent to the instruction decoder of the existing lower CPU, the conventional design assets can be used effectively.

また、そのほかの演算命令(加算、減算、乗算、除算、比較、論理積、論理和、排他的論理和など)についても、同様の命令拡張用前置命令コードと転送命令コードを付加することによって、メモリと汎用レジスタの演算を実現できる。   For other arithmetic instructions (addition, subtraction, multiplication, division, comparison, logical product, logical sum, exclusive logical sum, etc.), the same instruction extension prefix instruction code and transfer instruction code are added. , Memory and general-purpose register operations can be realized.

また、ソース側のアドレッシングモードをレジスタ間接などとする場合、レジスタグループフィールドを持つレジスタ拡張用前置命令コードを、前記命令の先頭に付加し、gr1=1〜3のいずれかとすることによって、ソース側の汎用レジスタを、グループ1〜3とすることができる。即ち、レジスタグループフィールドを持つレジスタ拡張用前置命令コードのgr1がソース側、gr2がデスティネーション側に対応する。   In addition, when the addressing mode on the source side is set to register indirect or the like, a prefix instruction code for register expansion having a register group field is added to the head of the instruction so that one of gr1 = 1 to 3 is set. The general-purpose registers on the side can be grouped 1 to 3. That is, the register extension prefix instruction code gr1 having a register group field corresponds to the source side, and gr2 corresponds to the destination side.

図34にはレジスタ・メモリ型の加算命令(ADD.W R1,@aa:16)の実行タイミングを示す。すなわち、命令拡張用前置命令コード、MOV.W @aa:16,R0に相当する命令コード、及びADD.W R1,R0に相当する命令コードを組合せて、1命令とみなされる命令を実行したときのタイミングが示される。この時の命令拡張用前置命令コードは、図15に従い、H’0104とされ、信号MODDによって、ソース側は汎用レジスタ、デスティネーション側がメモリであることを指示する。   FIG. 34 shows the execution timing of the register / memory type addition instruction (ADD.WR1, @ aa: 16). That is, the instruction extension prefix instruction code, MOV. W @aa: 16, an instruction code corresponding to R0, and ADD. The timing when an instruction regarded as one instruction is executed by combining instruction codes corresponding to W R1 and R0 is shown. The pre-instruction code for instruction expansion at this time is H'0104 according to FIG. 15, and the signal MODED indicates that the source side is a general-purpose register and the destination side is a memory.

転送命令コードは、既存の転送命令と同様に、サイクルT4のスロットC2から、メモリのリードを行ない、命令拡張用前置命令コードによるデスティネーション側をメモリとする指示(MODD)に基づき、生成した実効アドレス(メモリアドレス)をテンポラリレジスタTRAに格納する。また、サイクルT6のスロットC1で、リードデータをリードデータバッファDBRに格納した時点で、既存の転送命令またはソース側のデータのリードの場合より1ステート早く実行を終了する。このため、命令フェッチとPCのインクリメントは行なわない。デスティネーション側をメモリとする指示を継続する。演算命令コード(add)を、サイクルT5のスロットC1から命令デコーダDECに入力する。   Similar to the existing transfer instruction, the transfer instruction code is generated based on the instruction (MODD) that reads the memory from the slot C2 in cycle T4 and sets the destination side as the memory by the instruction extension prefix instruction code. The effective address (memory address) is stored in the temporary register TRA. Further, at the time when the read data is stored in the read data buffer DBR in the slot C1 of the cycle T6, the execution is completed one state earlier than the case of reading the existing transfer instruction or the data on the source side. For this reason, instruction fetch and PC increment are not performed. The instruction to set the destination side as a memory is continued. The operation instruction code (add) is input from the slot C1 in cycle T5 to the instruction decoder DEC.

演算命令コードは、デスティネーション側をメモリとする指示(MODD)に従い、サイクルT6のスロットC1で、デスティネーション側データを、汎用レジスタではなく、リードデータバッファRDBから、バスGBに読み出し、算術論理演算器ALUに入力する。ソース側は汎用レジスタが暗黙的に指示されているので、汎用レジスタR1の内容を、バスDBに読み出し、算術論理演算器ALUに入力する。サイクルT6のスロットC2で、演算結果をテンポラリレジスタTRDに格納する。さらに、制御信号mkmovによって、MOV.W R0,@ER0に類似する命令コード(mov−st:16’b0111_1000_1???_????)をCHGで発生し、サイクルT6のスロットC1から命令デコーダDECに入力する。のビットは任意でよい。   The operation instruction code reads the destination side data from the read data buffer RDB to the bus GB instead of the general-purpose register in slot C1 of cycle T6 in accordance with the instruction (MODD) for setting the destination side as a memory, and performs arithmetic logic operation. Input to the ALU. Since the general-purpose register is implicitly designated on the source side, the contents of the general-purpose register R1 are read to the bus DB and input to the arithmetic logic unit ALU. In slot C2 of cycle T6, the operation result is stored in temporary register TRD. Further, the MOV. An instruction code (mov-st: 16'b0111_1000_1 ?????????) similar to WR0, @ ER0 is generated in CHG and input from slot C1 in cycle T6 to the instruction decoder DEC. The bits may be arbitrary.

発生された命令コード(mov−st)は、 テンポラリレジスタTRAをアドレスレジスタとし、テンポラリレジスタTRDをデータレジスタとする転送命令同様の動作を行う。即ち、サイクルT6のスロットC2で、テンポラリレジスタTRAに格納されている実効アドレスをバスGBに読み出し、アドレスバッファABを経由して内部アドレスバスIABに出力するとともに、ワードデータライトのバスコマンドを発行する。サイクルT7のスロットC2で、テンポラリレジスタTRDに格納されている演算結果をバスDBに読み出し、ライトデータバッファWDBを経由して、内部データバスIDBに出力して、デスティネーションのメモリアドレスに演算結果を書込む。サイクルT7のスロットC2から命令フェッチを行なうとともに、プログラムカウンタPCのインクリメントを行なう。これによって、転送命令コード(mov−1)の実行を短縮し、命令フェッチとプログラムカウンタPCのインクリメントを行なわなかった分を回復する。   The generated instruction code (mov-st) performs the same operation as the transfer instruction using the temporary register TRA as an address register and the temporary register TRD as a data register. In other words, in slot C2 of cycle T6, the effective address stored in the temporary register TRA is read to the bus GB, output to the internal address bus IAB via the address buffer AB, and a word data write bus command is issued. . In slot C2 of cycle T7, the operation result stored in the temporary register TRD is read to the bus DB, output to the internal data bus IDB via the write data buffer WDB, and the operation result is output to the destination memory address. Write. An instruction is fetched from the slot C2 in cycle T7 and the program counter PC is incremented. As a result, the execution of the transfer instruction code (mov-1) is shortened, and the amount of instruction fetch and increment of the program counter PC is recovered.

デスティネーション側メモリにライトする場合、命令コード(mov−st)をCPU2内部で発生することにより、命令コードを短縮し、処理時間を短縮することができる。テンポラリレジスタTRAの内容を参照することによって、再度実効アドレスの計算を行なう必要がなく、更に、処理時間を短縮することができる。 MOV.W R0,@ER0に類似する命令コードを使用することにより、設計を容易にし、論理的な規模の増加を抑止することができる。   When writing to the destination-side memory, the instruction code (mov-st) is generated inside the CPU 2, whereby 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. MOV. By using an instruction code similar to WR0, @ ER0, design can be facilitated and an increase in logical scale can be suppressed.

比較命令の場合は、デスティネーション側メモリにライトする必要がない。この場合も、前記同様に動作させ、サイクルT6のスロットC2のバスコマンドを無操作に変更するのみに止めるとよい。即ち、比較命令の命令コードを実行した場合に、制御信号を発行し、デスティネーション側メモリにライトする命令コードにライト動作を禁止させるようにするものである。制御方式を共通化し、論理的な規模の増加を抑止することができる。或いは、内部で発生する命令コードを無操作(NOP)命令の命令コードに相当するものにしてもよい。この場合は、処理時間を更に短縮することができる。   In the case of a comparison instruction, there is no need to write to the destination memory. In this case as well, the operation may be performed in the same manner as described above, and only the bus command in the slot C2 in cycle T6 is changed to no operation. That is, when the instruction code of the comparison instruction is executed, a control signal is issued so that the instruction code for writing to the destination-side memory is prohibited from performing a write operation. A common control method can be used to suppress an increase in logical scale. Alternatively, the instruction code generated internally may correspond to the instruction code of a no-operation (NOP) instruction. In this case, the processing time can be further shortened.

また、そのほかの2つのデータに対する演算命令(加算、減算、乗算、除算、比較、論理積、論理和、排他的論理和など)についても、同様の命令拡張用前置命令コードと転送命令コードを付加することによって、メモリと汎用レジスタの演算を実現できる。更に、1つのデータに対する演算命令(符号反転、論理反転、シフト、ローテートなど)についても、同様の命令拡張用前置命令コードと転送命令コードを付加することによって、メモリ上のデータの演算を実現できる。   In addition, the same instruction extension prefix instruction code and transfer instruction code are used for the operation instructions (addition, subtraction, multiplication, division, comparison, logical product, logical sum, exclusive logical sum, etc.) for the other two data. By adding, it is possible to realize the operation of the memory and general-purpose registers. In addition, for arithmetic instructions (sign inversion, logic inversion, shift, rotate, etc.) for one data, the same instruction expansion pre-instruction code and transfer instruction code are added to realize the operation of data on the memory. it can.

尚、図34で説明した命令の実行においても、演算命令の実行に至るまでの途中の演算結果によるコンディションコードレジスタCCRの変更抑止と、制御信号mskintによる割り込み抑止の制御は前記と同様に行われる。   Even in the execution of the instruction described with reference to FIG. 34, the control of the change of the condition code register CCR by the operation result in the middle of the execution of the operation instruction and the control of the interrupt suppression by the control signal mskint are performed in the same manner as described above. .

図35にはメモリ・メモリ型の加算命令(ADD.W @ER1,@aa:16)の実行タイミングを示す。即ち、命令拡張用前置命令コード(pf)、 MOV.W @ER1,R0に相当する命令コード(mov−1)、MOV.W @aa:16,R0に相当する命令コード(mov2)、及びADD.W R0,R1に相当する命令コード(add)を組合せて、1命令とみなされる命令を実行したときのタイミングが示される。   FIG. 35 shows the execution timing of a memory / memory type addition instruction (ADD.W @ ER1, @aa: 16). That is, the instruction extension prefix instruction code (pf), MOV. Instruction code (mov-1) corresponding to W @ ER1, R0, MOV. W @aa: 16, an instruction code (mov2) corresponding to R0, and ADD. The timing when an instruction regarded as one instruction is executed by combining instruction codes (add) corresponding to W R0 and R1 is shown.

図35の場合、命令拡張用前置命令コードは、図15に従い、H’010Cとされ、MODS,MODD信号によって、ソース側、デスティネーション側がいずれもメモリであることを指示する。   In the case of FIG. 35, the pre-instruction code for instruction extension is H'010C according to FIG. 15, and the MODS and MODD signals indicate that both the source side and the destination side are memories.

転送命令コード(mov−1)は、サイクルT3のスロットC2から、メモリのリードを行ない、命令拡張用前置命令コードによるソース側をメモリとする指示(MODS)に基づき、生成した実効アドレス(メモリアドレス)をテンポラリレジスタTRAに格納する。また、サイクルT5のスロットC1で、リードデータ(data1)をリードデータバッファRDBを経由して、バスGBに出力する。算術論理演算器ALUを経由してバスWBに出力され、サイクルT5のスロットC2でテンポラリレジスタTRDに格納される。ソース側及びデスティネーション側をメモリとする指示を継続すると共に、ソース側データの終了を指示する(MODSE)。   The transfer instruction code (mov-1) reads the memory from the slot C2 of cycle T3, and generates an effective address (memory) based on an instruction (MODS) that uses the instruction side for instruction expansion as the source side as a memory. Address) is stored in the temporary register TRA. Further, in the slot C1 of the cycle T5, the read data (data1) is output to the bus GB via the read data buffer RDB. The signal is output to the bus WB via the arithmetic logic unit ALU, and stored in the temporary register TRD in the slot C2 of the cycle T5. The instruction to store the source side and the destination side as memory is continued and the end of the source side data is instructed (MODSE).

転送命令コード(mov−2)は、図34の転送命令コードと同様に、サイクルT6のスロットC2から、メモリのリードを行ない、命令拡張用前置命令コードによるデスティネーション側をメモリとする指示(MODD)とソース側データの終了指示(MODSE)に基づき、生成した実効アドレス(メモリアドレス)をテンポラリレジスタTRAに格納する。また、サイクルT8のスロットC1で、リードデータをリードデータバッファRDBに格納した時点で、既存の転送命令またはソース側のデータのリードの場合より1ステート早く実行を終了する。ソース側及びデスティネーション側をメモリとする指示を継続する。   As in the case of the transfer instruction code of FIG. 34, the transfer instruction code (mov-2) reads the memory from the slot C2 in cycle T6, and designates the destination side by the instruction extension pre-instruction code as the memory ( The generated effective address (memory address) is stored in the temporary register TRA based on (MODD) and the source data end instruction (MODSE). Further, at the time when the read data is stored in the read data buffer RDB in the slot C1 of the cycle T8, the execution is completed one state earlier than the case of reading the existing transfer instruction or the data on the source side. Continue to instruct the source side and destination side to be memory.

演算命令コードは、ソース側及びデスティネーション側をメモリとする指示(MODS、MODD)に従い、サイクルT8のスロットC1で、デスティネーション側データをリードデータバッファRDBから、バスGBに読み出し、算術論理演算器ALUに入力する。ソース側データをテンポラリレジスタTRDから、バスDBに読み出し、算術論理演算器ALUに入力する。サイクルT8のスロットC2で、演算結果をテンポラリレジスタTRDに格納する。さらに、MOV.W R0,@ER0に類似する命令コード(mov−st)を発生し、サイクルT6のスロットC1から命令デコーダDECに入力する。   The operation instruction code reads the destination side data from the read data buffer RDB to the bus GB in the slot C1 of the cycle T8 in accordance with the instruction (MODS, MODD) for setting the source side and the destination side as memories. Input to ALU. Source-side data is read from the temporary register TRD to the bus DB and input to the arithmetic logic unit ALU. In slot C2 of cycle T8, the operation result is stored in temporary register TRD. Furthermore, MOV. An instruction code (mov-st) similar to WR0, @ ER0 is generated and input to the instruction decoder DEC from the slot C1 in cycle T6.

発生された命令コード(mov−st)は、テンポラリレジスタTRAをアドレスレジスタとし、テンポラリレジスタTRDをデータレジスタとする転送命令同様の動作を行う。   The generated instruction code (mov-st) performs the same operation as the transfer instruction using the temporary register TRA as an address register and the temporary register TRD as a data register.

ここで、ソース側及びデスティネーション側をメモリとする指示(MODS、MODD)がなされている場合、転送命令コードは、1回目はMODSE信号が0にクリアされており、ソース側のデータのリードを行ない、2回目はMODSE信号が1にセットされており、デスティネーション側のリードを行なうものとする。   Here, when an instruction (MODS, MODD) for setting the memory on the source side and the destination side is made, the transfer instruction code has the MODSE signal cleared to 0 for the first time, and the data on the source side is read. It is assumed that the MODSE signal is set to 1 for the second time and the destination side is read.

尚、図35で説明した命令の実行においても、演算命令の実行に至るまでの途中の演算結果によるコンディションコードレジスタCCRの変更抑止と、制御信号mskintによる割り込み抑止の制御は前記と同様に行われる。   Even in the execution of the instruction described with reference to FIG. 35, the control of the change of the condition code register CCR by the operation result in the middle of the execution of the operation instruction and the control of the interrupt suppression by the control signal mskint are performed in the same manner as described above. .

図36にはメモリ・メモリ型の転送命令(MOV.W @ER1,@aa:16)の実行タイミングを示す。即ち、命令拡張用前置命令コード、MOV.W @ER1,R0に相当する命令コード、MOV.W R0,@aa:16に相当する命令コードを組合せて、1命令とみなされる命令を実行したときのタイミングが示される。この時の命令拡張用前置命令コードは、図15に従い、H’0108とされる。   FIG. 36 shows the execution timing of a memory / memory type transfer instruction (MOV.W @ ER1, @aa: 16). That is, the instruction extension prefix instruction code, MOV. Instruction code corresponding to W @ ER1, R0, MOV. A timing when an instruction regarded as one instruction is executed by combining instruction codes corresponding to W R0, @ aa: 16 is shown. The pre-instruction code for instruction expansion at this time is H'0108 according to FIG.

メモリ・メモリ間の転送命令は前記加算命令と同様にし、ADD.W R0,R1に相当する命令コードの代わりに、MOV.W R0,R1に相当する命令コードを用いて、実現することもできる。この場合は、デスティネーション側のリードを行なってしまうが、転送命令の性質上、デスティネーション側のリードは必要なく、処理時間が無駄になってしまう。   The transfer instruction between the memory and the memory is the same as the addition instruction, and ADD. Instead of instruction codes corresponding to W R0 and R1, MOV. It can also be realized using instruction codes corresponding to W R0 and R1. In this case, reading on the destination side is performed, but due to the nature of the transfer instruction, reading on the destination side is not necessary, and processing time is wasted.

この例では、命令拡張用前置命令コードと、リード型の転送命令コードと、ライト型の転送命令コードを組合せ、命令拡張用前置命令コードは、ソース側がメモリであることを指示する。   In this example, the instruction extension pre-instruction code, the read type transfer instruction code, and the write type transfer instruction code are combined, and the instruction extension pre-instruction code indicates that the source side is a memory.

リード型転送命令コードは、メモリのリードを行なって、命令拡張用前置命令コードの指示に基づき、リードデータをテンポラリレジスタTRDに格納する。ソース側をメモリとする指示を継続する。   The read type transfer instruction code reads the memory and stores the read data in the temporary register TRD based on the instruction of the pre-instruction code for instruction expansion. Continue the instruction to use the source side as memory.

ライト型転送命令コードは、既存の転送命令と同様に、メモリのライトを行なうが、ソース側をメモリとする指示(MODS)に従い、ライトデータを汎用レジスタではなく、テンポラリレジスタTRDから取り出す。   The write type transfer instruction code writes the memory as in the case of the existing transfer instruction, but takes out the write data from the temporary register TRD instead of the general-purpose register according to the instruction (MODS) for setting the source side as the memory.

前記加算命令と同等の実現方法を採用した場合に比べて、演算命令コードを省略できる。結果的に、命令コード長を1ワード短縮し、実行ステート数を3ステート短縮できる。   The operation instruction code can be omitted as compared with the case where an implementation method equivalent to the addition instruction is adopted. As a result, the instruction code length can be shortened by one word, and the number of execution states can be shortened by three states.

図37にはイミディエイト−メモリ型の加算命令(ADD.W #xx,@aa:16)の実行タイミングを示す。同図の内容は、図34と同様に、命令拡張用前置命令コード、MOV.W @aa:16,R0に相当する命令コード、及びADD.W #xx,R0に相当する命令コードを組合せて定義されて、1命令とみなされる命令を実行したときのタイミングが示されている。デスティネーション側がメモリであるが、イミディエイトデータの場合は、リードデータを一旦テンポラリレジスタTRDに格納する。このため、命令拡張用前置命令コードは、図15に従い、H’0108とされ、ソース側をメモリとする制御信号(MODS)を発行する。   FIG. 37 shows the execution timing of the immediate-memory type addition instruction (ADD.W #xx, @aa: 16). As shown in FIG. 34, the contents of FIG. W @aa: 16, an instruction code corresponding to R0, and ADD. The timing when an instruction that is defined as a combination of instruction codes corresponding to W # xx, R0 and regarded as one instruction is executed is shown. Although the destination side is a memory, in the case of immediate data, the read data is temporarily stored in the temporary register TRD. For this reason, the pre-instruction code for instruction expansion is set to H′0108 according to FIG. 15, and a control signal (MODS) using the source side as a memory is issued.

命令拡張用前置命令コード、転送命令コードの動作は、サイクルT6のスロットC1で、リードデータがリードデータバッファRDBからバスGBに読み出される。算術論理演算器ALUを経由して、バスWBに出力され、サイクルT6のスロットC2でテンポラリレジスタTRDに格納される。   In the operation of the instruction extension prefix instruction code and the transfer instruction code, the read data is read from the read data buffer RDB to the bus GB in the slot C1 of the cycle T6. The signal is output to the bus WB via the arithmetic logic unit ALU and stored in the temporary register TRD in the slot C2 of the cycle T6.

命令拡張用前置命令コードの指示(MODS)に対して、イミディエイトデータの演算命令コードは、サイクルT8のスロットC1で、デスティネーション側データを、汎用レジスタではなく、テンポラリレジスタTRDから、バスGBに読み出し、算術論理演算器ALUに入力する。ソース側はイミディエイトデータがリードデータバッファRDBから、内部バスDBに読み出し、算術論理演算器ALUに入力する。サイクルT8のスロットC2で、演算結果をテンポラリレジスタTRDに格納する。さらに、命令拡張用前置命令コードの指示(MODS)に基づいて、サイクルT6のスロットC2からワードサイズライトを開始する。アドレスはテンポラリレジスタTRAから、サイクルT6のスロットC2で読み出し、バスGB及びアドレスバッファABを経由して内部アドレスバスIABに出力する。データは、サイクルT8のスロットC1で、演算結果を、テンポラリレジスタTRDから読み出して、バスDB及びライトデータバッファWDBを経由して内部データバスIDBに出力する。命令拡張用前置命令コードの指示(MODS)に従って、イミディエイトデータの演算命令にライト動作が加えられることになる。   In response to the instruction extension instruction instruction (MODS), the immediate data operation instruction code is the slot C1 in cycle T8, and the destination side data is transferred from the temporary register TRD to the bus GB instead of the general-purpose register. Read and input to arithmetic logic unit ALU. On the source side, immediate data is read from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. In slot C2 of cycle T8, the operation result is stored in temporary register TRD. Further, based on the instruction extension instruction code instruction (MODS), word size write is started from slot C2 of cycle T6. The address is read from the temporary register TRA in the slot C2 of the cycle T6 and output to the internal address bus IAB via the bus GB and the address buffer AB. The data is read from the temporary register TRD in the slot C1 of the cycle T8, and is output to the internal data bus IDB via the bus DB and the write data buffer WDB. In accordance with the instruction extension instruction instruction instruction (MODS), a write operation is added to the immediate data operation instruction.

ADD.W #xx,@aa:16の場合は、演算命令コードが2ワードであるため、図34と相違されているが、バイトサイズのイミディエイトの場合、演算命令コードが1ワードであれば、図34と同じ動作タイミングとすればよい。   ADD. In the case of W # xx, @ aa: 16, the operation instruction code is 2 words, which is different from FIG. 34. However, in the case of byte-size immediate, if the operation instruction code is 1 word, FIG. The operation timing may be the same.

尚、図37で説明した命令の実行においても、演算命令の実行に至るまでの途中の演算結果によるコンディションコードレジスタCCRの変更抑止と、制御信号mskintによる割り込み抑止の制御は前記と同様に行われる。   Even in the execution of the instruction described with reference to FIG. 37, the control of the change of the condition code register CCR by the operation result in the middle of the execution of the operation instruction and the control of the interrupt suppression by the control signal mskint are performed in the same manner as described above. .

図38にはイミディエイト・メモリ型の転送命令(MOV.W #xx,@aa:16)の実行タイミングを示す。すなわち、命令拡張用前置命令コード、MOV.W #xx,R0に相当する命令コード、及びMOV.W R0,@aa:16に相当する命令コード(ライト型転送命令コード)を組合せて1命令とみなされる命令を実行したときにタイミングが示される。このとき、命令拡張用前置命令コードは、図15に従い、H’0104とされる。   FIG. 38 shows the execution timing of the immediate memory type transfer instruction (MOV.W #xx, @aa: 16). That is, the instruction extension prefix instruction code, MOV. W #xx, an instruction code corresponding to R0, and MOV. Timing is indicated when an instruction that is regarded as one instruction is executed by combining an instruction code (write transfer instruction code) corresponding to WR0, @ aa: 16. At this time, the pre-instruction code for instruction expansion is set to H′0104 according to FIG.

図38におけるサイクルT4のスロットC1で、イミディエイトデータをリードデータバッファRDBからバスDBに読み出し、算術論理演算器ALUを経由して、サイクルT4のスロットC2で、バスWBに出力する。このイミディエイトデータを、命令拡張用前置命令コードの指示(MODD)に基づき、テンポラリレジスタTRDに格納する。   In the slot C1 of the cycle T4 in FIG. 38, the immediate data is read from the read data buffer RDB to the bus DB, and is output to the bus WB in the slot C2 of the cycle T4 via the arithmetic logic unit ALU. The immediate data is stored in the temporary register TRD based on the instruction (MODD) of the instruction extension prefix instruction code.

ライト型転送命令コードは、既存の転送命令と同様に、メモリのライトを行なうが、サイクルT7のスロットC2で、命令拡張用前置命令コードの指示(MODD)に従い、ライトデータを汎用レジスタではなく、テンポラリレジスタTRDから取り出す。   The write type transfer instruction code writes the memory in the same way as the existing transfer instruction. However, in slot C2 of cycle T7, the write data is not a general-purpose register according to the instruction extension instruction code instruction (MODD). , Taken out from the temporary register TRD.

イミディエイトデータを、内部I/Oレジスタを含むメモリに設定することは、比較的出現頻度が高いと考えられるので、命令コード長の短縮、及び処理時間の短縮は望ましい。   Setting immediate data in a memory including an internal I / O register is considered to have a relatively high appearance frequency. Therefore, it is desirable to reduce the instruction code length and the processing time.

図39乃至図41には、命令デコーダDECに含まれる演算命令コード(exe)の解読論理201の一部に関する論理記述の別の例が示される。同図に示される論理記述は、16ビットイミディエイトデータのワードサイズの加算命令(ADD.W #xx:16,Rn)に相当する。   FIG. 39 to FIG. 41 show another example of the logical description regarding a part of the decoding logic 201 of the operation instruction code (exe) included in the instruction decoder DEC. The logical description shown in the figure corresponds to an add instruction (ADD.W #xx: 16, Rn) having a word size of 16-bit immediate data.

MODS信号に対応して、実行ステートが延長され、ライト動作が挿入される。図39に示される論理記述の第1の部分(4−1)でステートコードTMGが生成される。単独の命令としては、ステートコードTMGは1→3と進行する。イミディエイトデータとメモリ上のデータとを演算する場合は、MODS=1とされ、ステートコードTMGは1→17→3と進行する。   In response to the MODS signal, the execution state is extended and a write operation is inserted. The state code TMG is generated in the first part (4-1) of the logical description shown in FIG. As a single instruction, the state code TMG proceeds from 1 to 3. When calculating the immediate data and the data on the memory, MODS = 1, and the state code TMG proceeds from 1 → 17 → 3.

図39に示される論理記述の第2の部分(4−2)でバス制御を行なう。MODS=0の場合は、2回の命令リードを行なう。MODS=1の場合は、ステートコード1で、データライトを行い、ステートコード17、3で命令リードを行なう。データサイズは演算命令コードの発生した、当該命令(ADD.W #xx:16,Rn)のデータサイズであるワードサイズとされる。   Bus control is performed in the second part (4-2) of the logical description shown in FIG. When MODS = 0, two instruction reads are performed. When MODS = 1, data write is performed with state code 1 and instruction read is performed with state codes 17 and 3. The data size is the word size that is the data size of the instruction (ADD.W #xx: 16, Rn) generated by the operation instruction code.

図40に示される論理記述の第3の部分(4−3)で実効アドレスを計算する。MODS=1の場合は、ステートコード1で、テンポラリレジスタTRAに保持している実効アドレスを、内部バスGBに出力する。   The effective address is calculated in the third part (4-3) of the logical description shown in FIG. When MODS = 1, the effective address held in the temporary register TRA is output to the internal bus GB with the state code 1.

図40に示される論理記述の第4の部分(4−4)で、転送データを制御する。ステートコード1で演算を行なう。MODS=0の場合は、汎用レジスタとリードデータバッファRDBからデータを読み出し、演算結果を汎用レジスタに格納する。MODS=1の場合は、テンポラリレジスタTRDとリードデータバッファRDBからデータを読み出し、演算結果をテンポラリレジスタTRDに格納する。   The fourth part (4-4) of the logical description shown in FIG. 40 controls the transfer data. An operation is performed with state code 1. When MODS = 0, data is read from the general-purpose register and read data buffer RDB, and the operation result is stored in the general-purpose register. When MODS = 1, data is read from the temporary register TRD and the read data buffer RDB, and the operation result is stored in the temporary register TRD.

図41に示される論理記述の第5の部分(5)で、制御信号はいずれも初期化する。割込みも許可し、割込みが要求すれば、引き続き割込み例外処理を行なうことができる。   In the fifth part (5) of the logical description shown in FIG. 41, all control signals are initialized. Interrupts are also permitted, and if an interrupt is requested, interrupt exception handling can be continued.

ここで、前記命令拡張用前置命令コードを省略してもそれと同様に命令の拡張を行うことができる複合命令について説明する。例えば、図38に基づいて説明したMOV.W #xx,R0の命令コードに余裕があり、メモリに対する転送か、汎用レジスタに対する転送かのデスティネーション情報を持つことができれば、命令拡張用前置命令コードを設けなくてもよい。要するに、命令コードに実質的な空き領域があり、その空き領域にメモリに対する転送か、汎用レジスタに対する転送かの情報を組み込んでも、その他の命令コードと区別が付けばよい。このような前記デスティネーション情報に基づき、イミディエイトデータをテンポラリレジスタTRDに格納するとともに、デスティネーション側をメモリとする制御信号を発生すればよい。そのような前記デスティネーション情報を付加した転送命令コードと演算命令コードを結合して1命令として実行可能な複合命令を採用すれば、命令拡張用前置命令コードを設けた場合と同様の機能を実現でき、更に当該命令拡張用前置命令コードを設けない分だけ、命令コード長を短縮でき、命令実行時間を短縮することができる。   Here, a description will be given of a compound instruction that can be expanded in the same manner as described above even if the pre-instruction code for instruction expansion is omitted. For example, the MOV. If the instruction code of W # xx, R0 has a margin and can have destination information indicating whether it is a transfer to a memory or a transfer to a general-purpose register, it is not necessary to provide a pre-instruction code for instruction extension. In short, there is a substantial free area in the instruction code, and even if information on whether the transfer to the memory or the transfer to the general-purpose register is incorporated in the free area, it can be distinguished from other instruction codes. Based on such destination information, immediate data may be stored in the temporary register TRD and a control signal for generating the destination side as a memory may be generated. If a composite instruction that can be executed as a single instruction by combining the transfer instruction code with the destination information and the operation instruction code is adopted, the same function as the case of providing a pre-instruction code for instruction expansion is provided. Further, the instruction code length can be shortened and the instruction execution time can be shortened by the amount that the pre-instruction code for instruction expansion is not provided.

図52には命令拡張用前置命令コード、MOV.W #xx,R0に相当する命令コードに前記ディスティネーション情報を付加した命令コードを組合せて1命令とみなされる命令を実行したときのタイミングが示される。図38と比較すれば明らかなように、命令拡張用前置命令コード(pf=H’0104)に対する処理はない。   52 shows an instruction extension prefix instruction code, MOV. The timing when an instruction regarded as one instruction is executed by combining the instruction code corresponding to W #xx, R0 with the instruction code added with the destination information is shown. As is clear from comparison with FIG. 38, there is no processing for the pre-instruction code for instruction expansion (pf = H′0104).

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

Cコンパイラ400は、使用者の作成したそれぞれのC言語ソースプログラムを入力し、アセンブリ言語ソースプログラム乃至オブジェクトモジュールを出力する。   The C compiler 400 inputs each C language source program created by the user and outputs an assembly language source program or an object module.

アセンブラ401は、アセンブリ言語ソースプログラムを入力し、オブジェクトモジュールを出力する。   The assembler 401 inputs an assembly language source program and outputs an object module.

リンケージエディタ402は、前記Cコンパイラ400やアセンブラ401の生成した、複数のオブジェクトモジュールを入力して、各モジュールの外部参照や相対アドレスなどの解決を行い、1つのプログラムに結合して、ロードモジュールを出力する。   The linkage editor 402 inputs a plurality of object modules generated by the C compiler 400 and the assembler 401, resolves external references and relative addresses of each module, combines them into one program, and loads a load module. Output.

ロードモジュールは、シミュレータデバッガ403に入力され、パーソナルコンピュータなどのシステム開発装置上で、CPU2の動作をシミュレーションし、実行結果を表示し、プログラムの解析や評価を行なうことができる。また、ロードモジュールはエミュレータ404に入力され、実際の応用システム上などで動作する、いわゆるインサーキットエミュレーションを行ない、CPU2を有するマイクロコンピュータ全体としての、実動作の解析や評価を行なうことができる。   The load module is input to the simulator debugger 403 and can simulate the operation of the CPU 2 on a system development device such as a personal computer, display the execution result, and analyze and evaluate the program. Further, the load module is input to the emulator 404 and performs so-called in-circuit emulation that operates on an actual application system or the like, so that the actual operation of the entire microcomputer having the CPU 2 can be analyzed and evaluated.

このほかに、ライブラリアンとして、汎用的なサブルーチンなどを提供することもできる。   In addition, a general subroutine can be provided as a librarian.

図43には本発明に係るCPU2のシステム開発装置におけるCPU選択方法を示す。   FIG. 43 shows a CPU selection method in the system development apparatus for CPU 2 according to the present invention.

ここでは、上位CPU2のマキシマムモードを選択する場合を例示してある。(a)の場合、パーソナルコンピュータなどのシステム開発装置上のディスプレイでプロンプトが表示された状態で、“SET CPU= CPU−UMAX”と入力すればよいようにする。(b)の場合は、プロンプトが表示された状態で、“SET CPU”とコマンドを入力し、これに対して、CPUの種類及び動作モードのメニューを、例えば“CPU NAME (1.CPU−UMAX、2.CPU−UMIN、3.CPU−L1、4.CPUL2)”と表示するとともに、メニュー番号の入力を要求し、使用者がメニューの番号1〜4のいずれかを入力すればよいようにする。ここで、CPU−UMAXは前記上位CPU2のマキシマムモード、CPU−UMINは前記上位CPUのミニマムモード、CPU−L1は前記第1の下位CPU、CPUL2は前記第2の下位CPU、を示すものとする。   Here, a case where the maximum mode of the upper CPU 2 is selected is illustrated. In the case of (a), “SET CPU = CPU-UMAX” may be input while a prompt is displayed on a display on a system development apparatus such as a personal computer. In the case of (b), in the state where the prompt is displayed, a command “SET CPU” is input, and in response to this, a menu of the CPU type and operation mode is displayed, for example, “CPU NAME (1. CPU-UMAX). 2. CPU-UMIN, 3. CPU-L1, 4.CPUL2) "and requesting the input of the menu number so that the user can input any of menu numbers 1-4. To do. Here, CPU-UMAX indicates the maximum mode of the upper CPU 2, CPU-UMIN indicates the minimum mode of the upper CPU, CPU-L1 indicates the first lower CPU, and CPUL2 indicates the second lower CPU. .

このほか、ウィンドウのドロップダウンメニューで選択可能にしてもよいし、ワークステーションなどであれば、Cシェルコマンドとして入力することもできる。   In addition, it may be made selectable from a window drop-down menu, or it can be input as a C shell command for a workstation or the like.

更に、アセンブラ401やCコンパイラ400などの、ソースプログラムの制御命令として、CPUの種類及び動作モードを入力するようにしてもよい。   Further, the CPU type and operation mode may be input as a control instruction of the source program such as the assembler 401 or the C compiler 400.

アセンブラ401は、選択されたCPUの種類及び動作モードに従って、入力されたアセンブリ言語ソースプログラム上の記述を解釈し、オブジェクトモジュールを生成したり、エラーがあればそれを表示したりする。下位CPUを選択し、上位CPUに存在して、下位CPUに存在しない命令を記述するとエラーになる。命令コード自体は上位CPUが包含しているから、このためのアセンブラを開発し、下位CPUについては、上位CPUに存在して、下位CPUに存在しない命令を検出するような追加を行なうなどして、容易に開発できる。   The assembler 401 interprets the description in the input assembly language source program in accordance with the selected CPU type and operation mode, and generates an object module or displays it if there is an error. If a lower CPU is selected and an instruction that exists in the upper CPU and does not exist in the lower CPU is described, an error occurs. Because the instruction code itself is included in the upper CPU, an assembler for this purpose is developed, and the lower CPU is added to detect an instruction that exists in the upper CPU and does not exist in the lower CPU. Easy to develop.

Cコンパイラ400は、選択されたCPUの種類及び動作モードに従って、使用可能な、オペレーション、データサイズ、アドレッシングモードの組合せで示される命令や、汎用レジスタ、アドレス空間を判別して、C言語によるプログラムを、CPUの命令に変換し、アセンブリ言語プログラムやオブジェクトモジュールとして出力する。   The C compiler 400 discriminates instructions, general-purpose registers, and address spaces indicated by combinations of operations, data sizes, and addressing modes according to the selected CPU type and operation mode, and executes a program in C language. Are converted into CPU instructions and output as assembly language programs or object modules.

Cコンパイラ400自体には、C言語によるプログラムを、CPUの命令に変換する場合に、そのプログラム自体の解析を最適化するステップとその結果を当該CPUの命令で実現するステップとを有する。また、C++言語によるプログラムのコンパイルや、モジュール間最適化などといった、CPUの命令セットとは直接関係のない機能の向上が図られているが、CPU毎の個別のコンパイラでは、これらのCPUに依存しない機能向上を全ての個別のコンパイラに適用しなければならない。本発明のように、互いに互換性のないCPUを含めて、共通のCコンパイラとしておけば、前記、CPUの命令セットとは直接関係のない機能向上を図ることが容易になり、また、開発効率などを向上することができる。   The C compiler 400 itself includes a step of optimizing the analysis of the program itself when converting a C language program into a CPU instruction, and a step of realizing the result with the CPU instruction. In addition, functions that are not directly related to the instruction set of the CPU, such as compiling a program in the C ++ language and optimization between modules, have been improved. However, individual compilers for each CPU depend on these CPUs. Unenhanced enhancements must be applied to all individual compilers. If a common C compiler including CPUs that are not compatible with each other as in the present invention is used, it is easy to improve functions that are not directly related to the instruction set of the CPU, and development efficiency is improved. Etc. can be improved.

前記シミュレータデバッガ403は、入力されたロードモジュールのプログラムを解釈して、CPUの動作をシミュレーションし、その中で、エラーがあればそれを表示したりする。例えば、下位CPUを選択し、上位CPUに存在して、下位CPUに存在しない命令を記述するとエラーになる。命令コード及び命令実行機能自体は上位CPUが包含しているから、このためのシミュレータデバッガを開発し、下位CPUについては、上位CPUに存在して、下位CPUに存在しない命令を検出するような追加を行なうなどして、容易に開発できる。   The simulator debugger 403 interprets the input load module program, simulates the operation of the CPU, and displays any errors in the simulation. For example, if a lower CPU is selected and an instruction that exists in the upper CPU and does not exist in the lower CPU is described, an error occurs. Since the instruction code and instruction execution function itself are included in the upper CPU, a simulator debugger is developed for this purpose, and the lower CPU is added to detect an instruction that exists in the upper CPU and does not exist in the lower CPU. Can be easily developed.

図44には本発明のCPU2のアセンブラが出力するリストを例示する。リストには、行番号、ロケーションカウンタ、オブジェクトコード、ソース行番号、ソースステートメントが表示される。   FIG. 44 illustrates a list output by the assembler of the CPU 2 of the present invention. The list displays the line number, location counter, object code, source line number, and source statement.

図44の(a)に示されるプログラムでは、制御命令(.CPU)で、CPU−UMAX、即ち、前記上位CPUのマキシマムモードを指定している。なお、ソースプログラム上で「.」で始まる命令は制御命令であり、マイクロコンピュータのプログラムには直接の関係はない。   In the program shown in FIG. 44 (a), the CPU-UMAX, that is, the maximum mode of the host CPU is designated by the control instruction (.CPU). Note that an instruction starting with “.” On the source program is a control instruction, and is not directly related to the microcomputer program.

SPはER7を表す。これはスタックポインタとしての機能の表記である。更に、本発明では、前記図5の通り、R0LをALと、ER1をEBXと表記してもよいとしている。いずれの表記を用いても、エラーとはされず、同一のオブジェクトコードに変換される。   SP represents ER7. This is a function notation as a stack pointer. Furthermore, in the present invention, as shown in FIG. 5, R0L may be expressed as AL and ER1 may be expressed as EBX. Whichever notation is used, it is not an error and is converted into the same object code.

また、STACKなどのラベルは、本プログラムのみでは解決されないので、オブジェクトコード上の相当するフィールドは0とされている。これらは、前記の通り、リンケージエディタで解決される。   Further, since a label such as STACK cannot be resolved only by this program, the corresponding field on the object code is set to 0. These are solved by the linkage editor as described above.

図44の(b)に示されるプログラムでは、同一のプログラムを、第1の下位CPU(CPU−L1)を指定してアセンブルした例を示す。第1の下位CPUには、MOV.L命令が存在しないため、エラーが表示され、オブジェクトコードは生成されない。図44のリストに関する更に詳細な内容は本発明と直接の関係ないので説明を省略する。   The program shown in FIG. 44 (b) shows an example in which the same program is assembled by designating the first lower CPU (CPU-L1). The first lower CPU includes MOV. Since there is no L instruction, an error is displayed and no object code is generated. Since the detailed content regarding the list of FIG. 44 is not directly related to the present invention, the description is omitted.

図45には本発明に係るCPU2を有するマイクロコンピュータのためのエミュレータを示す。   FIG. 45 shows an emulator for a microcomputer having the CPU 2 according to the present invention.

エミュレーション用プロセッサ410は、マイクロコンピュータ部分にエミュレーション用インタフェースを加えて構成される。前記マイクロコンピュータ部分は、例えば図2のマイクロコンピュータ1の構成に相当される。   The emulation processor 410 is configured by adding an emulation interface to the microcomputer portion. The microcomputer portion corresponds to, for example, the configuration of the microcomputer 1 shown in FIG.

コネクタ部411がシングルチップマイクロコンピュータの代わりに応用システム(ターゲットシステム又はユーザシステムとも称する)412のターゲットマイクロコンピュータ搭載領域413に装着される。エミュレーション用プロセッサ410は前記コネクタ部411とインタフェースケーブル414を介し、前記ターゲットシステムインタフェースを用いて前記応用システムと信号の入出力を行う。   The connector unit 411 is attached to the target microcomputer mounting area 413 of the application system (also referred to as target system or user system) 412 instead of the single chip microcomputer. The emulation processor 410 inputs / outputs signals to / from the application system using the target system interface via the connector unit 411 and the interface cable 414.

特に制限はされないものの、前記応用システム412に、ユーザバス415が存在し、ユーザメモリ416を接続することも可能とされる。この場合、エミュレーション用プロセッサ410が出力し、インタフェースケーブル414を介して供給されるユーザストローブ信号に従って、ユーザメモリ416はリード/ライトされる。   Although not particularly limited, a user bus 415 exists in the application system 412 and a user memory 416 can be connected. In this case, the user memory 416 is read / written according to the user strobe signal output from the emulation processor 410 and supplied via the interface cable 414.

一方、エミュレーション用プロセッサ410は前記エミュレーションインタフェースを用いてエミュレーションバス420に接続される。エミュレーションバス420には図示はされない状態信号・制御信号などを含む。前記エミュレーションバス420を用いて、エミュレーション用プロセッサ410から、応用システム412とエミュレーション用プロセッサ410の内部状態に応じた情報などが出力され、また、エミュレーション用プロセッサ410に対し、エミュレーションのための各種信号が入力される。エミュレーション用プロセッサ410の、図示はされないエミュレートモード端子が電源レベルに固定され、エミュレーション用プロセッサ410内部ではエミュレートモードが設定される。   On the other hand, the emulation processor 410 is connected to the emulation bus 420 using the emulation interface. The emulation bus 420 includes state signals and control signals not shown. Using the emulation bus 420, information corresponding to the internal state of the application system 412 and the emulation processor 410 is output from the emulation processor 410, and various signals for emulation are sent to the emulation processor 410. Entered. An emulation mode terminal (not shown) of the emulation processor 410 is fixed to the power supply level, and the emulation mode is set inside the emulation processor 410.

さらに、前記エミュレーションバス420には、エミュレーションメモリ421、ブレーク制御回路422、リアルタイムトレース回路423などが接続される。前記エミュレーションメモリ421は、特に制限はされないものの、RAMなどによって構成され、前記のユーザプログラムを格納した領域と、エミュレーションのためのプログラムを格納した領域とを持つ。前記ブレーク制御回路422は、エミュレーション用プロセッサ410による制御状態やエミュレーションバス420の状態を監視して、その状態が予め設定された状態に達した時に、前記エミュレータ専用割込みを入力して、エミュレーション用プロセッサ410のCPU(便宜上CPU2と記す)によるユーザプログラムの実行を停止させ、エミュレーション用プログラム実行状態に遷移させる(ブレークする)。前記リアルタイムトレース回路423は、前記CPU2のリード動作またはライト動作を示す信号、命令リード動作を示す信号(CPUステータス信号)、エミュレーションバスに与えられるアドレスやデータさらには制御信号を逐次蓄える。   Further, an emulation memory 421, a break control circuit 422, a real-time trace circuit 423, and the like are connected to the emulation bus 420. Although the emulation memory 421 is not particularly limited, the emulation memory 421 is configured by a RAM or the like, and has an area for storing the user program and an area for storing a program for emulation. The break control circuit 422 monitors the state of control by the emulation processor 410 and the state of the emulation bus 420, and when the state reaches a preset state, inputs the emulator-dedicated interrupt, Execution of the user program by the CPU 410 (denoted as CPU 2 for convenience) is stopped, and a transition to the emulation program execution state is made (break). The real-time trace circuit 423 sequentially stores a signal indicating the read operation or write operation of the CPU 2, a signal indicating a command read operation (CPU status signal), an address and data given to the emulation bus, and a control signal.

前記エミュレーションメモリ421、ブレーク制御回路422、リアルタイムトレース回路423はコントロールバス424にも接続され、コントロールバス424を介してコントロールプロセッサ425の制御を受けるようになっている。前記コントロールバス424は、前記コントロールプロセッサ425に接続されるとともに、ホストインタフェース回路426を介して、特に制限はされないものの、前記パーソナルコンピュータなどのシステム開発装置427に接続される。   The emulation memory 421, the break control circuit 422, and the real-time trace circuit 423 are also connected to the control bus 424, and are controlled by the control processor 425 via the control bus 424. The control bus 424 is connected to the control processor 425 and is connected to a system development device 427 such as the personal computer through the host interface circuit 426, although not particularly limited.

例えば、システム開発装置427から入力されたプログラム(ロードモジュール)をエミュレーションメモリ421のユーザプログラム格納領域に転送し、内蔵ROM上に配置されるべきかかるプログラムをCPU2がリードすると、エミュレーションメモリ421上のプログラムがリードされ、実行される。また、ブレーク条件や、リアルタイムトレース条件などもシステム開発装置427から与えることができる。   For example, when the program (load module) input from the system development device 427 is transferred to the user program storage area of the emulation memory 421 and the CPU 2 reads the program to be placed on the built-in ROM, the program on the emulation memory 421 is read. Is read and executed. In addition, a break condition, a real-time trace condition, and the like can be given from the system development device 427.

コントロールプロセッサ425は、応用システム412で本来使用するCPUの種類の選択を行うためのプログラムを、エミュレーションメモリ421のエミュレーションプログラム格納領域に格納する。CPU2は、かかるプログラムを、所定の条件でブレークした状態で、実行し、エミュレーションインタフェース442内の制御レジスタ449の設定を行なうことで、エミュレーション上の必要な設定を行なう。この場合は、エミュレーション用プログラムの実行モード、いわゆるブレークモードでのみライト可能にすると都合がよい。開発途上にあるユーザのソフトウェアの誤動作によって、誤った設定を行なってしまうことを抑止できる。また、制御レジスタを用いることによって、応用システム412で本来使用するCPUの種類の選択対象が増えたりしても、制御レジスタの構成のみを変更すればよく、エミュレーション用インタフェースを変更する必要がなく、エミュレータのハードウェアを変更しなくてよい。   The control processor 425 stores a program for selecting the type of CPU originally used in the application system 412 in the emulation program storage area of the emulation memory 421. The CPU 2 executes such a program in a state where the program is broken under a predetermined condition, and performs setting necessary for emulation by setting the control register 449 in the emulation interface 442. In this case, it is convenient to enable writing only in the execution mode of the emulation program, so-called break mode. It is possible to prevent erroneous setting due to malfunction of the software of the user who is still developing. Further, by using the control register, even if the number of CPU types to be originally used in the application system 412 increases, it is only necessary to change the configuration of the control register, and there is no need to change the emulation interface. There is no need to change the hardware of the emulator.

エミュレーション用プロセッサ410およびエミュレータを複数のCPUをサポート可能にすることによって、実際のマイクロコンピュータのみを開発すればよく、開発効率を向上することができる。   By making the emulation processor 410 and the emulator support a plurality of CPUs, it is only necessary to develop an actual microcomputer, and the development efficiency can be improved.

エミュレータにおいても、前記同様に、CPUの種類を選択可能にする。選択方法は、パーソナルコンピュータなどのシステム開発装置上で、図42と同様に、行なえばよい。選択された内容は、コントロールプロセッサ425を介して、所定のプログラムとして、エミュレーションメモリ421のエミュレーションプログラム格納領域に格納され、CPU2は、かかるプログラムを実行し、エミュレーションインタフェース内の制御レジスタの設定を行なうことで、前記選択が実行される。   In the emulator as well, the CPU type can be selected. The selection method may be performed on a system development apparatus such as a personal computer as in FIG. The selected content is stored as a predetermined program in the emulation program storage area of the emulation memory 421 via the control processor 425, and the CPU 2 executes the program and sets the control register in the emulation interface. Then, the selection is performed.

このとき、同時に、シングルチップマイクロコンピュータの動作モードなどを同時に指定してもよい。シングルチップマイクロコンピュータの動作モードは、例えば、シングルチップモード、内蔵ROM有効拡張モード、内蔵ROM無効拡張モードなどがあり、これに、CPU2の動作モードを組合せて指定することができる。また、汎用レジスタの表示方法も合わせて選択するようにしてもよい。トレースリスト上などの逆アセンブル時に、ER0と表示するか、EAXと表示するかなどを切り替えるようにする。   At this time, the operation mode of the single chip microcomputer may be specified at the same time. The operation mode of the single-chip microcomputer includes, for example, a single-chip mode, a built-in ROM valid expansion mode, a built-in ROM invalid expansion mode, and the like, which can be designated in combination with the operation mode of the CPU 2. Further, the display method of the general-purpose register may be selected together. When disassembling on the trace list or the like, it is switched whether to display ER0 or EAX.

応用システム412で本来使用するCPUの種類を指定可能にすることにより、同一のエミュレーション用プロセッサ乃至同一のエミュレータを以って、内蔵機能モジュールや内蔵メモリの容量の組合せなどで、多数の種類のシングルチップマイクロコンピュータをエミュレーションできる。エミュレーション用プロセッサ乃至エミュレータの開発後でも、内蔵している機能の組合せで実現できれば、エミュレーション用プロセッサ乃至エミュレータの開発を行なうことなく、応用分野などの動向に合わせた、シングルチップマイクロコンピュータのみを開発していくことができる。開発効率を向上することができる。   By making it possible to specify the type of CPU that is originally used in the application system 412, it is possible to specify many types of singles using combinations of built-in function modules and built-in memory capacity using the same emulation processor or the same emulator. A chip microcomputer can be emulated. Even after the development of an emulation processor or emulator, if it can be realized with a combination of built-in functions, only a single-chip microcomputer that matches the trend of the application field can be developed without developing the emulation processor or emulator. Can continue. Development efficiency can be improved.

エミュレータに占めるエミュレーション用プロセッサの費用は、少ないから、エミュレーション用プロセッサにはなるべく多くの機能モジュールなどを内蔵しておけばよい。   Since the cost of the emulation processor occupying the emulator is small, it is only necessary to incorporate as many function modules as possible in the emulation processor.

図46には本発明に係るCPUのためのエミュレータによるトレースリストを例示する。   FIG. 46 illustrates a trace list by an emulator for the CPU according to the present invention.

トレースリストは、行番号(BP)、アドレスバス(AB)、データバス(DB)、アドレスデコード(MA)、リード/ライト(R/W)、ステータス(ST)、割込み信号(NMI、IRQ)を表示するとともに、実行した命令のアセンブリ言語によるリストを示す。これは、データバスの状態と、図示はされないCPU命令実行状態信号を解析して、逆アセンブラが表示する。なお、行番号は、トレースリストの最後は0になる。また、アドレスデコード(MA)のROMは内蔵ROMへのアクセス、リード/ライト(R/W)のRはリードサイクル、ステータス(ST)のPRGは命令を示す。   The trace list includes a line number (BP), an address bus (AB), a data bus (DB), an address decode (MA), a read / write (R / W), a status (ST), and an interrupt signal (NMI, IRQ). A list of executed instructions in assembly language is displayed. This is analyzed by the data bus state and a CPU instruction execution state signal (not shown) and displayed by the disassembler. The line number is 0 at the end of the trace list. The address decode (MA) ROM indicates access to the built-in ROM, the read / write (R / W) R indicates a read cycle, and the status (ST) PRG indicates an instruction.

更に、(a)で示されている、LIR、LID信号は、エミュレーション用インタフェースに含まれている、命令解析用の信号のトレース結果である。通常、かかる信号は、トレースリスト上には表示されないが、トレースメモリには格納され、逆アセンブラなどの解析に用いられる。また、使用者には、通常公開されないコマンドなどによって、表示することができる。   Further, the LIR and LID signals shown in (a) are trace results of the instruction analysis signal included in the emulation interface. Normally, such a signal is not displayed on the trace list, but is stored in the trace memory and used for analysis of a disassembler or the like. Also, it can be displayed to the user by a command that is not normally disclosed.

LIR信号は当該バスサイクルが、命令リードであることを示す。LID信号は命令実行開始を示す。   The LIR signal indicates that the bus cycle is an instruction read. The LID signal indicates the start of instruction execution.

例えば、200行目は、100番地から、命令リードを行い、命令コードH’7A07を読み出したことを示す。199、198行目と合わせて、MOV.L #FFFFFF0E:32,ER7を実行したことが表示されている。逆アセンブラは、LID信号で命令の第1ワードを判定して、H’7A07FFFFFF0Eを、前記MOV.L #FFFFFF0E:32,ER7と解釈して表示するものである。   For example, the 200th line indicates that the instruction is read from address 100 and the instruction code H′7A07 is read. 199, 198 and MOV. L # FFFFFF0E: 32 and ER7 are displayed. The disassembler determines the first word of the instruction using the LID signal, and replaces H′7A07FFFFFF0E with the MOV. L # FFFFFF0E: 32, ER7 is interpreted and displayed.

下位CPUのエミュレーション時に、逆アセンブラは、上位CPUは持つが、下位CPUが持たない命令を実行すると、未定義の命令として、表示する。未定義の命令として表示する場合は、データとして、命令コードを表示する。   When the lower CPU is emulated, the disassembler displays an undefined instruction when it executes an instruction that the upper CPU has but the lower CPU does not have. When displaying as an undefined instruction, an instruction code is displayed as data.

図46では、上位CPUの“MOV.L ER0,@ER1”に相当する命令コードを、80、79行目で、200番地から、命令リードを行い、第2の下位CPUで未定義の命令(DATA.L H’01006990)として表示する例が示されている。   In FIG. 46, the instruction code corresponding to “MOV.L ER0, @ ER1” of the upper CPU is read from the address 200 on the 80th and 79th lines, and the undefined instruction ( DATA.L H'01006990) is shown as an example.

図47には本発明を適用したマイクロコンピュータのエミュレーション用プロセッサのブロック図を示す。   FIG. 47 is a block diagram of a microcomputer emulation processor to which the present invention is applied.

エミュレーション用プロセッサ410は、図2のシングルチップマイクロコンピュータ1の部分(マイクロコンピュータコア441)と、エミュレーションインタフェース442から構成される。なお、図2のタイマや入出力ポートなどは、I/Oとして代表させ、また、内部バスの詳細とバスコントローラを図示している。なお、図2のタイマ6,7や入出力ポート11〜19などは、I/O443、ユーザバッファ(ユーザBUF)444として代表させ、また、図2ではその詳細な図示を省略した内部バスIDB,IAB,PDB,PABの詳細とバスコントローラ(BSC)445を図示している。ユーザインタフェース446は前記I/O443、ユーザバッファ444、及び図示を省略する入出力バッファなどを含む、ユーザシステム(エミュレーション対象システムであるターゲットシステム)に接続されるインタフェース回路を総称する。   The emulation processor 410 includes the part (microcomputer core 441) of the single chip microcomputer 1 of FIG. 2 are represented as I / O, and details of the internal bus and the bus controller are shown. The timers 6 and 7 and the input / output ports 11 to 19 in FIG. 2 are represented as I / O 443 and user buffer (user BUF) 444. Also, in FIG. Details of IAB, PDB, and PAB and a bus controller (BSC) 445 are shown. The user interface 446 is a generic name for an interface circuit connected to a user system (a target system that is an emulation target system) including the I / O 443, the user buffer 444, an input / output buffer (not shown), and the like.

マイクロコンピュータコア441は、図2のマイクロコンピュータ1に対して未定義命令検出回路448が追加されている。エミュレーションインタフェース440は、制御レジスタ449を含む。制御レジスタ449は、ブレークモードでのみライト可能とされる。エミュレーションインタフェース440から入出力される信号は、アドレスバス、データバス、リード信号、ライト信号、データサイズ信号、命令フェッチ信号などバスの状態を表示するバスステータス信号、命令の実行開始を示す信号、割込み処理の実行開始を示す信号などのCPU2の実行状態を示すCPUステータス信号、などを含み、エミュレータによる、マイクロコンピュータの動作解析に使用される。   The microcomputer core 441 has an undefined instruction detection circuit 448 added to the microcomputer 1 of FIG. The emulation interface 440 includes a control register 449. The control register 449 can be written only in the break mode. Signals input and output from the emulation interface 440 include a bus status signal indicating the bus status such as an address bus, a data bus, a read signal, a write signal, a data size signal, and an instruction fetch signal, a signal indicating the start of instruction execution, and an interrupt It includes a CPU status signal indicating the execution state of the CPU 2 such as a signal indicating the start of processing execution, etc., and is used for operation analysis of the microcomputer by the emulator.

未定義命令検出回路448は、CPU2に入力される命令コードを解析し、選択されているCPU2に存在しない命令が実行を開始したことを検出すると、CPU2にブレーク割込みを要求する。CPU2に何れの機能が選択されるかは、制御レジスタ449から指示される。例えば、第1の下位CPUが選択されている場合には、レジスタグループフィールドを持つ前置命令コードを実行すると、未定義命令として検出される。具体的には、命令コードを前記LIR信号でラッチして、解析し、未定義と解読された場合、前記LID信号が発生した時点で、ブレーク割込みを要求するようにすればよく、容易である。   The undefined instruction detection circuit 448 analyzes the instruction code input to the CPU 2 and, when detecting that the instruction that does not exist in the selected CPU 2 has started execution, requests the CPU 2 to make a break interrupt. Which function is selected for the CPU 2 is instructed from the control register 449. For example, when the first lower CPU is selected, when a prefix instruction code having a register group field is executed, it is detected as an undefined instruction. Specifically, if the instruction code is latched with the LIR signal, analyzed, and decoded as undefined, it is easy to request a break interrupt when the LID signal is generated. .

エミュレーション用プロセッサ410は、前記の通り、上位CPU2(CPU−U)を内蔵して、これを用いて、サブセットの機能を持つ、第1の下位CPU、第2の下位CPUの代行をさせる。これによって、下位CPUにエミュレーション用の機能を持たせる必要がなく、開発効率を向上したり、下位CPUは、エミュレーション用の論理回路を含む必要がなく、論理的規模を縮小したりできる。上位CPU2についても、未定義命令検出回路448を独立した機能ブロックとして持つことにより、CPU2を変更する必要がなく、開発効率を損なうことはない。   As described above, the emulation processor 410 incorporates the upper CPU 2 (CPU-U), and uses this to act as a substitute for the first lower CPU and the second lower CPU having a subset function. As a result, it is not necessary for the lower CPU to have a function for emulation, so that development efficiency can be improved, and the lower CPU does not need to include a logic circuit for emulation, and the logical scale can be reduced. The host CPU 2 also has the undefined instruction detection circuit 448 as an independent function block, so that it is not necessary to change the CPU 2 and development efficiency is not impaired.

いずれにせよ、エミュレーション用インタフェースを共通化しておけば、CPU乃至そのほかの機能ブロックが変更になった場合にも、エミュレータ側のハードウェアの変更をする必要がなく、エミュレーション用プロセッサ410のみを変更して、命令の動作を解析して表示する際の逆アセンブラに、いずれのCPUを対象にするかを指示すればよい。逆アセンブラに対する指示は、使用者がシステム開発装置から指定することもできるし、アセンブラからの入力情報によって、自動的に選択されるようなものであってもよい。これによってエミュレータの開発効率を向上し、逸早くエミュレータの開発環境を提供することができる。   In any case, if the emulation interface is made common, even if the CPU or other functional blocks are changed, there is no need to change the hardware on the emulator side, and only the emulation processor 410 is changed. Thus, it is only necessary to indicate which CPU is targeted for the disassembler when analyzing and displaying the operation of the instruction. The instruction to the disassembler can be designated by the user from the system development device, or can be automatically selected by input information from the assembler. This improves emulator development efficiency and provides an emulator development environment quickly.

図48には第2の下位CPUの別のプログラミングモデルが示される。このプログラミングモデルにおいても、汎用レジスタの総ビット数は同等としているが、汎用レジスタのみ4本としている。汎用レジスタの機能自体は、前記同様である。前記図5と同様に、R0、R1、R2、R3をAX、BX、CX、DXなどと表記できるようにしている。また、PCは24ビットで同等である。図示はされないものの、レジスタ直接やイミディエイトも含めて、ロングワードサイズのデータは扱わないようにする。汎用レジスタを16ビット構成にすることにより、算術論理演算器ALUなど、CPUの実効部の構成を、プログラムカウンタPCとインクリメンタを除いて、16ビット構成にでき、論理的規模を更に縮小できる。   FIG. 48 shows another programming model of the second lower CPU. In this programming model, the total number of bits of the general-purpose registers is the same, but only four general-purpose registers are used. The function of the general register is the same as described above. As in FIG. 5, R0, R1, R2, and R3 can be expressed as AX, BX, CX, DX, and the like. The PC is equivalent to 24 bits. Although not shown, long word size data including direct registers and immediate data is not handled. By configuring the general-purpose register to have a 16-bit configuration, the configuration of the effective part of the CPU, such as the arithmetic logic unit ALU, can be configured to have a 16-bit configuration, excluding the program counter PC and the incrementer, and the logical scale can be further reduced.

図49にはCPUのアドレスマップの別の例が示される。第2の下位CPUのアドレスマップは、マキシマムモードに相当する16MBのアドレス空間を持つ。データアクセス時は実効アドレスを16ビットで生成し、0〜H’7FFF及びH’FF8000〜H’FFFFFFを指定する。従って、RAMと内部I/Oレジスタを合わせて32kBまで、及びROMを32kBまで指定できる。前記の通り、RAMと内部I/Oレジスタを合わせて32kBの容量は、内蔵された機能モジュールのみで動作する、シングルチップマイクロコンピュータ乃至はマイクロコンピュータシステムでは十分な容量といえる。   FIG. 49 shows another example of the CPU address map. The address map of the second lower CPU has a 16 MB address space corresponding to the maximum mode. At the time of data access, an effective address is generated with 16 bits, and 0 to H'7FFF and H'FF8000 to H'FFFFFF are designated. Accordingly, the RAM and internal I / O registers can be specified up to 32 kB, and the ROM can be specified up to 32 kB. As described above, the capacity of 32 kB including the RAM and the internal I / O register is sufficient for a single-chip microcomputer or a microcomputer system that operates only with a built-in functional module.

データアクセス時で指定できるROMのアドレスが限定されてしまうが、前記の通り、ROMに割り当てる定数などについては、Cコンパイラなどで記述した場合も、モジュール間最適化で、再配置することができる。   Although the ROM addresses that can be specified at the time of data access are limited, as described above, the constants assigned to the ROM can be rearranged by inter-module optimization even when described by a C compiler or the like.

プログラムカウンタPCは24ビット構成であり、命令リード時は、24ビットでアドレスを生成し、16MBのアドレス空間を利用できる。分岐命令について、プログラムカウンタ相対と、メモリ間接または絶対アドレス24ビットを実行可能にするとよい。分岐命令は、レジスタフィールドを持たないから、2ワードの命令長で、絶対アドレス24ビットを持つことは可能である。16MBのアドレス空間を連続したものとして、ソフトウェアの負荷なく、利用できる。   The program counter PC has a 24-bit configuration. When an instruction is read, an address is generated with 24 bits and a 16 MB address space can be used. For branch instructions, program counter relative and memory indirect or absolute address 24 bits may be executed. Since a branch instruction does not have a register field, it is possible to have an instruction address of 2 words and an absolute address of 24 bits. The 16 MB address space can be used continuously without any software load.

また、例外処理時のベクタは24ビット(メモリ上は32ビットとされ、上位8ビットは無視される)、サブルーチン分岐などにおいて待避/復帰されるプログラムカウンタPCも24ビットとされる。   Further, the vector for exception processing is 24 bits (32 bits on the memory and the upper 8 bits are ignored), and the program counter PC saved / restored in a subroutine branch or the like is also 24 bits.

一方、上位CPUについても、準マキシマムモードを追加し、マキシマムモードに相当するアドレスマップを持つ第2の下位CPUと同等の動作を行なうことができるようにしている。   On the other hand, the quasi-maximum mode is also added to the upper CPU so that the operation equivalent to that of the second lower CPU having an address map corresponding to the maximum mode can be performed.

図50及び図51には図49に示される第2の下位CPUのアドレスマップにおける実効アドレスの計算方法が例示されている。   50 and 51 exemplify the effective address calculation method in the address map of the second lower CPU shown in FIG.

実効アドレスの計算方法は、図7、図8とほぼ同様であるが、データアクセス時には、全て、実効アドレスは16ビットで計算した上で、上位8ビットを符号拡張して、0〜H’7FFF及びH’FF8000〜H’FFFFFFを指定する。   The method for calculating the effective address is almost the same as in FIGS. 7 and 8, but at the time of data access, the effective address is calculated with 16 bits, and the upper 8 bits are sign-extended to 0 to H'7FFF. And H'FF8000 to H'FFFFFF are designated.

プログラムカウンタ相対は、分岐命令に使用し、前記同様に24ビットで計算する。また、図示はされないものの、分岐命令に、メモリ間接または絶対アドレス24ビットが使用可能な場合は、24ビットで実効アドレスを計算する。   The program counter relative is used for a branch instruction and is calculated with 24 bits as described above. Although not shown in the figure, when a memory indirect or 24-bit absolute address can be used for a branch instruction, the effective address is calculated with 24 bits.

上位CPUの、前記準マキシマムモードにおいては、図49に第2の下位CPUのアドレスマップと同様にする。実際には、実効アドレスの計算自体は図7、図8と同様にしておき、ポストインクリメント/プリデクリメントレジスタ間接の汎用レジスタEへの書込みを抑止するとともに、実効アドレスを利用する際に、上位8ビットを符号拡張すればよい。個別のアドレッシングモードによらず、統一的な制御を可能にして、論理的規模を縮小できる。一方、実効アドレスの計算には、仕様上、汎用レジスタRのみを使用することになるから、汎用レジスタEをデータ用に使用でき、実質的に汎用レジスタを増加させたことになる。   In the quasi-maximum mode of the upper CPU, the address map of the second lower CPU is set in FIG. Actually, the effective address calculation itself is the same as in FIG. 7 and FIG. 8, and the post-increment / pre-decrement register indirect writing to the general-purpose register E is suppressed, and when the effective address is used, the upper 8 The bits may be sign extended. Regardless of the individual addressing mode, unified control is possible and the logical scale can be reduced. On the other hand, since only the general-purpose register R is used for calculation of the effective address because of the specification, the general-purpose register E can be used for data, which effectively increases the number of general-purpose registers.

第2の下位CPUの場合には、上位CPUに比較して、汎用レジスタ本数が限定されているから、プログラム用のアドレス空間を縮小せず、実質的に汎用レジスタを増加させるメリットが相対的に大きい。   In the case of the second lower CPU, the number of general-purpose registers is limited as compared with the upper CPU, so that the merit of substantially increasing the general-purpose registers without reducing the program address space is relatively large.

以上説明した第1の下位CPU及び第2の下位CPUと共に上位CPU2を提供することにより、以下の作用効果を得る。   By providing the upper CPU 2 together with the first lower CPU and the second lower CPU described above, the following operational effects are obtained.

〔1−1〕異なる命令セットを持つ複数のCPUが、それぞれ論理的規模を縮小しつつ、それぞれ固有の特徴を以って、応用分野乃至使用者の多様な要求に応えることを可能にする。   [1-1] A plurality of CPUs having different instruction sets can respond to various demands of application fields or users with respective unique characteristics while reducing the logical scale.

〔1−2〕下位CPUのレジスタ構成、命令セット、並びに下位CPUの命令実行機能を包含することにより、下位CPUのために開発されたプログラムは、少なくとも、ソースプログラムのレベルで上位CPUに利用可能になり、少なくとも、ソースプログラムレベルでの上位互換を実現することができる。   [1-2] By including the register configuration of the lower CPU, the instruction set, and the instruction execution function of the lower CPU, the program developed for the lower CPU can be used by the upper CPU at least at the source program level. Thus, at least, upward compatibility at the source program level can be realized.

〔1−3〕有効なアドレスのビット数と、ベクタ及びスタックの単位サイズとを切り替える動作モードを予め用意しておくことにより、オブジェクトプログラムレベルでの上位互換も簡単に実現できるようになる。   [1-3] By preparing in advance an operation mode for switching the number of bits of a valid address and the unit size of a vector and a stack, upward compatibility at the object program level can be easily realized.

〔1−4〕第1、第2の下位CPUの双方に対して、ソースプログラムレベルまたはオブジェクトプログラムレベルでの上位互換を実現した、上位CPUを提供することにより、第1、第2の下位CPUのそれぞれの上位互換のCPUを開発することに比較して、開発効率を向上できる。更に、機能乃至性能を向上する場合にも、上位CPUに対する互換性を維持すれば、自ずから、第1、第2の下位CPUに対しても上位互換を維持できるから、将来拡張性を維持できるし、また開発効率も向上することができる。例えば、上位CPUについて、内部データバスを32ビット化するなどして高速化できれば、第1、第2の下位CPUのソフトウェア資産を有効に利用しつつ、高速化を享受できることになる。   [1-4] The first and second lower CPUs are provided by providing upper CPUs that realize upward compatibility at the source program level or the object program level for both the first and second lower CPUs. The development efficiency can be improved as compared with the development of each upward compatible CPU. Furthermore, even when the function or performance is improved, if the compatibility with the upper CPU is maintained, the upper compatibility can be maintained with respect to the first and second lower CPUs, so that the future expandability can be maintained. Also, development efficiency can be improved. For example, if the upper CPU can be speeded up by making the internal data bus 32 bits or the like, it is possible to enjoy the speedup while effectively using the software assets of the first and second lower CPUs.

〔1−5〕内部構成を共通化することによって、第1の下位CPUの上位互換で、上位CPUの下位互換となるようなCPU、或いは、第2の下位CPUに、更に下位互換のCPUなど、種々の互換性のあるCPUを提供することが容易にできる。   [1-5] A CPU that is upwardly compatible with the first lower CPU and is backward compatible with the upper CPU by sharing the internal configuration, or a CPU that is further backward compatible with the second lower CPU, etc. It is possible to easily provide various compatible CPUs.

〔1−6〕第2の下位CPUの命令セットを上位CPUのサブセットとし、削除した命令セットに対応する論理回路などを、上位CPUから削除して、第2の下位CPUを開発することにより、開発効率を向上することができる。   [1-6] By developing the second lower CPU by using the instruction set of the second lower CPU as a subset of the upper CPU and deleting the logic circuit corresponding to the deleted instruction set from the upper CPU. Development efficiency can be improved.

〔1−7〕第1の下位CPUに対して、上位CPUで追加された命令セットの部分の一部を、第2の下位CPUで継承することによって、第1、第2の下位CPUを互いに包含しない命令セットにして、総体的に、多様な要求に応えることができる。   [1-7] A part of the instruction set added by the upper CPU is inherited by the second lower CPU with respect to the first lower CPU, thereby allowing the first and second lower CPUs to communicate with each other. It is possible to respond to various requests as a whole by using an instruction set that is not included.

〔1−8〕ソースプログラムレベルまたはオブジェクトプログラムレベルでの上位互換を実現することによって、ソフトウェア資産を有効に利用することができ、使用者のソフトウェア開発効率を向上することができる。   [1-8] By realizing upward compatibility at the source program level or the object program level, software assets can be used effectively, and the software development efficiency of the user can be improved.

〔1−9〕異なる命令セットを持つ複数のCPUを含めて、ソフトウェア開発装置を共通に利用可能にし、CPUを選択する手段を設けることによって、ソフトウェア開発費用を減少させることができる。また、アセンブラなどは上位CPUについて開発して、そのほかのCPUについては、未定義の命令を検出すればよいから、ソフトウェア開発装置の開発効率を向上することができる。開発効率を向上することによって、開発に必要な資源を削減し、削減した資源を以って、機能向上の頻度を高めることも可能になる。   [1-9] Software development costs can be reduced by making it possible to commonly use software development apparatuses including a plurality of CPUs having different instruction sets and providing means for selecting CPUs. In addition, since the assembler and the like need only be developed for the upper CPU and detect undefined instructions for the other CPUs, the development efficiency of the software development apparatus can be improved. By improving the development efficiency, it is possible to reduce the resources required for development and increase the frequency of function improvement with the reduced resources.

〔1−10〕ソフトウェア開発装置及び、アセンブリ言語での記述フォーマットを、第1、第2の下位CPUで共通に利用可能にし、第1、第2の下位CPU間でのソフトウェア資産の移植を、比較的容易にすることができる。いずれかの下位CPUを使用することにより、上位のCPUに移行するほど費用を増加させない。   [1-10] A software development apparatus and a description format in an assembly language can be commonly used by the first and second lower CPUs, and software assets can be ported between the first and second lower CPUs. It can be made relatively easy. By using any one of the lower CPUs, the cost does not increase as much as the higher CPU is migrated.

〔1−11〕ソフトウェア開発装置上の、汎用的な機能のみを有する汎用レジスタの記述を複数使用可能にすることにより、他のCPUからのプログラムの移植を、比較的容易に行なうことができる。   [1-11] By making it possible to use a plurality of general-purpose register descriptions having only general-purpose functions on the software development apparatus, porting of programs from other CPUs can be performed relatively easily.

〔1−12〕複数のCPUに対応させてエミュレーション用プロセッサのエミュレーション用インタフェースを共通化することにより、同じエミュレータのハードウェアを共有できる。エミュレーション用インタフェースを共通化したり、エミュレータのハードウェアを共通化することによって、逸早く開発環境を整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   [1-12] By sharing the emulation interface of the emulation processor corresponding to a plurality of CPUs, the hardware of the same emulator can be shared. By making the emulation interface common and the emulator hardware common, the development environment can be quickly prepared, and the resources necessary for emulator development can be minimized.

〔1−13〕上位CPUに対するエミュレーション用論理を持ち、かかる上位CPUに対するエミュレーション用論理を以って、第1、第2の下位CPUのエミュレーション用プロセッサを構成することができ、エミュレーション用プロセッサの開発効率を向上することができる。   [1-13] Having emulation logic for the upper CPU, and by using the emulation logic for the upper CPU, the emulation processors of the first and second lower CPUs can be configured. Efficiency can be improved.

以上説明した上位CPU2によれば以下の作用効果を得る。   According to the host CPU 2 described above, the following operational effects are obtained.

〔2−1〕レジスタ拡張用前置命令コードで、レジスタグループを指定し、このレジスタ拡張用前置命令コードを省略可能とし、更にはレジスタ拡張用前置命令コードを付加しない場合の命令コードを既存のCPUの命令コードと同一とすることにより、互換性を損なわずに、汎用レジスタを増加させることができる。ソフトウェア資産を有効に利用可能とするとともに、使い勝手を向上し、処理速度を向上することができる。レジスタ拡張用前置命令コードを用いることにより、全ての汎用レジスタは同時に指定可能であるから、汎用レジスタ上のデータの配置などを考慮する必要がなく、プログラムの作成を容易にすることができる。   [2-1] A register group is specified by a register extension prefix instruction code, the register extension prefix instruction code can be omitted, and an instruction code when no register extension prefix instruction code is added By using the same instruction code as that of an existing CPU, the number of general-purpose registers can be increased without losing compatibility. Software assets can be used effectively, usability can be improved, and processing speed can be improved. By using the register extension pre-instruction code, all general purpose registers can be specified at the same time, so it is not necessary to consider the arrangement of data on the general purpose registers and the creation of the program can be facilitated.

〔2−2〕グループ指定フィールドを既存の命令コードの前に配置することにより、汎用レジスタを使用する全ての命令について、汎用レジスタを増加させることができる。この指定方法を共通化することにより、必要な論理的・物理的規模の増加を抑止し、ひいては製造費用の増加も抑止することができる。既存の論理と大部分を共通にできるから、設計資産を有効に利用して、設計品質を向上したり、開発期間を短縮したりできる。また、互換性を保った、アドレス空間の広いCPUと狭いCPUがある場合、双方に、互換性を維持しつつ汎用レスタを追加することも可能である。   [2-2] By placing the group designation field before the existing instruction code, the number of general-purpose registers can be increased for all instructions using the general-purpose registers. By making this designation method common, an increase in necessary logical and physical scales can be suppressed, and an increase in manufacturing cost can also be suppressed. Since most of the existing logic can be shared, design assets can be used effectively to improve design quality and shorten development time. In addition, when there is a CPU with a wide address space and a CPU with a narrow address space that maintain compatibility, it is possible to add general-purpose resters to both while maintaining compatibility.

〔2−3〕下位CPUにおける既存のレジスタグループを指定するものに相当するオペレーションコード(レジスタ拡張用前置命令コード)を、NOP(ノーオペレーション)命令と同一にすることにより、オペレーションコードマップを有効に利用するとともに、論理構成を共通化し、論理的規模の増加を抑止することができる。   [2-3] The operation code map is enabled by making the operation code corresponding to the one specifying an existing register group in the lower CPU (pre-instruction code for register expansion) the same as the NOP (no operation) instruction. In addition, the logical configuration can be shared and the increase in logical scale can be suppressed.

〔2−4〕グループ指定フィールドに余裕を持たせることにより、半導体製造プロセスの進展などに対応して、互換性を維持しつつ、汎用レジスタを増加させることができる。使い勝手を更に向上し、処理速度を向上することができる。方式的には同一にできるので、開発効率を向上することができる。また、アセンブラやCコンパイラ、シミュレータ、逆アセンブラなどのソフトウェアツールなどを、前記拡張を考慮して設計しておく、乃至、予め、前記拡張に対応させておくことにより、開発効率を向上することができる。   [2-4] By providing a margin in the group designation field, it is possible to increase the number of general-purpose registers while maintaining compatibility in accordance with the progress of the semiconductor manufacturing process. Usability can be further improved and processing speed can be improved. Development efficiency can be improved because the method can be the same. In addition, it is possible to improve development efficiency by designing software tools such as an assembler, a C compiler, a simulator, and a disassembler in consideration of the extension, or by corresponding to the extension in advance. it can.

〔2−5〕CPUCRのような制御レジスタを設けて、これによって暗黙的に使用されるスタックポインタなどのグループを指定することにより、スタックポインタを変更可能になり、スタックの再配置などを容易に行ことができる。レジスタ拡張用前置命令コードを付加できない割込例外処理についても、スタックポインタを変更することができる。サブルーチン分岐と割込みなどの例外処理のスタックポインタを分離することができる。サブルーチン用のスタック領域と、割込用のスタック領域とを別に持つことができる。これによって、サブルーチン分岐などで実現される各タスクが、予期し得ない割込み例外処理に対応するためにスタックを確保する必要がなくなり、スタックの使用量を抑止することができる。   [2-5] By providing a control register such as CPUCR and specifying a group such as a stack pointer that is used implicitly, the stack pointer can be changed, and stack relocation can be easily performed. Can do. The stack pointer can also be changed for interrupt exception handling to which a register extension prefix instruction code cannot be added. Stack pointers for subroutine handling and exception handling such as interrupts can be separated. A subroutine stack area and an interrupt stack area can be provided separately. As a result, it is not necessary for each task realized by a subroutine branch or the like to secure a stack in order to cope with an unexpected interrupt exception process, and the amount of use of the stack can be suppressed.

〔2−6〕上位CPUは、第1の下位CPUに既存の、転送命令コード、演算命令コードを命令拡張用前置命令コードと共に組合せて1命令として実行し、前記各命令コード単独では既存の動作を行なうから、既存の命令実行を阻害することがない。また、第1の下位CPUで作成した、既存の命令のみを使用した既存のソフトウェア資産をそのまま利用できる。換言すれば、第1の下位CPUとの互換性を損なわずに、メモリ上のデータに対する直接的な演算を可能とすることができる。メモリとレジスタ間の演算のみならず、メモリ間の直接的なデータ転送を可能とすることができる。ソフトウェア資産を有効に利用可能とするとともに、不所望な汎用レジスタの待避/復帰動作などを抑止して、使い勝手を向上するとともに、プログラム容量を縮小し、処理速度を向上することができる。プログラム容量を縮小することによって、ひいては、プログラム格納用のROMなどのメモリ容量を縮小し、費用を節約することができる。   [2-6] The upper CPU executes the transfer instruction code and the operation instruction code existing in the first lower CPU in combination with the instruction instruction prefix instruction code to execute as one instruction. Since the operation is performed, existing instruction execution is not hindered. Also, existing software assets created using the first lower CPU and using only existing instructions can be used as they are. In other words, it is possible to perform direct computation on data in the memory without impairing compatibility with the first lower CPU. In addition to operations between the memory and the register, it is possible to directly transfer data between the memories. Software resources can be used effectively, and undesired general-purpose register saving / restoring operations can be suppressed to improve usability, program capacity can be reduced, and processing speed can be improved. By reducing the program capacity, it is possible to reduce the memory capacity of the ROM for storing the program, thereby saving costs.

〔2−7〕第1の下位CPUに既存の、転送命令の命令コード、演算命令の命令コードを命令拡張用前置命令コードと共に組合せて、動作するから、命令デコーダの、従来の設計資産を有効に利用することができ、論理的な規模の追加と変更を最小限にし、論理的・物理的規模の増大を最小限にできる。また、開発に必要な期間を短縮し、資源を節約することができる。既存のデータアクセスのためのアドレッシングモードを全てサポートできるから、任意のアドレッシングモードの組合せを可能にして、プログラムの作成を容易にすることができる。   [2-7] Since the instruction code of the transfer instruction and the instruction code of the operation instruction existing in the first lower CPU are combined with the instruction code for instruction expansion, the conventional design assets of the instruction decoder are reduced. It can be used effectively, minimizing logical scale additions and changes, and minimizing logical and physical scale increases. In addition, the time required for development can be shortened and resources can be saved. Since all of the existing addressing modes for data access can be supported, any addressing mode can be combined to facilitate the creation of a program.

〔2−8〕第1の下位CPUの命令セットに追加する命令コードをレジスタ拡張用及び命令拡張用前置命令コードに止めることができるから、命令セットの変更を最小限にして上位CPU2の命令セットを構成することができる。   [2-8] Since the instruction code to be added to the instruction set of the first lower CPU can be stopped at the pre-instruction code for register extension and instruction extension, the instruction of the upper CPU 2 can be minimized with minimal change of the instruction set. A set can be configured.

〔2−9〕デスティネーションがメモリである場合に、デスティネーションデータのリード時の実効アドレスをテンポラリレジスタに確保し、演算結果のデスティネーションデータのライト時の実効アドレスの計算を不要にし、直ちにライト動作を実行可能にして、実行時間を短縮することができる。また、デスティネーションデータのライトを行なう命令コードを、CPU内部で自動的に生成し、命令長を短縮するとともに、かかる命令コードに、データサイズを指示することによって、必要な命令コードを節約し、かかる命令コードを転送命令の動作と類似にすることによって、設計を容易にし、制御回路の論理規模を縮小することができる。比較命令のように、デスティネーションデータのライト動作を必要としない命令においては、ライトサイクルを空きサイクルとすることによって、他の命令との動作を共通化し、設計を容易にし、制御回路の論理規模を縮小することができる。設計を容易にすることによって、ひいては、開発期間を短縮することができる。   [2-9] When the destination is a memory, the effective address at the time of reading the destination data is secured in the temporary register, the calculation of the effective address at the time of writing the destination data of the operation result is not required, and the write is immediately performed. The operation can be executed, and the execution time can be shortened. In addition, the instruction code for writing the destination data is automatically generated inside the CPU, the instruction length is shortened, and the instruction code is instructed to save the necessary instruction code. By making the instruction code similar to the operation of the transfer instruction, the design can be facilitated and the logic scale of the control circuit can be reduced. For instructions that do not require a destination data write operation, such as a comparison instruction, the write cycle is made empty so that the operation can be shared with other instructions, making the design easier, and the logic scale of the control circuit Can be reduced. By facilitating the design, the development period can be shortened.

〔2−10〕命令拡張用前置命令コードと、メモリをリードする転送命令の命令コードと、メモリに対する転送命令の命令コードを組合せることによって、メモリ・メモリ間の転送を実現できる。   [2-10] Transfer between the memory and the memory can be realized by combining the front instruction code for instruction extension, the instruction code of the transfer instruction for reading the memory, and the instruction code of the transfer instruction for the memory.

〔2−11〕イミディエイトデータの転送命令の命令コードと、メモリに対する転送命令の命令コードを組合せることによって、イミディエイト・メモリ間の転送を実現できる。   [2-11] By combining the instruction code of the immediate data transfer instruction and the instruction code of the transfer instruction for the memory, transfer between the immediate memories can be realized.

〔2−12〕命令拡張用前置命令コードに他の情報を含めることによって、命令コード長を短縮し、実行時間を短縮することができる。例えば、既存のCPUにおいて、メモリに対する演算以外の指示を行なう前置命令コードと演算コードとを組合せて実現されている命令が存在する場合、前記メモリに対する演算以外の指示を、前記メモリに対する演算を指示する命令拡張用前置命令コードに含めることによって、命令コード長を短縮し、実行時間を短縮することができる。   [2-12] By including other information in the pre-instruction code for instruction expansion, the instruction code length can be shortened and the execution time can be shortened. For example, in an existing CPU, when there is an instruction implemented by combining a prefix instruction code that performs an instruction other than an operation with respect to a memory and an operation code, an instruction other than the operation with respect to the memory is performed. By including it in the pre-instruction code for instruction extension to be instructed, the instruction code length can be shortened and the execution time can be shortened.

〔2−13〕既存の命令を組合せ、新規の命令機能を実現しているので、既存のCPUと比較して、将来拡張余裕を同等程度に保持することができる。例えば、既存のCPUに対して、更なる命令セットの拡張や更なる高速化が可能になった場合には、かかる技術を、本発明を適用したCPUにも用いることができる。新規の命令機能を実現している、既存の命令に、前記技術を用い、これを組合せて、前記新規の命令機能を実現することができる。   [2-13] Since a new instruction function is realized by combining existing instructions, the future expansion margin can be maintained at the same level as that of the existing CPU. For example, when it is possible to further expand the instruction set and further increase the speed of an existing CPU, such a technique can be used for a CPU to which the present invention is applied. The new instruction function can be realized by combining the above-described technique with an existing instruction that implements a new instruction function.

以上説明した第2の下位CPUによれば以下の作用効果を得る。   According to the second lower CPU described above, the following operational effects are obtained.

〔3−1〕第2の下位CPUにおいて、アドレス空間とプログラムカウンタを上位CPUと同等にし、プログラムの大容量化に応えるとともに、比較的小規模なデータを扱える程度に、データ転送のアドレッシングモードを縮小したり、転送データのデータサイズを限定したりして、所望の応用分野などでの使い勝手を損なわずに、CPUの論理的規模を縮小できる。   [3-1] In the second lower CPU, the address space and the program counter are made the same as those of the upper CPU, the capacity of the program is increased, and the data transfer addressing mode is set so that relatively small data can be handled. By reducing the size or limiting the data size of the transfer data, the logical scale of the CPU can be reduced without impairing usability in a desired application field.

〔3−2〕データアクセス時に使用できるアドレス空間を小さくすることによって、更に論理的な規模を縮小できる。また、データアクセス時に使用できるアドレス空間を2つに分割することによって、使い勝手を損なわずに、上位CPUとのアドレス空間上の互換性を維持するとともに、上位CPUに実効アドレス計算方法などを切り替える動作モードを予め用意しておくことにより、ソフトウェア上の互換性を維持することができる。   [3-2] The logical scale can be further reduced by reducing the address space that can be used during data access. In addition, by dividing the address space that can be used during data access into two, the compatibility of the address space with the upper CPU is maintained without impairing the usability, and the effective address calculation method is switched to the upper CPU. By preparing the mode in advance, software compatibility can be maintained.

〔3−3〕プログラム用のアドレス空間を、上位CPUと同等に、大きくしていることにより、C言語などの高級言語を使用したプログラミングなどに対する適性を向上できる。また、スタックポインタを切替え可能にすることによって、OSなどのタスク管理時のスタックの容量の不所望な増加を抑止できる。   [3-3] By making the address space for the program as large as the upper CPU, the suitability for programming using a high-level language such as C language can be improved. In addition, by making the stack pointer switchable, an undesired increase in the capacity of the stack during task management such as an OS can be suppressed.

〔3−4〕データアクセス用の実効アドレスの計算を、アドレス空間に対応するビット長より、短いビット長(16ビット)で行い、符号拡張して実効アドレスを得ることによって、汎用レジスタの上位側(汎用レジスタE)をデータレジスタとして使用可能にし、実質的に汎用レジスタ数を増加させることができる。   [3-4] The effective address for data access is calculated with a bit length (16 bits) shorter than the bit length corresponding to the address space, and sign-extended to obtain the effective address. (General purpose register E) can be used as a data register, and the number of general purpose registers can be substantially increased.

前記検討課題A乃至Cの解決手段に関する発明の具体例について説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   Although specific examples of the invention relating to the means for solving the problems A to C have been described, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the scope of the invention.

例えば、対象になるCPUは、上位CPU、第1、第2の下位CPUに限定されない。第1の下位CPUの上位互換で、上位CPUの下位互換となるようなCPUが存在してもよい。或いは、第2の下位CPUに、更に下位互換のCPUが存在してもよい。第2の下位CPUの2つの実施例は、排他的なものではなく、同時に存在してもよい。そのほか、種々の互換性のあるCPUを提供することができる。   For example, the target CPU is not limited to the upper CPU and the first and second lower CPUs. There may be a CPU that is upwardly compatible with the first lower CPU and is backward compatible with the upper CPU. Alternatively, a lower compatible CPU may exist in the second lower CPU. The two embodiments of the second lower CPU are not exclusive and may exist simultaneously. In addition, various compatible CPUs can be provided.

レジスタ構成(プログラミングモデル)、即ち、汎用レジスタのビット数あるいはレジスタの本数などは任意に選択することもできる。アドレッシングモードと実効アドレスの計算方法についても種々変更可能である。 CPUの具体的な論理回路例などについても限定されない。EA1コードなどは転送命令コードと全く同じでなくてもよい。少なくともCPU内部の実行において同等の動作をすればよい。前置コードに従って転送命令コードの一部のビットの意味を変更してEA1コードとしたりすることができる。汎用レジスタは、アドレス及びデータに共通に利用可能なものである必要はなく、一部または全部がアドレス専用またはデータ専用のものであってもよい。   The register configuration (programming model), that is, the number of bits of the general-purpose register or the number of registers can be arbitrarily selected. Various changes can be made to the addressing mode and the effective address calculation method. The specific logic circuit example of the CPU is not limited. The EA1 code or the like may not be exactly the same as the transfer instruction code. It is sufficient to perform an equivalent operation at least in the execution inside the CPU. The meaning of some bits of the transfer instruction code can be changed according to the prefix code to obtain an EA1 code. The general-purpose registers need not be commonly used for addresses and data, and some or all of them may be dedicated for addresses or data.

前置命令コードの種類は特に限定はされない。命令拡張用前置命令コードは、転送命令と演算命令を組合せる情報や、転送命令と転送命令を組み合わせる情報以外の別の制御情報を含んでもよい。例えば、データサイズを指示する情報を含んでもよい。また、命令コードの基本単位16ビットに限定する必要はなく、8ビット或いは32ビットなど任意のビット幅とできる。命令コードの組合せについては、命令拡張用前置命令コード、第1のリード型転送命令コード、第2のリード型転送命令コード、演算命令コード、ライト型転送命令コードを組合せて、メモリ上の相異なる2つのアドレスのデータを入力して、演算し、結果を、ライト型転送命令コードで指定する別のメモリのアドレスに格納するようにすることもできる。第1、第2のリード型転送命令コードを省略して、汎用レジスタ上のデータを入力とすることもできる。命令拡張用前置命令コード、第1のリード型転送命令コード、第2のリード型転送命令コードを組み合せて、第1のリード型転送命令コードでリードしたデータを、第2のリード型転送命令コードのアドレス計算に用いるようにすることもできる。   The type of prefix instruction code is not particularly limited. The pre-instruction code for instruction extension may include other control information other than information for combining the transfer instruction and the operation instruction and information for combining the transfer instruction and the transfer instruction. For example, information indicating the data size may be included. Also, it is not necessary to limit the basic unit of the instruction code to 16 bits, and any bit width such as 8 bits or 32 bits can be used. For the instruction code combination, the instruction extension prefix instruction code, the first read type transfer instruction code, the second read type transfer instruction code, the operation instruction code, and the write type transfer instruction code are combined. Data of two different addresses can be input and operated, and the result can be stored in another memory address designated by the write type transfer instruction code. The first and second read type transfer instruction codes can be omitted and the data on the general-purpose register can be used as input. A combination of the pre-instruction code for instruction expansion, the first read type transfer instruction code, and the second read type transfer instruction code, and the data read by the first read type transfer instruction code is used as the second read type transfer instruction. It can also be used for code address calculation.

また、グループ0の汎用レジスタのみを、メモリ上のデータに対する演算命令に使用可能としてもよい。シングルチップマイクロコンピュータのその他の機能ブロックについても何等制約されない。   In addition, only the group 0 general-purpose registers may be used for operation instructions for data on the memory. There are no restrictions on the other functional blocks of the single-chip microcomputer.

《検討課題Dの解決手段に関する実施の形態》
次に、前記検討課題Dの解決手段に関する発明の具体例を説明する。ここで説明するマイクロコンピュータは、特に制限されないが、図53に例示されるCPU2Aを有する。マイクロコンピュータのモジュール構成は、特に制限されないが図2と同様である。CPU2Aは図3のレジスタ構成を有し、CPU2Aのアドレス空間は図6と同様であり、CPU2Aによる実効アドレスの演算手法は図7及び図8に示される通りである。CPU2Aの機械語の命令フォーマットは図9に準拠する。
<< Embodiment Regarding Solution to Study Problem D >>
Next, a specific example of the invention relating to the means for solving the examination problem D will be described. The microcomputer described here has a CPU 2A exemplified in FIG. 53, although not particularly limited. The module configuration of the microcomputer is not particularly limited, but is the same as that shown in FIG. The CPU 2A has the register configuration of FIG. 3, the address space of the CPU 2A is the same as that of FIG. 6, and the effective address calculation method by the CPU 2A is as shown in FIGS. The machine language instruction format of the CPU 2A conforms to FIG.

図54にはCPU2Aのビットテスト命令の命令フォーマットが例示される。ビットテスト命令は、汎用レジスタ上またはアドレス空間上のデータの所定のビットを検査して、検査結果をCCRのZフラグに反映するものである。   FIG. 54 illustrates an instruction format of the bit test instruction of the CPU 2A. The bit test instruction inspects a predetermined bit of data on the general-purpose register or address space, and reflects the inspection result in the Z flag of the CCR.

ビットテスト命令において、汎用レジスタ上のデータは、図54の(5)に例示されるように、レジスタ直接で指定される。この時のビットテスト命令は、オペレーションフィード(op)とレジスタフィールド(r)及び、ビット番号を指定するビットフィールド(n)を有する命令コードとなる。   In the bit test instruction, the data on the general-purpose register is designated directly by the register as illustrated in (5) of FIG. The bit test instruction at this time is an instruction code having an operation feed (op), a register field (r), and a bit field (n) for specifying a bit number.

ビットテスト命令において、汎アドレス空間上のデータの指定は、図54の(1)、(2)、(3)、(4)に例示されるように、絶対アドレス8ビット、16ビット、32ビット、及びレジスタ間接を使用することができる。即ち、絶対アドレスの場合はオペレーションフィールド(op)とEA拡張部(EA)を持つワード、レジスタ間接の場合はオペレーションフィード(op)とレジスタフィールド(r)を持つワードを有し、これに、前記レジスタ直接のビットテスト命令に相当するワードが続く、命令フォーマットを有する。   In the bit test instruction, the designation of data on the pan address space is as follows: absolute address 8 bits, 16 bits, 32 bits, as exemplified in (1), (2), (3), (4) of FIG. , And register indirection can be used. That is, in the case of an absolute address, it has a word having an operation field (op) and an EA extension (EA), and in the case of register indirect, it has a word having an operation feed (op) and a register field (r). It has an instruction format followed by a word corresponding to a register direct bit test instruction.

図55乃至図57にはCPU2Aのアドレス空間上からデータを読み込んで、前記データの所定のビットの状態に応じた処理を行う複合命令の命令フォーマットとして、アドレス空間上のデータの所定ビットに対する条件分岐命令(ビット条件分岐命令)の命令フォーマットを示す。ここで示す命令フォーマットは命令拡張用前置命令コードを用いる後述の例とは異なる例である。尚、単独の条件分岐命令ではコンディションコードフィールド(cc)が分岐条件を指定する。複合命令として分岐命令が組み込まれたビット条件分岐命令において分岐条件はビットコンディションフィールド(bc)で指定されることになる。   55 to 57 show a conditional branch for a predetermined bit of data on the address space as an instruction format of a composite instruction that reads data from the address space of the CPU 2A and performs processing according to the state of the predetermined bit of the data. Indicates the instruction format of an instruction (bit conditional branch instruction). The instruction format shown here is an example different from an example described later using an instruction extension prefix instruction code. In a single conditional branch instruction, the condition code field (cc) specifies a branch condition. In a bit condition branch instruction in which a branch instruction is incorporated as a composite instruction, the branch condition is specified in the bit condition field (bc).

アドレス空間上のデータの指定は、図55乃至図57に示されるように、絶対アドレス8ビット、16ビット、32ビット、及びレジスタ間接を使用することができる。これは前記ビットテスト命令の場合のデータ指定のための命令コード(ワード)と完全同一ではないが共通のコードを有する。即ち、データ指定のための命令コードは、例えば“MOVE命令”のようなデータ転送命令であり、命令コード中に単数又は複数の余剰ビットが存在し、その余剰ビットに適当な情報を設定しても、命令セット上でその他の命令コードと区別がつくようになっている。このようなデータ指定のための命令コードは、メモリ空間上で参照したデータをプログラム上解放されていないレジスタ例えばテンポラリデータレジスタTRDにロードする。   As shown in FIGS. 55 to 57, the designation of data on the address space can use absolute address 8 bits, 16 bits, 32 bits, and register indirect. This is not completely identical to the instruction code (word) for data designation in the case of the bit test instruction, but has a common code. That is, the instruction code for specifying data is a data transfer instruction such as a “MOVE instruction”, for example. One or more surplus bits exist in the instruction code, and appropriate information is set in the surplus bits. However, it can be distinguished from other instruction codes on the instruction set. Such an instruction code for designating data loads data referenced in the memory space into a register not released in the program, for example, the temporary data register TRD.

前記データ指定のための命令コードの後ろには、前記レジスタ直接のビットテスト命令に相当する命令ワードに代えて、条件分岐命令、サブルーチン分岐命令に相当するワードが続くことである。分岐アドレスの指定は、ディスプレースメント8ビット、16ビットのプログラムカウンタ相対を使用することができる。これは、既存の条件分岐命令と共通の命令コードであり、コンディションフィールド(cc)が、ビットコンディションフィールド(bc)となっている。更に、サブルーチン分岐は、ディスプレースメント16ビットのプログラムカウンタ相対のみを使用することができるようにしている。   The instruction code for data designation is followed by a word corresponding to a conditional branch instruction or a subroutine branch instruction instead of an instruction word corresponding to the bit test instruction directly in the register. For specifying the branch address, a displacement 8-bit, 16-bit program counter relative can be used. This is an instruction code common to existing conditional branch instructions, and the condition field (cc) is a bit condition field (bc). Further, the subroutine branch can use only the displacement 16-bit program counter relative.

尚、前記アドレス空間の小さい、若しくは下位のCPUにおいて、ビットテスト命令に絶対アドレス32ビットがなかった場合には可能な範囲の組合せのみを持つようにすればよい。   In the CPU having a small address space or a low-order CPU, if there is no absolute address of 32 bits in the bit test instruction, it is only necessary to have a combination in a possible range.

ビットコンディションフィールド(bc)は、下位3ビットbc[2:0]が前記テンポラリデータレジスタTRDのビット番号を、上位1ビットbc[3]が分岐条件(セット/クリア)を指定する。即ち、ビット条件分岐命令の最初の命令コードによりアドレス空間上で参照されて前記テンポラリデータレジスタTRDにロードされたデータに対するビット番号が下位3ビットbc[2:0]で指定され、指定されたビット番号の値の真値(True)を前記上位1ビットbc[3]が指定し、参照値が真値であるとき分岐を指示するように作用される。   In the bit condition field (bc), the lower 3 bits bc [2: 0] specify the bit number of the temporary data register TRD, and the upper 1 bit bc [3] specifies a branch condition (set / clear). That is, the bit number for the data that is referred to in the address space by the first instruction code of the bit conditional branch instruction and loaded into the temporary data register TRD is designated by the lower 3 bits bc [2: 0], and the designated bit The upper value 1 bit bc [3] designates the true value (True) of the number value, and when the reference value is the true value, the branch value is instructed.

図55乃至図57の複合命令としてのビット条件分岐命令によれば、アドレスaaのビットnが1にセットされている場合に分岐する命令は、BBS #n,@aa,dと記述すればよく、アドレスaaのビットnが0にクリアされている場合に分岐する命令は、BBC #n,@aa,dと記述すればよく、アドレスaaのビットnが1にセットされている場合にサブルーチン分岐する命令は、BSSR #n,@aa,dと記述すればよく、アドレスaaのビットnが0にクリアされている場合にサブルーチン分岐する命令は、BCSR #n,@aa,dと記述すればよい。前記の通り、n=bc[2:0]である。ディスプレースメントdは、アセンブリ言語においてはラベルを記述すればよく、相対値の計算はアセンブラが行なう。   According to the bit conditional branch instruction as the compound instruction in FIGS. 55 to 57, the instruction that branches when the bit n of the address aa is set to 1 may be described as BBS #n, @aa, d. An instruction that branches when the bit n of the address aa is cleared to 0 may be described as BBC #n, @aa, d, and when the bit n of the address aa is set to 1, the subroutine branches An instruction to be executed may be described as BSSR #n, @aa, d, and an instruction for branching a branch when bit n of address aa is cleared to 0 should be described as BCSR #n, @aa, d. Good. As described above, n = bc [2: 0]. For the displacement d, a label may be described in the assembly language, and the relative value is calculated by the assembler.

前記ビット条件分岐命令をサポートしないCPUでは、例えばBBS #n,@aa,dは、
BTST #n,@aa
BNE d
のように、ビットテスト命令(BTST)とその命令の実行結果に応じて分岐する命令(BNT)とを記述する必要があった。また、BSSR #n,@aa,dは、例えば、
BTST #n,@aa
BEQ NEXT
BSR d
NEXT:
のように、ビットテスト命令(BTST)と、その命令の実行結果に応じて分岐する命令(BEQ)と、PC相対によるサブルーチン分岐命令(BSR)とを記述する必要があった。ビットテスト命令に代えてビット転送命令(BLD)とその命令の実行結果に応じて分岐する命令(BCSまたはBCC)を用いても同じである。
In a CPU that does not support the bit conditional branch instruction, for example, BBS #n, @aa, d
BTST #n, @aa
BNE d
As described above, it is necessary to describe a bit test instruction (BTST) and an instruction (BNT) that branches according to the execution result of the instruction. BSSR #n, @aa, d is, for example,
BTST #n, @aa
BEQ NEXT
BSR d
NEXT:
As described above, it is necessary to describe a bit test instruction (BTST), an instruction (BEQ) that branches according to the execution result of the instruction, and a subroutine branch instruction (BSR) by PC relative. The same applies when a bit transfer instruction (BLD) and an instruction (BCS or BCC) branching according to the execution result of the instruction are used instead of the bit test instruction.

図55乃至図57に示されるビット条件分岐命令では、アドレス空間所で参照されたデータが汎用レジスタではなくテンポラリデータレジスタTRDにロードされ、その所定ビットの値に応じて分岐の可否を制御する事ができる。したがって、当該命令コードは1ワード、実行ステート数は1ステートの短縮が可能である。また、ビット条件サブルーチン分岐命令では、命令コードは2ワード、実行ステート数は3ステートの短縮が可能である。   In the bit conditional branch instruction shown in FIG. 55 to FIG. 57, the data referred to in the address space is loaded into the temporary data register TRD instead of the general-purpose register, and branching is controlled according to the value of the predetermined bit. Can do. Therefore, the instruction code can be shortened by one word and the number of execution states can be shortened by one state. In the bit condition subroutine branch instruction, the instruction code can be shortened to 2 words and the number of execution states can be shortened to 3 states.

前記の通り、機器制御の場合には、これらの条件分岐命令が組合せて(ツリー状に構成して)、多数の分岐条件の中から分岐先を判定することが多いから、上記短縮効果は全体的には、更に大きくなる。   As described above, in the case of device control, these conditional branch instructions are combined (configured in a tree shape), and branch destinations are often determined from a large number of branch conditions. In reality, it becomes even larger.

図58にはCPU2Aにおけるビット条件分岐命令を考慮したときの別の命令フォーマットにおける命令コードの組み合わせが例示される。ここに示す例は、図55乃至図57で説明した命令フォーマットの命令による機能を命令拡張用前置命令コードを用いて実現する例である。即ち、アドレス空間上のデータ指定に用いる命令コードを前記ビットテスト命令の場合のデータ指定のための命令コード(ワード)と同一とし、更にそのワードの前に、プリフィックスコードとして前置命令コードを付加する事により、上記同様に、複合命令をテンポラリデータレジスタTRD等を用いて単一命令として実行可能にするものである。   FIG. 58 illustrates combinations of instruction codes in another instruction format when a bit conditional branch instruction in the CPU 2A is considered. The example shown here is an example in which the function based on the instructions in the instruction format described with reference to FIGS. 55 to 57 is realized by using the instruction instruction prefix instruction code. That is, the instruction code used to specify data in the address space is the same as the instruction code (word) for specifying data in the case of the bit test instruction, and a prefix instruction code is added as a prefix code before that word. By doing so, the composite instruction can be executed as a single instruction using the temporary data register TRD or the like as described above.

図58は前記図12乃至図14と合わせれば、前記図11乃至図14に基づいて説明した命令拡張用前置命令コード及び転送命令と共に複合された前記直接的な演算命令の命令フォーマットにおける命令コードの組合せも含めて表現されることになる。尚、CPU2Aのメモリに対する転送命令の例の命令フォーマットは前記図11に基づいて説明した命令フォーマットと同じである。   58 is combined with FIG. 12 to FIG. 14, the instruction code in the instruction format of the direct operation instruction combined with the front instruction code for instruction extension and the transfer instruction explained based on FIG. 11 to FIG. It is expressed including the combination of. The instruction format of the transfer instruction example for the memory of the CPU 2A is the same as the instruction format described with reference to FIG.

図58の命令フォーマットにおいて、ビット条件分岐命令は、命令拡張用前置命令コード、EA1コード、分岐コードを組合せ手実現される。図ではEA2コードとの組合せも可能であるが、EA2コードはメモリアドレスをディスティネーションアドレスとするコードを意味するから、実際には意味がない。   In the instruction format of FIG. 58, the bit condition branch instruction is realized by combining the instruction extension prefix instruction code, the EA1 code, and the branch code. In the figure, the EA2 code can be combined with the EA2 code. However, the EA2 code means a code having a memory address as a destination address.

図58の命令フォーマットにおいて、複合命令としてのビットテスト命令は、命令拡張用前置命令コード、EA1コード、ビットテスト命令コードを組合せて実現することができる。このときの、ビットテスト命令コードは、汎用レジスタ上の所望のビットに対するビットテスト命令、即ち、図54の(5)の前記レジスタ直接のアドレッシングモードに相当する命令コードとする。また、所望のビットとキャリとの演算命令を備えているような場合には、ビットテスト命令と同様に実現できる。図ではEA2コードとの組合せも可能であるが、上記同様に実際には意味がない。   In the instruction format of FIG. 58, a bit test instruction as a compound instruction can be realized by combining a pre-instruction code for instruction expansion, an EA1 code, and a bit test instruction code. The bit test instruction code at this time is a bit test instruction for a desired bit on the general-purpose register, that is, an instruction code corresponding to the register direct addressing mode in (5) of FIG. In addition, when an operation instruction for a desired bit and carry is provided, it can be realized in the same manner as the bit test instruction. In the figure, a combination with the EA2 code is also possible, but in the same way as described above, there is no actual meaning.

図58の命令フォーマットにおいてはビットセット命令の機能を拡張できる。単独のビットセット命令は、指定されたデータの指定されたビットにセットする命令である。図58の命令フォーマットにおいて、複合命令としてのビットセット命令は、命令拡張用前置命令コード、EA2コード、ビットテスト命令コードを組合せる。このときの、ビットセット命令コードは、前記同様に、汎用レジスタ上の所望のビットに対するビットセット命令に相当する命令コードとする。図ではEA1コードとの組合せも可能であるが、EA1コードはメモリアドレスをソースアドレスとするコードを意味するから、実際には意味がない。   In the instruction format of FIG. 58, the function of the bit set instruction can be expanded. A single bit set instruction is an instruction to set a designated bit of designated data. In the instruction format of FIG. 58, a bit set instruction as a compound instruction is a combination of an instruction extension prefix instruction code, an EA2 code, and a bit test instruction code. The bit set instruction code at this time is an instruction code corresponding to a bit set instruction for a desired bit on the general-purpose register, as described above. In the figure, a combination with the EA1 code is also possible, but the EA1 code means a code having a memory address as a source address, and therefore has no meaning in practice.

CPU2Aにおける前記命令拡張用前置命令コード(制御コード)のフォーマットは前記図15に基づいて説明したフォーマットと同じである。このフォーマットに従えば、ソース側、デスティネーション側がメモリである情報を示すビットを持っている。ビット条件分岐命令、ビット操作命令の場合は、ソース側がメモリとなるように指定する。EA1とEA2の転送命令コードは同一としているため、ソース側がメモリであれば、デスティネーション側に拘らず、命令拡張用前置命令コードに続くものが、EA1と判断される。一方、ソース側が汎用レジスタとされ、デスティネーション側がメモリであれば、EA2と判断される。図58の命令フォーマットを有し1個の命令として実行されるとき、命令コード間でのデータの受け渡しにはテンポラリデータレジスタTRDが利用されることについては図55乃至図57で説明したのと同様である。   The format of the instruction extension prefix instruction code (control code) in the CPU 2A is the same as the format described with reference to FIG. According to this format, the source side and the destination side have bits indicating information indicating the memory. For bit conditional branch instructions and bit manipulation instructions, specify that the source side is memory. Since the transfer instruction codes of EA1 and EA2 are the same, if the source side is a memory, the one following the instruction extension prefix instruction code is determined to be EA1 regardless of the destination side. On the other hand, if the source side is a general-purpose register and the destination side is a memory, it is determined as EA2. As described with reference to FIGS. 55 to 57, the temporary data register TRD is used to exchange data between instruction codes when the instruction format shown in FIG. 58 is executed as one instruction. It is.

図58による命令コードの組み合わせにより、所望のビットの存在するアドレスを指定するために、転送命令と同等のアドレッシングモードを使用することができる。当該命令セットの中で、任意のアドレッシングモードを使用できるから、プログラミングを容易にすることができる。例えば、レジスタ直接、レジスタ間接と絶対アドレスのみしか持たない既存のCPUに対し、ディスプレースメント付きレジスタ間接、プリデクリメント/ポストインクリメントレジスタ間接などを追加することによって、複数のアドレスに存在するビットを操作したり、参照したりする場合に、プログラムステップ数を低減したり、処理速度を向上したりできる。このとき、既存の、転送命令の命令コード、ビット操作命令の命令コードを組合せて、動作するから、命令デコーダの、従来の設計資産を有効に利用することができ、論理的な規模の追加と変更を最小限にし、論理的・物理的規模の増大を最小限にできる。   By the combination of instruction codes according to FIG. 58, an addressing mode equivalent to a transfer instruction can be used to designate an address where a desired bit exists. Since any addressing mode can be used in the instruction set, programming can be facilitated. For example, by adding register indirect with displacement and indirect pre-decrement / post-increment register to existing CPUs that have only register direct, register indirect and absolute address, manipulate bits that exist in multiple addresses. Or the number of program steps can be reduced or the processing speed can be improved. At this time, the existing instruction code of the transfer instruction and the instruction code of the bit manipulation instruction operate in combination, so that the conventional design assets of the instruction decoder can be effectively used, and the logical scale is added. Minimize changes and minimize the increase in logical and physical scale.

ビット条件分岐命令については、図55乃至図57のフォーマットのものと図58のフォーマットのものとを揃えることができる。両方で同等の機能が実現できる命令(データ及び分岐先のアドレッシングモードの組合せ)については、命令コード長及び実行ステート数の短い方を採用すればよい。   As for the bit conditional branch instruction, the format shown in FIGS. 55 to 57 and the format shown in FIG. 58 can be arranged. For instructions (a combination of data and branch destination addressing modes) that can achieve equivalent functions in both, the instruction code length and the execution state number that are shorter may be employed.

図53には前記CPU2Aの詳細な一例が示される。図1のCPU2では特に図示はしなかったが、コンディションコードレジスタCCRにはコンディションフィールド(cc)の値が入力され、コンディションコードレジスタCCRの所定のビットの値がコンディションフィールド(cc)の値に一致するか否かを判定する判定回路(CMP)35が設けられ、これによる判定結果を受けて分岐制御信号36を生成する分岐制御論理(BRC)37が設けられている。   FIG. 53 shows a detailed example of the CPU 2A. Although not shown in particular in the CPU 2 in FIG. 1, the value of the condition field (cc) is input to the condition code register CCR, and the value of a predetermined bit in the condition code register CCR matches the value of the condition field (cc). A determination circuit (CMP) 35 for determining whether or not to perform is provided, and a branch control logic (BRC) 37 for generating a branch control signal 36 in response to the determination result is provided.

図55乃至図58の命令フォーマットで説明した複合命令としてのビット条件分岐命令において、テンポラリデータレジスタTRDにはビットコンディションフィールド(bc)の値が入力され、これによって指定されるビット位置の値が分岐条件に一致するか否かを判定する判定回路(CMP)38が設けられ、これによる判定結果は前記分岐制御論理37に供給される。分岐制御論理37は、制御信号MODSの論理値にしたがって判定回路35又は判定回路38からの入力を有効とする。即ち、複合命令としてのビット条件分岐命令を実行してアドレス空間上からデータを参照するとき、命令デコーダDECはMODS=1とし、MODS=1のときテンポラリレジスタライト信号TRDwrが有効にされ、汎用レジスタに代えてテンポラリデータレジスタTRDに参照データが書込まれる。命令デコーダDECは前記複合命令以外のときはMODS=0とし、MODS=0のとき汎用レジスタライト信号Rdwrが有効にされ、汎用レジスタに書込まれる演算結果に応じてCCRのフラグが操作される。前記分岐制御論理37はMODS=1のときテンポラリデータレジスタTRDの判定回路38から出力される情報を採用し、其れに応じて分岐制御を行う。MODS=0のとき、分岐制御回路37はコンディションコードレジスタCCRの判定回路35から出力される情報を採用して分岐制御を行う。   In the bit conditional branch instruction as the compound instruction described in the instruction format of FIGS. 55 to 58, the value of the bit condition field (bc) is input to the temporary data register TRD, and the value of the bit position specified thereby is branched. A determination circuit (CMP) 38 for determining whether or not the conditions are met is provided, and the determination result is supplied to the branch control logic 37. The branch control logic 37 validates the input from the determination circuit 35 or the determination circuit 38 according to the logical value of the control signal MODS. That is, when executing a bit conditional branch instruction as a compound instruction and referring to data from the address space, the instruction decoder DEC sets MODS = 1, and when MODS = 1, the temporary register write signal TRDwr is enabled, and the general-purpose register Instead, reference data is written to temporary data register TRD. The instruction decoder DEC sets MODS = 0 when the instruction is other than the above compound instruction. When MODS = 0, the general-purpose register write signal Rdwr is validated, and the CCR flag is manipulated according to the operation result written to the general-purpose register. The branch control logic 37 adopts information output from the determination circuit 38 of the temporary data register TRD when MODS = 1, and performs branch control accordingly. When MODS = 0, the branch control circuit 37 performs branch control by using information output from the determination circuit 35 of the condition code register CCR.

割り込み制御部INTCは、図55乃至図58に示されるように、複数の命令コード(オペレーションフィールドを持つワード)を一連のものとして実行する場合には、それぞれの命令コードが割込みマスクを指示して、所定の組合せの命令コードの実行が途切れないようにする。   When the interrupt control unit INTC executes a plurality of instruction codes (words having an operation field) as a series as shown in FIGS. 55 to 58, each instruction code indicates an interrupt mask. The execution of the predetermined combination of instruction codes is not interrupted.

算術演算器AUは、プログラムカウンタ相対の分岐命令/サブルーチン分岐命令の分岐アドレスの生成に使用する。具体的には、直前の命令リードに使用したプログラムカウンタPCの出力を入力すると共に、リードデータバッファRDBが保持するディスプレースメントを入力して、それらの加算を行なう。8ビットディスプレースメントのプログラムカウンタ相対の分岐命令/サブルーチン分岐命令の実行開始時には、分岐アドレスが得られているようにする。   The arithmetic operator AU is used to generate a branch address for a branch instruction / subroutine branch instruction relative to the program counter. Specifically, the output of the program counter PC used for the previous instruction read is input, and the displacement held in the read data buffer RDB is input, and these are added. At the start of execution of an 8-bit displacement program counter relative branch instruction / subroutine branch instruction, a branch address is obtained.

インクリメンタINCは、プログラムカウンタPCのインクリメントに用いられる。前述の如く、ビット条件分岐命令では、テンポラリデータレジスタTRDと判定回路38を用いる。   The incrementer INC is used to increment the program counter PC. As described above, in the bit conditional branch instruction, the temporary data register TRD and the determination circuit 38 are used.

尚、その他、図1と同一の機能を有する回路ブロックには同じ符号を付してその詳細な説明は省略する。   In addition, circuit blocks having the same functions as those in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted.

図59には前記テンポラリデータレジスタTRDの判定回路38の論理構成及び分岐制御論理37を論理記述によって例示する。   FIG. 59 illustrates the logical configuration of the determination circuit 38 of the temporary data register TRD and the branch control logic 37 by a logical description.

図59の(5−1)の部分において、ビットコンディションフィールド(bc)は、命令コードに応じて、命令コードのビット11〜8、ビット7〜4の何れかである。これを、制御信号bcc1で選択した結果を、内部信号bc1とする。この内部信号bc1の、最上位ビットbc1[3]はビットの状態(セット/クリア)を、下位ビットbc1[2:0]はビット番号を指定する。   In the part (5-1) of FIG. 59, the bit condition field (bc) is any one of bits 11 to 8 and bits 7 to 4 of the instruction code according to the instruction code. The result selected by the control signal bcc1 is defined as an internal signal bc1. In the internal signal bc1, the most significant bit bc1 [3] designates a bit state (set / clear), and the lower bit bc1 [2: 0] designates a bit number.

図59の(5−2)の部分では、bc1[2:0]によるセレクタによって、TRDの所望のビットが選択される(trdsel)。   In the portion (5-2) in FIG. 59, a desired bit of TRD is selected (trdsel) by the selector based on bc1 [2: 0].

図59の(5−3)の部分では、bc[3]=0のときは、選択されたビットの反転が、bc[3]=1のときは、選択されたビットがそのまま、出力される(bout)。これがビット条件の判定結果である。   In the part (5-3) of FIG. 59, when bc [3] = 0, the selected bit is inverted, and when bc [3] = 1, the selected bit is output as it is. (Bout). This is the determination result of the bit condition.

図59の(5−4)の部分では、MODS信号によって、既存の条件分岐命令のコンディションコードCCRの判定結果(cout)と前記出力(bout)とが選択されて、分岐/非分岐の結果を得る(bcout)。この結果が、1のとき分岐成立、0のとき分岐不成立である。なお、特に制限はされないものの、分岐条件判定信号(bcc1とbcc2の論理和)が活性状態でないときには、1とするようにしている。   In the part (5-4) of FIG. 59, the determination result (cout) of the condition code CCR of the existing conditional branch instruction and the output (bout) are selected by the MODS signal, and the result of branch / non-branch is obtained. Bcout. When the result is 1, the branch is established, and when the result is 0, the branch is not established. Although not particularly limited, it is set to 1 when the branch condition determination signal (logical sum of bcc1 and bcc2) is not active.

図60乃至図62にはビットテスト命令及びビット条件分岐命令の一部(第1のワード)に対する命令デコーダDECの論理構成が論理記述によって示される。デコーダDECの論理記述において、小文字の信号は、命令デコーダDECで生成されて出力される信号とし、大文字の信号は命令デコーダDECに入力された信号とする。同図の論理記述は、8ビット絶対アドレスによるデータリードを行ない、リードしたデータをテンポラリデータレジスタTRDに格納する場合を例示する。   60 to 62 show the logical configuration of the instruction decoder DEC for the bit test instruction and a part of the bit conditional branch instruction (first word) by the logical description. In the logic description of the decoder DEC, lowercase signals are signals generated and output by the instruction decoder DEC, and uppercase signals are signals input to the instruction decoder DEC. The logical description in FIG. 6 illustrates a case where data reading is performed with an 8-bit absolute address and the read data is stored in the temporary data register TRD.

図60の(6−1)の部分でステートコードTMGが生成される。ステートコードTMGは1→2と進行する。なお、NEXTTMG[5]=0のとき、次のTMGはNEXTTMG[4:0]とされる。NEXTTMG[5]=1のとき、次のTMGは5’b00001とされる。   The state code TMG is generated at the portion (6-1) in FIG. The state code TMG proceeds from 1 to 2. When NEXTTMG [5] = 0, the next TMG is NEXTTMG [4: 0]. When NEXTTMG [5] = 1, the next TMG is set to 5'b00001.

図60の第2の部分(6−2)ではバス制御を行なう。nop=0はバスアクセス開始、nop=1はバスアクセス禁止を指示する。data=0は命令リード、data=1はデータアクセスを指示する。long=1はロングワードサイズ、long=0のとき、byte=0はワードサイズ、byte=1はバイトサイズを指示する。write=0はリード、write =1はライトを指示する。命令リードの場合は所定のタイミングでバスIDBの内容がIR1とリードデータバッファRDBに格納される。データリードの場合は所定のタイミングでバスIDBの内容がリードデータバッファRDBに格納される。データライトの場合は所定のタイミングでライトデータバッファWDBの内容がバスIDBに出力される。本命令の場合、ステートコード1でデータアクセスを行い、データアクセスのリード且つバイトアクセスと指示される。ステートコード2で命令リードを行なう。   In the second part (6-2) of FIG. 60, bus control is performed. When nop = 0, the bus access is started, and when nop = 1, the bus access is prohibited. Data = 0 indicates an instruction read, and data = 1 indicates a data access. long = 1 indicates a long word size, and when long = 0, byte = 0 indicates a word size, and byte = 1 indicates a byte size. Write = 0 indicates read, and write = 1 indicates write. In the case of instruction read, the contents of the bus IDB are stored in IR1 and the read data buffer RDB at a predetermined timing. In the case of data read, the contents of the bus IDB are stored in the read data buffer RDB at a predetermined timing. In the case of data write, the contents of the write data buffer WDB are output to the bus IDB at a predetermined timing. In the case of this instruction, data access is performed with state code 1, and data access read and byte access are instructed. Instruction read is performed with state code 2.

図61の(6−3)の部分で実効アドレスを計算する。本転送命令の場合、ステートコード1で、dbragb=1として、DBRAに保持している命令コードのEA拡張部8ビットを、32ビットに1拡張(上位24ビットをすべて1とする)した上、内部バスGBに出力する。GBの内容はアドレスバッファABに毎ステート格納されるようにされており、特に制御は必要ない。   The effective address is calculated at (6-3) in FIG. In the case of this transfer instruction, with the state code 1 and dbragb = 1, the EA extension part 8 bits of the instruction code held in the DBRA is expanded by 1 to 32 bits (all the upper 24 bits are set to 1). Output to the internal bus GB. The contents of GB are stored in the address buffer AB every state, and no control is required.

図61の(6−4)の部分で、転送データを制御する。ステートコード2で、dbrdb=1とし、リードデータをDBRからDBへ出力すると共に、算術論理演算器ALUを経由して、wbtrd=1とし、テンポラリデータレジスタTRDへ格納する。   The transfer data is controlled at (6-4) in FIG. In state code 2, dbrdb = 1 is set, read data is output from DBR to DB, and wbtrd = 1 is set via the arithmetic logic unit ALU and stored in the temporary data register TRD.

図62の(6−5)の部分で、割込みマスク信号を制御する。また、制御信号MODSを発生する。   The interrupt mask signal is controlled at (6-5) in FIG. Further, the control signal MODS is generated.

図63乃至図65には条件分岐命令の一部に対する命令デコーダDECの論理構成が論理記述によって示される。本論理記述は、8ビットディスプレースメントの条件分岐命令(Bcc d:8)に相当する。   63 to 65 show a logical configuration of the instruction decoder DEC for a part of the conditional branch instruction by a logical description. This logical description corresponds to an 8-bit displacement conditional branch instruction (Bcc d: 8).

図63の(7−1)の部分ではステートコードTMGが生成される。ステートコードTMGは1→2と進行する。図63の(7−2)の部分でバス制御を行なう。本命令の場合、ステートコード1、2で命令リードを行い、ステートコード1では、算術演算器AUで計算した分岐アドレスに基づいて分岐アドレスの命令リードを行なう。後述するように、リード完了以前に、分岐するかしないかの判定を行なって、分岐しない場合は、リードした命令は取り込まない。ステートコード2では、前記判定結果に従って、分岐アドレスの次のアドレスまたは、当該分岐命令の次の次のアドレスの命令リードを行なう。   In the part (7-1) of FIG. 63, the state code TMG is generated. The state code TMG proceeds from 1 to 2. Bus control is performed at (7-2) in FIG. In the case of this instruction, instruction reading is performed using state codes 1 and 2, and in state code 1, instruction reading of a branch address is performed based on the branch address calculated by the arithmetic unit AU. As will be described later, it is determined whether or not to branch before the completion of reading. If the branch is not branched, the read instruction is not fetched. In state code 2, according to the determination result, instruction read of the next address of the branch address or the next address of the branch instruction is performed.

図64の(7−3)の部分で実効アドレスを計算する。ステートコード1で、augb=1とし、算術演算器AUの結果(分岐アドレスの実効アドレス)を、内部バスGBに出力する。また、bcc1=1とし、分岐判定を指示する。実際の判定は、MODS=0のときコンディションコードレジスタCCRの、MODS=1のときテンポラリデータレジスタTRDの内容に従って行われる。なお、bcc1とbcc2は、コンディションフィールド(cc/bc)として使用される命令コードのビット位置が相違される。bcc1の場合はビット11〜8が、bcc2の場合はビット7〜4が使用される。   The effective address is calculated at (7-3) in FIG. In state code 1, augb = 1 is set, and the result of the arithmetic operator AU (the effective address of the branch address) is output to the internal bus GB. Also, bcc1 = 1 is set and branch determination is instructed. The actual determination is made according to the contents of the condition code register CCR when MODS = 0 and according to the contents of the temporary data register TRD when MODS = 1. Note that bcc1 and bcc2 are different in the bit position of the instruction code used as the condition field (cc / bc). In the case of bcc1, bits 11 to 8 are used, and in the case of bcc2, bits 7 to 4 are used.

図64の(7−4)の部分で、転送データを制御するが、本命令では動作を行なわない。図64の(7−5)の部分で、制御信号はいずれも初期化する。割込みも許可し、割込みが要求すれば、引き続き割込み例外処理を行なうことができる。   The transfer data is controlled in the portion (7-4) in FIG. 64, but no operation is performed by this command. In the part (7-5) in FIG. 64, all control signals are initialized. Interrupts are also permitted, and if an interrupt is requested, interrupt exception handling can be continued.

図66乃至図68にはサブルーチン分岐命令の一部に対する命令デコーダDECの論理構成が論理記述によって示される。本論理記述は、16ビットディスプレースメントのサブルーチン命令(BSR d:16)に相当する。MAX信号は、マキシマムモードを示す。実際には、スタックポインタ(ER7)のデクリメントや、GBへの出力の制御を行なうが、本発明に直接の関係はないので、図示は省略する。   66 to 68 show the logical configuration of the instruction decoder DEC for a part of the subroutine branch instruction by the logical description. This logical description corresponds to a 16-bit displacement subroutine instruction (BSR d: 16). The MAX signal indicates the maximum mode. Actually, the stack pointer (ER7) is decremented and the output to the GB is controlled. However, the illustration is omitted because it is not directly related to the present invention.

条件成立/不成立に従って、動作が異なる。また、マキシマム/ミニマムモードで、スタックするプログラムカウンタPCのビット長が異なる。   The operation varies depending on whether the condition is met or not. Further, the bit length of the program counter PC to be stacked differs in the maximum / minimum mode.

図66の(8−1)の論理記述部分でステートコードTMGが生成される。ミニマムモードの条件成立時、ステートコードTMGは1→14→2→3と進行する。マキシマムモードの条件成立時、ステートコードTMGは1→14→2→11→3と進行する。不成立の場合は、ステートコードTMGは1→14→3と進行する。   The state code TMG is generated in the logic description part (8-1) in FIG. When the minimum mode condition is satisfied, the state code TMG proceeds in the order of 1 → 14 → 2 → 3. When the conditions for the maximum mode are satisfied, the state code TMG proceeds in the order of 1 → 14 → 2 → 11 → 3. If not established, the state code TMG proceeds from 1 → 14 → 3.

図66の(8−2)の論理記述部分でバス制御を行なう。本命令の場合、ステートコード14、3で命令リードを行い、ステートコード2、11は、スタックへのライトを行なう。ステートコード1ではバスアクセスを行なわない。ステートコード14での命令リードは、分岐条件判定結果に基づいて行なう。   Bus control is performed in the logic description part (8-2) in FIG. In the case of this instruction, instruction reading is performed with the state codes 14 and 3, and the state codes 2 and 11 perform writing to the stack. State code 1 does not perform bus access. The instruction read by the state code 14 is performed based on the branch condition determination result.

図67の(8−3)の論理記述部分で実効アドレスを計算する。bcc2=1とし、分岐判定を指示する。実際の判定は、MODS=1のときテンポラリデータレジスタTRDの内容に従って行われる。また、ステートコード1では、リードデータバッファRDBに保持している命令コードのEA拡張部16ビットを、dbrext信号によって32ビットに符号拡張し、内部バスDBへ出力する。図示はされないものの、プログラムカウンタPCの内容を内部バスGBへ出力して、算術論理演算器ALUで加算を行なう。ステートコード2では、判定結果(BCOUT)に従って、BCOUT=1ならばALUから内部バスGBへの出力を行なう。また、図示はされないものの、BCOUT=0ならPCから内部バスGBへの出力を行なう。   The effective address is calculated in the logical description part (8-3) in FIG. bcc2 = 1 is set and branch determination is instructed. The actual determination is made according to the contents of the temporary data register TRD when MODS = 1. In state code 1, the 16 bits of the EA extension part of the instruction code held in the read data buffer RDB are sign-extended to 32 bits by the dbrext signal and output to the internal bus DB. Although not shown, the contents of the program counter PC are output to the internal bus GB and added by the arithmetic logic unit ALU. In state code 2, according to the determination result (BCOUT), if BCOUT = 1, output from ALU to internal bus GB is performed. Although not shown, if BCOUT = 0, output from the PC to the internal bus GB is performed.

図67の(8−4)の論理記述部分で、転送データを制御するが、本命令では動作を行なわない。図68の(8−5)の論理記述部分で、制御信号はいずれも初期化する。割込みも許可し、割込みが要求すれば、引き続き割込み例外処理を行なうことができる。   The transfer data is controlled by the logical description part (8-4) in FIG. 67, but no operation is performed by this instruction. In the logic description part (8-5) in FIG. 68, all control signals are initialized. Interrupts are also permitted, and if an interrupt is requested, interrupt exception handling can be continued.

図60乃至図68で説明した論理記述を組合せることによって命令デコーダDECは前記ビット条件分岐命令を制御することができる。   The instruction decoder DEC can control the bit conditional branch instruction by combining the logical descriptions described with reference to FIGS.

命令デコーダDECにおける転送命令の一部の論理記述は図23乃至図25の例と同じである。また、命令デコーダDECにおける演算命令の一部の論理記述は図26及び図27と同じである。   The logical description of a part of the transfer instruction in the instruction decoder DEC is the same as the example in FIGS. The logical description of a part of the operation instruction in the instruction decoder DEC is the same as that in FIGS.

図69及び図70には他の演算命令に対する命令デコーダDECの論理構成の論理記述が例示される。本論理記述は、ビットテスト命令(BTST #n,Rn)に相当する。前記同様に、独立したビットテスト命令として実行するか、メモリ上のデータに対する処理命令の一部として実行するかは、MODS信号によって指示される。特に図示していない部分(算術論理演算器ALUの制御など)については、独立したビットテスト命令と同様にできる。   69 and 70 illustrate logical descriptions of the logical configuration of the instruction decoder DEC for other operation instructions. This logical description corresponds to a bit test instruction (BTST #n, Rn). Similarly to the above, whether to execute as an independent bit test instruction or as part of a processing instruction for data on the memory is instructed by the MODS signal. In particular, a portion not shown (such as control of the arithmetic logic unit ALU) can be performed in the same manner as an independent bit test instruction.

図69における(9−1)の論理記述部分でステートコードTMGが生成される。ステートコードTMGは1で終了する。同図における(9−2)の論理記述部分ではバス制御を行なう。ステートコード1で命令リードを終了する。   The state code TMG is generated at the logical description portion (9-1) in FIG. The state code TMG ends with 1. In the logical description portion (9-2) in FIG. The instruction read ends with state code 1.

図70における(9−3)の論理記述部分では演算データを制御する。MODS=0の場合には、データを汎用レジスタとし、汎用レジスタの内容をDBに読み出す(rsdb)。MODS=1の場合には、データをメモリとし、テンポラリレジスタTRDの内容をDBに読み出す(trddb)。同図における(9−4)の論理記述部分で制御信号が何れも初期化される。割込みも許可し、割込みが要求すれば、引き続き割込み例外処理を行なうことができる。   In the logic description part (9-3) in FIG. 70, the operation data is controlled. When MODS = 0, the data is used as a general-purpose register, and the contents of the general-purpose register are read out to the DB (rsdb). When MODS = 1, the data is used as a memory, and the contents of the temporary register TRD are read out to the DB (trdb). All the control signals are initialized in the logic description portion (9-4) in FIG. Interrupts are also permitted, and if an interrupt is requested, interrupt exception handling can be continued.

図71及び図72には更に他の演算命令に対する命令デコーダDECの論理構成を論理記述で例示する。本論理記述は、ビットセット命令(BSET #n,Rn)に相当する。前記同様に、独立したビットセット命令として実行するか、メモリ上のデータに対する処理命令の一部として実行するかは、MODD信号によって指示される。特に図示していない部分(算術論理演算器ALUの制御など)については、独立したビットセット命令と同様にできる。   71 and 72 exemplify the logical configuration of the instruction decoder DEC with respect to other arithmetic instructions in a logical description. This logical description corresponds to a bit set instruction (BSET #n, Rn). Similarly to the above, whether to execute as an independent bit set instruction or as a part of a processing instruction for data on the memory is instructed by the MODD signal. Parts not particularly shown (such as control of the arithmetic logic unit ALU) can be performed in the same manner as independent bit set instructions.

図71における(10−1)の論理記述部分でステートコードTMGが生成される。ステートコードTMGは1で終了する。同図における(10−2)の論理記述部分でバス制御を行なう。 ステートコード1で命令リードを終了する。   The state code TMG is generated at the logic description portion (10-1) in FIG. The state code TMG ends with 1. Bus control is performed in the logical description portion (10-2) in FIG. The instruction read ends with state code 1.

図72における(10−3)の論理記述部分で、演算データを制御する。MODD=0の場合には、データを汎用レジスタとし、汎用レジスタの内容をGBに読み出す(rdgb)とともに、演算結果を汎用レジスタに書込む(wbrd)。MODD=1の場合には、データをメモリとし、リードデータバッファの内容をバスDBに読み出す(DBRdb)とともに、演算結果をテンポラリデータレジスタTRDに書込む(wbtrd)。   The operation data is controlled by the logic description portion (10-3) in FIG. When MODED = 0, the data is used as a general-purpose register, the contents of the general-purpose register are read to GB (rdgb), and the operation result is written to the general-purpose register (wbrd). When MODED = 1, the data is used as a memory, the contents of the read data buffer are read to the bus DB (DBRdb), and the operation result is written to the temporary data register TRD (wbtrd).

図72における(10−4)の論理記述部分では、割込みマスク信号を制御する。また、デスティネーション側がメモリの場合には、制御信号MKMOVを発生して、ライト型転送命令と同等の動作を行なう命令コードの発生を、命令変更部CHGに指示する。また、ロングワードサイズ信号LNG、バイトサイズ信号BYTEを継続する。   In the logic description portion (10-4) in FIG. 72, the interrupt mask signal is controlled. When the destination side is a memory, the control signal MKMOV is generated to instruct the instruction change unit CHG to generate an instruction code that performs the same operation as the write type transfer instruction. Further, the long word size signal LNG and the byte size signal BYTE are continued.

次に上記ビット条件分岐命令などの複合命令の実行タイミングの例を説明する。特に制限はされないものの、内部データバスは16ビットであって、内蔵ROM、RAMリード/ライトを1ステートでリード/ライト可能とする。内蔵ROM、RAMは、バスIABをアドレスバスとし、バスIDBをデータバスとする。後述のPAB、PDBは接続されていないが、同様のタイミングを内部で生成していると理解されたい。   Next, an example of the execution timing of a compound instruction such as the bit conditional branch instruction will be described. Although not particularly limited, the internal data bus is 16 bits, and the built-in ROM and RAM can be read / written in one state. The built-in ROM and RAM use the bus IAB as an address bus and the bus IDB as a data bus. Although PAB and PDB described later are not connected, it should be understood that the same timing is generated internally.

図73にはビット条件分岐命令の第1の例(BBS #0,@FFFFFE,$+20)の実行タイミングが例示される。サイクルT0のスロットC2で、CPU2Aのアドレスバッファ(AB)からアドレスがバスIABに出力される。   FIG. 73 illustrates the execution timing of the first example (BBS # 0, @FFFFFE, $ + 20) of the bit conditional branch instruction. In slot C2 of cycle T0, the address is output from the address buffer (AB) of CPU 2A to bus IAB.

サイクルT1のスロットC1で、バスIABの内容がバスPABに出力され、リードサイクルが開始される。スロットC2でリードデータが内部データバスに得られ、これをサイクルT2のスロットC1でレジスタIR1にラッチされる。これは、ビットテスト命令の第1のワードと共通のワードであり(bld)、指定したアドレスのデータをテンポラリレジスタへ格納する。   In slot C1 of cycle T1, the contents of bus IAB are output to bus PAB, and a read cycle is started. In slot C2, read data is obtained on the internal data bus, and this is latched in register IR1 in slot C1 of cycle T2. This is a word common to the first word of the bit test instruction (bld), and stores the data at the designated address in the temporary register.

引き続き、サイクルT2のスロットC2で次のアドレス(+2された内容)がバスIABに出力され、このリードデータがサイクルT3のスロットC1でレジスタIR1にラッチされる(条件分岐命令の命令コード(bcc))。以上の動作は以前の命令の実行の制御によって行われ、相対的な関係が異なる場合もある。   Subsequently, in slot C2 of cycle T2, the next address (+2 contents) is output to the bus IAB, and this read data is latched in register IR1 in slot C1 of cycle T3 (instruction code (bcc) of conditional branch instruction) ). The above operation is performed by controlling the execution of the previous instruction, and the relative relationship may be different.

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、サイクルT2のスロットC1で命令コード(bld)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、図60乃至図62に基づいて説明した通り、制御信号を出力して、各部の制御を行う。即ち、8ビット絶対アドレスのアドレッシングモードであるので、この絶対アドレスに基づき、ソースデータのリードを行い、リード結果をテンポラリレジスタTRDに格納する。また、制御信号MODS=1とする。   When the execution of the immediately preceding instruction is completed, when the execution of the instruction is started earliest, the instruction code (bld) is input to the instruction decoder DEC in the slot C1 of the cycle T2, and the content of the instruction is decoded. According to the decoding result, as described with reference to FIGS. 60 to 62, 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 the temporary register TRD. The control signal MODS = 1.

サイクルT2のスロットC2で、リードデータバッファRDBの内容(絶対アドレス)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C2 of cycle T2, the contents (absolute address) of the read data buffer RDB are read to the internal bus GB and input to the address buffer AB. An address is output from address buffer AB to address bus IAB.

サイクルT3から、データがリードされる。また、サイクルT3のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。算術演算器AUは、このバスGBの内容を入力して、サイクルT4のスロットC1から分岐アドレスの計算を行なう。   Data is read from cycle T3. In slot C2 of cycle T3, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. The arithmetic operator AU receives the contents of the bus GB and calculates a branch address from the slot C1 in the cycle T4.

サイクルT4のスロットC1で前記リードデータが、リードデータバッファRDBに格納される。更に、リードデータバッファRDBから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。   The read data is stored in the read data buffer RDB in the slot C1 of the cycle T4. Further, the data is output from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated.

サイクルT4のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、テンポラリデータレジスタTRDに格納される。   In slot C2 of cycle T4, the read data is output from the arithmetic logic unit ALU to the internal bus WB and stored in the temporary data register TRD.

サイクルT4のスロットC1で、命令コード(条件分岐命令(bcc))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、図63乃至図65に基づいて説明した通り、制御信号を出力して、各部の制御を行う。MODS信号が1にセットされているので、コンディションコードレジスタCCRではなく、テンポラリデータレジスタTRDの所定のビットのテストを行なう。   In slot C1 of cycle T4, an instruction code (conditional branch instruction (bcc)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the decoding result, as described with reference to FIGS. 63 to 65, a control signal is output to control each unit. Since the MODS signal is set to 1, a test is performed on a predetermined bit of the temporary data register TRD, not the condition code register CCR.

サイクルT4のスロットC2で、前記の通り、算術演算器AUで計算した分岐アドレスの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C2 of cycle T4, as described above, the contents of the branch address calculated by the arithmetic operator AU are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB.

サイクルT5のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してテンポラリレジスタTRAにライトされる。分岐条件のテストが指示される。   In slot C1 of cycle T5, the result incremented (+2) by the incrementer INC is written to the temporary register TRA via the internal bus WB. A branch condition test is directed.

サイクルT5のスロットC2で、分岐条件が成立している場合にはテンポラリアドレスレジスタTRAの内容を、不成立の場合にはプログラムカウンタPCの内容を、内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。これによって、次の次の命令コードのアドレスを切り替える。   In slot C2 of cycle T5, the contents of temporary address register TRA are read to internal bus GB when the branch condition is satisfied, and the contents of program counter PC when the branch condition is not satisfied, and address buffer AB and incrementer are read. Input to INC. An address is output from address buffer AB to address bus IAB. As a result, the address of the next instruction code is switched.

一方、サイクルT6のスロットC1で、分岐条件が成立している場合には、バスIDBの内容をレジスタIR1にラッチする(分岐先の命令コード)。不成立の場合には、レジスタIR1の内容が保持され、ビット条件分岐命令の次の命令コードが保存される。これによって、次の命令コードを切り替える。   On the other hand, if the branch condition is satisfied in slot C1 of cycle T6, the contents of bus IDB are latched in register IR1 (branch destination instruction code). If not, the contents of the register IR1 are retained and the instruction code next to the bit conditional branch instruction is saved. As a result, the next instruction code is switched.

なお、第1ワードと第2ワード以降が分割されないための連続命令信号(mskint)を出力する。本信号によって、割込み要求などが発生していても、命令の実行を継続することができる。   Note that a continuous instruction signal (mskint) is output so that the first word and the second word and thereafter are not divided. Even if an interrupt request or the like is generated, the execution of the instruction can be continued by this signal.

図74にはビット条件サブルーチン分岐命令の例(BBSR #5,@FFFE00,$+300)の実行タイミングが示される。   FIG. 74 shows the execution timing of an example of a bit condition subroutine branch instruction (BBSR # 5, @ FFFE00, $ + 300).

サイクルT2のスロットC1で命令コード(bld−1)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。即ち、16ビット絶対アドレスのアドレッシングモードであるので、引き続き、EA拡張部である絶対アドレスをリードした後、この絶対アドレスに基づき、ソースデータのリードを行い、リード結果をテンポラリデータレジスタTRDに格納する。また、制御信号MODS=1とする。   In slot C1 of cycle T2, the instruction code (bld-1) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. That is, since the addressing mode is a 16-bit absolute address, after reading the absolute address as the EA extension unit, the source data is read based on the absolute address, and the read result is stored in the temporary data register TRD. . The control signal MODS = 1.

サイクルT1のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT2から、リードサイクルが開始され、このリードデータがサイクルT3のスロットC1でリードデータバッファRDBにラッチされる(EA拡張部である絶対アドレス(bld−2))。   In slot C2 of cycle T1, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. A read cycle is started from the cycle T2, and this read data is latched in the read data buffer RDB in the slot C1 of the cycle T3 (absolute address (bld-2) which is an EA extension unit).

サイクルT2のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT3から、リードサイクルが開始され、このリードデータがサイクルT4のスロットC1でリードデータバッファRDBにラッチされる(サブルーチン分岐命令(bsr−1))。   In slot C2 of cycle T2, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. From cycle T3, a read cycle is started, and this read data is latched in the read data buffer RDB in slot C1 of cycle T4 (subroutine branch instruction (bsr-1)).

サイクルT3のスロットC2で、リードデータバッファRDBの内容(絶対アドレス)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT4から、データがリードされ、サイクルT6のスロットC1で前記リードデータが、リードデータバッファRDBに格納される。更に、リードデータバッファRDBから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。   In slot C2 of cycle T3, the contents (absolute address) of the read data buffer RDB are read to the internal bus GB and input to the address buffer AB. An address is output from address buffer AB to address bus IAB. Data is read from the cycle T4, and the read data is stored in the read data buffer RDB in the slot C1 of the cycle T6. Further, the data is output from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated.

サイクルT6のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、テンポラリデータレジスタTRDに格納される。   In slot C2 of cycle T6, the read data is output from the arithmetic logic unit ALU to the internal bus WB and stored in the temporary data register TRD.

サイクルT5のスロットC1で、命令コード(サブルーチン分岐命令(bsr−1))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、図66乃至図68に8基づいて説明した通り、制御信号を出力して、各部の制御を行う。MODS信号が1にセットされているので、テンポラリレジスタTRDの所定のビットのテストを行なう。   In slot C1 of cycle T5, the instruction code (subroutine branch instruction (bsr-1)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the decoding result, as described based on FIG. 66 to FIG. 68 based on 8, a control signal is output to control each part. Since the MODS signal is set to 1, a predetermined bit of the temporary register TRD is tested.

サイクルT5で分岐条件のテストが指示される。サイクルT6のステートC1でプログラムカウンタPCの内容を内部バスGBに、リードデータバッファRDBの内容(ディスプレースメント)を内部バスDBに、それぞれ読み出して、算術論理演算器ALUで加算を行なう。サイクルT6のスロットC2で、分岐条件が成立している場合には算術論理演算器ALUの内容を、不成立の場合にはプログラムカウンタPCの内容を、内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。これによって、次の命令コードのアドレスを切り替える。サイクルT7のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。   In cycle T5, a branch condition test is instructed. In state C1 of cycle T6, the contents of the program counter PC are read to the internal bus GB and the contents (displacement) of the read data buffer RDB are read to the internal bus DB, respectively, and the addition is performed by the arithmetic logic unit ALU. In slot C2 of cycle T6, when the branch condition is satisfied, the contents of the arithmetic logic unit ALU are read to the internal bus GB when the branch condition is not satisfied, and the contents of the address buffer AB and the increment are read out. Input to the INC. An address is output from address buffer AB to address bus IAB. As a result, the address of the next instruction code is switched. In slot C1 of cycle T7, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

サイクルT7のスロットC1でスタックポインタSP(ER7)の内容を内部バスGBに読み出して、算術論理演算器ALUでデクリメント(マキシマムモードのときは4、ミニマムモードのときは2を減算)を行なう。サイクルT7のスロットC2で、算術論理演算器ALUの内容を内部バスGBに読み出して、アドレスバッファABに入力し、アドレスバッファABからアドレスバスIABにアドレスが出力される。ワードサイズライトのバスコマンドを発生する。サイクルT8のスロットC2で、プログラムカウンタPCの内容が内部バスDB、ライトデータバッファWDBを経由して、内部バスIDBに出力される。マキシマムモードの場合は、更に、もう1回のワードサイズライトが行われる。条件不成立の場合には、このスタック動作は行なわない。   The contents of the stack pointer SP (ER7) are read to the internal bus GB at the slot C1 in the cycle T7, and decremented by the arithmetic logic unit ALU (4 is subtracted in the maximum mode and 2 is subtracted in the minimum mode). In slot C2 of cycle T7, the contents of the arithmetic logic unit ALU are read to the internal bus GB and input to the address buffer AB, and the address is output from the address buffer AB to the address bus IAB. Generates a word size write bus command. In slot C2 of cycle T8, the contents of the program counter PC are output to the internal bus IDB via the internal bus DB and the write data buffer WDB. In the maximum mode, another word size write is performed. If the condition is not satisfied, this stack operation is not performed.

サイクルT8のスロットC2で、条件不成立の場合は、サイクルT8のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。次のステートから、リードサイクルが開始される。   If the condition is not satisfied in the slot C2 of the cycle T8, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC in the slot C2 of the cycle T8. An address is output from address buffer AB to address bus IAB. A read cycle starts from the next state.

図75にはビットテスト命令の第1の例(BTST #0,@FFFFFE)の実行タイミングが示される。これは既存の単独の命令の場合である。   FIG. 75 shows the execution timing of the first example (BTST # 0, @FFFFFE) of the bit test instruction. This is the case of an existing single instruction.

サイクルT2のスロットC1で命令コード(bld)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、図60乃至図62に基づいて説明した通り、制御信号を出力して、各部の制御を行う。即ち、8ビット絶対アドレスのアドレッシングモードであるので、この絶対アドレスに基づき、ソースデータのリードを行い、リード結果をテンポラリデータレジスタTRDに格納する。また、制御信号MODS=1とする。   The instruction code (bld) is input to the instruction decoder DEC in the slot C1 of the cycle T2, and the contents of the instruction are decoded. According to the decoding result, as described with reference to FIGS. 60 to 62, 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 the temporary data register TRD. The control signal MODS = 1.

サイクルT2のスロットC2で、リードデータバッファRDBの内容(絶対アドレス)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C2 of cycle T2, the contents (absolute address) of the read data buffer RDB are read to the internal bus GB and input to the address buffer AB. An address is output from address buffer AB to address bus IAB.

サイクルT3から、データがリードされる。また、サイクルT3のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。算術演算器AUは、このバスGBの内容を入力して、サイクルT4のスロットC1から分岐アドレスの計算を行なう。   Data is read from cycle T3. In slot C2 of cycle T3, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. The arithmetic operator AU receives the contents of the bus GB and calculates a branch address from the slot C1 in the cycle T4.

サイクルT4のスロットC1で前記リードデータが、リードデータバッファDBRに格納される。更に、リードデータバッファDBRから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。   The read data is stored in the read data buffer DBR in slot C1 of cycle T4. Further, the data is output from the read data buffer DBR to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated.

サイクルT4のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、テンポラリデータレジスタTRDに格納される。   In slot C2 of cycle T4, the read data is output from the arithmetic logic unit ALU to the internal bus WB and stored in the temporary data register TRD.

サイクルT4のスロットC1で、命令コード(ビットテスト命令(btst))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。MODS信号が1にセットされているので、データを汎用レジスタではなく、テンポラリデータレジスタTRDから読み出す。   In slot C1 of cycle T4, an instruction code (bit test instruction (btst)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since the MODS signal is set to 1, data is read from the temporary data register TRD instead of the general-purpose register.

サイクルT4のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスIABが出力される。サイクルT5のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。   In slot C2 of cycle T4, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. The address IAB is output from the address buffer AB. In slot C1 of cycle T5, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

サイクルT5のスロットC1で、データが、MODS信号に従って、テンポラリレジスタTRDから内部バスGBに出力され、算術論理演算器ALUに入力される。指定されたビットの選択を行なう。   In slot C1 of cycle T5, data is output from the temporary register TRD to the internal bus GB according to the MODS signal and input to the arithmetic logic unit ALU. Select the specified bit.

サイクルT7のスロットC2で、ビットテスト結果が、コンディションコードレジスタCCRのZフラグに格納される。選択されたビットが0のときZ=1、1のときZ=0とされる。   In slot C2 of cycle T7, the bit test result is stored in the Z flag of the condition code register CCR. When the selected bit is 0, Z = 1, and when it is 1, Z = 0.

図76にはビットテスト命令の第2の例(BTST #1,@ER0+)の実行タイミングが示される。これは、アドレッシングモードを拡張した例である。前置命令コード、MOV.B @ER0+,R0に相当する命令コード、BTST #1,R0Hに相当する命令コードを組合せて実行される。前置命令コードは、図15に従い、H’0108とされ、MODS信号によって、ソース側がメモリであることを指示する。   FIG. 76 shows the execution timing of the second example (BTST # 1, @ ER0 +) of the bit test instruction. This is an example in which the addressing mode is extended. Prefix instruction code, MOV. The instruction code corresponding to B @ ER0 +, R0 and the instruction code corresponding to BTST # 1, R0H are executed in combination. The prefix instruction code is H'0108 according to FIG. 15, and the MODS signal indicates that the source side is a memory.

転送命令コードは、既存の転送命令と同様に、メモリのリードを行なうが、前置命令コードによるソース側をメモリとする指示に基づき、リードデータをテンポラリデータレジスタTRDに格納する。ソース側をメモリとする指示を継続する。演算命令コードは、ソース側をメモリとする指示に従い、ソース側データを汎用レジスタではなく、テンポラリデータレジスタTRDから読み出す。そのほかの動作は、既存の演算命令と同様になる。   The transfer instruction code reads the memory as in the case of the existing transfer instruction, but stores the read data in the temporary data register TRD based on the instruction to set the source side as the memory by the prefix instruction code. Continue the instruction to use the source side as memory. The operation instruction code reads the source-side data from the temporary data register TRD instead of the general-purpose register in accordance with an instruction to set the source side as a memory. Other operations are the same as those of the existing operation instruction.

サイクルT2のスロットC1で命令コード(前置命令コードpf)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。かかる前置命令コードの場合には、ソース側データがメモリ上に存在することを指示する。即ち、制御信号controlCとしてMODS信号を1にセットし、命令デコーダDECにフィードバックする。   In slot C1 of cycle T2, the instruction code (prefix instruction code pf) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. In the case of such a prefix instruction code, it indicates that the source side data exists on the memory. That is, the MODS signal is set to 1 as the control signal controlC and fed back to the instruction decoder DEC.

サイクルT2のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。次の命令のリードを行なう。   In slot C2 of cycle T2, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. Read the next instruction.

サイクルT3のスロットC1で命令コード(MOV命令(mov))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。ポストインクリメントレジスタ間接のアドレッシングモードであるので、アドレスレジスタER0に基づき、ソースデータのリードを行い、リード結果をテンポラリデータレジスタTRDに格納する。   An instruction code (MOV instruction (mov)) is input to the instruction decoder DEC in the slot C1 of the cycle T3, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since this is the post-increment register indirect addressing mode, the source data is read based on the address register ER0, and the read result is stored in the temporary data register TRD.

サイクルT3のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。サイクルT3のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C1 of cycle T3, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. In slot C2 of cycle T3, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB.

サイクルT3から、リードサイクルが開始され、このリードデータがサイクルT4のスロットC1でリードデータバッファRDBにラッチされる(ビットテスト命令(btst))。また、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。   From cycle T3, a read cycle is started, and this read data is latched in read data buffer RDB in slot C1 of cycle T4 (bit test instruction (btst)). The result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

サイクルT4のスロットC2で、アドレスレジスタER0の内容(EA)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT5のスロットC1で、再度、アドレスレジスタER0の内容(EA)を内部バスGBに読み出して、算術論理演算器ALUに入力し、インクリメント処理を行なう。この結果は、サイクルT5のスロットC2でアドレスレジスタER0に格納される。   In slot C2 of cycle T4, the contents (EA) of the address register ER0 are read to the internal bus GB and input to the address buffer AB. An address is output from address buffer AB to address bus IAB. In the slot C1 of the cycle T5, the contents (EA) of the address register ER0 are read again to the internal bus GB and input to the arithmetic logic unit ALU to perform increment processing. This result is stored in the address register ER0 in slot C2 of cycle T5.

サイクルT5から、データがリードされる。サイクルT6のスロットC1で前記リードデータが、リードデータバッファRDBに格納される。更に、リードデータバッファRDBから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。サイクルT6のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、MODS信号が1にセットされているので、汎用レジスタではなく、テンポラリデータレジスタTRDに格納される。   Data is read from cycle T5. The read data is stored in the read data buffer RDB in the slot C1 of the cycle T6. Further, the data is output from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated. In slot C2 of cycle T6, the read data is output from the arithmetic logic unit ALU to the internal bus WB, and the MODS signal is set to 1. Therefore, the read data is stored not in the general-purpose register but in the temporary data register TRD.

また、サイクルT5のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。次の命令のリードを行なう。   In slot C2 of cycle T5, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. Read the next instruction.

サイクルT6のスロットC1で、命令コード(BTST命令(btst))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。MODS信号が1にセットされているので、データを汎用レジスタではなく、テンポラリデータレジスタTRDから読み出す。   In slot C1 of cycle T6, the instruction code (BTST instruction (btst)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since the MODS signal is set to 1, data is read from the temporary data register TRD instead of the general-purpose register.

サイクルT6のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT7のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。   In slot C2 of cycle T6, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. In slot C1 of cycle T7, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

また、サイクルT7のスロットC1で、データが、MODS信号に従って、テンポラリデータレジスタTRDから内部バスGBに出力され、算術論理演算器ALUに入力される。指定されたビットの選択が行なわれる。   In slot C1 of cycle T7, data is output from the temporary data register TRD to the internal bus GB according to the MODS signal and input to the arithmetic and logic unit ALU. The specified bit is selected.

サイクルT7のスロットC2で、ビットテスト結果が、コンディションコードレジスタCCRのZフラグに格納される。選択されたビットが0のときZ=1、1のときZ=0とされる。   In slot C2 of cycle T7, the bit test result is stored in the Z flag of the condition code register CCR. When the selected bit is 0, Z = 1, and when it is 1, Z = 0.

図77にはビットセット命令の例(BSET #2,@ER0+)の実行タイミングが示される。これは、アドレッシングモードを拡張した例である。前置命令コード、MOV.B @ER0+,R0に相当する命令コード、BSET#2,R0Hに相当する命令コードを組合せて実行される。前置命令コードは、図15に従い、H’0104とされ、MODD信号によって、デスティネーション側がメモリであることを指示する。   FIG. 77 shows the execution timing of an example of a bit set instruction (BSET # 2, @ ER0 +). This is an example in which the addressing mode is extended. Prefix instruction code, MOV. The instruction code corresponding to B @ ER0 +, R0 and the instruction code corresponding to BSET # 2, R0H are executed in combination. The prefix instruction code is H'0104 according to FIG. 15, and the MODD signal indicates that the destination side is a memory.

転送命令コードは、既存の転送命令と同様に、サイクルT4のスロットC2から、メモリのリードを行ない、前置命令コードによるデスティネーション側をメモリとする指示(MODD)に基づき、生成した実効アドレス(メモリアドレス)をテンポラリアドレスレジスタTRAに格納する。また、サイクルT6のスロットC1で、リードデータをリードデータバッファDBRに格納した時点で、既存の転送命令またはソース側のデータのリードの場合より1ステート早く実行を終了する。このため、命令フェッチとプログラムカウンタPCのインクリメントは行なわない。デスティネーション側をメモリとする指示を継続する。ビットセット命令コード(bset)を、サイクルT5のスロットC1から命令デコーダDECに入力する。   Similar to the existing transfer instruction, the transfer instruction code reads the memory from the slot C2 in cycle T4, and generates an effective address (MODD) based on the instruction (MODD) for setting the destination side as the memory by the prefix instruction code. Memory address) is stored in the temporary address register TRA. Further, at the time when the read data is stored in the read data buffer DBR in the slot C1 of the cycle T6, the execution is completed one state earlier than the case of reading the existing transfer instruction or the data on the source side. For this reason, instruction fetch and program counter PC are not incremented. The instruction to set the destination side as a memory is continued. The bit set instruction code (bset) is input to the instruction decoder DEC from the slot C1 in cycle T5.

演算命令コードは、デスティネーション側をメモリとする指示(MODD)に従い、サイクルT6のスロットC1で、デスティネーション側データを、汎用レジスタではなく、リードデータバッファDBRから、バスGBに読み出し、算術論理演算器ALUに入力する。サイクルT6のスロットC2で、ビットセット結果をテンポラリデータレジスタTRDに格納する。さらに、MOV.W R0,@ER0に類似する命令コード(mov−st)を発生し、サイクルT6のC1から命令デコーダDECに入力する。   The operation instruction code reads the destination side data from the read data buffer DBR to the bus GB instead of the general-purpose register in slot C1 of cycle T6 in accordance with the instruction (MODD) for setting the destination side as a memory, and performs arithmetic logic operation. Input to the ALU. In slot C2 of cycle T6, the bit set result is stored in temporary data register TRD. Furthermore, MOV. An instruction code (mov-st) similar to WR0, @ ER0 is generated and input to the instruction decoder DEC from C1 in cycle T6.

発生された命令コード(mov−st)は、 テンポラリアドレスレジスタTRAをアドレスレジスタとし、テンポラリデータレジスタTRDをデータレジスタとする転送命令同様の動作を行う。即ち、サイクルT6のスロットC2で、テンポラリレジスタTRAに格納されている実効アドレスをバスGBに読み出し、アドレスバッファABを経由してバス7IABに出力するとともに、バイトデータライトのバスコマンドを発行する。サイクルT7のスロットC2で、テンポラリデータレジスタTRDに格納されている演算結果をバスDBに読み出し、ライトデータバッファを経由して、バスIDBに出力して、デスティネーションのメモリアドレスに演算結果を書込む。サイクルT7のスロットC2から命令フェッチを行なうとともに、プログラムカウンタPCのインクリメントを行なう。これによって、転送命令コード(mov−1)の実行を短縮し、命令フェッチとプログラムカウンタPCインクリメントを行なわなかった分を回復する。   The generated instruction code (mov-st) performs the same operation as the transfer instruction using the temporary address register TRA as the address register and the temporary data register TRD as the data register. That is, in slot C2 of cycle T6, the effective address stored in the temporary register TRA is read to the bus GB, output to the bus 7IAB via the address buffer AB, and a bus command for byte data write is issued. In slot C2 of cycle T7, the operation result stored in the temporary data register TRD is read to the bus DB, output to the bus IDB via the write data buffer, and the operation result is written to the memory address of the destination. . An instruction is fetched from the slot C2 in cycle T7 and the program counter PC is incremented. As a result, the execution of the transfer instruction code (mov-1) is shortened, and the amount of instruction fetch and program counter PC increment is not recovered.

デスティネーション側メモリにライトする場合、命令コード(mov−st)をCPU2A内部で発生することにより、命令コードを短縮し、処理時間を短縮することができる。テンポラリレジスタTRAの内容を参照することによって、再度実効アドレスの計算を行なう必要がなく、更に、処理時間を短縮することができる。 MOV.W R0,@ER0に類似する命令コードを使用することにより、設計を容易にし、論理的な規模の増加を抑止することができる。   When writing to the destination memory, the instruction code (mov-st) is generated inside the CPU 2A, whereby 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. MOV. By using an instruction code similar to WR0, @ ER0, design can be facilitated and an increase in logical scale can be suppressed.

図78にはビット条件分岐命令の第2の例(BBC #0,@ER0+,$+20)の実行タイミングが示される。   FIG. 78 shows the execution timing of the second example (BBC # 0, @ ER0 +, $ + 20) of the bit conditional branch instruction.

前置命令コード、MOV.B @ER0+,R0に相当する命令コード、BRA $+20に相当する命令コードを組合せて実行される。前置命令コードは、図15に従い、H’0108とされ、MODS信号によって、ソース側がメモリであることを指示する。転送命令コードは、既存の転送命令と同様に、メモリのリードを行なうが、前置命令コードによるソース側をメモリとする指示に基づき、リードデータをテンポラリデータレジスタTRDに格納する。ソース側をメモリとする指示を継続する。   Prefix instruction code, MOV. The instruction code corresponding to B @ ER0 +, R0 and the instruction code corresponding to BRA $ + 20 are executed in combination. The prefix instruction code is H'0108 according to FIG. 15, and the MODS signal indicates that the source side is a memory. The transfer instruction code reads the memory as in the case of the existing transfer instruction, but stores the read data in the temporary data register TRD based on the instruction to set the source side as the memory by the prefix instruction code. Continue the instruction to use the source side as memory.

サイクルT3のスロットC1で命令コード(条件分岐命令(bcc))が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。ポストインクリメントレジスタ間接のアドレッシングモードであるので、アドレスレジスタER0に基づき、ソースデータのリードを行い、リード結果をテンポラリレジスタTRDに格納する。   In slot C1 of cycle T3, an instruction code (conditional branch instruction (bcc)) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since the post-increment register indirect addressing mode is used, the source data is read based on the address register ER0, and the read result is stored in the temporary register TRD.

サイクルT3のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。サイクルT3のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C1 of cycle T3, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. In slot C2 of cycle T3, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB.

サイクルT3から、リードサイクルが開始され、このリードデータがサイクルT4のスロットC1でリードデータバッファRDBにラッチされる(条件分岐命令(bcc))。また、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。   From cycle T3, a read cycle is started, and this read data is latched in the read data buffer RDB in slot C1 of cycle T4 (conditional branch instruction (bcc)). The result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB.

サイクルT4のスロットC2で、アドレスレジスタER0の内容(EA)を内部バスGBに読み出して、アドレスバッファABに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。サイクルT5のスロットC1で、再度、アドレスレジスタER0の内容(EA)を内部バスGBに読み出して、算術論理演算器ALUに入力し、インクリメント処理を行なう。この結果は、サイクルT5のスロットC2でアドレスレジスタER0に格納される。   In slot C2 of cycle T4, the contents (EA) of the address register ER0 are read to the internal bus GB and input to the address buffer AB. An address is output from address buffer AB to address bus IAB. In the slot C1 of the cycle T5, the contents (EA) of the address register ER0 are read again to the internal bus GB and input to the arithmetic logic unit ALU to perform increment processing. This result is stored in the address register ER0 in slot C2 of cycle T5.

サイクルT5から、データがリードされる。サイクルT6のスロットC1で前記リードデータが、リードデータバッファRDBに格納される。更に、リードデータバッファRDBから内部バスDBに出力され、算術論理演算器ALUに入力する。算術論理演算器ALUの動作は無操作とする。サイクルT6のスロットC2で、リードデータが、算術論理演算器ALUから内部バスWBに出力され、MODS信号が1にセットされているので、汎用レジスタではなく、テンポラリデータレジスタTRDに格納される。   Data is read from cycle T5. The read data is stored in the read data buffer RDB in the slot C1 of the cycle T6. Further, the data is output from the read data buffer RDB to the internal bus DB and input to the arithmetic logic unit ALU. The arithmetic logic unit ALU is not operated. In slot C2 of cycle T6, the read data is output from the arithmetic logic unit ALU to the internal bus WB, and the MODS signal is set to 1. Therefore, the read data is stored not in the general-purpose register but in the temporary data register TRD.

また、サイクルT5のスロットC2で、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。次の命令のリードを行なう。   In slot C2 of cycle T5, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB. Read the next instruction.

サイクルT6のスロットC1で、命令コード(条件分岐命令(bcc))が命令デコーダDECに入力されて、図74と同様に、命令の内容を解読し、制御信号を出力して、各部の制御を行う。MODS信号が1にセットされているので、コンディションコードレジスタCCRではなく、テンポラリデータレジスタTRDの所定のビットのテストを行なう。   In slot C1 of cycle T6, an instruction code (conditional branch instruction (bcc)) is input to the instruction decoder DEC, and the contents of the instruction are decoded and a control signal is output in the same manner as in FIG. 74 to control each part. Do. Since the MODS signal is set to 1, a test is performed on a predetermined bit of the temporary data register TRD, not the condition code register CCR.

サイクルT6のスロットC2で、前記の通り、算術演算器AUで計算した分岐アドレスの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。   In slot C2 of cycle T6, as described above, the contents of the branch address calculated by the arithmetic operator AU are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address is output from address buffer AB to address bus IAB.

サイクルT8のスロットC1で、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してテンポラリアドレスレジスタTRAにライトされる。分岐条件のテストが指示される。   In slot C1 of cycle T8, the result incremented (+2) by the incrementer INC is written to the temporary address register TRA via the internal bus WB. A branch condition test is directed.

サイクルT7のスロットC2で、分岐条件が成立している場合にはテンポラリアドレスレジスタTRAの内容を、不成立の場合にはプログラムカウンタPCの内容を、内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレスが出力される。これによって、次の次の命令コードのアドレスを切り替える。   In slot C2 of cycle T7, the contents of the temporary address register TRA are read to the internal bus GB when the branch condition is satisfied, and the contents of the program counter PC are read to the address bus AB and the incrementer when the branch condition is not satisfied. Input to INC. An address is output from address buffer AB to address bus IAB. As a result, the address of the next instruction code is switched.

一方、サイクルT8のスロットC1で、分岐条件が成立している場合には、バスIDBの内容を命令レジスタIR1にラッチする(分岐先の命令コード)。不成立の場合には、命令レジスタIR1の内容が保持され、ビット条件分岐命令の次の命令コードが保存される。これによって、次の命令コードを切り替える。   On the other hand, if the branch condition is satisfied in slot C1 of cycle T8, the contents of the bus IDB are latched in the instruction register IR1 (branch destination instruction code). If not, the contents of the instruction register IR1 are retained and the instruction code next to the bit conditional branch instruction is saved. As a result, the next instruction code is switched.

転送命令で使用可能なアドレッシングモードを、ビットテスト命令、ビット条件分岐命令、ビット条件サブルーチン分岐命令の、テスト対象のビットの存在するアドレスの指定に用いることができる。   An addressing mode that can be used for a transfer instruction can be used to specify an address where a bit to be tested exists in a bit test instruction, a bit condition branch instruction, and a bit condition subroutine branch instruction.

尚、CPU2Aは加算命令やデータ転送命令等を実行するとき図1のCPU2と同様に図31乃至図41の実行タイミングを実現する。更にCPU2Aの命令デコーダDECは図1のPPU2と同様に図39乃至図41に例示される論理記述の制御論理を実現している。また、CPU2Aの開発環境は図42のように構成できる。このときのシステム開発装置におけるCPU選択手法についても図43で説明した手法をそのまま適用することができる。また、CPU2Aのアセンブラの出力するリストとして図44を例示することができる。更にCPU2Aのエミュレータには図45と同じ構成を採用すればよい。CPU2Aを用いたマイクロコンピュータのエミュレーション用マイクロコンピュータは図47で説明したように構成することができる。   Note that the CPU 2A realizes the execution timings of FIGS. 31 to 41 in the same manner as the CPU 2 of FIG. Further, the instruction decoder DEC of the CPU 2A realizes the control logic of the logic description illustrated in FIGS. 39 to 41 as with the PPU 2 of FIG. Further, the development environment of the CPU 2A can be configured as shown in FIG. The method described in FIG. 43 can be applied as it is to the CPU selection method in the system development apparatus at this time. Further, FIG. 44 can be exemplified as a list output by the assembler of the CPU 2A. Further, the same configuration as that shown in FIG. A microcomputer for emulating a microcomputer using the CPU 2A can be configured as described with reference to FIG.

前記検討課題Dの解決手段に関する発明の具体的な実施の形態によれば、以下の作用効果を得るものである。   According to a specific embodiment of the invention relating to the means for solving the examination subject D, the following operational effects are obtained.

〔1〕第1のワード、第2のワード(条件分岐命令)などの命令コードは既存のものであるから、単独では従来同様に動作し、既存の命令実行を阻害することがない。また、既存の命令のみを使用していれば、既存のソフトウェア資産を有効に利用できる。汎用レジスタやロードストアアーキテクチャなどの既存のCPUのメリットを損なうことがない。第1のワード、第2のワード(条件分岐命令)に、それぞれ、絶対アドレスのビット長、ディスプレースメントのビット長などに複数の種類があれば、同じ方法によって、これらを組合せることができる。換言すれば、既存のデータアクセスのためのアドレッシングモードや、条件分岐命令のアドレッシングモードを全てサポートできるから、任意のアドレッシングモードの組合せを可能にできる。これらの組合せを可能にすることによって、プログラム上の制約をなくし、使い勝手を向上することができる。また、同じ方法によって、サブルーチン分岐命令と組合せることが可能となり、使い勝手を向上することができる。既存の、独立したビットテスト命令と条件分岐命令を組合せるより、命令コード長の短縮や処理速度の向上に、寄与することができる。   [1] Since the instruction codes such as the first word and the second word (conditional branch instruction) are already existing, they operate independently as before and do not hinder the execution of existing instructions. Also, if only existing instructions are used, existing software assets can be used effectively. The advantages of existing CPUs such as general-purpose registers and load / store architecture are not impaired. If the first word and the second word (conditional branch instruction) have a plurality of types in the bit length of the absolute address, the bit length of the displacement, etc., these can be combined by the same method. In other words, all the existing addressing modes for data access and the conditional branch instruction addressing modes can be supported, so that any combination of addressing modes can be made possible. By making these combinations possible, program restrictions can be eliminated and usability can be improved. Moreover, it becomes possible to combine with a subroutine branch instruction by the same method, and usability can be improved. Combining existing independent bit test instructions and conditional branch instructions can contribute to shortening the instruction code length and improving the processing speed.

ビットテスト命令、ビットセット命令などのビット操作命令などのアドレッシングモードにも、転送命令と同等のアドレッシングモードを指定でき、使い勝手を向上することができる。多様なアドレッシングモードを指定可能にすることによって、複数のビットの状態に応じて、複数の処理に分岐したり、また、複数のビットを設定したりするような場合などに、最適なアドレッシングモードを使用でき、全体的なプログラム容量の低減や処理速度の向上に、寄与することができる。   An addressing mode equivalent to that of the transfer instruction can also be specified for an addressing mode such as a bit operation instruction such as a bit test instruction and a bit set instruction, and usability can be improved. By making it possible to specify various addressing modes, the optimum addressing mode can be selected when branching to multiple processes or setting multiple bits according to the state of multiple bits. It can be used and can contribute to the reduction of the overall program capacity and the improvement of the processing speed.

〔2〕既存の、転送命令の命令コード、演算命令の命令コードを組合せて、動作するから、命令デコーダの、従来の設計資産を有効に利用することができ、論理的な規模の追加と変更を最小限にし、論理的・物理的規模の増大を最小限にできる。また、開発に必要な期間を短縮し、資源を節約することができる。命令コードの動作内容を変更するための制御信号であるMOD信号を共通化することができる。即ち、データを転送する命令コードを共通にし、続く、命令コードを演算命令コード或いは分岐命令コードを、組合せればよい。命令セットを最適化し、論理的規模の増加を抑止できる。   [2] Since it operates by combining the instruction code of the existing transfer instruction and the instruction code of the operation instruction, the existing design assets of the instruction decoder can be used effectively, and the logical scale is added or changed To minimize the increase in logical and physical scale. In addition, the time required for development can be shortened and resources can be saved. A MOD signal, which is a control signal for changing the operation content of the instruction code, can be shared. That is, the instruction code for transferring data is made common, and the instruction code that follows is combined with the operation instruction code or the branch instruction code. The instruction set can be optimized to prevent an increase in logical scale.

〔3〕テンポラリレジスタの様なラッチ手段には、指定されたビットの状態を判定する手段を設け、ALUなどに読み出したりすることなく、所定のビットの状態を判定できるようにすることにより、条件分岐命令の全体的な動作を変更することなく、実現できるから、変更する部分を小さくし、また論理的規模の増加を最小限にすることができる。   [3] A latch means such as a temporary register is provided with means for judging the state of a designated bit so that the state of a predetermined bit can be judged without reading it to an ALU or the like. Since it can be realized without changing the overall operation of the branch instruction, the portion to be changed can be reduced and the increase in logical scale can be minimized.

〔4〕追加する命令コードを前置命令コードに止めることによって、命令セットの変更を最小限にすることができ、一般的なCPU乃至は命令セットに対して、適用することができる。前記前置命令コードは、アドレッシングモードや演算の内容によらず共通に使用できるから、追加する命令コードを最低限にすることができる。また、前置命令コードに、そのほかのデータサイズなどの情報を持たせることによって、全体的な命令コード長を短縮できる。前置命令コードに他の情報を含めることによって、命令コード長を短縮し、実行時間を短縮することができる。例えば、既存のCPUにおいて、メモリに対する演算以外の指示を行なう前置命令コードと演算コードとを組合せて実現されている命令が存在する場合、前記メモリに対する演算以外の指示を、前記メモリに対する演算を指示する前置命令コードに含めることによって、命令コード長を短縮し、実行時間を短縮することができる。   [4] By stopping the instruction code to be added to the front instruction code, the change of the instruction set can be minimized, and can be applied to a general CPU or an instruction set. Since the prefix instruction code can be used in common regardless of the addressing mode and the content of the operation, the instruction code to be added can be minimized. Further, by providing the prefix instruction code with other information such as data size, the overall instruction code length can be shortened. By including other information in the prefix instruction code, the instruction code length can be shortened and the execution time can be shortened. For example, in an existing CPU, when there is an instruction implemented by combining a prefix instruction code that performs an instruction other than an operation with respect to a memory and an operation code, an instruction other than the operation with respect to the memory is performed. By including it in the instructed prefix instruction code, the instruction code length can be shortened and the execution time can be shortened.

メモリからラッチ手段へのデータ読み込み、演算、ラッチ手段の内容に基づくメモリへのライトは既存の命令と、使用するレジスタが相違なるのみであるから、既存の命令動作を大きく変更することなく、利用できる。これによって、メモリ上のデータへの演算を可能にすることによる論理規模の増加を最小限にすることができる。   Data read from memory to latch means, operation, and write to memory based on the contents of latch means are different from existing instructions and used registers. it can. As a result, an increase in the logical scale due to the operation on the data on the memory can be minimized.

〔5〕オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUで、前記命令を実現することで、下位互換性をもつ、アドレス空間の小さいCPUでもメモリ上のデータを演算を可能にできる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUでもメモリ上のデータを演算を可能にできる。オブジェクトレベルで互換性を保つことによる利点とメモリ上のデータを演算を可能にすることの利点の双方を享受することができる。   [5] When there is a CPU with a wide address space and a CPU with a small address space while maintaining compatibility at the object level, the CPU can achieve backward compatibility by realizing the instructions with a CPU with a wide address space. Even in a CPU with a small address space, data on the memory can be operated. In other words, in the same method, while maintaining compatibility at the object level, a CPU with a wide address space and a CPU with a small address space can be operated on data in the memory. Both the advantage of maintaining compatibility at the object level and the advantage of enabling computation on data in the memory can be enjoyed.

〔6〕既存の命令を組合せ、新規の命令機能を実現しているので、命令セットの更なる拡張や、更なる高速化に当たって、既存のCPUに対して新たなる課題を生じることが少ない。換言すれば、既存のCPUに対して、更なる命令セットの拡張や、更なる高速化を行なう技術が存在する(発明された)場合には、本発明を適用して、既存のCPUに対して命令セットを拡大したCPUに対しても、同様の技術を適用することができる。新規の命令機能を実現するために用いている、既存の命令のそれぞれに、前記技術を適用して、再度組合せればよい。前置命令コードは動作が単純であり、また、既存の命令に類似した動作とすることによって、変更は容易である。   [6] Since a new instruction function is realized by combining existing instructions, new problems are rarely caused to the existing CPU when the instruction set is further expanded and further speeded up. In other words, if there is a technique for further expanding the instruction set or further speeding up (invented) for an existing CPU, the present invention is applied to the existing CPU. The same technique can be applied to a CPU whose instruction set is expanded. The technique may be applied to each of the existing instructions used for realizing the new instruction function and combined again. The prefix instruction code has a simple operation and can be easily changed by making the operation similar to an existing instruction.

〔7〕また、既存の命令を組合せ、新規の命令機能を実現しているので、既存のCPUとエミュレーション用インタフェースを共通化することができ、ひいては、同じエミュレータのハードウェアを共通できる。エミュレータのハードウェアを共通化することによって、逸早く開発環境を整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   [7] Since the new instruction function is realized by combining the existing instructions, the existing CPU and the emulation interface can be shared, and the hardware of the same emulator can be shared. By making the emulator hardware common, the development environment can be quickly established, and the resources required for emulator development can be minimized.

前記検討課題Dの解決手段に関する発明の実施の形態は一例であり、その要旨を逸しない範囲において種々変更可能である。   The embodiment of the invention relating to the means for solving the examination problem D is merely an example, and various modifications can be made without departing from the scope of the invention.

例えば、組合せる命令コードは、ビットテスト命令や条件分岐命令に限定されない。新規の命令セットを考える場合、既存の命令セットの上位互換とする場合など、適宜、適当な命令コードを組合せるようにしてよい。少なくとも、1つのオペレーションフィールドで、乃至1回の命令デコードで、ビット条件分岐命令を実行するような複雑な動作を行なわず、当該ビットの存在するアドレスのリード、当該ビットのテスト、分岐判定、分岐などの個別の動作を、類似の命令と共通化するようにすればよい。   For example, the instruction code to be combined is not limited to a bit test instruction or a conditional branch instruction. When considering a new instruction set, an appropriate instruction code may be appropriately combined, for example, when an existing instruction set is upwardly compatible. At least in one operation field, or in a single instruction decode, a complicated operation such as executing a bit conditional branch instruction is not performed, and the address where the bit exists is read, the bit is tested, branch determination, and branch Individual operations such as these may be shared with similar instructions.

ビット条件分岐命令のアドレッシングモードも、実施例に限定されない。分岐アドレスの指定は、プログラムカウンタ相対に限定されず、絶対アドレスや、レジスタ間接などとしてもよい。これは、全体的な命令セットに適合するようにすればよい。   The addressing mode of the bit conditional branch instruction is not limited to the embodiment. The designation of the branch address is not limited to relative to the program counter, and may be an absolute address or register indirect. This may be adapted to the overall instruction set.

CPUのアーキテクチャは、ロードストア型アーキテクチャでなくてもよい。汎用レジスタは、アドレス及びデータに共通に利用可能なものである必要はなく、一部または全部がアドレス専用またはデータ専用のものであってもよい。汎用レジスタのデータサイズについても任意とすることができる。   The CPU architecture may not be a load store architecture. The general-purpose registers need not be commonly used for addresses and data, and some or all of them may be dedicated for addresses or data. The data size of the general-purpose register can also be set arbitrarily.

前置命令コードの種類は特に限定はされない。また、前置命令コードは、転送命令と条件分岐命令乃至演算命令を組合せる情報のほか、そのほかの制御情報を含んでもよい。例えば、データサイズを指示する情報を含んでもよい。   The type of prefix instruction code is not particularly limited. The prefix instruction code may include other control information in addition to information combining the transfer instruction and the conditional branch instruction or the operation instruction. For example, information indicating the data size may be included.

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

前置命令コード、第1のリード型転送命令コード、第2のリード型転送命令コード、演算命令コード、ライト型転送命令コードを組合せて、メモリ上の相異なる2つのアドレスのデータを入力して、演算し、結果を、ライト型転送命令コードで指定する別のメモリのアドレスに格納することができる。第1、第2のリード型転送命令コードを省略して、汎用レジスタ上のデータを入力とすることもできる。   Combine the prefix instruction code, first read type transfer instruction code, second read type transfer instruction code, operation instruction code, write type transfer instruction code, and input the data of two different addresses on the memory , And the result can be stored in another memory address specified by the write type transfer instruction code. The first and second read type transfer instruction codes can be omitted and the data on the general-purpose register can be used as input.

《検討課題Eの解決手段に関する実施の形態》
次に、前記検討課題Eの解決手段に関する発明の具体例を説明する。ここで説明するマイクロコンピュータは図2に基づいて説明した構成を有するものであり、繰り返しになるのでその詳細な説明は省略する。従って、マイクロコンピュータ1に内蔵される前記CPU2は図3に示されるような汎用レジスタ及び制御レジスタの構成を有している。当然CPU2は図4のプログラミングモデルを有する下位CPUの汎用レジスタ及び命令セットを包含することになる。そして上位CPUとしてのCPU2は図5のアドレス空間を有している。CPU2の実効アドレスの計算には前述の図7及び図8で説明した手法が採用されている。
<< Embodiment Regarding Solution to Study Problem E >>
Next, a specific example of the invention related to the means for solving the examination problem E will be described. The microcomputer described here has the configuration described with reference to FIG. 2 and will not be described in detail because it is repeated. Therefore, the CPU 2 built in the microcomputer 1 has a general-purpose register and a control register as shown in FIG. Of course, CPU 2 will contain the general purpose registers and instruction set of the lower CPU having the programming model of FIG. The CPU 2 as the upper CPU has the address space shown in FIG. The method described with reference to FIGS. 7 and 8 is employed for calculating the effective address of the CPU 2.

ここで説明するマイクロコンピュータの一例は図79に示される。マイクロコンピュータ501は、命令を実行してマイクロコンピュータ501全体の制御を司る中央処理装置(CPU)502、シングルチップマイクロコンピュータの動作モードなどを制御するシステムコントローラ(SYSC)514、割込コントローラ(INT)503、バスコントローラ510、DMAコントローラ(DMAC)511、外部バスDMAC(EXDMAC)512、CPU502の処理プログラムなどを格納するメモリであるリードオンリメモリ(ROM)504、CPU502の作業領域並びにデータの一時記憶用のメモリであるランダムアクセスメモリ(RAM)505、タイマ506、パルス出力回路507、シリアルコミュニケーションインタフェース(SCI)508、A/D変換器(A/D)509、入出力ポートIOPA〜IOPF、入出力ポートIOP1〜IOP5、及びクロック発振器(CPG)513の機能ブロック若しくは回路モジュールを有し、公知の半導体集積回路製造技術により1つの半導体基板(半導体チップ)に形成されている。   An example of the microcomputer described here is shown in FIG. The microcomputer 501 executes a command to control the entire microcomputer 501, a central processing unit (CPU) 502, a system controller (SYSC) 514 that controls an operation mode of a single chip microcomputer, an interrupt controller (INT) 503, a bus controller 510, a DMA controller (DMAC) 511, an external bus DMAC (EXDMAC) 512, a read only memory (ROM) 504 that is a memory for storing processing programs of the CPU 502, a work area of the CPU 502, and a temporary storage of data Random access memory (RAM) 505, timer 506, pulse output circuit 507, serial communication interface (SCI) 508, A / D converter (A / D) 509, It has functional blocks or circuit modules of output ports IOPA to IOPF, input / output ports IOP1 to IOP5, and clock oscillator (CPG) 513, and is formed on one semiconductor substrate (semiconductor chip) by a known semiconductor integrated circuit manufacturing technique. Yes.

前記CPU502は主にROM504から命令をフェッチし、これを解読して演算動作や制御動作を行う。前記DMAC511はCPU502とバスを共有し、CPU502に代ってデータ転送制御を行う。前記EXDMAC512は、外部バス上のデータ転送制御に特化された転送制御装置であり、CPU502またはDMAC511の内部バス上でのアクセス動作に並行して、外部バス上でのデータ転送制御が可能にされる。   The CPU 502 mainly fetches instructions from the ROM 504 and decodes them to perform arithmetic operations and control operations. The DMAC 511 shares a bus with the CPU 502 and performs data transfer control on behalf of the CPU 502. The EXDMAC 512 is a transfer control device specialized for data transfer control on the external bus, and enables data transfer control on the external bus in parallel with the access operation on the internal bus of the CPU 502 or the DMAC 511. The

バスコントローラ510は、内部バスコントローラ、外部バスコントローラ、及びリフレッシュタイマなどを持つ。内部バスコントローラはCPU502とDMAC511とのバス権調停を行う。外部アドレスは、例えば、8個のエリアに分割され、外部バスコントローラにはエリア毎に、バス幅やアクセスステート数を設定することができ、DRAMやROMなどの高速ページモードといった、連続アクセス時に、短縮されたバスサイクルを実現可能にしている。例えば、外付けのDRAMに対する場合、ノーマル4ステートアクセスに対し、高速ページ2ステートなどとされる。外部バスコントローラは、CPU502、DMAC511、EXDMAC512の夫々からのバス権要求と、外部からバス権要求に対する調停を行う。   The bus controller 510 has an internal bus controller, an external bus controller, a refresh timer, and the like. The internal bus controller performs bus arbitration between the CPU 502 and the DMAC 511. The external address is divided into, for example, eight areas, and the bus width and the number of access states can be set for each area in the external bus controller. During continuous access such as high-speed page mode such as DRAM or ROM, A shortened bus cycle can be realized. For example, in the case of an external DRAM, high-speed page 2-state is used for normal 4-state access. The external bus controller arbitrates for the bus right request from each of the CPU 502, the DMAC 511, and the EXDMAC 512 and the bus right request from the outside.

マイクロコンピュータ501の前記各種機能ブロックは、内部バスによって相互に接続される。内部バスはアドレスバス、データバスの他、図示はされない、バス権要求信号、バスアクノレッジ信号、バスコマンド、外部バスコマンド、レディ信号、外部バスレディ信号、リード信号・ライト信号、さらにバスサイズ信号、システムクロック信号等を含む。内部アドレスバスバスには、IAB、PAB、EXABが存在する。内部データバスにはIDB、PDBが存在する。   The various functional blocks of the microcomputer 501 are connected to each other by an internal bus. In addition to the address bus and data bus, the internal bus is not shown, bus right request signal, bus acknowledge signal, bus command, external bus command, ready signal, external bus ready signal, read signal / write signal, bus size signal, system Includes clock signals and the like. There are IAB, PAB, and EXAB in the internal address bus. IDB and PDB exist in the internal data bus.

それらのバスは、バスコントローラ510によってインタフェースされている。内部バスIAB、IDBはCPU2、DMAC11、ROM504、RAM505、バスコントローラ510に接続され、更に、アドレスバスIABは外部バスのアドレスバスとインタフェースするために、入出力ポートIOPA〜IOPCに接続され、データバスIDBは外部バスのデータバスとインタフェースするために、入出力ポートIOPD、IOPEに接続される。   These buses are interfaced by a bus controller 510. The internal buses IAB and IDB are connected to the CPU 2, DMAC 11, ROM 504, RAM 505, and bus controller 510, and the address bus IAB is connected to the input / output ports IOPA to IOPC to interface with the address bus of the external bus, and the data bus The IDB is connected to the input / output ports IOPD and IOPE in order to interface with the data bus of the external bus.

ペリフェラルバスPAB、PDBはバスコントローラ510、EXDMAC512、タイマ506、パルス出力回路507、SC5I8、A/D変換器509、割込コントローラ503、入出力ポートIOPA〜IOPF及び入出力ポートIOP1〜IOP5に接続される。これらの機能ブロックが有する制御レジスタを総称して、内部I/Oレジスタと呼ぶ。   The peripheral buses PAB and PDB are connected to the bus controller 510, EXDMAC 512, timer 506, pulse output circuit 507, SC5I8, A / D converter 509, interrupt controller 503, input / output ports IOPA to IOPF and input / output ports IOP1 to IOP5. The Control registers included in these functional blocks are collectively referred to as internal I / O registers.

アドレスバスEXABは、EXDMAC512とバスコントローラ510、入出力ポートIOPA〜IOPCを接続する。なお、バスコントローラ510は、アドレスバスEXABのアドレスを判定し、バス仕様に従った動作を実行するために参照する。従って、バスコントローラ510はエリアを判定したり、DRAMのロウアドレスを判定する程度の上位ビットを入力するのみでよい。   The address bus EXAB connects the EXDMAC 512, the bus controller 510, and the input / output ports IOPA to IOPC. Note that the bus controller 510 determines the address of the address bus EXAB and refers to it in order to execute an operation according to the bus specification. Therefore, the bus controller 510 only needs to input upper bits that determine the area or determine the row address of the DRAM.

CPU502とDMAC511が、内部バスマスタとして、内部バスを使用することができ、それぞれのバス権要求信号に従って、バスコントローラ(内部バスアービタ)510が調停する。また、外部バスについては、内部バスマスタによる外部バスアクセス、EXDMAC512、外部バス権解放要求、リフレッシュ要求のバス権要求信号に従って、バスコントローラ(外部バスアービタ)510が調停する。   The CPU 502 and the DMAC 511 can use the internal bus as an internal bus master, and the bus controller (internal bus arbiter) 510 arbitrates in accordance with each bus right request signal. For the external bus, the bus controller (external bus arbiter) 510 arbitrates according to the external bus access by the internal bus master, EXDMAC 512, external bus right release request, and refresh request bus right request signal.

ROM504、RAM505、及びタイマ506、パルス出力回路507、SCI508、A/D変換器509、入出力ポートIOPA〜IOPF及びIOP1〜IOP5、割込コントローラ503の各機能ブロック及びEXDMAC512は、内部バススレーブとして、CPU502またはDMAC511によって動作制御情報等がリード/ライト可能にされる。   ROM 504, RAM 505, timer 506, pulse output circuit 507, SCI 508, A / D converter 509, input / output ports IOPA to IOPF and IOP1 to IOP5, each functional block of interrupt controller 503 and EXDMAC 512 are used as internal bus slaves. Operation control information and the like can be read / written by the CPU 502 or the DMAC 511.

割込コントローラ503は、タイマ506、SCI508、A/D変換器509、入出力ポートIOP5の出力する割込信号を入力し、CPU502に割込要求信号531を、DMAC511に起動要求信号(図示せず)を出力する。また、DMAC511の出力するクリア信号(図示せず)を入力して、割込クリア信号(図示せず)を出力する。   The interrupt controller 503 inputs an interrupt signal output from the timer 506, the SCI 508, the A / D converter 509, and the input / output port IOP5, receives an interrupt request signal 531 in the CPU 502, and an activation request signal (not shown) in the DMAC 511. ) Is output. Also, a clear signal (not shown) output from the DMAC 511 is input, and an interrupt clear signal (not shown) is output.

入出力ポートは、外部バス信号、入出力回路の入出力信号と兼用とされている。入出力ポートIOPA〜IOPCはアドレスバス出力、入出力ポートIOPD、IOPEはデータバス入出力、入出力ポートIOPFはバス制御信号入出力信号と兼用されている。外部アドレス、外部データは、それぞれ、これらの入出力ポートに含まれるバッファ回路を介してバスIAB、IDBと接続されている。バスPAB、PDBは入出力ポートのレジスタをリード/ライトするために使用し、外部バスとは直接の関係はない。バス制御信号出力は、アドレスストローブ、ハイ/ロウデータストローブ、リードストローブ、ライトストローブ、バスアクノリッジ信号などがある。バス制御入力信号にはウェイト信号、バスリクエスト信号などがある。これらの入出力信号は図示はされない。外部バス拡張を行うことは、動作モードなどで選択され、これらの入出力ポートの機能も選択される。   The input / output port is also used as an external bus signal and an input / output signal of the input / output circuit. The input / output ports IOPA to IOPC are also used as address bus outputs, the input / output ports IOPD and IOPE are used as data bus inputs / outputs, and the input / output port IOPF is also used as bus control signal input / output signals. External addresses and external data are connected to buses IAB and IDB via buffer circuits included in these input / output ports, respectively. The buses PAB and PDB are used for reading / writing the registers of the input / output ports, and are not directly related to the external bus. The bus control signal output includes an address strobe, a high / low data strobe, a read strobe, a write strobe, and a bus acknowledge signal. The bus control input signal includes a wait signal and a bus request signal. These input / output signals are not shown. The expansion of the external bus is selected by an operation mode or the like, and the functions of these input / output ports are also selected.

また、入出力ポートIOP1はタイマ入出力、入出力ポートIOP2はパルス出力、入出力ポートIOP3はSCI508の入出力、入出力ポートIOP4はアナログ入力、入出力ポートIOP5はEXDMAC512、DMAC511入出力と兼用されている。EXDMAC512、DMAC511、タイマ506、SCI508、パルス出力507、A/D変換器509と入出力ポートIOP1〜IOP5との入出力信号や内部割込み要求信号などは図示を省略してある。   The input / output port IOP1 is a timer input / output, the input / output port IOP2 is a pulse output, the input / output port IOP3 is an input / output of the SCI508, the input / output port IOP4 is an analog input, and the input / output port IOP5 is also used as an EXDMAC512 and DMAC511 input / output. ing. The EXDMAC 512, the DMAC 511, the timer 506, the SCI 508, the pulse output 507, the input / output signals between the A / D converter 509 and the input / output ports IOP1 to IOP5, internal interrupt request signals, and the like are not shown.

割込要因が発生すると、割り込みコントローラ503でCPU502又はDMAC511の何れに要求を行なうか判定し、また、優先順位などが判定される。CPU502に割込要求が発生されると、CPU502は実行中の処理を中断して、例外処理状態を経て、所定の処理ルーチンに分岐し、所望の処理を行い、割込要因をクリアしたりする。所定の処理ルーチンの最後には、通常復帰命令(RTE命令)がおかれ、この命令を実行することによって前記中断した処理を再開する。   When an interrupt factor occurs, the interrupt controller 503 determines whether the CPU 502 or the DMAC 511 makes a request, and determines the priority order. When an interrupt request is generated in the CPU 502, the CPU 502 interrupts the process being executed, branches to a predetermined processing routine through an exception processing state, performs a desired process, and clears the interrupt factor. . At the end of the predetermined processing routine, a normal return instruction (RTE instruction) is provided, and the interrupted process is resumed by executing this instruction.

上記マイクロコンピュータ501は、電源端子として、グランドレベル(Vss)、電源電圧レベル(Vcc)、アナロググランドレベル(AVss)、アナログ電源電圧レベル(AVcc)、アナログ基準電圧(Vref)の入力端子の他に、専用制御端子として、リセット(RES)、スタンバイ(STBY)、モード制御(MD0、MD1、MD2)、クロック入力(EXTAL、XTAL)の各端子を有する。   In addition to the ground level (Vss), power supply voltage level (Vcc), analog ground level (AVss), analog power supply voltage level (AVcc), and analog reference voltage (Vref) input terminals, the microcomputer 501 has power supply terminals. As dedicated control terminals, there are terminals for reset (RES), standby (STBY), mode control (MD0, MD1, MD2), and clock input (EXTAL, XTAL).

前記端子EXTAL、XTALを介してCPG513に水晶発振子による発振信号又は外部クロック信号が入力され、これに基づいて基準クロック信号(システムクロック)φを生成する。マイクロコンピュータはその基準クロック信号φに同期して動作を行う。この基準クロック信号φの1周期をステートと呼ぶ。   An oscillation signal from a crystal oscillator or an external clock signal is input to the CPG 513 via the terminals EXTAL and XTAL, and a reference clock signal (system clock) φ is generated based on the oscillation signal. The microcomputer operates in synchronization with the reference clock signal φ. One cycle of the reference clock signal φ is called a state.

RES端子にリセット信号が加えられると、SYSC514がモード端子MD0〜MD2で与えられる動作モードを取り込み、マイクロコンピュータ501はリセット状態になる。モード端子で設定する動作モードは、シングルチップ/拡張、アドレス空間、内蔵ROMの有効/無効、データバス幅の初期値8ビット/16ビットなどを選択する。   When a reset signal is applied to the RES terminal, the SYSC 514 takes in the operation mode given by the mode terminals MD0 to MD2, and the microcomputer 501 enters a reset state. The operation mode set by the mode terminal is selected from single chip / expansion, address space, validity / invalidity of built-in ROM, initial value of data bus width 8 bits / 16 bits, and the like.

このリセットが解除されると、CPU502は所定のアドレスからスタートアドレスをリードして、このスタートアドレスから命令のリードを開始するリセット例外処理を行う。この後、CPU502は逐次、ROM504などから命令をリードし、解読して、その解読内容に基づいてデータの処理或はRAM505、タイマ506、SCI508、入出力ポートなど、或いは外部バスに接続されるメモリやI/Oなどとのデータ転送を行う。即ち、CPU502は、入出力ポート、A/D変換器509などか入力されるデータ、或はSCI508などから入力される指示を参照しつつ、ROM504などに記憶されている命令に基づいて処理を行い、その結果に基づいて、入出力ポート、タイマ506などを使用して、外部に信号を出力し、各種機器の制御を行う。   When the reset is released, the CPU 502 reads a start address from a predetermined address, and performs reset exception processing to start reading an instruction from the start address. Thereafter, the CPU 502 sequentially reads and decodes instructions from the ROM 504, etc., and processes data based on the decoded contents or RAM 505, timer 506, SCI 508, input / output port, etc., or memory connected to an external bus. And data transfer with I / O. That is, the CPU 502 performs processing based on instructions stored in the ROM 504 or the like while referring to data input from the input / output port, the A / D converter 509, or instructions input from the SCI 508 or the like. Based on the result, an input / output port, a timer 506 and the like are used to output signals to the outside to control various devices.

図3は前記CPU502に内蔵されている汎用レジスタ及び制御レジスタの構成例(プログラミングモデル)として上位のCPU502のプログラミングモデルを示す図面でもある。   FIG. 3 is also a drawing showing a programming model of the host CPU 502 as a configuration example (programming model) of general-purpose registers and control registers built in the CPU 502.

CPU502は、32ビット長の汎用レジスタを32本持っている。汎用レジスタER0〜ER31は、全て同等の機能を持っており、アドレスレジスタとしてもデータレジスタとしても使用することができる。   The CPU 502 has 32 general-purpose registers having a 32-bit length. The general purpose registers ER0 to ER31 all have the same function, and can be used as an address register or a data register.

データレジスタとしてしては32ビット、16ビットおよび8ビットレジスタとして使用きる。アドレスレジスタおよび32ビットレジスタとしては、一括して汎用レジスタER(ER0〜ER31)として使用する。16ビットレジスタとしては、汎用レジスタERを分割して汎用レジスタE(E0〜E31)、汎用レジスタR(R0〜R31)として使用する。これらは同等の機能を持っており、16ビットジスタを最大64本まで使用することができる。なお、汎用レジスタE(E0〜E31)を、特に拡張レジスタと呼ぶ場合がある。8ビットレジスタとしては、汎用レジスタRを分割して汎用レジスタRH(R0H〜R31H)、汎用レジスタRL(R0L〜R31L)として使用する。これらは同等の機能を持っており、8ビットレジスタを最大64本まで使用することができる。各レジスタ独立に使用方法を選択することができる。   As a data register, it can be used as a 32-bit, 16-bit and 8-bit register. The address register and the 32-bit register are used as general registers ER (ER0 to ER31) at once. As 16-bit registers, the general-purpose register ER is divided and used as general-purpose registers E (E0 to E31) and general-purpose registers R (R0 to R31). These have equivalent functions, and up to 64 16-bit registers can be used. Note that the general-purpose registers E (E0 to E31) may be particularly referred to as extension registers. As an 8-bit register, the general-purpose register R is divided and used as general-purpose registers RH (R0H to R31H) and general-purpose registers RL (R0L to R31L). These have equivalent functions, and up to 64 8-bit registers can be used. The usage method can be selected independently for each register.

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

なお、内部論理構成上はER0〜ER7をグループ0、ER8〜ER15をグループ1、ER16〜ER23をグループ2、ER24〜ER31をグループ3としている。グループ0が既存のCPU(CPU502に対する下位CPU)の汎用レジスタと同一とされる。   In terms of the internal logical configuration, ER0 to ER7 are group 0, ER8 to ER15 are group 1, ER16 to ER23 are group 2, and ER24 to ER31 are group 3. Group 0 is the same as the general-purpose register of the existing CPU (lower CPU relative to CPU 502).

それらの汎用レジスタは、プログラミング仕様上は相違なく、すべて同等に使用できる。少なくとも、アセンブリ言語で書く場合には、グループを意識せず、例えば、R0H、E8、R16,ER31、などと記述できる。例えば平成7年3月(株)日立製作所発行『H8S/2600シリーズH8S/2000シリーズプログラミングマニュアル』のアセンブラフォーマットに従って記述すれば、「MOV.L ER0,ER31」或いは、「ADD.W E8,R16」などとレジスタ番号のみで記述できる。   These general-purpose registers can be used equally without any difference in programming specifications. At least, when writing in assembly language, it can be described as, for example, R0H, E8, R16, ER31, etc. without regard to the group. For example, if written according to the assembler format of “H8S / 2600 Series H8S / 2000 Series Programming Manual” published by Hitachi, Ltd. in March 1995, “MOV.L ER0, ER31” or “ADD.W E8, R16” And can be described only by register numbers.

CPU502は更に、コントロールレジスタとして、図3に例示される24ビットのプログラムカウンタPCと8ビットのエクステンドレジスタEXR及び8ビットのコンディションコードレジスタCCRを含んでいる。   The CPU 502 further includes, as control registers, a 24-bit program counter PC illustrated in FIG. 3, an 8-bit extended register EXR, and an 8-bit condition code register CCR.

前記プログラムカウンタPCは、CPU502が次に実行する命令のアドレスを示す。特に制限されないものの、CPU502の命令は、すべて2バイト(ワード)を単位としているため、バイトを最小単位として指示するアドレス信号の最下位ビットは無効であり、命令リード時には命令アドレスの最下位ビットは0とみなされる。   The program counter PC indicates an address of an instruction to be executed next by the CPU 502. Although not particularly limited, since all the instructions of the CPU 502 are in units of 2 bytes (words), the least significant bit of the address signal instructing the byte as the minimum unit is invalid, and at the time of instruction read, the least significant bit of the instruction address is Considered zero.

前記コンディションコードレジスタCCRは8ビットのレジスタで、CPU502の内部状態を示している。割込みマスクビット(I)とハーフキャリ(H)、ネガティブ(N)、ゼロ(Z)、オーバフロー(V)、キャリ(C)の各フラグを含む8ビットで構成されている。   The condition code register CCR is an 8-bit register and indicates the internal state of the CPU 502. It consists of 8 bits including interrupt mask bit (I) and half carry (H), negative (N), zero (Z), overflow (V) and carry (C) flags.

前記エクステンドレジスタEXRは8ビットのレジスタで、割込みなどの例外処理の制御を行なう。割込みマスクビット(I2〜I0)とトレース(T)の各ビットを含んでいる。   The extended register EXR is an 8-bit register and controls exception processing such as interrupts. It includes interrupt mask bits (I2 to I0) and trace (T).

図4はCPU502に対する下位互換のCPUのプログラミングモデルを示す図面でもある。前記図3のプログラミングモデルを持つ上位のCPU502は、図4のプログラミングモデルを有する下位CPUの汎用レジスタ及び命令セットを包含している。   FIG. 4 is also a drawing showing a programming model of a CPU that is backward compatible with the CPU 502. The upper CPU 502 having the programming model of FIG. 3 includes general registers and instruction sets of the lower CPU having the programming model of FIG.

下位互換のCPUは、16ビット長の汎用レジスタを8本持っている。汎用レジスタR0〜R7は、すべて同等の機能を持っており、アドレスレジスタとしてもデータレジスタとしても使用することができる。   A backward compatible CPU has eight 16-bit general-purpose registers. The general-purpose registers R0 to R7 all have the same function, and can be used as an address register and a data register.

データレジスタとして16ビット及び8ビットレジスタとして使用きる。アドレスレジスタおよび16ビットレジスタとしては、一括して汎用レジスタR(R0〜R7)として使用する。8ビットレジスタとしては、汎用レジスタRを分割して汎用レジスタRH(R0H〜R7H)、汎用レジスタRL(R0L〜R7L)として使用する。これらは同等の機能を持っており、8ビットレジスタを最大16本まで使用することができる。各レジスタを独立に使用方法を選択することができる。   It can be used as a 16-bit and 8-bit register as a data register. The address register and 16-bit register are used as general-purpose registers R (R0 to R7) at once. As an 8-bit register, the general-purpose register R is divided and used as general-purpose registers RH (R0H to R7H) and general-purpose registers RL (R0L to R7L). These have equivalent functions, and up to 16 8-bit registers can be used. The usage of each register can be selected independently.

汎用レジスタR7には、前記同様に、汎用レジスタとしての機能に加えて、スタックポインタ(SP)としての機能が割り当てられており、例外処理やサブルーチン分岐などで暗黙的に使用される。   As described above, the general-purpose register R7 is assigned a function as a stack pointer (SP) in addition to a function as a general-purpose register, and is used implicitly in exception processing, subroutine branching, and the like.

図80にはCPU502のアドレス空間が示されている。マイクロコンピュータ501のアドレスマップとしては、ROM504は0番地から、一方、RAM505及び内部I/OレジスタはH’FFFFまたはH’FFFFFF番地まで、それぞれアドレス空間の両端になるように配置されるようにする。   FIG. 80 shows the address space of the CPU 502. As the address map of the microcomputer 501, the ROM 504 is arranged from the address 0, while the RAM 505 and the internal I / O register are arranged at both ends of the address space from the address H'FFFF or the address H'FFFFFF. .

上位CPU502は、16MBのアドレス空間のマキシマムモードと64kBのアドレス空間のミニマムモードを持つ。かかるマキシマムモードとミニマムモードの選択は、マイクロコンピュータ501のモード制御入力端子MD0〜MD2の状態によって行われる。   The host CPU 502 has a 16 MB address space maximum mode and a 64 kB address space minimum mode. The selection of the maximum mode and the minimum mode is performed according to the state of the mode control input terminals MD0 to MD2 of the microcomputer 501.

マキシマムモードでは、絶対アドレス24ビット(上位8ビットは予約され、命令コード中は32ビット)で全空間を、絶対アドレス16ビットで0〜 H’7FFF及びH’FF8000〜H’FFFFFFを指定する。また、例外処理時のベクタは24ビット(メモリ上は32ビットとされ、上位8ビットは無視される)、サブルーチン分岐などにおいて待避/復帰されるプログラムカウンタPCも24ビットとされる。   In the maximum mode, the absolute space is 24 bits (the upper 8 bits are reserved and 32 bits in the instruction code), and the entire space is designated by 16 bits and 0 to H'7FFF and H'FF8000 to H'FFFFFF are designated. Further, the vector for exception processing is 24 bits (32 bits on the memory and the upper 8 bits are ignored), and the program counter PC saved / restored in a subroutine branch or the like is also 24 bits.

ミニマムモードでは、絶対アドレスとレジスタ間接のアドッレシングモードのいずれも、下位16ビットのみを使用し、上位ビットは無視する。例外処理時のベクタは16ビット、サブルーチン分岐などにおいて待避/復帰されるプログラムカウンタPCも16ビットとされる。   In the minimum mode, both the absolute address and the register indirect addressing mode use only the lower 16 bits and ignore the upper bits. The vector at the time of exception processing is 16 bits, and the program counter PC saved / restored at a subroutine branch is also 16 bits.

下位CPUは、ミニマムモードに相当する64kBのアドレス空間を持つ。絶対アドレスは16ビットのみを持ち、また、レジスタ間接では16ビットレジスタで、それぞれ全空間を指定する。ベクタやスタックの構造などが前記上位CPU502のミニマムモードと同等の動作になり、例外処理時のベクタは16ビット、サブルーチン分岐などにおいて待避/復帰されるプログラムカウンタPCも16ビットとされる。   The lower CPU has an address space of 64 kB corresponding to the minimum mode. An absolute address has only 16 bits, and in the register indirect, a 16-bit register designates the entire space. The vector and stack structure are the same as the minimum mode of the host CPU 502, the vector during exception processing is 16 bits, and the program counter PC saved / restored at subroutine branching is also 16 bits.

前記図7及び図8は上位CPU502のマキシマムモードにおける実効アドレス計算方法を例示する図面でもある。   FIGS. 7 and 8 are also diagrams illustrating an effective address calculation method in the maximum mode of the host CPU 502.

図7の(1)に示されるレジスタ間接では命令コード中にレジスタを指定する部分(レジスタフィールド)を含み、この命令コードで指定された汎用レジスタERの内容の合計32ビットをアドレスとしてメモリ上のアドレスを指定する。アドレスは24ビットでよいため、上位8ビットは無視する。   The register indirect shown in (1) of FIG. 7 includes a part (register field) for designating a register in the instruction code, and a total of 32 bits of the contents of the general-purpose register ER designated by the instruction code are stored in the memory. Specify an address. Since the address may be 24 bits, the upper 8 bits are ignored.

図7の(2)、(3)に示されるディスプレースメント付レジスタ間接は、上記レジスタ間接と同様に得られた32ビットのアドレスに、命令コード中に含まれるディスプレースメントを加算した結果をアドレスとしてメモリ上のアドレスを指定する。加算結果はアドレスの指定のみに使用され、汎用レジスタERの内容には反映されない。特に制限はされないものの、ディスプレースメントは32ビットまたは16ビットであり、16ビットディスプレースメントは加算する場合には上位16ビットは符号拡張される。すなわち、ディスプレースメントの上位16ビットは16ビットディスプレースメントのビット15と同じ値であるとして加算が行われる。この場合も上位8ビットは無視される。   The register indirect with displacement shown in (2) and (3) of FIG. 7 uses the result obtained by adding the displacement included in the instruction code to the 32-bit address obtained in the same manner as the register indirect. Specify an address in memory. The addition result is used only for address designation and is not reflected in the contents of the general-purpose register ER. Although there is no particular limitation, the displacement is 32 bits or 16 bits, and when the 16-bit displacement is added, the upper 16 bits are sign-extended. That is, the addition is performed on the assumption that the upper 16 bits of the displacement have the same value as bit 15 of the 16-bit displacement. In this case, the upper 8 bits are ignored.

図7の(4)に示されるポストインクリメントレジスタ間接は、前記レジスタ間接と同様に得られた32ビットのアドレスでメモリ上のアドレスを指定する。その後、このアドレスに1、2又は4を加算し、その加算結果が汎用レジスタERに格納される。メモリ上のバイトデータを指定する場合には1が、ワードデータを指定する場合には2が、アドレスデータを指定する場合には4が、それぞれ加算される。また、複数レジスタの転送命令では、レジスタ本数分を乗算した結果が用いられる。加算結果の上位8ビットも拡張レジスタに格納される。後述する複数汎用レジスタ転送命令の場合は、2(ワードサイズ)または4(ロングワードサイズ)に、レジスタ本数を乗算した値が用いられる。   The post-increment register indirect shown in (4) of FIG. 7 designates an address on the memory with a 32-bit address obtained in the same manner as the register indirect. Thereafter, 1, 2 or 4 is added to this address, and the addition result is stored in the general-purpose register ER. 1 is added when byte data on the memory is designated, 2 is added when word data is designated, and 4 is added when address data is designated. In addition, in a multiple register transfer instruction, a result obtained by multiplying the number of registers is used. The upper 8 bits of the addition result are also stored in the extension register. In the case of a multiple general-purpose register transfer instruction to be described later, a value obtained by multiplying 2 (word size) or 4 (long word size) by the number of registers is used.

図7の(5)に示されるプリデクリメントレジスタ間接は、前記レジスタ間接と同様に得られた32ビットのアドレスから1、2又は4を減算した結果の24ビットのアドレスでメモリ上のアドレスを指定する。その後、その減算結果が汎用レジスタERに格納される。メモリ上のバイトデータを指定する場合には1が、ワードデータを指定する場合には2が、アドレスデータを指定する場合には4が、それぞれ減算される。また、複数レジスタの転送命令では、レジスタ本数分を乗算した結果が用いられる。前記同様に、アドレスが24ビットでよい場合には、特に制限はされないものの、減算結果の上位8ビットも拡張レジスタに格納される。(4)と同様に、後述の複数汎用レジスタ転送命令の場合は、2(ワードサイズ)または4(ロングワードサイズ)に、レジスタ本数を乗算した値が用いられる。   In the pre-decrement register indirect shown in (5) of FIG. 7, the address on the memory is designated by a 24-bit address obtained by subtracting 1, 2, or 4 from the 32-bit address obtained in the same manner as the register indirect. To do. Thereafter, the subtraction result is stored in the general-purpose register ER. 1 is subtracted when byte data on the memory is designated, 2 is subtracted when word data is designated, and 4 is subtracted when address data is designated. In addition, in a multiple register transfer instruction, a result obtained by multiplying the number of registers is used. Similarly to the above, when the address may be 24 bits, the upper 8 bits of the subtraction result are also stored in the extension register, although there is no particular limitation. Similarly to (4), in the case of a later-described multiple general-purpose register transfer instruction, a value obtained by multiplying 2 (word size) or 4 (long word size) by the number of registers is used.

図8の(6)(7)(8)に示される絶対アドレスは命令コード中に含まれる、8ビット、16ビット又は32ビットの絶対アドレスをアドレスとしてメモリ上のアドレスを指定する。8ビット絶対アドレスは、上位16ビットが論理値1に拡張(1拡張)される。すなわちアドレスのビット23〜8は全ビット1とされる。従って使用可能なアドレスはH’FFFF00〜H’FFFFFFの256バイトである。また、16ビット絶対アドレスは、上位8ビットが符号拡張される。すなわち、16ビット絶対アドレスのビット15が0であればアドレスのビット23〜16は全ビット0とされ、ビット15が1であればアドレスのビット23〜16は全ビット1とされる。従って使用可能なアドレスはH’000000〜H’007FFF及びH’FF8000〜H’FFFFFFの64kバイトである。   The absolute addresses shown in (6), (7), and (8) of FIG. 8 designate an address on the memory by using an 8-bit, 16-bit, or 32-bit absolute address included in the instruction code as an address. In the 8-bit absolute address, the upper 16 bits are extended to a logical value 1 (one extension). That is, bits 23 to 8 of the address are all 1 bits. Therefore, usable addresses are 256 bytes of H'FFFF00 to H'FFFFFF. In the 16-bit absolute address, the upper 8 bits are sign-extended. That is, if bit 15 of the 16-bit absolute address is 0, bits 23 to 16 of the address are all 0s, and if bit 15 is 1, bits 23 to 16 of the address are all 1s. Accordingly, usable addresses are 64 kbytes of H'000000 to H'007FFF and H'FF8000 to H'FFFFFF.

図8の(9)、(10)に示されるプログラムカウンタ相対は、プログラムカウンタの内容の24ビットのアドレスに命令コード中に含まれるディスプレースメントを加算した結果をアドレスとしてメモリ上のアドレスを指定する。加算結果はプログラムカウンタに格納される。特に制限はされないものの、ディスプレースメントは16ビットまたは8ビットであり、これらのディスプレースメントは加算する場合には上位8ビットまたは16ビットは符号拡張される。すなわち、ディスプレースメントの上位8ビットは16ビットディスプレースメントのビット15と、または上位16ビットは8ビットディスプレースメントのビット7と同じ値であるとみなして加算が行われる。プログラムカウンタ相対は分岐命令のみで使用される。   In the program counter relative shown in (9) and (10) of FIG. 8, the address on the memory is designated by using the result of adding the displacement included in the instruction code to the 24-bit address of the contents of the program counter. . The addition result is stored in the program counter. Although there is no particular limitation, the displacement is 16 bits or 8 bits, and when these displacements are added, the upper 8 bits or 16 bits are sign-extended. That is, the addition is performed assuming that the upper 8 bits of the displacement are the same as the bit 15 of the 16-bit displacement, or the upper 16 bits are the same as the bit 7 of the 8-bit displacement. Program counter relative is used only for branch instructions.

尚、上位CPU502のミニマムモードでは、実効アドレスの上位8ビットが無視され、下位16ビットが有効になる。上記の他にイミディエイト、レジスタ直接、メモリ間接などのアドレッシングモードを実行するが、これらは本発明に直接は関係しないので詳細な説明は省略する。   In the minimum mode of the upper CPU 502, the upper 8 bits of the effective address are ignored and the lower 16 bits are valid. In addition to the above, addressing modes such as immediate, register direct, and memory indirect are executed, but since these are not directly related to the present invention, detailed description thereof is omitted.

図4のプログラミングモデルを持つ下位互換のCPUの、データ転送命令では、レジスタ間接、16ビットディスプレースメント付レジスタ間接、ポストインクリメント/プリデクリメントレジスタ間接、8/16ビット絶対アドレス、が使用可能である。実効アドレスの計算方法は上記同様である。   In the data transfer instruction of the backward compatible CPU having the programming model of FIG. 4, register indirect, register indirect with 16-bit displacement, post-increment / pre-decrement register indirect, and 8 / 16-bit absolute address can be used. The effective address calculation method is the same as described above.

図81には複数レジスタ転送命令(複数レジスタ・メモリ間転送命令、複数レジスタ・レジスタ間転送命令)としての複数汎用レジスタの転送命令(MOVM)の機能が示される。データサイズは、ワード(W)及びロングワード(L)が可能であり、また、汎用レジスタ間、及び汎用レジスタ・メモリ間のデータ転送が可能である。また、アドレッシングモードは、イミディエイトを除き、従来の転送命令と同様である。   FIG. 81 shows the function of a multi-general register transfer instruction (MOVM) as a multi-register transfer instruction (multi-register / memory transfer instruction, multi-register / register transfer instruction). The data size can be word (W) or longword (L), and data transfer between general-purpose registers and between general-purpose registers and memories is possible. The addressing mode is the same as that of a conventional transfer instruction except for immediate.

汎用レジスタの選択は、2、3、4本の選択が可能であり、ロングワードサイズの場合、ER0−ER1、ER2−ER3、ER4−ER5、ER6−ER7、…、ER30−ER31の2本の組み合わせ、ER0−ER2、ER4−ER6、…、ER28−ER30の3本の組合せ、ER0−ER3、ER4−ER7、…、ER28−ER31の4本の組合せが可能である。ワードサイズの場合は、相当する汎用レジスタRのみ、または汎用レジスタEのみが選択される。   The general-purpose register can be selected from 2, 3, and 4. In the case of a long word size, two of ER0-ER1, ER2-ER3, ER4-ER5, ER6-ER7,. Three combinations, ER0-ER2, ER4-ER6,..., ER28-ER30, and four combinations ER0-ER3, ER4-ER7,. In the case of the word size, only the corresponding general purpose register R or only the general purpose register E is selected.

図81においてRnsはソースになる汎用レジスタ番号を意味し、Rndはディスティネーションになる汎用レジスタ番号を意味し、EAsはソースになる実効アドレスを意味し、EAdはディスティネーションになる実効アドレスを意味する。   In FIG. 81, Rns means a general-purpose register number that becomes a source, Rnd means a general-purpose register number that becomes a destination, EAs means an effective address that becomes a source, and EAd means an effective address that becomes a destination. .

図82には複数汎用レジスタの転送命令(MOVM)によるデータ転送のデータ配置が示される。(1)はワードサイズの2個のデータのレジスタ・メモリ間転送を示し、(2)はワードサイズの2個のデータのレジスタ・レジスタ間転送を示し、(3)はロングワードサイズの2個のデータのレジスタ・メモリ間転送を示し、(4)はロングワードサイズの2個のデータのレジスタ・レジスタ間転送を示している。   FIG. 82 shows a data arrangement of data transfer by a transfer instruction (MOVM) of a plurality of general purpose registers. (1) shows transfer between two registers of word size, between registers and memory, (2) shows transfer between two registers with word size, and (3) shows two transfers of long word size (4) shows the transfer between two registers of long word size between the register and the register.

例えば図82の(3)において、第1の汎用レジスタERnの最上位のデータ、例えば、Enの上位8ビット(aで示される)が、実効アドレスEAで指定されるメモリ(aで示される)に対応し、汎用レジスタの次のデータ、例えば、Enの下位8ビット(bで示される)が、実効アドレスEA+1で指定されるメモリ(bで示される)に対応する。第1の汎用レジスタの最下位のデータ、例えば、RLnのデータdの次は、第2の汎用レジスタ例えばERn+1の最上位のデータ、例えば、En+1の上位8ビットのデータeになる。ワードサイズの場合は、図示を省略するが、EnとEn+1の2本と、RmとRm+1の2本との間のデータ転送も可能である。   For example, in (3) of FIG. 82, the most significant data of the first general-purpose register ERn, for example, the upper 8 bits of En (indicated by a) is the memory (indicated by a) designated by the effective address EA. , The next data in the general-purpose register, for example, the lower 8 bits of En (indicated by b) corresponds to the memory (indicated by b) specified by the effective address EA + 1. Next to the lowest-order data of the first general-purpose register, for example, the data d of RLn, the second-most general-purpose register, for example, the highest-order data of ERn + 1, for example, the upper 8-bit data e of En + 1. In the case of the word size, although not shown, data transfer between two of En and En + 1 and two of Rm and Rm + 1 is also possible.

図9はCPU502の機械語の命令フォーマットと命令コードを例示する図面でもある。CPU502の命令は、2バイト(ワード)を単位にしている。各命令はオペレーションフィード(op)、レジスタフィールド(r、gr)、EA拡張部(EA)、およびコンディションフィールド(cc)を含む。   FIG. 9 is also a diagram exemplifying a machine language instruction format and instruction code of the CPU 502. The instruction of the CPU 502 is in units of 2 bytes (word). Each instruction includes an operation feed (op), a register field (r, gr), an EA extension (EA), and a condition field (cc).

オペレーションフィールド(op)は、命令の機能を表し、アドレッシングモードの指定オペランドの処理内容を指定する。オペレーションフィールド(op)は、命令の先頭4ビットを必ず含む。2つのオペレーションフィールドを持つ場合もある。   The operation field (op) represents the function of the instruction, and specifies the processing contents of the specified operand in the addressing mode. The operation field (op) always includes the first 4 bits of the instruction. There may be two operation fields.

レジスタフィールド(r、gr)は組合わせて汎用レジスタを指定する。レジスタフィールド(r)はアドレスレジスタのとき3ビット、データレジスタのとき3ビット(32ビットレジスタ)または4ビット(8または16ビットレジスタ)である。2つのレジスタフィールドr1,r2を持つ場合、またはレジスタフィールドr1,r2を持たない場合もある。   The register fields (r, gr) are combined to specify a general purpose register. The register field (r) is 3 bits for the address register and 3 bits (32 bit register) or 4 bits (8 or 16 bit register) for the data register. There may be two register fields r1 and r2 or no register fields r1 and r2.

レジスタフィールド(gr)は4ビット存在するが、特に制限はされないものの下位2ビットを有効にする。レジスタフィールド(gr)を含むワード(op,gr1,gr2を含むワード)は省略可能とされ、省略された場合は、0が与えられたものと想定され、グループ0のレジスタセットが指定されたものと見なされ、レジスタフィールド(r)で指定されるレジスタはレジスタ番号は0〜7とされ、汎用レジスタER0〜ERが選択できる。そのようなワード(op,gr1,gr2を含む命令コード)をレジスタ拡張用前置命令コードと称する。   There are 4 bits in the register field (gr), but the lower 2 bits are valid though not particularly limited. Words including register field (gr) (words including op, gr1, and gr2) can be omitted. If omitted, it is assumed that 0 is given, and a group 0 register set is specified. The registers specified in the register field (r) have register numbers 0 to 7, and general-purpose registers ER0 to ER can be selected. Such a word (instruction code including op, gr1, and gr2) is referred to as a register extension prefix instruction code.

レジスタ番号n=gr[1:0]<<3+r[2:0]で求められる(<<3は3ビット左シフトを示す)。即ち、grを上位とし、rの下位3ビットr[2:0]を下位とした5ビットで指定される番号のレジスタを指定する。例えば、gr=0、r=1の場合はレジスタ番号n=1となり、gr=2、r=3の場合はレジスタ番号n=19となる。このレジスタ番号nに対応する汎用レジスタERnの、命令コードのサイズを指定する部分や、r[3]の内容によって、レジスタER、レジスタE、レジスタR、レジスタRH、レジスタRLが指定される。例えば、データサイズがロングワード、ワード、バイトの何れであるかは命令コードのオペレーションフィールドの所定のビットで指定される。データサイズがワード又はバイトのとき、利用するレジスタ位置はr[3]で指定される。r[3]は、rの下位から4ビット目のビットデータを意味する。データサイズがワードのときr[3]=1のときはレジスタEを指定し、r[3]=0のときはレジスタRを意味する。データサイズがバイトのときr[3]=1のときはレジスタRLを指定し、r[3]=0のときはレジスタRHを意味する。   Register number n = gr [1: 0] << 3 + r [2: 0] (<< 3 indicates a 3-bit left shift). That is, a register having a number designated by 5 bits is designated, with gr being the higher order and the lower 3 bits r [2: 0] of r being the lower order. For example, when gr = 0 and r = 1, the register number n = 1, and when gr = 2 and r = 3, the register number n = 19. The register ER, the register E, the register R, the register RH, and the register RL are specified according to the portion of the general-purpose register ERn corresponding to the register number n that specifies the size of the instruction code and the content of r [3]. For example, whether the data size is a long word, a word, or a byte is specified by a predetermined bit in the operation field of the instruction code. When the data size is word or byte, the register position to be used is specified by r [3]. r [3] means bit data of the fourth bit from the lower order of r. When the data size is word, the register E is designated when r [3] = 1, and the register R is designated when r [3] = 0. When the data size is byte, r [3] = 1 designates the register RL, and when r [3] = 0, the register RH is designated.

尚、gr1、r1はソースレジスタまたはアドレスレジスタのレジスタ指定フィールドを意味し、gr2、r2はデスティネーションレジスタまたはデータレジスタのレジスタ指定フィールドを意味する。gr1(命令コードの基本ワード中のビット7〜4)はr1(命令コードの基本ワード中のビット7〜4またはビット6〜4)に、gr2(命令コードの基本ワード中のビット3〜0)はr2(命令コードの基本ワード中のビット11〜8またはビット3〜0)に対応する。   In addition, gr1 and r1 mean a register designation field of a source register or an address register, and gr2 and r2 mean a register designation field of a destination register or a data register. gr1 (bits 7 to 4 in the basic word of the instruction code) is replaced with r1 (bits 7 to 4 or 6 to 4 in the basic word of the instruction code) and gr2 (bits 3 to 0 in the basic word of the instruction code) Corresponds to r2 (bits 11 to 8 or bits 3 to 0 in the basic word of the instruction code).

EA拡張部(EA)は、イミディエイトデータ、絶対アドレスまたはディスプレースメントを指定し、8ビット、16ビット、または32ビットである。コンディションフィールド(cc)は条件分岐命令(Bcc命令)の分岐条件を指定する。   The EA extension (EA) designates immediate data, an absolute address or a displacement, and is 8 bits, 16 bits, or 32 bits. The condition field (cc) specifies the branch condition of the conditional branch instruction (Bcc instruction).

各命令フォーマット毎に例示されている命令コードは、16進数で表記した機械語を意味する。グループ指定フィールドgr1、gr2を持つ前置命令コード(00)を省略すると、既存の命令コードになるようになっている。   The instruction code exemplified for each instruction format means a machine language expressed in hexadecimal. If the prefix instruction code (00) having the group designation fields gr1 and gr2 is omitted, an existing instruction code is obtained.

例えば、図9の(2)に例示されたH'0901を単独で使用する場合、ADD.W R0,R1となり、これに、図9の(3)に例示されるグループ指定フィールドを持つ前置命令コードH'0012を付加すると、H'00120901は、 ADD.W R8,R17となる。   For example, when H′0901 exemplified in (2) of FIG. W R0 and R1 are added, and when a prefix instruction code H′0012 having a group designation field illustrated in (3) of FIG. 9 is added thereto, H′00120901 becomes ADD. W R8, R17.

また、暗黙的に使用されるグループ0を指定するH'0000はNOP(無操作)命令になる。 H'00xx(xxは01〜FF)は、グループフィールドを指定し、連続的に次の命令コードを実行する(割込みを禁止する)他は、NOP命令と同様に、PCのインクリメントを行い、最小のステート数で実行される。   Also, H'0000 that designates the group 0 that is used implicitly becomes a NOP (no operation) instruction. H'00xx (xx is 01 to FF) designates a group field, and continuously executes the next instruction code (inhibits interrupts), and increments the PC in the same manner as the NOP instruction. It is executed with the number of states.

レジスタ指定フィールド(gr)は、4ビットあるので、論理的には汎用レジスタグループを16に拡張することができる。この場合では32ビット汎用レジスタ128本(または16ビット汎用レジスタ256本)を利用できる。   Since the register designation field (gr) has 4 bits, the general-purpose register group can be logically expanded to 16. In this case, 128 32-bit general registers (or 256 16-bit general registers) can be used.

レジスタ指定フィールド(gr)に対応するオペレーションフィールドは複数種類あってよい。例えば、単純にレジスタ指定のみを行うものと、そのほかの機能(データサイズなど)を切り換える機能とを合わせ持つオペレーションコードとを用意しもよい。   There may be a plurality of operation fields corresponding to the register designation field (gr). For example, an operation code having both a function for simply specifying a register and a function for switching other functions (such as data size) may be prepared.

図10はCPU502における単一の汎用レジスタのデータ転送命令の機械語の命令コードを例示する図面でもある。それぞれのアドレッシングモードの実効アドレスの計算は図7及び図8に従い、機械語の命令フォーマットは図9に従っている。   FIG. 10 is also a diagram exemplifying a machine language instruction code of a single general-purpose register data transfer instruction in the CPU 502. The calculation of the effective address of each addressing mode is in accordance with FIGS. 7 and 8, and the machine language instruction format is in accordance with FIG.

図83には複数汎用レジスタの転送命令(MOVM)のような命令を示す前置命令コード(命令拡張用前置命令コード)が例示される。複数レジスタの転送命令は、命令拡張用前置命令コードと、既存の転送命令コードとを組合せて、複合命令化して実現される。   FIG. 83 exemplifies a prefix instruction code (an instruction extension prefix instruction code) indicating an instruction such as a transfer instruction (MOVM) of a plurality of general-purpose registers. The multi-register transfer instruction is realized by combining a pre-instruction code for instruction extension and an existing transfer instruction code into a composite instruction.

命令拡張用前置命令コードは以下の通りである。ビット2(最下位から3ビット目)が、レジスタのサイズを示し、B’0(B’はバイナリデータであることを意味する)がワードサイズ、B’1がロングワードサイズを意味する。ビット5、4が汎用レジスタ本数を示し、B’01が2本、B’10が3本、B’11が4本とする。この本命令コードは、下位CPUの命令セットに対して追加された新たな命令コードとされる。   The pre-instruction code for instruction expansion is as follows. Bit 2 (third bit from the least significant) indicates the size of the register, B'0 (B 'means binary data) indicates the word size, and B'1 indicates the long word size. Bits 5 and 4 indicate the number of general-purpose registers, and B'01 is 2, B'10 is 3, and B'11 is 4. This instruction code is a new instruction code added to the instruction set of the lower CPU.

この命令拡張用前置命令コードを用いたデータ転送命令は、単一の汎用レジスタとメモリのデータ転送命令(MOV)のようなワードサイズの命令コード(例えば、絶対アドレス16ビットのとき、2ワード)に、ロングワードサイズを示す命令コードが付加されて構成される(例えば、絶対アドレス16ビットのとき、合計3ワード)のと等価である。   A data transfer instruction using the pre-instruction code for instruction expansion is an instruction code of a word size such as a single general-purpose register and memory data transfer instruction (MOV) (for example, 2 words when the absolute address is 16 bits) ) To which an instruction code indicating a long word size is added (for example, a total of 3 words when the absolute address is 16 bits).

図83によれば、サイズを切り替える情報を保持しているため、単一の汎用レジスタとメモリのデータ転送命令のロングワードサイズを示す命令コードに代えて、前記命令拡張用前置命令コードを付加すればよい。命令コード長を長くすることなく、複数汎用レジスタのデータ転送命令(MOVM)を実現できる。   According to FIG. 83, since the information for switching the size is held, the instruction extension prefix instruction code is added instead of the instruction code indicating the long word size of the data transfer instruction of the single general-purpose register and the memory. do it. A multi-purpose register data transfer instruction (MOVM) can be realized without increasing the instruction code length.

なお、既存の、複数汎用レジスタのスタックへの待避命令である「STM ER0−3,@−SP」と、本発明の命令である「MOVM.L ER0−3,@−SP」とは概略同様の動作になるが、スタック上での汎用レジスタの配置順序が異なる。STM命令では、スタックの先頭(実効アドレス)からER3、ER2、ER1、ER0の順序でデータが配置されるのに対して、MOVM命令では、スタックの先頭からER0、ER1、ER2、ER3の順序でデータが配置される。上記双方の命令による処理は、後述するようにアドレス演算手法において大きく相違されている。   The existing “STM ER0-3, @ -SP” which is a save instruction to the stack of a plurality of general-purpose registers and the “MOVM.L ER0-3, @ -SP” which is an instruction of the present invention are substantially the same. However, the order of general-purpose registers on the stack is different. In the STM instruction, data is arranged in the order of ER3, ER2, ER1, and ER0 from the top (effective address) of the stack, whereas in the MOVM instruction, in the order of ER0, ER1, ER2, and ER3 from the top of the stack. Data is placed. The processing by both of the above instructions is greatly different in the address calculation method as will be described later.

前記命令拡張用前置命令コードを採用する場合には前記スタックへの退避命令を持たなくても動作上支障はないが、ソフトウェア資産を有効に利用する観点に立つと、両方の命令コードを持つことが望ましい。   In the case of adopting the pre-instruction code for instruction extension, there is no problem in operation even if it does not have an instruction to save to the stack, but it has both instruction codes from the viewpoint of effectively using software assets. It is desirable.

または、複数レジスタの転送命令における汎用レジスタのリード/ライトの順序を、番号の大きい方から使用するものとすれば、上記命令を同一の動作にすることもできる。更には、汎用レジスタのリード/ライトの順序を、内部I/Oレジスタなどで指定可能にしてもよい。   Alternatively, if the general-purpose register read / write order in the transfer instruction of a plurality of registers is used from the one with the largest number, the instructions can be made to have the same operation. Further, the general-purpose register read / write order may be designated by an internal I / O register or the like.

図84には上位CPU502の詳細な一例が示される。このCPU502は制御部CONTと実行部EXECから構成される。   FIG. 84 shows a detailed example of the upper CPU 502. The CPU 502 includes a control unit CONT and an execution unit EXEC.

制御部CONTは、命令レジスタIR1、命令レジスタIR2、命令デコーダDEC、レジスタセレクタRSEL、割込み制御部INTCを有する。下位CPUに対して、命令レジスタIR2が追加され、レジスタセレクタRSELの構成が相違されている。命令デコーダDECも命令レジスタIR2の追加や、レジスタセレクタRSELの構成の変更に対応して変更されている。特に、制御部CONTは、命令拡張用前置命令コードの有無に応じた第1の制御、レジスタ拡張用前置命令コードの有無に応じた第2の制御を行なうようになっている。   The control unit CONT includes an instruction register IR1, an instruction register IR2, an instruction decoder DEC, a register selector RSEL, and an interrupt control unit INTC. An instruction register IR2 is added to the lower CPU, and the configuration of the register selector RSEL is different. The instruction decoder DEC is also changed corresponding to the addition of the instruction register IR2 and the change of the configuration of the register selector RSEL. In particular, the control unit CONT performs a first control according to the presence / absence of an instruction extension pre-instruction code and a second control according to the presence / absence of a register extension pre-instruction code.

第1の制御は、命令で指定可能な複数の汎用レジスタの組み合わせを固定的にして、当該組み合わせが固定的な複数の汎用レジスタとアドレス空間上のメモリアドレス又は汎用レジスタとの間でデータ転送を可能にする制御を行う。上記転送命令の実効アドレスの計算は、演算器ALUで1回のみ行なうようにし、後続のアドレスについては、アドレスバッファABのインクリメントまたはデクリメント機能で対処させる。   In the first control, a combination of a plurality of general-purpose registers that can be specified by an instruction is fixed, and data transfer is performed between a plurality of general-purpose registers in which the combination is fixed and a memory address in the address space or a general-purpose register. Take control that makes possible. The effective address of the transfer instruction is calculated only once by the arithmetic unit ALU, and subsequent addresses are dealt with by the increment or decrement function of the address buffer AB.

第2の制御は、上位互換を考慮したレジスタ指定制御であり、一方では拡張された汎用レジスタをレジスタ拡張用前置命令コードを用いて指定するようにし、他方では、省略可能なレジスタ指定フィールドgr(gr1、gr2)が省略されたとき省略不可能なレジスタ指定フィールドr(r1、r2)によるレジスタ指定を暗黙的にレジスタグループ0に含まれるレジスタの指定とみなす制御を行なう。   The second control is a register designation control in consideration of upward compatibility. On the one hand, an extended general-purpose register is designated using a register instruction prefix instruction code, and on the other hand, an optional register designation field gr is designated. When (gr1, gr2) is omitted, control is performed so that register specification by the register specification field r (r1, r2) which cannot be omitted is implicitly specified as a register included in the register group 0.

前記命令デコーダDECは、例えば、マイクロROM或はPLA(Programmable Logic Array)または布線論理で構成される。   The instruction decoder DEC is configured by, for example, a micro ROM, PLA (Programmable Logic Array), or a wiring logic.

レジスタセレクタRSELには、前記命令デコーダDECの出力信号、命令レジスタIR1,IR2の出力信号、そして前記SYSC3に含まれる内部I/OレジスタCPUCRの出力信号ispgr,sspgrが供給される。   The register selector RSEL is supplied with the output signal of the instruction decoder DEC, the output signals of the instruction registers IR1 and IR2, and the output signals ispgr and sspgr of the internal I / O register CPUCR included in the SYSC3.

前記命令レジスタIR1は内部データバスIDBから命令が供給される。前記命令レジスタIR1の出力は、もう一つの命令レジスタIR2、前記命令デコーダDEC及び前記レジスタセレクタRSELに結合される。前記命令レジスタIR2の出力は前記レジスタセレクタRSELに結合される。   The instruction register IR1 is supplied with an instruction from the internal data bus IDB. The output of the instruction register IR1 is coupled to another instruction register IR2, the instruction decoder DEC, and the register selector RSEL. The output of the instruction register IR2 is coupled to the register selector RSEL.

前記命令デコーダDECの出力はレジスタセレクタRSEL及び前記命令レジスタIR2に結合される。命令デコーダDECは命令レジスタIR1にフェッチされた命令のオペレーションフィールドのオペレーションコードを解読する。   The output of the instruction decoder DEC is coupled to a register selector RSEL and the instruction register IR2. The instruction decoder DEC decodes the operation code in the operation field of the instruction fetched into the instruction register IR1.

命令レジスタIR1にフェッチされた命令コードがレジスタ拡張用前記前置命令コードであるとき、命令デコーダDECがこれを解読することによって、当該レジスタ拡張用前置命令コードのレジスタグループ指定フィールド(gr)のレジスタ指定情報を命令レジスタIR2にラッチさせる。その時のラッチ信号は命令デコーダDECから出力される。命令レジスタIR2にラッチされたレジスタフィールド指定情報、及び続けて命令レジスタIR1にフェッチされた後続の命令に含まれるレジスタフィールド(r)のレジスタ指定情報は、レジスタセレクタRSELで解読され、それら情報で直接的に指定されたレジスタグループの中のレジスタが選択され、選択されたレジスタを利用して当該後続の命令が実行される。この命令実行後、前記命令デコーダDECは前記命令レジスタIR2のラッチ情報を全ビット値“0”(レジスタグループ0の指定情報)にクリアするためのセット信号を命令レジスタIR2に供給する。したがって、その後に、前置命令コードを省いた命令が命令レジスタIR1にフェッチされても、命令レジスタIR2の出力はレジスタグループ0の指定情報を維持する結果、レジスタセレクタRSELは暗黙的にレジスタグループ0が指定されていると見做して、命令レジスタIR1からのレジスタ指定情報に従ったレジスタをレジスタグループ0から選択する。   When the instruction code fetched into the instruction register IR1 is the register extension pre-instruction code, the instruction decoder DEC decodes the instruction code to read the register group specification field (gr) of the register extension pre-instruction code. The register designation information is latched in the instruction register IR2. The latch signal at that time is output from the instruction decoder DEC. The register field designation information latched in the instruction register IR2 and the register designation information of the register field (r) included in the subsequent instruction fetched in the instruction register IR1 are decoded by the register selector RSEL and directly used as the information. A register in the designated register group is selected, and the subsequent instruction is executed using the selected register. After executing this instruction, the instruction decoder DEC supplies a set signal to the instruction register IR2 for clearing the latch information of the instruction register IR2 to all bit values “0” (register group 0 designation information). Therefore, even if an instruction omitting the prefix instruction code is fetched to the instruction register IR1 thereafter, the output of the instruction register IR2 maintains the designation information of the register group 0. As a result, the register selector RSEL implicitly registers the register group 0. Is selected from the register group 0 according to the register specification information from the instruction register IR1.

実行部EXECには、更に、テンポラリレジスタTRA,TRD、算術論理演算器ALU、インクリメンタINC、リードデータバッファRDB、ライトデータバッファWDB、アドレスバッファABを含む。これらの回路ブロックはデータバスGB、DB、WBによって相互に接続されている。前記データバスGB、DBはレジスタER0〜ER31に対するデータリードバス、データバスWBはレジスタER0〜ER31に対するデータライトバスとして位置付けられる。尚、詳細な図示を省いているが、実行部EXECの各部は、汎用レジスタの分割E(16ビット)、H(8ビット)、L(8ビット)に呼応して分割されている。   The execution unit EXEC further includes temporary registers TRA and TRD, an arithmetic logic unit ALU, an incrementer INC, a read data buffer RDB, a write data buffer WDB, and an address buffer AB. These circuit blocks are connected to each other by data buses GB, DB, and WB. The data buses GB and DB are positioned as data read buses for the registers ER0 to ER31, and the data bus WB is positioned as a data write bus for the registers ER0 to ER31. Although not shown in detail, each part of the execution unit EXEC is divided in accordance with the division E (16 bits), H (8 bits), and L (8 bits) of the general-purpose registers.

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

リードデータバッファRDBは、前記ROM504、RAM505、内部I/Oレジスタ、或は図示を省略する外部メモリから、リードした命令コードやデータを一時的に格納する。ライトデータバッファWDBはROM504、RAM505、内部I/Oレジスタ、或は外部メモリへのライトデータを一時的に格納する。リードデータバッファRDB、ライトデータバッファWDBによってCPU502の内部動作と、CPU502の外部のリード/ライト動作のタイミングを調整している。   The read data buffer RDB temporarily stores instruction codes and data read from the ROM 504, RAM 505, internal I / O register, or external memory (not shown). The write data buffer WDB temporarily stores write data to the ROM 504, RAM 505, internal I / O register, or external memory. The read data buffer RDB and the write data buffer WDB adjust the timing of the internal operation of the CPU 502 and the external read / write operation of the CPU 502.

アドレスバッファABは、CPU502がリード/ライトするデータのアドレスを一時的に格納するほか、格納した内容に対するインクリメント機能と、インクリメント結果を保持する機能を有している。GBバス、DBバス、WBバスが32ビットであるのに対して、IDBが16ビットであるため、32ビットのデータを、2回の16ビットデータのアクセスとする場合に、2回目のデータアクセスに先立って、アドレスバッファABの内容をインクリメントする。   The address buffer AB temporarily stores an address of data read / written by the CPU 502, and has an increment function for the stored contents and a function for holding the increment result. The GB bus, DB bus, and WB bus are 32 bits, whereas the IDB is 16 bits. Therefore, when 32-bit data is accessed twice as 16-bit data, the second data access is performed. Prior to this, the contents of the address buffer AB are incremented.

図85には前記レジスタセレクタRSELの一部と命令レジスタIR2との詳細なブロック図が示される。   FIG. 85 shows a detailed block diagram of a part of the register selector RSEL and the instruction register IR2.

前記命令レジスタIR2は、保持手段としてのラッチ回路LGR1,LGR2を有する。これらラッチ回路LGR1,LGR2は、前述の通りレジスタグループ指定フィールドgr1、gr2のレジスタグループ指定情報をラッチする。   The instruction register IR2 has latch circuits LGR1 and LGR2 as holding means. These latch circuits LGR1 and LGR2 latch the register group designation information in the register group designation fields gr1 and gr2, as described above.

図85に従えば、前記ラッチ回路LGR1,LGR2は、いわゆるリセット付きD型フリップフロップによって構成されている。リセット信号RSLGRとして、命令デコーダDECから指定される命令実行終了信号RSLGRを入力する。ラッチクロックとして、命令デコーダDECから指定されるラッチクロックLGRCLを入力し、また、データとして、命令レジスタIR1が保持する命令コードのビット7〜4、3〜0(グループ4の場合は、ビット5、4、1、0のみでもよい)を入力する。ラッチクロックLGRCLは、レジスタグループを指定する命令コード(省略可能なレジスタ拡張用前置命令コード)を実行したときに活性状態になって、そのときのレジスタフィールド(gr)である、ビット7〜4、3〜0をラッチさせる。ラッチ回路LGR1,LGR2は、命令の実行終了時点で、命令デコーダDECからの制御信号であるリセット信号RSLGRに基づいて、所定の値、例えば全ビット0に設定され、レジスタブロック0を指定する状態に初期化される。汎用レジスタグループを指定するレジスタ拡張用前置命令コードを持たない命令は、ラッチ回路LGR1,LGR2が値“0”にクリアされたままになっているから、命令実行が行われるとき、レジスタグループ0の汎用レジスタが指定されることになる。   According to FIG. 85, the latch circuits LGR1 and LGR2 are constituted by so-called reset D flip-flops. An instruction execution end signal RSLGR designated from the instruction decoder DEC is input as the reset signal RSLGR. A latch clock LGRCL designated from the instruction decoder DEC is input as a latch clock, and bits 7 to 4 and 3 to 0 of the instruction code held in the instruction register IR1 as data (in the case of group 4, bit 5; 4, 1, 0) may be entered. The latch clock LGRCL becomes active when an instruction code designating a register group (an optional instruction code for register extension) is executed, and bits 7 to 4 are register fields (gr) at that time. , 3 to 0 are latched. The latch circuits LGR1 and LGR2 are set to a predetermined value, for example, all bits 0 based on a reset signal RSLGR, which is a control signal from the instruction decoder DEC, at the end of execution of the instruction, so that the register block 0 is designated. It is initialized. Since the latch circuits LGR1 and LGR2 remain cleared to the value “0”, an instruction that does not have the register instruction prefix instruction code that designates the general-purpose register group remains in the register group 0 when the instruction is executed. General-purpose registers are specified.

レジスタセレクタRSELのデスティネーションレジスタ指定側には、ラッチ回路LGR2から出力されるレジスタグループ指定フィールド(gr2)の情報を保持するラッチ回路LAT1と、命令レジスタIR1から出力されるレジスタ指定フィールド(r2)の情報をラッチするラッチ回路LAT2が設けられている。それらラッチ回路LAT1,LAT2は、システムクロックφの反転クロックφ#でラッチ動作を行うようになっており、ソースレジスタの選択動作より遅くデスティネーションレジスタの選択動作が行なわれる。これによって、デスティネーション側のレジスタ指定情報のラッチタイミング即ちデスティネーションレジスタ選択タイミングがソースレジスタ選択タイミングよりも0.5ステート遅くなるようにされる。ソースレジスタはアドレスレジスタとして先行して選択され、デスティネーションレジスタはデータの書込みのために遅れて選択されることが可能になっている。   On the destination register designation side of the register selector RSEL, there are a latch circuit LAT1 that holds information of a register group designation field (gr2) output from the latch circuit LGR2, and a register designation field (r2) output from the instruction register IR1. A latch circuit LAT2 for latching information is provided. These latch circuits LAT1 and LAT2 perform a latch operation with an inverted clock φ # of the system clock φ, and the destination register selection operation is performed later than the source register selection operation. As a result, the latch timing of the register designation information on the destination side, that is, the destination register selection timing is delayed by 0.5 state from the source register selection timing. The source register is selected in advance as an address register, and the destination register can be selected later for writing data.

更に、命令レジスタIR1から出力されるレジスタ指定フィールドr1の情報と、ラッチ回路LAT2から出力されるレジスタ指定フィールドr2の情報とは、論理回路LOG1,LOG2に入力され、入力されたレジスタ指定フィールドr1、r2のビット0と1が、制御信号s1〜s3よって制御されて、論理回路LOG1,LOG2から出力され、組合せ固定的なレジスタ選択に用いられる。前記制御信号s1〜s3はデコーダDECから出力される。制御信号s1〜s3は複数汎用レジスタの転送命令の実効時に使用され、それ以外のときは全部0にされていて、LOG1,LOG2の入力r1,r2がそのまま出力とされる。   Further, the information in the register designation field r1 output from the instruction register IR1 and the information in the register designation field r2 output from the latch circuit LAT2 are input to the logic circuits LOG1 and LOG2, and the input register specification field r1, Bits 0 and 1 of r2 are controlled by the control signals s1 to s3, output from the logic circuits LOG1 and LOG2, and used for combination fixed register selection. The control signals s1 to s3 are output from the decoder DEC. The control signals s1 to s3 are used when a transfer instruction of a plurality of general purpose registers is executed, otherwise they are all set to 0, and the inputs r1 and r2 of LOG1 and LOG2 are output as they are.

前記制御信号s1〜s3の機能は図86に例示されている。制御信号s1はレジスタ指定フィールドr1,r2の情報のビット0を1に固定する。同様に、制御信号s2はレジスタ指定フィールドr1,r2の情報のビット1を1に、ビット0を0に固定する。s3はレジスタ指定フィールドr1,r2の情報のビット1とビット0を共に1に固定する。汎用レジスタ2本を指定する場合は、制御信号s1が出力される。3本の場合は、s1、s2の順に出力され、4本の場合は、s1、s2、s3の順に出力される。これにより、複数本の汎用レジスタを対象とする転送命令において最初に一つのレジスタがレジスタ指定フィールドr1,r2で指定されれば、その後はそれに続くレジスタが上記制御信号s1〜s3により規定の順に選択される。これによって、組合せ固定的に順次汎用レジスタが選択される。上記制御信号s1〜s3の出力論理より明らかなように、複数の汎用レジスタの転送命令において3ビット又は4ビットのレジスタ指定領域r1,r2でレジスタを指定するとき、当該レジスタ指定領域r1,r2に設定可能な初期値は、その命令が転送対象とする汎用レジスタの本数によって異なり、2本の場合は***0、3本の場合は**00、4本の場合は**00でなければならない。記号*はどのような値を採ってもよい。これによって、レジスタセレクタSEL自体をそのほかの命令と共通化して、前記複数汎用レジスタ転送命令に対処できるので、論理的規模の増加を極力抑止できる。   The functions of the control signals s1 to s3 are illustrated in FIG. The control signal s1 fixes bit 0 of information in the register designation fields r1 and r2. Similarly, the control signal s2 fixes bit 1 of information in the register designation fields r1 and r2 to 1 and bit 0 to 0. s3 fixes both bit 1 and bit 0 of the information in the register designation fields r1 and r2. When two general purpose registers are designated, the control signal s1 is output. In the case of three, it outputs in order of s1, s2, and in the case of four, it outputs in order of s1, s2, s3. As a result, if one register is first designated in the register designation fields r1 and r2 in a transfer instruction for a plurality of general purpose registers, the subsequent registers are selected in the prescribed order by the control signals s1 to s3. Is done. As a result, general-purpose registers are sequentially selected in a fixed combination. As is apparent from the output logic of the control signals s1 to s3, when a register is designated by the 3-bit or 4-bit register designation areas r1 and r2 in the transfer instructions of a plurality of general-purpose registers, the register designation areas r1 and r2 are designated. The initial value that can be set depends on the number of general-purpose registers to which the instruction is to be transferred, and must be *** 0 for two, *** 00 for three, or ** 00 for four. I must. The symbol * may take any value. As a result, the register selector SEL itself can be shared with other instructions to cope with the plural general-purpose register transfer instructions, so that an increase in logical scale can be suppressed as much as possible.

図87には前記アドレスバッファABの一例が示される。アドレスバッファABは、ラッチ回路521、インクリメンタ522、セレクタ・バッファ523から構成される。前記ラッチ回路521は、内部バスGBとインクリメンタ522の出力を入力する。制御信号mabincが活性状態の場合に、インクリメンタ522の出力がラッチされ、非活性状態の場合に、バスGBの内容がラッチされる。   FIG. 87 shows an example of the address buffer AB. The address buffer AB includes a latch circuit 521, an incrementer 522, and a selector buffer 523. The latch circuit 521 inputs the output of the internal bus GB and the incrementer 522. When the control signal mabinc is active, the output of the incrementer 522 is latched, and when it is inactive, the contents of the bus GB are latched.

前記インクリメンタ522は、ラッチ回路521の出力を入力して、+2の加算を行なう。制御信号mabincが活性状態にされることによって、インクリメントされた値がラッチ回路21からインクリメンタ22に繰り返し帰還されることにより、複数回のインクリメント+4、+6、…が可能にされる。   The incrementer 522 receives the output of the latch circuit 521 and adds +2. When the control signal mabinc is activated, the incremented value is repeatedly fed back from the latch circuit 21 to the incrementer 22, whereby a plurality of increments +4, +6,.

セレクタ・バッファ523は、ラッチ回路521とインクリメンタ522の内容を入力する。制御信号mabincが活性状態の場合に、インクリメンタ522の出力が選択され、非活性状態の場合に、ラッチ回路521の出力が選択される。選択された内容は、バス権アクノレッジ信号に従って、内部アドレスバスIABに出力される。バス権アクノレッジが非活性の場合には、アドレスバッファABは、内部アドレスバスIABへの出力は行なわず、出力はハイインピーダンス状態にされる。   The selector buffer 523 inputs the contents of the latch circuit 521 and the incrementer 522. When the control signal mabinc is active, the output of the incrementer 522 is selected. When the control signal mabinc is inactive, the output of the latch circuit 521 is selected. The selected content is output to the internal address bus IAB in accordance with the bus right acknowledge signal. When the bus right acknowledge is inactive, address buffer AB does not output to internal address bus IAB, and the output is set to a high impedance state.

図88及び図89にはレジスタ・レジスタ間のワードサイズの転送命令(MOV及びMOVM命令)に対するデコーダDECの制御論理の一部が論理記述によって示される。図9の記述は図88の後に続く残りの論理記述である。図93は図88乃至89に記載の論理記述の制御によるレジスタ・レジスタ間の単一及び複数汎用レジスタの転送命令(MOV及びMOVM)による制御動作に対応されるフローチャートである。   88 and 89 show a part of the control logic of the decoder DEC for a transfer instruction (MOV and MOVM instruction) of a word size between registers and registers by a logical description. The description of FIG. 9 is the remaining logical description following FIG. FIG. 93 is a flowchart corresponding to a control operation by transfer instructions (MOV and MOVM) of single and plural general-purpose registers between registers and registers by controlling the logical description shown in FIGS.

図88及び図89に示された論理記述は、RTL(Register Transfer Level)若しくはHDL(Hardware Description Language)記述と呼ばれ、公知の論理合成ツールによって、論理回路に論理展開できる。HDLはIEEE1364として標準化されている。これに示される論理記述の構文は、ケース(case)文に準拠しており、always@の次の()内で定義された値若しくは信号に変化が有ったとき、それ以下の記述行の処理を行う、という内容になっている。「8’b00001000」は8ビット長の00001000を意味する。また、図において、小文字の信号は、命令デコーダDECで生成され、出力される信号とし、大文字の信号は命令デコーダDECに入力された信号とする。   The logic description shown in FIGS. 88 and 89 is called RTL (Register Transfer Level) or HDL (Hardware Description Language) description, and can be logically expanded into a logic circuit by a known logic synthesis tool. HDL is standardized as IEEE 1364. The syntax of the logical description shown here conforms to the case statement, and when there is a change in the value or signal defined in () next to alwayss @, The content is that processing is performed. “8′b00001000” means 00001000 having an 8-bit length. In the figure, a lowercase signal is a signal generated and output by the instruction decoder DEC, and an uppercase signal is a signal input to the instruction decoder DEC.

図88の論理記述において転送命令が単一汎用レジスタを用いるか、複数汎用レジスタを用いるかは、信号MOD2〜MOD4によって指示される。信号MOD2は2本の汎用レジスタの指定を示し、信号MOD3は3本の汎用レジスタの指定を示し、信号MOD4信号は4本の汎用レジスタの指定を示す。それら信号MOD2〜MOD4は命令拡張用前置命令コードの内容によって生成される。   In the logical description of FIG. 88, whether the transfer instruction uses a single general purpose register or a plurality of general purpose registers is instructed by signals MOD2 to MOD4. Signal MOD2 indicates the designation of two general purpose registers, signal MOD3 indicates the designation of three general purpose registers, and signal MOD4 indicates the designation of four general purpose registers. The signals MOD2 to MOD4 are generated according to the contents of the instruction extension prefix instruction code.

図88及び図89の論理記述ではステートコードTMG(5ビットの情報)にしたがって制御信号を生成するようになっており、現時点でのステートコードの値とその時のMOD2〜MOD4の値とに従って、次のステートコードNEXTTMGの値を決定するようになっている。   88 and 89, the control signal is generated in accordance with the state code TMG (5-bit information), and the following is performed according to the current state code value and the MOD2 to MOD4 values at that time. The value of the state code NEXTTMG is determined.

単一レジスタの転送命令ではステートコードTMGは1(0001)であり、これに対して、複数レジスタの転送命令固有のデータ転送制御のためにステートコードTMG5(00101)、9(01001)、13(01101)が加えられている。   In the single register transfer instruction, the state code TMG is 1 (0001). On the other hand, the state codes TMG5 (00101), 9 (01001), 13 ( 01101) has been added.

複数レジスタの転送命令は、MOD2〜MOD4信号で示される。図88の論理記述の第1の部分(1)でステートコードTMGが生成される。単一レジスタの場合、ステートコードTMGは1である。複数レジスタの場合、例えば、MOD4=1ではTMGは1→5→9→13と進行する。MOD3=1では、ステートコード13が、MOD2=1では、ステートコード9及び13が、省略される。   Multiple register transfer instructions are indicated by MOD2 to MOD4 signals. The state code TMG is generated in the first part (1) of the logical description of FIG. In the case of a single register, the state code TMG is 1. In the case of multiple registers, for example, when MOD4 = 1, TMG proceeds from 1 → 5 → 9 → 13. When MOD3 = 1, the state code 13 is omitted, and when MOD2 = 1, the state codes 9 and 13 are omitted.

なお、NEXTTMG[5]=0のとき、次のTMGはNEXTTMG[4:0]とされる。NEXTTMG[5]=1のとき、次のTMGは5’b00001とされる。   When NEXTTMG [5] = 0, the next TMG is NEXTTMG [4: 0]. When NEXTTMG [5] = 1, the next TMG is set to 5'b00001.

図89の論理記述の第2の部分(2)でバス制御を行なう。nop=0はバスアクセス開始、nop=1はバスアクセス禁止を指示する。data=0は命令リード、data=1はデータアクセスを指示する。   Bus control is performed in the second part (2) of the logical description of FIG. When nop = 0, the bus access is started, and when nop = 1, the bus access is prohibited. Data = 0 indicates an instruction read, and data = 1 indicates a data access.

本転送命令の場合、ステートコードTMGが1で命令リードを行い、ステートコードTMGが5、9、13ではバスアクセスを行なわない。   In the case of this transfer instruction, instruction read is performed when the state code TMG is 1, and bus access is not performed when the state code TMG is 5, 9, or 13.

命令リードの場合は所定のタイミングで内部データバスIDBの内容が命令レジスタIR1とリードデータバッファRDBに格納される。データリードの場合は所定のタイミングで内部データバスIDBの内容がリードデータバッファRDBに格納される。データライトの場合は所定のタイミングでライトデータバッファWDBの内容がIDBに出力される。   In the case of instruction read, the contents of the internal data bus IDB are stored in the instruction register IR1 and the read data buffer RDB at a predetermined timing. In the case of data read, the contents of the internal data bus IDB are stored in the read data buffer RDB at a predetermined timing. In the case of data write, the contents of the write data buffer WDB are output to the IDB at a predetermined timing.

図89の論理記述の第3の部分(3)で、転送データを制御する。各ステートで、汎用レジスタから内部バスDBへ出力し、算術論理演算器ALUを経由して、内部バスWBから汎用レジスタへのライトを指示する。   In the third part (3) of the logical description of FIG. 89, the transfer data is controlled. In each state, the data is output from the general-purpose register to the internal bus DB, and the write from the internal bus WB to the general-purpose register is instructed via the arithmetic logic unit ALU.

いずれの場合も、汎用レジスタを指定した後、レジスタ指定フィールドr2の更新を行なう。信号s1が1のときは、レジスタフィールドr1のビット0を1に固定する。同様に、信号s2は、ビット1を1に、ビット0を0に固定する。信号s3はビット1、0を1に固定する。   In any case, after designating the general-purpose register, the register designation field r2 is updated. When the signal s1 is 1, the bit 0 of the register field r1 is fixed to 1. Similarly, the signal s2 fixes bit 1 to 1 and bit 0 to 0. The signal s3 fixes bits 1 and 0 to 1.

ステートコードTMGの1では、単一レジスタの転送命令、即ち、MOD2〜MOD4が何れも0のとき、ccrset信号が1とされ、コンディションコードレジスタCCRの所定のビットが転送データを反映して変化するようにされる。   In the state code TMG 1, when a single register transfer instruction, that is, MOD2 to MOD4 is 0, the ccrset signal is set to 1, and a predetermined bit of the condition code register CCR changes to reflect the transfer data. To be done.

図90乃至図92に記載の論理記述は、16ビット絶対アドレスによる転送命令(MOV及びMOVM命令)に対するデコーダDECの制御論理の一部を示す。図91の記述は図90の後に続く残りの論理記述、図92の記述は図91の後に続く残りの論理記述である。図94は図90乃至図92に記載の論理記述の制御による16ビット絶対アドレスによる単一及び複数汎用レジスタの転送命令(MOV及びMOVM)による制御動作に対応されるフローチャートである。   90 to 92 show a part of the control logic of the decoder DEC for transfer instructions (MOV and MOVM instructions) with 16-bit absolute addresses. The description of FIG. 91 is the remaining logical description following FIG. 90, and the description of FIG. 92 is the remaining logical description following FIG. FIG. 94 is a flowchart corresponding to the control operation by single and plural general-purpose register transfer instructions (MOV and MOVM) with 16-bit absolute addresses under the control of the logical description shown in FIGS.

図10の「(4)16ビット絶対アドレス」に示される通り、データサイズはIR[8](インストラクションレジスタIRの最下位から8ビット目)=0のときバイトサイズ、IR[8]=1のときワードサイズ、転送方向はIR[7]=0のときメモリ→汎用レジスタ(リード型)、IR[7]=1のとき汎用レジスタ→メモリ(ライト型)、の転送となる。   As shown in “(4) 16-bit absolute address” in FIG. 10, the data size is IR [8] (the eighth bit from the least significant bit of the instruction register IR) = 0, the byte size, and IR [8] = 1. When IR [7] = 0, memory → general-purpose register (read type), and when IR [7] = 1, general-purpose register → memory (write type).

ワードサイズ/ロングワードサイズ、単一レジスタ/複数レジスタの選択は、信号LNG、信号MOD2〜MOD4によって指示される。信号LNGはロングワードサイズを示す。信号MOD2〜MOD4は、それぞれ2〜4本のレジスタ選択を示し、命令拡張用前置命令コードに従って生成される。   Selection of word size / long word size, single register / multiple registers is instructed by signals LNG and signals MOD2 to MOD4. Signal LNG indicates the long word size. Signals MOD2 to MOD4 indicate 2 to 4 register selections, respectively, and are generated according to an instruction extension prefix instruction code.

単一レジスタの転送命令のフロー(ステートコード1→2→3)に対して、複数レジスタの転送命令固有のデータ転送のステート(ステートコード6、10、14)と、単一/複数レジスタの転送命令のロングワードサイズ時のステート(ステートコード18、22、26、30)が加えられている。   Single register transfer instruction flow (state code 1 → 2 → 3), multiple register transfer instruction specific data transfer state (state codes 6, 10, 14) and single / multiple register transfer The state (state codes 18, 22, 26, 30) at the time of the long word size of the instruction is added.

図90に示される論理記述の第1の部分(1)でステートコードTMGが生成される。単一レジスタの場合、ステートコードTMGは1→2→3と進行する。複数レジスタの場合、例えば、MOD4=1ではTMGは1→2→6→10→14→3と進行する。MOD3=1では、ステートコード14が省略され、MOD2=1では、ステートコード10及び14が省略される。また、ロングワードサイズの場合は、ステートコード18、22、26、30が追加される。   The state code TMG is generated in the first part (1) of the logical description shown in FIG. In the case of a single register, the state code TMG proceeds from 1 → 2 → 3. In the case of multiple registers, for example, when MOD4 = 1, TMG proceeds as 1 → 2 → 6 → 10 → 14 → 3. When MOD3 = 1, the state code 14 is omitted, and when MOD2 = 1, the state codes 10 and 14 are omitted. In the case of a long word size, state codes 18, 22, 26, and 30 are added.

図91の論理記述の第2の部分(2)ではバス制御を行なう。本転送命令の場合、ステートコード1、3で命令リードを行い、ステートコード2、18、6、22、10、26、14、30でデータアクセスを行なう。データアクセスのリード/ライトはIR[7]によって指示される。最後のデータアクセス以外では、long=1とし、バス権移譲禁止を指示する。   In the second part (2) of the logical description of FIG. 91, bus control is performed. In the case of this transfer instruction, instruction read is performed with the state codes 1 and 3, and data access is performed with the state codes 2, 18, 6, 22, 10, 26, 14, and 30. Data access read / write is instructed by IR [7]. Except for the last data access, long = 1 is set, and bus right transfer prohibition is instructed.

命令リードの場合は所定のタイミングで内部データバスIDBの内容がインストラクションレジスタIRとリードデータバッファRDBに格納される。データリードの場合は所定のタイミングで内部デーバスIDBの内容がリードデータバッファRDBに格納される。データライトの場合は所定のタイミングでライトデータバッファWDBの内容が内部データバスIDBに出力される。   In the case of instruction read, the contents of the internal data bus IDB are stored in the instruction register IR and the read data buffer RDB at a predetermined timing. In the case of data read, the contents of the internal data bus IDB are stored in the read data buffer RDB at a predetermined timing. In the case of data write, the contents of the write data buffer WDB are output to the internal data bus IDB at a predetermined timing.

図91に示される論理記述の第3の部分(3)で実効アドレスを計算する。本転送命令の場合、ステートコード2で、リードデータバッファRDBに保持している命令コードのEA拡張部16ビットを、信号dbrextによって32ビットに符号拡張した上、内部バスGBに出力する。内部バスGBの内容はアドレスバッファABに毎ステート格納されるようにされており、特に制御は必要ない。ステートコード18、6、22、10、26、14、30では、信号mabincによって、アドレスバッファABに保持した内容のインクリメント(+2)を行なう。   The effective address is calculated in the third part (3) of the logical description shown in FIG. In the case of this transfer instruction, the 16-bit EA extension part of the instruction code held in the read data buffer RDB is sign-extended to 32 bits by the signal dbrex and output to the internal bus GB with the state code 2. The contents of the internal bus GB are stored in the address buffer AB every state, and no particular control is required. In the state codes 18, 6, 22, 10, 26, 14, and 30, the content held in the address buffer AB is incremented (+2) by the signal mabinc.

図92に示される論理記述の第4の部分(4)で、転送データを制御する。リード型(IR[7]=0)の場合は、ステートコード6、10、14、3で、リードデータをリードデータバッファRDBから内部バスGBへ出力し、算術論理演算器ALUと内部バスWBを経由して、汎用レジスタへ格納する。ライト型(IR[7]=1)の場合は、ステートコード2、6、10、14で汎用レジスタから内部バスDBへ出力し、ライトデータバッファWDBを経由して、内部データバスIDBに出力する。何れの場合も、汎用レジスタを指定した後、レジスタ指定フィールドr1の更新を行なう。信号s1が1のときは、レジスタフィールドr1のビット0を1に固定する。同様に、信号s2は、ビット1を1に、ビット0を0に固定する。信号s3はビット1、0を1に固定する。これらは、図93においてr2++と示されている。   In the fourth part (4) of the logical description shown in FIG. 92, transfer data is controlled. In the case of the read type (IR [7] = 0), the read data is output from the read data buffer RDB to the internal bus GB with the state codes 6, 10, 14, and 3, and the arithmetic logic unit ALU and the internal bus WB are output. And store in general-purpose registers. In the case of the write type (IR [7] = 1), the state code 2, 6, 10, 14 is output from the general-purpose register to the internal bus DB, and is output to the internal data bus IDB via the write data buffer WDB. . In any case, after designating the general-purpose register, the register designation field r1 is updated. When the signal s1 is 1, the bit 0 of the register field r1 is fixed to 1. Similarly, the signal s2 fixes bit 1 to 1 and bit 0 to 0. The signal s3 fixes bits 1 and 0 to 1. These are indicated as r2 +++ in FIG.

ステートコード3では、単一レジスタの転送命令、即ち、信号MOD2〜MOD4が何れも0のとき、信号ccrsetが1とされ、コンディションコードレジスタCCRの所定のビットが転送データを反映して変化するようにされる。   In the state code 3, when a single register transfer instruction, that is, the signals MOD2 to MOD4 are all 0, the signal ccrset is set to 1, and a predetermined bit of the condition code register CCR changes to reflect the transfer data. To be.

そのほかのアドレッシングモードについても、上記同様に、所定の命令リードと実効アドレスの計算に加えて、ステートコード18、6、22、10、26、14、30に相当するデータアクセスの動作を加えればよい。これらは各種のアドレッシングモードに共通にすることができる。   In the other addressing modes, in addition to the predetermined instruction read and effective address calculation, the data access operation corresponding to the state codes 18, 6, 22, 10, 26, 14, and 30 may be added in the same manner as described above. . These can be common to various addressing modes.

図95にはレジスタ・レジスタ型の、第1の転送命令(MOV.L ER0,ER1)、第2の転送命令(MOV.L ER8,ER17)、及び複数レジスタの転送命令の第1の例(MOVM.W R0−R1,E28−E29)の実行タイミングが例示される。   FIG. 95 shows a first example of a register / register type first transfer instruction (MOV.L ER0, ER1), a second transfer instruction (MOV.L ER8, ER17), and a multiple register transfer instruction ( The execution timing of MOVM.W R0-R1, E28-E29) is illustrated.

レジスタ・レジスタ型の第1の転送命令(MOV.L ER0,ER1)は、グループ0の汎用レジスタのみを使用するので、汎用レジスグループを指定する命令コードを必要とせず、前記CPU2に対する下位CPUと同じ1ワードの命令とする。   Since the register / register type first transfer instruction (MOV.L ER0, ER1) uses only the general-purpose register of group 0, the instruction code for specifying the general-purpose register group is not required. The instruction is the same one word.

図95では、特に制限はされないものの、内蔵ROM504、RAM505のリード/ライトを1ステートでリード/ライト可能とする場合のタイミングを示している。以下の説明において、φの立ち上がりに同期する1ステートをφ同期ステートと称し、φ#(クロック信号φの反転クロック信号であり図示を省略する)の立ち上がりに同期する1ステートをφ#同期ステートと称する。   FIG. 95 shows the timing when the read / write of the internal ROM 504 and RAM 505 can be read / written in one state, although not particularly limited. In the following description, one state synchronized with the rise of φ is referred to as a φ synchronization state, and one state synchronized with the rise of φ # (which is an inverted clock signal of the clock signal φ and not shown) is referred to as a φ # synchronization state. Called.

サイクルT0のφ#同期ステートで、CPU502のアドレスバッファABからアドレスが内部アドレスバスIABに出力される。また、命令デコーダDECから、命令フェッチ(if)を示す、バスコマンドBCMDが出力される。   In the φ # synchronous state of cycle T0, the address is output from the address buffer AB of the CPU 502 to the internal address bus IAB. The instruction decoder DEC outputs a bus command BCMD indicating instruction fetch (if).

サイクルT1のφ同期ステートで、内部アドレスバスIABの内容が内部アドレスバスPABに出力され、バスコマンドBCMDに基づき、リードサイクルが開始され、内部データバスPDBにデータが出力される。サイクルT1のφ#同期ステートで内部データバスPDBのリードデータが内部データバスIDBに得られ、これをサイクルT2のφ同期ステートでインストラクションレジスタIR1にラッチする。以上の動作は以前の命令の実行の制御によって行われる(プリフェッチ)。ここで、内蔵ROM504、RAM505は、内部アドレスバスPAB及び内部データバスPDBに接続されていないが、前記内部バスPAB、PDB相当の動作をモジュール内で行い、本タイミング図には、このモジュール内の動作を示している。   In the φ synchronization state of cycle T1, the contents of internal address bus IAB are output to internal address bus PAB, a read cycle is started based on bus command BCMD, and data is output to internal data bus PDB. In the φ # synchronous state of cycle T1, the read data of the internal data bus PDB is obtained on the internal data bus IDB, and this is latched in the instruction register IR1 in the φ synchronous state of cycle T2. The above operation is performed by controlling the execution of the previous instruction (prefetch). Here, the built-in ROM 504 and RAM 505 are not connected to the internal address bus PAB and the internal data bus PDB, but the operations corresponding to the internal buses PAB and PDB are performed in the module. The operation is shown.

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、サイクルT2のφ同期ステートで命令コードが命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。命令の一部であるレジスタ指定フィードr1、r2の値や複数レジスタのレジスタ本数によって形成される信号s1〜s3を回路LOG1,LOG2が受けて、レジスタフィールドr1、r2の値を制御してそれを出力する。回路LOG1の出力を信号SEL1、回路LOG2の出力を信号SEL2と称する。   When the execution of the immediately preceding instruction is completed, when the execution of the instruction is started earliest, the instruction code is input to the instruction decoder DEC in the φ synchronous state of cycle T2, and the content of the instruction is decoded. According to the result of decoding, a control signal is output to control each part. The circuits LOG1 and LOG2 receive the signals s1 to s3 formed by the values of the register designation feeds r1 and r2 that are part of the instruction and the number of registers of a plurality of registers, and control the values of the register fields r1 and r2. Output. The output of the circuit LOG1 is called a signal SEL1, and the output of the circuit LOG2 is called a signal SEL2.

レジスタ間演算命令では、サイクルT2のφ#同期ステートで、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレス信号が出力される。このとき、ラッチ回路LGR1及びLGR2が何れも0にクリアされているので、前記信号SEL1、SEL2と命令デコーダDECの出力する制御信号B(Rs→DB)とに基づいて、レジスタセレクタRSELはレジスタ選択信号B(ER0→DB)を生成する。   In the inter-register operation instruction, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC in the φ # synchronous state of the cycle T2. An address signal is output from address buffer AB to address bus IAB. At this time, since both the latch circuits LGR1 and LGR2 are cleared to 0, the register selector RSEL selects the register based on the signals SEL1 and SEL2 and the control signal B (Rs → DB) output from the instruction decoder DEC. A signal B (ER0 → DB) is generated.

サイクルT3から、次の次の命令(本例では、MOV.L ER8,ER17)がリードされる。サイクルT3のφ同期ステートで、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。信号SEL1、SEL2と制御信号C(WB→Rd)とに基づいて、レジスタセレクタRSELがレジスタ選択信号C(WB→ER1)を生成する。レジスタ選択信号Bがレジスタを選択して、ソース側のレジスタ(Rs)のデータを算術論理演算器ALUに入力する。算術論理演算器ALUの演算内容は、命令デコーダDECが制御信号Cによって指示する。加算、論理演算、シフトなどは1クロックで演算を行うことができる。例えば、上記命令では32ビットの加算が指示される(バスGB側の入力は0とされる)。   From cycle T3, the next next instruction (in this example, MOV.L ER8, ER17) is read. In the φ synchronization state of cycle T3, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. Based on the signals SEL1, SEL2 and the control signal C (WB → Rd), the register selector RSEL generates a register selection signal C (WB → ER1). The register selection signal B selects the register and inputs the data of the source side register (Rs) to the arithmetic logic unit ALU. The operation content of the arithmetic logic unit ALU is instructed by the control signal C by the instruction decoder DEC. Addition, logical operation, shift, and the like can be performed in one clock. For example, in the above instruction, 32-bit addition is instructed (the input on the bus GB side is set to 0).

次の命令の命令デコーダDECへのロードが指示される。制御信号B(RSLGR)によって、ラッチ回路LGR1、LGR2のクリアが指示される。ラッチ回路LGR1はサイクルT3のφ同期ステートで、ラッチ回路LGR2はサイクルT3のφ#同期ステートでクリアされた結果が伝達される。   The instruction to load the next instruction to the instruction decoder DEC is instructed. Clearing of the latch circuits LGR1 and LGR2 is instructed by the control signal B (RSLGR). The latch circuit LGR1 transmits the result cleared in the φ synchronous state of cycle T3, and the latch circuit LGR2 transmits the result cleared in the φ # synchronous state of cycle T3.

サイクルT3のφ#同期ステートで、算術論理演算器ALUの演算結果が、内部バスWBを経由して、レジスタ選択信号Cが選択したデスティネーション側のレジスタ(ER1)にライトされる。図示はされないが、制御信号Cによって、コンディションコードレジスタCCRの更新を行う。更に次の次の命令を命令レジスタIR1に取り込む。同時に、次の命の実行が開始され、例えば、プログラムカウンタPCの内容を読み出して、アドレスバッファABとインクリメンタINCに入力される。   In the φ # synchronous state of cycle T3, the operation result of the arithmetic logic unit ALU is written to the destination-side register (ER1) selected by the register selection signal C via the internal bus WB. Although not shown, the condition code register CCR is updated by the control signal C. Further, the next instruction is fetched into the instruction register IR1. At the same time, execution of the next life is started. For example, the contents of the program counter PC are read out and input to the address buffer AB and the incrementer INC.

グループ0同士のレジスタ間演算を実質的に1ステートで実行できる。   Inter-register operations between groups 0 can be executed substantially in one state.

レジスタ・レジスタ型の第2の転送命令(MOV.L ER8,ER17)は、汎用レジスタグループを指定する命令コードを付加して2ワード命令とする。第2ワードは前記MOV.L R0,R1と同一である。すなわち、gr1=1であるため、同じr1=0に対して、レジスタ番号n=8、また、gr2=2であるため、同じr2=1に対して、レジスタ番号n=17と解釈される。   The register / register type second transfer instruction (MOV.L ER8, ER17) is a two-word instruction by adding an instruction code designating a general-purpose register group. The second word is the MOV. It is the same as L R0 and R1. That is, because gr1 = 1, the register number n = 8 for the same r1 = 0, and because gr2 = 2, the register number n = 17 is interpreted for the same r2 = 1.

サイクルT2のφ#同期ステートで、CPU502のアドレスバッファABからアドレスがアドレスバスIABに出力される。   In the φ # synchronization state of cycle T2, the address is output from the address buffer AB of the CPU 502 to the address bus IAB.

サイクルT3のφ同期ステートで、アドレスバスIABの内容がアドレスバスPABに出力され、リードサイクルが開始される。サイクルT3のφ#同期ステートでリードデータが内部データバスに得られ、これをサイクルT4のφ同期ステートで命令レジスタIR1にラッチする。これは、レジスタグループフィールドを持つ省略可能な命令ワード(前置命令コード)である。   In the φ synchronization state of cycle T3, the contents of the address bus IAB are output to the address bus PAB, and a read cycle is started. Read data is obtained on the internal data bus in the φ # synchronous state of cycle T3, and this is latched in the instruction register IR1 in the φ synchronous state of cycle T4. This is an optional instruction word (prefix instruction code) with a register group field.

引き続き、サイクルT4のφ#同期ステートで次のアドレス(+2された内容)がアドレスバスIABに出力され、このリードデータがサイクルT5のφ同期ステートで命令レジスタIR1にラッチされる。以上の動作は前記レジスタ・レジスタ型の第1の転送命令及び図示はされない次の命令の実行の制御によって行われている。   Subsequently, the next address (+2 content) is output to the address bus IAB in the φ # synchronous state of cycle T4, and this read data is latched in the instruction register IR1 in the φ synchronous state of cycle T5. The above operations are performed by controlling the execution of the first register / register type transfer instruction and the next instruction (not shown).

サイクルT4のφ同期ステートで命令コード(前置命令コード)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。グループフィールドラッチ信号LGRCLが発行されて、レジスタグループ指定フィールド(IR1のビット7〜0)がラッチ回路LGR1,LGR2にラッチされる。   In the φ synchronous state of cycle T4, an instruction code (prefix instruction code) is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Group field latch signal LGRCL is issued, and the register group designation field (bits 7 to 0 of IR1) is latched by latch circuits LGR1 and LGR2.

サイクルT4のφ#同期ステートで、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレス信号が出力される。   In the φ # synchronous state of cycle T4, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address signal is output from address buffer AB to address bus IAB.

サイクルT5から、更に次の命令(本例では、MOVM.W R0−R1,E28−E29)がリードされる。   From cycle T5, the next instruction (in this example, MOVM.W R0-R1, E28-E29) is read.

サイクルT5のφ同期ステートで、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。第1ワードと第2ワード以降が分割されないための制御信号B(controlB)に含まれる連続命令信号continue(割込み禁止信号mskintと同じ)を割込み制御回路INTCに出力する。本信号によって、割込み要求などが発生していても、命令の実行を継続することができる。また、ラッチ回路LGR1、LGR2の内容が保持される。   In the φ synchronous state of cycle T5, the result incremented (+2) by the incrementer INC is written to the program counter PC via the internal bus WB. A continuous command signal continue (same as the interrupt inhibition signal mskint) included in the control signal B (control B) for not dividing the first word and the second word is output to the interrupt control circuit INTC. Even if an interrupt request or the like is generated, the execution of the instruction can be continued by this signal. The contents of the latch circuits LGR1 and LGR2 are held.

一方、サイクルT4のφ同期ステートで命令コード(転送命令を指示)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。LGR1=1及びLGR2=2であるため、信号SEL1,SEL2と命令デコーダDECの出力する制御信号B(Rs−DB)とに基づいて、レジスタ選択信号B(ER8−DB)が生成される。信号SEL1、SEL2と制御信号C(WB−Rd)とに基づいて、レジスタ選択信号C(WB−ER17)が生成される。これ以外の第2ワードによる動作は第1の転送命令(MOV.L ER0,ER1)と同一にできる(第1の転送命令同様に、制御信号B(RSLGR)によって、LGR1、LGR2のクリアが指示される。ラッチ回路LGR1はサイクルT6のφ同期ステートで、ラッチ回路LGR2はサイクルT6のφ#同期ステートでクリアされた結果が伝達される)。   On the other hand, an instruction code (instructing a transfer instruction) is input to the instruction decoder DEC in the φ synchronous state of cycle T4, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since LGR1 = 1 and LGR2 = 2, the register selection signal B (ER8-DB) is generated based on the signals SEL1 and SEL2 and the control signal B (Rs-DB) output from the instruction decoder DEC. A register selection signal C (WB-ER17) is generated based on the signals SEL1 and SEL2 and the control signal C (WB-Rd). The other operations based on the second word can be the same as the first transfer instruction (MOV.L ER0, ER1) (LGR1 and LGR2 are instructed to be cleared by the control signal B (RSLGR) as in the first transfer instruction). The latch circuit LGR1 is transmitted in the φ synchronous state of cycle T6, and the latch circuit LGR2 is transmitted the result cleared in the φ # synchronous state of cycle T6).

即ち、第1ワード(前置命令コード)に対応するラッチ回路LGR1,LGR2のラッチ信号、連続命令信号を出力する以外は、命令デコーダDECの内容を、既存の下位CPUの命令デコーダと同等にできる。命令デコーダDECの前置命令コードに対応する部分は、相対的に小さいことは言うまでもない。すなわち、論理的な規模の追加を最小限にできる。また、命令デコーダDECの大部分を既存の下位CPUの命令デコーダと同等にできるから、従来の設計資産を有効に利用することができる。   That is, the content of the instruction decoder DEC can be made equivalent to that of the instruction decoder of the existing lower CPU except that the latch signals LGR1 and LGR2 corresponding to the first word (prefix instruction code) and the continuous instruction signal are output. . Needless to say, the portion corresponding to the front instruction code of the instruction decoder DEC is relatively small. That is, the addition of logical scale can be minimized. Further, since most of the instruction decoder DEC can be made equivalent to the instruction decoder of the existing lower CPU, the conventional design assets can be used effectively.

次に、複数レジスタのレジスタ・レジスタ間転送命令である「MOVM.W R0−R1,E28−E29」の例を示す。レジスタ指定フィールドr1は3’b000、r2は3’b100である。   Next, an example of “MOVM.W R0-R1, E28-E29” which is a register-register transfer instruction of a plurality of registers is shown. The register designation field r1 is 3'b000, and r2 is 3'b100.

本転送命令「MOVM.W R0−R1,E28−E29」は、汎用レジスタグループを指定するレジスタ拡張用前置命令コードと、MOVMを示す命令拡張用前置命令コード(プリフィックスコードとも称する)を付加して、3ワード命令とする。第3ワード(mov)はMOV.W R0,R4と同一である。gr2=3であるため、同じr1=4に対して、レジスタ番号n=28と解釈される。ワードサイズで、r2[3]=1であるため、汎用レジスタEが指定される。   This transfer instruction “MOVM.W R0-R1, E28-E29” adds a register extension prefix instruction code for specifying a general-purpose register group and an instruction extension prefix instruction code (also referred to as a prefix code) indicating MOVM. Thus, a 3-word instruction is obtained. The third word (mov) is MOV. It is the same as W R0 and R4. Since gr2 = 3, the register number n = 28 is interpreted for the same r1 = 4. Since the word size is r2 [3] = 1, the general-purpose register E is designated.

サイクルT5のφ#同期ステートで、CPU502のアドレスバッファABからアドレスがアドレスバスIABに出力される。   In the φ # synchronous state of cycle T5, an address is output from the address buffer AB of the CPU 502 to the address bus IAB.

サイクルT6のφ同期ステートで、アドレスバスIABの内容がアドレスバスPABに出力され、リードサイクルが開始される。サイクルT6のφ#同期ステートでリードデータが内部データバスに得られ、これをサイクルT7のφ同期ステートで命令レジスタIR1にラッチする。これは、レジスタグループフィールドを持つ省略可能な命令ワード(前置命令コード)である。   In the φ synchronization state of cycle T6, the contents of the address bus IAB are output to the address bus PAB, and a read cycle is started. Read data is obtained on the internal data bus in the φ # synchronous state of cycle T6, and is latched in the instruction register IR1 in the φ synchronous state of cycle T7. This is an optional instruction word (prefix instruction code) with a register group field.

引き続き、サイクルT7のφ#同期ステートで次のアドレス(+2された内容)がアドレスバスIABに出力され、このリードデータがサイクルT8のφ同期ステートで命令レジスタIR1にラッチされる。以上の動作は前記レジスタ・レジスタ型の第2の転送命令及び図示はされない次の命令の実行の制御によって行われている。   Subsequently, the next address (+2 content) is output to the address bus IAB in the φ # synchronous state of cycle T7, and this read data is latched in the instruction register IR1 in the φ synchronous state of cycle T8. The above operation is performed by controlling the execution of the register / register type second transfer instruction and the next instruction (not shown).

サイクルT7のφ同期ステートで第1の命令コードが命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、グループフィールドラッチ信号LGRCLが発行されて、レジスタグループ指定フィールド(IR1のビット7〜0)がラッチ回路LGR1、LGR2にラッチされる。   In the φ synchronous state of cycle T7, the first instruction code is input to the instruction decoder DEC, and the contents of the instruction are decoded. According to the decoding result, a group field latch signal LGRCL is issued, and the register group designation field (bits 7 to 0 of IR1) is latched in the latch circuits LGR1 and LGR2.

サイクルT7のφ#同期ステートで、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスバスIABにアドレス信号が出力される。   In the φ # synchronous state of cycle T7, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address signal is output from address buffer AB to address bus IAB.

サイクルT8から、次の次の命令がリードされる。サイクルT8のφで、インクリメンタINCでインクリメント(+2)された結果が、内部バスWBを経由してプログラムカウンタPCにライトされる。第1ワードと第2ワード以降が分割されないための制御信号Bで連続命令信号(割込み禁止信号)を割込み制御回路INTCに出力する。また、ラッチ回路LGR1,LGR2の内容が保持される。また、第2の命令コードが命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号MOD2が出力される。サイクルT8のφ#同期ステートで、プログラムカウンタPCの内容を内部バスGBに読み出して、アドレスバッファABとインクリメンタINCに入力する。アドレスバッファABからアドレスIABにアドレス信号が出力される。   From cycle T8, the next next instruction is read. The result incremented (+2) by the incrementer INC at φ in cycle T8 is written to the program counter PC via the internal bus WB. A continuous command signal (interrupt prohibition signal) is output to the interrupt control circuit INTC with the control signal B for preventing the first word and the second word and thereafter from being divided. The contents of the latch circuits LGR1 and LGR2 are held. Also, the second instruction code is input to the instruction decoder DEC, and the contents of the instruction are decoded. A control signal MOD2 is output according to the decoding result. In the φ # synchronous state of cycle T8, the contents of the program counter PC are read to the internal bus GB and input to the address buffer AB and the incrementer INC. An address signal is output from address buffer AB to address IAB.

一方、サイクルT9のφ同期ステートで命令コード(転送命令を指示)が命令デコーダDECに入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行う。LGR1=0及びLGR2=3であるため、信号SEL1、SEL2と命令デコーダDECの出力する制御信号B、C(Rs−DB、WB−Rd)とに基づいて、レジスタセレクタRSELでレジスタ選択信号B、C(R0−DB、WB−E28)が生成される。制御信号s1が生成されて、SEL1、SEL2の変更(3’b100→101)が指示される。   On the other hand, an instruction code (instructing a transfer instruction) is input to the instruction decoder DEC in the φ synchronous state of cycle T9, and the contents of the instruction are decoded. According to the result of decoding, a control signal is output to control each part. Since LGR1 = 0 and LGR2 = 3, the register selector RSEL uses the register selection signal B, based on the signals SEL1, SEL2 and the control signals B, C (Rs-DB, WB-Rd) output from the instruction decoder DEC. C (R0-DB, WB-E28) is generated. A control signal s1 is generated to instruct change of SEL1 and SEL2 (3'b100 → 101).

引き続き、MOD2信号に従って、信号SEL1、SEL2と命令デコーダDECの出力する制御信号B、C(Rs−DB、WB−Rd)とに基づいて、レジスタセレクタRSELがレジスタ選択信号B、C(R1−DB、WB−E29)を生成する。   Subsequently, based on the signals SEL1, SEL2 and the control signals B, C (Rs-DB, WB-Rd) output from the instruction decoder DEC, the register selector RSEL outputs the register selection signals B, C (R1-DB) according to the MOD2 signal. WB-E29).

図96には複数レジスタの転送命令の第2の例(MOVM.L @aa:16,ER0−ER1)の実行シーケンスが示される。   FIG. 96 shows an execution sequence of a second example (MOVM.L @aa: 16, ER0-ER1) of a multiple register transfer instruction.

上記命令は、2本の汎用レジスタへデータをリードする例である。レジスタ指定フィールドは3’b000である。アドレッシングモードは、絶対アドレス16ビットであり、実効アドレスはaaを符号拡張した内容である。この符号拡張は、リードデータバッファRDBから読み出す際に行われるようにされる。以下では、aaを符号拡張した内容も、単にaaと記す。   The above instruction is an example of reading data to two general purpose registers. The register designation field is 3'b000. The addressing mode is 16 bits of an absolute address, and the effective address is a content obtained by sign extension of aa. This sign extension is performed when reading from the read data buffer RDB. In the following, the content of sign-extended aa is also simply referred to as aa.

サイクルT2から転送命令の実行が開始される。特に制限はされないものの、命令コードの第1ワードは、MOVMを示すプリフィックスコードであり、次の命令コードの動作を指定(MOD2信号出力)し、プログラムカウンタPCをインクリメントするほかの動作は行わない。   Execution of the transfer instruction is started from cycle T2. Although there is no particular limitation, the first word of the instruction code is a prefix code indicating MOVM, and the operation of the next instruction code is designated (MOD2 signal output), and other operations for incrementing the program counter PC are not performed.

第2ワードの命令コード(mov−1)は、MOV.L @aa:16,ER0命令と共通である。   The instruction code (mov-1) of the second word is MOV. L @aa: 16, common with ER0 instruction.

サイクルT4のφ#同期ステートでリードデータバッファRDBの内容がバスGBに出力されて、アドレスバッファABに格納される。アドレスバッファABの内容がアドレスバスIABに出力される。同時に、バスコマンドBCMDが出力され、ワードデータリードと次のバスサイクルでのバス権移譲禁止が示される。   The contents of the read data buffer RDB are output to the bus GB and stored in the address buffer AB in the φ # synchronization state of the cycle T4. The contents of address buffer AB are output to address bus IAB. At the same time, a bus command BCMD is output to indicate word data read and bus right transfer prohibition in the next bus cycle.

サイクルT5のφ#同期ステートで、リードデータの上位16ビット(汎用レジスタEの内容)が内部データバスIDBに出力される。また、アドレスバッファABのインクリメント機能によって、アドレスバスIABの出力値をaa+2とする。同時に、バスコマンドBCMDが出力され、ワードデータリードと次のバスサイクルでのバス権移譲禁止が示される。   In the φ # synchronization state of cycle T5, the upper 16 bits of the read data (contents of general-purpose register E) are output to the internal data bus IDB. Further, the output value of the address bus IAB is set to aa + 2 by the increment function of the address buffer AB. At the same time, a bus command BCMD is output to indicate word data read and bus right transfer prohibition in the next bus cycle.

サイクルT6のφ同期ステートで、リードデータがリードデータバッファRDBに格納される。   In the φ synchronous state of cycle T6, read data is stored in the read data buffer RDB.

サイクルT6のφ#同期ステートで、リードデータの下位16ビット(汎用レジスタRの内容)が内部データバスに出力される。また、アドレスバッファABのインクリメント機能によって、アドレスバスIABの出力値をaa+4とする。同時に、バスコマンドBCMDが出力され、ワードデータリードと次のバスサイクルでのバス権移譲禁止が示される。   In the φ # synchronous state of cycle T6, the lower 16 bits of the read data (contents of general register R) are output to the internal data bus. Further, the output value of the address bus IAB is set to aa + 4 by the increment function of the address buffer AB. At the same time, a bus command BCMD is output to indicate word data read and bus right transfer prohibition in the next bus cycle.

サイクルT7のφ同期ステートで、リードデータの内容が、32ビットでバスGBを経由して算術論理演算器ALUに転送される。   In the φ synchronization state of cycle T7, the content of the read data is transferred to the arithmetic logic unit ALU via the bus GB in 32 bits.

サイクルT7のφ#同期ステートで、リードデータの上位16ビット(汎用レジスタEの内容)が内部データバスに出力される。また、アドレスバッファABのインクリメント機能によって、アドレスバスIABの出力値をaa+6とする。同時に、バスコマンドBCMDが出力され、ワードデータリードと次のバスサイクルでのバス権移譲許可が示される。   In the φ # synchronization state of cycle T7, the upper 16 bits of the read data (contents of general register E) are output to the internal data bus. Further, the output value of the address bus IAB is set to aa + 6 by the increment function of the address buffer AB. At the same time, the bus command BCMD is output to indicate word data read and bus right transfer permission in the next bus cycle.

サイクルT8のφ#同期ステートで、リードデータの下位16ビット(汎用レジスタRの内容)が内部データバスに出力される。また、第2の制御信号Bによってレジスタ選択信号のビット0が反転される。第1の制御信号Aと信号SEL2(=3’b001)とによって、転送されるレジスタが選択され、レジスタ制御信号Bが生成される。   In the φ # synchronization state of cycle T8, the lower 16 bits of the read data (contents of general-purpose register R) are output to the internal data bus. Also, bit 0 of the register selection signal is inverted by the second control signal B. The register to be transferred is selected by the first control signal A and the signal SEL2 (= 3'b001), and the register control signal B is generated.

サイクルT8のφ#同期ステート以降で、前記同様に、次の次の命令の読み出しと、プログラムカウンタPCのインクリメント(+2)を行う。   After the φ # synchronous state of cycle T8, the next next instruction is read and the program counter PC is incremented (+2) as described above.

レジスタ3本を指定した場合は、実行ステート数が2ステート長くなり、アドレスバッファABのインクリメント(+2)が更に2回行われる(合計+6)。また、信号SEL1、SEL2のビット1が反転され、レジスタ指定フィールドが000の場合、010とされ、汎用レジスタER2が選択される。ライト動作が2回(合計6回)行われる。   When three registers are specified, the number of execution states is increased by two, and the address buffer AB is incremented twice (+2) (total +6). When bit 1 of the signals SEL1 and SEL2 is inverted and the register designation field is 000, it is set to 010 and the general-purpose register ER2 is selected. The write operation is performed twice (6 times in total).

レジスタ4本を指定した場合は、更に、実行ステート数が2ステート長くなり、アドレスバッファABのインクリメント(+2)が更に2回行われる(合計+10)。また、信号SEL1、SEL2のビット1とビット0が反転され、レジスタ指定フィールドが000の場合、011とされ、汎用レジスタER2、ER3が選択される。ライト動作が2回(合計8回)行われる。   When four registers are designated, the number of execution states is further increased by two states, and the address buffer AB is incremented twice (+2) (total +10). Further, when the bits 1 and 0 of the signals SEL1 and SEL2 are inverted and the register designation field is 000, it is set to 011 and the general purpose registers ER2 and ER3 are selected. The write operation is performed twice (8 times in total).

レジスタ番号の下位ビットが固定であるので、これを命令処理の実行に従って、変更する制御が容易である。加算器などを不要にして、論理的規模の増加を抑止できる。例えば、2本のレジスタを待避する場合、命令コード上のレジスタ指定フィールドの下位ビットは0であるので、1回めのレジスタ指定は、レジスタ指定フィールドの値に従い、2回のレジスタ指定は、命令デコーダDECの制御に従って、レジスタ指定フィールドの下位1ビットを1に変更して、行うようにする。   Since the lower bits of the register number are fixed, it is easy to control to change this according to the execution of instruction processing. An adder or the like is unnecessary, and an increase in logical scale can be suppressed. For example, when saving two registers, the low-order bit of the register designation field on the instruction code is 0, so the first register designation is in accordance with the value of the register designation field, and the second register designation is an instruction According to the control of the decoder DEC, the lower 1 bit of the register designation field is changed to 1 so as to be performed.

一方、MOV命令はレジスタ1本のリードであり、前記の2回目のリード動作を行わないようにされ、実行動作の共通化を図っている。   On the other hand, the MOV instruction is a read of one register, and the second read operation is not performed, so that the execution operation is shared.

図97には複数レジスタの転送命令の第3の例(MOVM.W R10−R11,@ER6)の実行シーケンスが示される。上記命令は、2本のワードサイズの汎用レジスタをライトする例である。レジスタ指定フィールドは3’b010である。   FIG. 97 shows an execution sequence of a third example (MOVM.W R10-R11, @ ER6) of a transfer instruction of a plurality of registers. The above instruction is an example of writing two general-purpose registers of word size. The register designation field is 3'b010.

サイクルT2から転送命令の実行が開始される。特に制限はされないものの、命令コードの第1ワードはレジスタグループフィールドを持つプリフィックスコードであり、レジスタグループ指定フィールド(IR1のビット7〜0)がラッチ回路LGR1、LGR2にラッチされ、プログラムカウンタPCをインクリメントする。   Execution of the transfer instruction is started from cycle T2. Although not particularly limited, the first word of the instruction code is a prefix code having a register group field, the register group designation field (bits 1 to 0 of IR1) is latched by the latch circuits LGR1 and LGR2, and the program counter PC is incremented. To do.

第2ワードの命令コードは、MOVMを示すプリフィックスコードであり、次の命令コードの動作を指定する。制御信号MOD2が出力される。第3ワードの命令コードは、MOV.W R2,@ER6命令と共通にされる。   The instruction code of the second word is a prefix code indicating MOVM, and specifies the operation of the next instruction code. A control signal MOD2 is output. The instruction code of the third word is MOV. Common to WR2, @ ER6 instruction.

サイクルT4のφ#同期ステートでレジスタER6の内容がバスGBに出力され、アドレスバッファABに格納される。アドレスバッファABの内容がアドレスバスIABに出力される。同時に、バスコマンドBCMDが出力され、ワードデータライトと次のバスサイクルでのバス権移譲禁止が示される。   In the φ # synchronous state of cycle T4, the contents of register ER6 are output to bus GB and stored in address buffer AB. The contents of address buffer AB are output to address bus IAB. At the same time, a bus command BCMD is output to indicate word data write and prohibition of bus right transfer in the next bus cycle.

また、第1の制御信号Bとラッチ回路LGR2のラッチ情報(=3’b001)と信号SEL2(=3’b010)とによって、転送されるレジスタが選択され、レジスタ制御信号Bが生成される。制御信号s1が生成されて、信号SEL2の変更(3’b010→011)が指示される。   Further, the register to be transferred is selected by the first control signal B, the latch information (= 3′b001) of the latch circuit LGR2, and the signal SEL2 (= 3′b010), and the register control signal B is generated. A control signal s1 is generated to instruct the change of the signal SEL2 (3'b010 → 011).

ステートサイクルT5のφ同期ステートで、選択されたレジスタ(R10の内容)がバスDB経由で、ライトデータバッファWDBに転送される。   In the φ synchronous state of the state cycle T5, the selected register (contents of R10) is transferred to the write data buffer WDB via the bus DB.

T5のφ#同期ステートで、転送されたデータ(R10の内容)が内部データバスIDBに出力される。また、アドレスバッファABのインクリメント機能によって、アドレスバスIABの出力値をEA+2とする。また、第1の制御信号Bとラッチ回路LGR2のラッチ情報(=3’b001)と信号SEL2(=3’b011)とによって、転送されるレジスタが選択され、レジスタ制御信号Bが生成される。   In the φ # synchronous state of T5, the transferred data (contents of R10) is output to the internal data bus IDB. Further, the output value of the address bus IAB is set to EA + 2 by the increment function of the address buffer AB. Further, the register to be transferred is selected by the first control signal B, the latch information (= 3′b001) of the latch circuit LGR2, and the signal SEL2 (= 3′b011), and the register control signal B is generated.

サイクルT6のφ同期ステートで、選択されたレジスタR11の内容がバスDB経由で、ライトデータバッファWDBに転送される。   In the φ synchronization state of cycle T6, the contents of the selected register R11 are transferred to the write data buffer WDB via the bus DB.

サイクルT6のφ#同期ステートで、転送されたデータ(R11の内容)が内部データバスIDBに出力される。   In the φ # synchronization state of cycle T6, the transferred data (content of R11) is output to the internal data bus IDB.

サイクルT6のφ#同期ステート以降で、前記同様に、次の次の命令の読み出しと、プログラムカウンタPCのインクリメント(+2)を行う。   After the φ # synchronous state of cycle T6, the next next instruction is read and the program counter PC is incremented (+2) as described above.

レジスタ3本を指定した場合は、実行ステート数が1ステート長くなり、アドレスバッファABのインクリメント(+2)が更に1回行われる(合計+4)。また、信号SEL1、SEL2のビット1が反転され、レジスタ指定フィールドが000の場合、010とされる。ライト動作が1回(合計3回)行われる。   When three registers are designated, the number of execution states is increased by one state, and the address buffer AB is incremented (+2) once more (total +4). When bit 1 of the signals SEL1 and SEL2 is inverted and the register designation field is 000, it is set to 010. The write operation is performed once (total 3 times).

レジスタ4本を指定した場合は、更に、実行ステート数が1ステート長くなり、アドレスバッファABのインクリメント(+2)が更に1回行われる(合計+6)。また、SEL1、SEL2のビット1とビット0が反転され、レジスタ指定フィールドが000の場合、011とされる。ライト動作が1回(合計4回)行われる。   When four registers are designated, the number of execution states is further increased by one state, and the address buffer AB is incremented (+2) once more (total +6). When bits 1 and 0 of SEL1 and SEL2 are inverted and the register designation field is 000, 011 is set. The write operation is performed once (total 4 times).

図98には前記CPU502の開発環境の概略が示される。これは、既存の下位CPUと、これに対する上位互換の前記CPU502とで、共通の開発環境を提供できるようにするものである。   FIG. 98 shows an outline of the development environment of the CPU 502. This makes it possible to provide a common development environment between the existing lower CPU and the CPU 502 that is upwardly compatible with the existing lower CPU.

使用者は、各種エディタなどを用いて、C言語乃至アセンブリ言語でプログラムを作成する。これは通常、複数のモジュールに分割して作成される。   The user creates a program in C language or assembly language using various editors. This is usually created by dividing it into a plurality of modules.

Cコンパイラ540は、使用者の作成したそれぞれのC言語ソースプログラムを入力し、アセンブリ言語ソースプログラム乃至オブジェクトモジュールを出力する。アセンブラ541は、アセンブリ言語ソースプログラムを入力し、オブジェクトモジュールを出力する。リンケージエディタ542は、上記Cコンパイラ540やアセンブラ541の生成した、複数のオブジェクトモジュールを入力して、各モジュールの外部参照や相対アドレスなどの解決を行い、1つのプログラムに結合して、ロードモジュールを出力する。   The C compiler 540 inputs each C language source program created by the user, and outputs an assembly language source program or an object module. The assembler 541 inputs an assembly language source program and outputs an object module. The linkage editor 542 inputs a plurality of object modules generated by the C compiler 540 and the assembler 541, resolves external references and relative addresses of each module, combines them into one program, and loads a load module. Output.

ロードモジュールは、シミュレータデバッガ543に入力して、パーソナルコンピュータなどのシステム開発装置上で、CPUの動作をシミュレーションし、実行結果を表示し、プログラムの解析や評価を行なうことができる。また、ロードモジュールをエミュレータ544に入力して、実際の応用システム上などで動作する、いわゆるインサーキットエミュレーションを行ない、マイクロコンピュータ全体としての、実動作の解析や評価を行なうことができる。更には、ロードモジュールをPROMライタ545に入力して、マイクロコンピュータ1のROM504が、フラッシュメモリのような電気的に書込み可能なメモリである場合に、かかるメモリに書込みを行なうことができる。このほかに、ライブラリアンとして、汎用的なサブルーチンなどを提供することもできる。   The load module can be input to the simulator debugger 543 to simulate the operation of the CPU on a system development apparatus such as a personal computer, display the execution result, and analyze and evaluate the program. Further, by inputting a load module into the emulator 544 and performing so-called in-circuit emulation that operates on an actual application system or the like, the actual operation of the microcomputer as a whole can be analyzed and evaluated. Furthermore, when the load module is input to the PROM writer 545 and the ROM 504 of the microcomputer 1 is an electrically writable memory such as a flash memory, the memory can be written. In addition, a general subroutine can be provided as a librarian.

図43は前記CPU502のシステム開発装置におけるCPU選択方法を例示する図面でもある。図43に基づいて説明した内容はCPU502のシステム開発装置のもそのまま当てはまる。CPUの選択方法としては、ウィンドウのドロップダウンメニューで選択可能にしてもよいし、ワークステーションなどであれば、Cシェルコマンドとして入力することもできる。更に、アセンブラやCコンパイラなどの、ソースプログラムの制御命令として、CPUの種類及び動作モードを入力することができる。   FIG. 43 is also a diagram illustrating a CPU selection method in the system development apparatus of the CPU 502. The contents described with reference to FIG. 43 also apply to the system development apparatus of the CPU 502 as it is. As a selection method of the CPU, the selection may be made by a drop-down menu of the window, or it may be input as a C shell command for a workstation or the like. Further, the CPU type and operation mode can be input as a control instruction of a source program such as an assembler or C compiler.

アセンブラは、選択されたCPUの種類及び動作モードに従って、入力されたアセンブリ言語ソースプログラム上の記述を解釈し、オブジェクトモジュールを生成したり、エラーがあればそれを表示したりする。既存の下位CPUを選択し、前記上位CPU502に存在して、既存CPUに存在しない命令(前記拡張命令)を記述するとエラーになる。命令コード自体はCPU502が包含しているから、このためのアセンブラ541を開発し、既存の下位CPUについては、上位CPU502に存在して、既存の下位CPUに存在しない命令を検出するような追加を行なうなどして、容易に共通化できる。既存の下位CPUについては、アセンブラが存在しているはずであるから、これを容易に改造して、前記上位CPU2に適用できることは言うまでもない。   The assembler interprets the description in the input assembly language source program according to the selected CPU type and operation mode, and generates an object module or displays it if there is an error. If an existing lower CPU is selected and an instruction (extended instruction) that exists in the upper CPU 502 and does not exist in the existing CPU is described, an error occurs. Since the instruction code itself is included in the CPU 502, an assembler 541 is developed for this purpose, and an existing lower CPU is added to detect an instruction that exists in the upper CPU 502 and does not exist in the existing lower CPU. It can be easily made common. Since there is an assembler for an existing lower CPU, it goes without saying that it can be easily modified and applied to the upper CPU 2.

Cコンパイラは、選択されたCPUの種類及び動作モードに従って、使用可能な、オペレーション、データサイズ、アドレッシングモードの組合せで示される命令や、汎用レジスタ、アドレス空間を判別して、C言語によるプログラムを、CPUの命令に変換し、アセンブリ言語プログラムやオブジェクトモジュールとして出力する。   According to the selected CPU type and operation mode, the C compiler discriminates instructions, general-purpose registers, and address spaces indicated by combinations of operations, data sizes, and addressing modes that can be used. It is converted into CPU instructions and output as an assembly language program or object module.

Cコンパイラ自体には、C言語によるプログラムを、CPUの命令に変換する機能の他、C++言語によるプログラムのコンパイルや、モジュール間最適化などといった、CPUの命令セットとは直接関係のない機能の向上が図られているが、CPU毎の個別のコンパイラでは、これらの機能向上を全ての個別のコンパイラに適用しなければならない。本発明のように、共通のCコンパイラ540としておけば、前記、CPUの命令セットとは直接関係のない機能向上を図ることが容易になり、また、開発効率などを向上することができる。   In addition to the function of converting C language programs into CPU instructions, the C compiler itself improves functions not directly related to the CPU instruction set, such as C ++ language program compilation and inter-module optimization. However, in an individual compiler for each CPU, these functional improvements must be applied to all the individual compilers. If the common C compiler 540 is used as in the present invention, it is easy to improve functions not directly related to the CPU instruction set, and to improve development efficiency.

シミュレータデバッガは、入力されたロードモジュールのプログラムを解釈して、CPUの動作をシミュレーションし、その中で、エラーがあればそれを表示したりする。例えば、既存の下位CPUを選択し、本発明のCPU502に存在して、既存CPUに存在しない命令を実行しようとするとエラーになる。命令コード及び命令実行機能自体は本発明のCPU502が包含しているから、このためのシミュレータデバッガ543を開発し、既存の下位CPUについては、本発明のCPU502に存在して、既存のCPUに存在しない命令を検出するような追加を行なうなどして、容易に共通化できる。既存のCPUについて、シミュレータデバッガが存在していれば、これを容易に改造して、本発明のCPU502に適用できることは言うまでもない。   The simulator debugger interprets the input load module program, simulates the operation of the CPU, and displays any errors in it. For example, if an existing lower CPU is selected and an instruction that exists in the CPU 502 of the present invention and does not exist in the existing CPU is executed, an error occurs. Since the instruction code and the instruction execution function itself are included in the CPU 502 of the present invention, a simulator debugger 543 is developed for this purpose, and the existing lower CPU exists in the CPU 502 of the present invention and exists in the existing CPU. It can be easily shared, for example, by adding an instruction that detects an instruction that is not to be executed. Needless to say, if an existing CPU has a simulator debugger, it can be easily modified and applied to the CPU 502 of the present invention.

図45は本発明に係るCPU502を有するマイクロコンピュータのためのエミュレータを示す図面でもある。図45において、エミュレーション用プロセッサ410は、マイクロコンピュータ部分にエミュレーション用インタフェースを加えて構成される。前記マイクロコンピュータ部分は、例えば図79のマイクロコンピュータ501の構成に相当される。例えば、システム開発装置427から入力されたプログラム(ロードモジュール)をエミュレーションメモリ421のユーザプログラム格納領域に転送し、内蔵ROM504上に配置されるべきかかるプログラムをCPU502がリードすると、エミュレーションメモリ421上のプログラムがリードされ、実行される。また、ブレーク条件や、リアルタイムトレース条件などもシステム開発装置427から与えることができる。   FIG. 45 is also a drawing showing an emulator for a microcomputer having a CPU 502 according to the present invention. In FIG. 45, an emulation processor 410 is configured by adding an emulation interface to the microcomputer portion. The microcomputer portion corresponds to, for example, the configuration of the microcomputer 501 in FIG. For example, when the program (load module) input from the system development device 427 is transferred to the user program storage area of the emulation memory 421 and the CPU 502 reads such a program to be placed on the internal ROM 504, the program on the emulation memory 421 is read. Is read and executed. In addition, a break condition, a real-time trace condition, and the like can be given from the system development device 427.

コントロールプロセッサ425は、応用システム412で本来使用するCPUの種類の選択を行うためのプログラムを、エミュレーションメモリ421のエミュレーションプログラム格納領域に格納する。CPU502は、かかるプログラムを、所定の条件でブレークした状態で、実行し、エミュレーション用の制御レジスタの設定を行なうことで、エミュレーション上の必要な設定を行なう。この場合は、エミュレーション用プログラムの実行モード、いわゆるブレークモードでのみライト可能にすると都合がよい。開発途上にあるユーザのソフトウェアの誤動作によって、誤った設定を行なってしまうことを抑止できる。また、制御レジスタを用いることによって、応用システム412で本来使用するCPUの種類の選択対象が増えたりしても、制御レジスタの構成のみを変更すればよく、エミュレーション用インタフェースを変更する必要がなく、エミュレータのハードウェアを変更しなくてよい。   The control processor 425 stores a program for selecting the type of CPU originally used in the application system 412 in the emulation program storage area of the emulation memory 421. The CPU 502 executes such a program in a state where the program is broken under a predetermined condition, and performs settings necessary for emulation by setting the control register for emulation. In this case, it is convenient to enable writing only in the execution mode of the emulation program, so-called break mode. It is possible to prevent erroneous setting due to malfunction of the software of the user who is still developing. Further, by using the control register, even if the number of CPU types to be originally used in the application system 412 increases, it is only necessary to change the configuration of the control register, and there is no need to change the emulation interface. There is no need to change the hardware of the emulator.

図99には前記マイクロコンピュータ501に対応されるエミュレーション用プロセッサのブロック図が示される。エミュレーション用プロセッサ50は、図79のマイクロコンピュータ501の部分(マイクロコンピュータコア571)と、エミュレーションインタフェース572から構成される。なお、図79のタイマや入出力ポートなどは、I/Oとして代表させ、また、内部バスの詳細とバスコントローラを図示している。なお、図79のタイマ506、パルス出力回路507、及び入出力ポートIOP1〜IOP5,IOPA〜IOPFなどは、I/O573、ユーザバッファ(ユーザBUF)574として代表させている。ユーザインタフェース576は前記I/O573、ユーザバッファ574、及び図示を省略する入出力バッファなどを含む、ユーザシステム(エミュレーション対象システムであるターゲットシステム)に接続されるインタフェース回路を総称する。   FIG. 99 is a block diagram of an emulation processor corresponding to the microcomputer 501. The emulation processor 50 includes a microcomputer 501 portion (microcomputer core 571) in FIG. 79 and an emulation interface 572. The timers and input / output ports of FIG. 79 are represented as I / O, and details of the internal bus and the bus controller are shown. Note that the timer 506, the pulse output circuit 507, the input / output ports IOP1 to IOP5, IOPA to IOPF, and the like in FIG. 79 are represented as an I / O 573 and a user buffer (user BUF) 574. The user interface 576 is a generic term for an interface circuit connected to a user system (a target system that is an emulation target system) including the I / O 573, the user buffer 574, an input / output buffer (not shown), and the like.

マイクロコンピュータコア571は、図79のマイクロコンピュータ501に対して未定義命令検出回路578が追加されている。エミュレーションインタフェース572は、制御レジスタ579を含む。制御レジスタ579は、ブレークモードでのみライト可能とされる。エミュレーションインタフェース572から入出力される信号は、アドレスバス、データバス、リード信号、ライト信号、データサイズ信号、命令フェッチ信号などバスの状態を表示するバスステータス信号、命令の実行開始を示す信号、割込み処理の実行開始を示す信号などのCPU502の実行状態を示すCPUステータス信号、などを含み、エミュレータによる、マイクロコンピュータの動作解析に使用される。   In the microcomputer core 571, an undefined instruction detection circuit 578 is added to the microcomputer 501 in FIG. The emulation interface 572 includes a control register 579. The control register 579 can be written only in the break mode. Signals input / output from the emulation interface 572 include a bus status signal indicating the state of the bus such as an address bus, a data bus, a read signal, a write signal, a data size signal, and an instruction fetch signal, a signal indicating the start of instruction execution, and an interrupt A CPU status signal indicating the execution state of the CPU 502, such as a signal indicating the start of processing execution, and the like are used for analyzing the operation of the microcomputer by the emulator.

未定義命令検出回路578は、CPU502に入力される命令コードを解析し、選択されているCPUの機能に存在しない命令が実行を開始したことを検出すると、CPU502にブレーク割込みを要求する。CPU502に何れの機能が選択されるかは、制御レジスタ579から指示される。例えば、既存の下位CPUの機能が選択されている場合には、レジスタグループフィールドを持つ前置命令コードを実行すると、未定義命令として検出される。具体的には、命令コードを前記LIR信号でラッチして、解析し、未定義と解読された場合、前記LID信号が発生した時点で、ブレーク割込みを要求するようにすればよく、容易である。   The undefined instruction detection circuit 578 analyzes the instruction code input to the CPU 502, and when it detects that an instruction that does not exist in the function of the selected CPU has started execution, it requests the CPU 502 to make a break interrupt. Which function is selected by the CPU 502 is instructed from the control register 579. For example, when the function of an existing lower CPU is selected, when a prefix instruction code having a register group field is executed, it is detected as an undefined instruction. Specifically, if the instruction code is latched with the LIR signal, analyzed, and decoded as undefined, it is easy to request a break interrupt when the LID signal is generated. .

エミュレーション用プロセッサ550は、前述の通り、上位CPU502を内蔵し、これを用いて、その他の下位CPUの代行をさせることができる。どれを選択するかはレジスタ579で指定すればよい。   As described above, the emulation processor 550 includes the upper CPU 502 and can be used as a substitute for other lower CPUs. Which one should be selected may be specified by the register 579.

いずれにせよ、エミュレーション用インタフェースを共通化しておけば、CPU乃至そのほかの機能ブロックが変更になった場合にも、エミュレータ側のハードウェアの変更をする必要がなく、エミュレーション用プロセッサ550のみを変更して、命令の動作を解析して表示する際の逆アセンブラに、いずれのCPUを対象にするかを指示すればよい。逆アセンブラに対する指示は、使用者がシステム開発装置から指定することもできるし、アセンブラからの入力情報によって、自動的に選択されるようなものであってもよい。これによってエミュレータの開発効率を向上し、エミュレータの開発環境を早く提供することができる。   In any case, if the emulation interface is shared, even if the CPU or other functional blocks are changed, it is not necessary to change the hardware on the emulator side, and only the emulation processor 550 is changed. Thus, it is only necessary to indicate which CPU is targeted for the disassembler when analyzing and displaying the operation of the instruction. The instruction to the disassembler can be designated by the user from the system development device, or can be automatically selected by input information from the assembler. This improves emulator development efficiency and provides an emulator development environment quickly.

図100には本発明の適用されたマイクロコンピュータ501をプリンタ制御に用いたマイクロコンピュータシステムが例示される。   FIG. 100 illustrates a microcomputer system using the microcomputer 501 to which the present invention is applied for printer control.

プリンタ制御システムは、マイクロコンピュータ501と、セントロニクスインタフェース(またはIEEE1284)やユニバーサルシリアルバス又はオプションなどの送受信回路(受信回路または送受信回路)580と、バッファRAM(DRAM)581と、キャラクタジェネレートROM(CGROM)582と、プログラムROM583と、印字制御回路584とを含み、これらがマイクロコンピュータの外部バス585を介して接続される。   The printer control system includes a microcomputer 501, a transmission / reception circuit (reception circuit or transmission / reception circuit) 580 such as a Centronics interface (or IEEE1284), a universal serial bus or an option, a buffer RAM (DRAM) 581, and a character generation ROM (CGROM). ), A program ROM 583, and a print control circuit 584, which are connected via an external bus 585 of the microcomputer.

外部バス585に接続されるアドレス空間は所定の大きさのエリアに分割されており、それぞれにバス仕様(バス幅、アクセスステート数、アドレスマルチプレクス、バースト動作など)を設定可能になっている。エリア毎のそのようなバス制御は、マイクロコンピュータ501に含まれる前記バスコントローラ510の外部バスコントローラが行なう。   The address space connected to the external bus 585 is divided into areas of a predetermined size, and bus specifications (bus width, number of access states, address multiplex, burst operation, etc.) can be set for each. Such bus control for each area is performed by an external bus controller of the bus controller 510 included in the microcomputer 501.

プログラムROM583はエリア0に、バッファRAM581はエリア2に、CGROM582はエリア6に、送受信回路580及び印字制御回路584はエリア7に接続される。バッファRAM581はリード/ライト可能なメモリであり、ダイナミック型メモリ故にリフレッシュ動作が必要であるが、安価であることが知られている。バッファRAM581についてはアドレス配置が記載されている。バッファRAM581は2MB(16Mビット)の記憶容量を有し、1MバイトをCPU502の作業領域に、残りを512kBずつのリングバッファとされる。   The program ROM 583 is connected to area 0, the buffer RAM 581 is connected to area 2, the CGROM 582 is connected to area 6, and the transmission / reception circuit 580 and the print control circuit 584 are connected to area 7. The buffer RAM 581 is a readable / writable memory and requires a refresh operation because of a dynamic memory, but is known to be inexpensive. The buffer RAM 581 describes the address arrangement. The buffer RAM 581 has a storage capacity of 2 MB (16 Mbits), and 1 Mbyte is used as a work buffer for the CPU 502, and the remaining is a 512 kB ring buffer.

また、本システムは、更に、ラインフィードモータ590、キャリッジリターンモータ591を含み、これらのモータ590、591は、それぞれタイマ506の出力、パルス出力装置507の出力がバッファ回路92を介して与えられることによって制御される。ラインフィードモータ590、キャリッジリターンモータ591は、特に制限はされないものの、ステッピングモータである。   The system further includes a line feed motor 590 and a carriage return motor 591. These motors 590 and 591 are provided with an output of a timer 506 and an output of a pulse output device 507 via a buffer circuit 92, respectively. Controlled by. The line feed motor 590 and the carriage return motor 591 are stepping motors although not particularly limited.

マイクロコンピュータ501に内蔵されているDMAC511は、印字データの出力、ラインフィードモータ590、キャリッジリターンモータ591を駆動するパルス出力を行う。また、DMAC511はSCI508の送信データ、受信データの転送制御を行なう。   The DMAC 511 built in the microcomputer 501 outputs print data, and outputs a pulse for driving the line feed motor 590 and the carriage return motor 591. The DMAC 511 controls transfer of SCI 508 transmission data and reception data.

図示はされないものの、SCI508はホストなどとの通信に使用し、A/D変換器509は紙枚数などのセンサ情報を入力する。   Although not shown, the SCI 508 is used for communication with a host or the like, and the A / D converter 509 inputs sensor information such as the number of sheets.

EXDMAC512はセントロニクスインタフェースやユニバーサルシリアルバスなどの複数の送受信回路580によるデータの受信を、CPU502の動作と並行して行う。EXDREQ入力に転送要求信号を入力し、転送時には、EXDACK出力によって、シングルアドレス転送を行うことができる。例えば、セントロニクスインタフェースのインプットストローブ信号をEXDREQ0に入力し、チャネル0でデュアルアドレス転送を行い、オプションインタフェースの受信信号をEXDREQ1に入力し、EXDACK1出力を、オプションインタフェースに与えて、チャネル1でシングルアドレス転送を行う。   The EXDMAC 512 receives data by a plurality of transmission / reception circuits 580 such as a Centronics interface and a universal serial bus in parallel with the operation of the CPU 502. A transfer request signal is input to the EXDREQ input, and at the time of transfer, single address transfer can be performed by EXDACK output. For example, input strobe signal of Centronics interface is input to EXDREQ0, dual address transfer is performed on channel 0, reception signal of option interface is input to EXDREQ1, EXDACK1 output is given to option interface, and single address transfer is performed on channel 1 I do.

EXDAMC512は、デスティネーションまたはソースの一方を、アドレス空間上のメモリや内部I/Oレジスタではなく、EXDMAC512のデータレジスタとすることができる。この選択は、EXDMAC512の制御レジスタの所定の制御ビットで行なうようにする。   The EXDAMC 512 can use either the destination or the source as a data register of the EXDMAC 512 instead of a memory or an internal I / O register in the address space. This selection is performed by a predetermined control bit of the control register of the EXDMAC 512.

実質的なデータ転送に先立って、パケットコマンドなどの転送情報を、EXDMAC512のデータレジスタに転送する。CPU502は、この情報を解析し、例えば、前回のデータ転送と連続して受信すればよい場合には、デスティネーションをメモリとするように設定して、転送カウントレジスタを設定して、起動をかければよい。   Prior to substantial data transfer, transfer information such as a packet command is transferred to the data register of the EXDMAC 512. The CPU 502 analyzes this information and, for example, if it only needs to be received continuously with the previous data transfer, set the destination as the memory, set the transfer count register, and start up. That's fine.

かかる情報の解析に当たっては、例えば、転送情報が16バイトである場合、「MOVM.L @EXD0DR0,ER0−3」を実行して、汎用レジスタに転送情報を格納して、解析を行なうことができる。なお、EXD0DR0は、EXDMAC512のチャネル0のデータレジスタの先頭アドレスを示すラベルである。前記MOVM命令では、絶対アドレスのアドレッシングモードを用いて、固有のアドレスを容易にアクセスできる。また、EXDMAC512のデータレジスタを使用せず、バッファRAM581上に転送情報が格納されている場合には、「MOV.L @EXDAR0,ER4、MOVM.L @−ER4,ER0−3」とすればよい。EXDAR0は、チャネル0のデスティネーションアドレスレジスタのラベルである。デスティネーションアドレスレジスタは次のデータ転送のデスティネーションとなるアドレスを示している。この内容を汎用レジスタER4に格納し、プリデクリメントレジスタ間接のアドレッシングモードを用いている。間接的にアドレスを扱うことにより、メモリ上の固定されていないアドレスも容易にアクセスできる。   In analyzing the information, for example, when the transfer information is 16 bytes, the transfer information can be stored in a general-purpose register by executing “MOVM.L @ EXD0DR0, ER0-3”. . Note that EXD0DR0 is a label indicating the start address of the data register of channel 0 of EXDMAC 512. In the MOVM instruction, a unique address can be easily accessed using an absolute addressing mode. If transfer data is stored in the buffer RAM 581 without using the EXDMAC 512 data register, “MOV.L @ EXDAR0, ER4, MOVM.L @ -ER4, ER0-3” may be used. . EXDAR0 is the label of the destination address register of channel 0. The destination address register indicates an address to be a destination for the next data transfer. The contents are stored in the general-purpose register ER4, and the pre-decrement register indirect addressing mode is used. By indirectly handling the address, an unfixed address on the memory can be easily accessed.

また、バッファRAM581のリードを連続して行なうから、バッファRAM581の高速ページモードなどを有効に利用して、高速化を図ることができる。   Further, since the buffer RAM 581 is continuously read, the high speed page mode of the buffer RAM 581 and the like can be effectively used to increase the speed.

転送情報の汎用レジスタへの格納を高速に行い、汎用レジスタ上で解析を行なうことによって、転送情報の受信から、転送情報に基づく処理の開始までの時間を短縮できる。ひいてはシステムの高速化に寄与できる。   By storing the transfer information in the general-purpose register at high speed and performing analysis on the general-purpose register, it is possible to shorten the time from reception of the transfer information to the start of processing based on the transfer information. As a result, it can contribute to speeding up the system.

上記システムにおいては、ホスト側からプリンタのステータスをリードするような場合は、チャネル2のEXD2DRにCPU502がステータスを随時書込んでおくようにし、EXDREQ2入力に従って、送受信回路580へ出力し、送受信回路580からホストへ転送するようにすることができる。この場合も、設定すべきデータが多ければ、MOVM命令を用いて、EXD2DRの設定を行なうことができる。   In the above system, when the printer status is read from the host side, the CPU 502 writes the status to the EXD2DR of channel 2 as needed, and outputs the status to the transmission / reception circuit 580 in accordance with the EXDREQ2 input. To the host. Also in this case, if there is a lot of data to be set, EXD2DR can be set using the MOVM instruction.

例えば、CPU502は、転送情報待ちを示すステータスをEXD2DR0〜7に設定しておく。ホストから、パケットコマンドの転送情報を受信すると、ビジーステータスをEXD2DR0〜7に設定し、転送情報の解析が終了し、EXDMAC512の設定が完了すると、データ受信待ちを示すステータスをEXD2DR0〜7に設定するようにする。ホストは、随時、ステータスを確認しつつ、転送情報やデータを送信するようにすればよい。   For example, the CPU 502 sets a status indicating waiting for transfer information to EXD2DR0-7. When the transfer information of the packet command is received from the host, the busy status is set to EXD2DR0-7, the analysis of the transfer information is finished, and when the setting of EXDMAC 512 is completed, the status indicating data reception waiting is set to EXD2DR0-7. Like that. The host may transmit the transfer information and data while checking the status as needed.

バッファRAM581上の印刷データを操作することもできる。各種のアドレッシングモードの複数レジスタ転送命令(MOVM)を用いて、高速化することができる。複数レジスタ転送命令で、バス権移譲を禁止することによって、そのほかのバスマスタであるDMAC511やEXDMAC512のデータ転送との競合による不所望のデータ変化を抑止できる。   Print data on the buffer RAM 581 can also be manipulated. The speed can be increased by using a multiple register transfer instruction (MOVM) in various addressing modes. By prohibiting the transfer of the bus right with a multiple register transfer instruction, it is possible to suppress an undesired data change due to a conflict with the data transfer of the other DMACs 511 and EXDMAC 512.

なお、半導体集積回路の集積度の向上によって、オプション以外の受信回路の一部や、印字制御回路584などを1個の半導体集積回路に集積することができる。更に、バッファRAM581などの汎用的なメモリも1個の半導体集積回路に集積することができる。プログラムROM583やCGROM582などのように個別のプリンタの機種など、マイクロコンピュータシステム毎に変更になるものは、個別の半導体集積回路にする方が都合よい。   Note that, by improving the integration degree of the semiconductor integrated circuit, a part of the receiving circuit other than the option, the print control circuit 584, and the like can be integrated into one semiconductor integrated circuit. Further, a general-purpose memory such as the buffer RAM 581 can be integrated in one semiconductor integrated circuit. What is changed for each microcomputer system, such as the model of an individual printer, such as the program ROM 583 and the CGROM 582, is more preferably an individual semiconductor integrated circuit.

以上説明した図79のマイクロコンピュータ及びデータ処理システムによれば以下の作用効果を得ることができる。   According to the microcomputer and data processing system of FIG. 79 described above, the following operational effects can be obtained.

〔1〕単一の命令で、複数の汎用レジスタとメモリ間、又は複数の汎用レジスタ相互間で転送を行なうことによって、相対的に、命令コードのリード回数を低減して、高速化することができる。また、データのリード/ライトを連続して行なうことによって、外部メモリに対するバースト動作などを有効に利用できる。複数のバスマスタが、データを処理する場合に、データアクセス時にバス権を移譲することを禁止して、不所望のデータの競合を回避することができる。   [1] By transferring data between a plurality of general-purpose registers and memories or between a plurality of general-purpose registers with a single instruction, the number of instruction code reads can be relatively reduced and speeded up. it can. Further, by continuously reading / writing data, a burst operation for an external memory can be used effectively. When a plurality of bus masters process data, it is prohibited to transfer the bus right at the time of data access, thereby avoiding undesired data conflicts.

上記転送命令の実効アドレスの計算は、1回のみ行なうようにし、アドレスバッファABにインクリメント(またはデクリメント)機能とインクリメント(またはデクリメント)結果を保持する機能を備えることによって、命令動作を単純にし、転送命令の為の多くの制御を既存の転送命令と共通化を図ることができ、命令デコーダDECの論理的な規模の増加を最小限にすることができる。実効アドレスの計算の回数を低減して、高速化を図ることができる。また、種々のアドレッシングモードを共通に利用することができ、論理的規模の増加を最小限にすることができる。   The effective address of the transfer instruction is calculated only once, and the address buffer AB has an increment (or decrement) function and a function to hold the increment (or decrement) result, thereby simplifying the instruction operation and transferring Many controls for instructions can be shared with existing transfer instructions, and an increase in the logical scale of the instruction decoder DEC can be minimized. Speeding up can be achieved by reducing the number of effective address calculations. In addition, various addressing modes can be used in common, and an increase in logical scale can be minimized.

複数レジスタ転送命令においてレジスタの本数の異なる命令を複数命令サポートすることによって、また、ワードサイズとロングワードサイズなど、データサイズの異なる命令を複数命令サポートすることによって、プログラムの作成を容易にし、マイクロコンピュータの使い勝手を向上することができる。   By supporting multiple instructions with different numbers of registers in multiple register transfer instructions, and supporting multiple instructions with different data sizes such as word size and longword size, program creation is easy. Usability of the computer can be improved.

汎用レジスタのみをCPUが直接処理可能なアーキテクチャにあっては、汎用レジスタとメモリとの転送を高速化して、処理速度を大きく向上することできる。   In an architecture in which only the general-purpose registers can be processed directly by the CPU, the processing speed can be greatly improved by speeding up the transfer between the general-purpose registers and the memory.

複数の汎用レジスタの組み合わせを固定的にした、複数の汎用レジスタと、アドレス空間上のアドレス(メモリ)との間の転送命令を備えることによって、汎用レジスタのビット長より大きいデータであっても、容易に扱うことができ、マイクロコンピュータの使い勝手を向上するとともに、データのリード/ライトに対して、命令のリードの頻度を低減して、データ処理の高速化を図ることができる。   By providing a transfer instruction between a plurality of general-purpose registers and an address (memory) in the address space with a combination of a plurality of general-purpose registers fixed, even if the data is larger than the bit length of the general-purpose register, It can be handled easily, improves the usability of the microcomputer, and reduces the frequency of instruction read for data read / write, thereby speeding up data processing.

複数レジスタの転送を指示する命令コードと、既存の単一の汎用レジスタの転送命令の命令コードを組合せて、複数の汎用レジスタの転送命令を実現することにより、既存のCPUであっても、命令の追加を容易にすることができる。   Even if it is an existing CPU, the instruction code for instructing the transfer of multiple registers and the instruction code of the transfer instruction of an existing single general-purpose register are combined to realize a transfer instruction for multiple general-purpose registers. Can be easily added.

〔2〕汎用レジスタが分割可能で、かつ分割した部分に機能上の相違がある場合などには、汎用レジスタ全体を使用する転送命令と、分割された一部分を使用する転送命令とを備えることにより、使用し易い汎用レジスタとの転送ができるから、その処理を容易にし、高速化することができる。   [2] When the general-purpose register can be divided and there is a functional difference between the divided parts, a transfer instruction that uses the entire general-purpose register and a transfer instruction that uses the divided part are provided. Since it can be transferred to a general-purpose register that is easy to use, the processing can be facilitated and speeded up.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPU、または、汎用レジスタのビット長の長いCPUと、汎用レジスタのビット長の短いCPUが存在する場合には、後者のCPUにも無駄なく利用可能な転送命令を提供できる。   If there is a CPU with a wide address space and a CPU with a small address space, or a CPU with a long general register bit length and a CPU with a short general register bit length, while maintaining compatibility at the object level, the latter A transfer instruction that can be used without waste to the CPU can also be provided.

〔3〕前置命令コードで、レジスタグループを指定し、この前置命令コードを省略可能とし、更には前置命令コードを付加しない場合の命令コードを既存のCPUの命令コードと同一とすることにより、互換性を損なわずに、汎用レジスタを増加させることができる。   [3] A register group is specified by a prefix instruction code, the prefix instruction code can be omitted, and the instruction code when no prefix instruction code is added is the same as the instruction code of an existing CPU. Thus, the number of general-purpose registers can be increased without impairing compatibility.

暗黙的に指定可能な汎用レジスタ(既存の汎用レジスタ)をのみを使用していれば、省略可能のワードを省略できるから、命令コードを増加させることがない(少なくとも従来同等の汎用レジスタを使用する場合は、従来同等の命令コードでよい)。命令コードを増加させないことよって、処理速度を低下させることがない。   If only the implicitly specifiable general-purpose registers (existing general-purpose registers) are used, the optional word can be omitted, so the instruction code is not increased (at least the conventional general-purpose registers are used) In this case, the same instruction code may be used). By not increasing the instruction code, the processing speed is not reduced.

前記省略可能なワードを付加することによって、命令によって直接汎用レジスタの全てを選択できるから、プログラムの容易性を損う部分が少ない。また、任意の量の汎用レジスタの一部を、所望のタスク毎や所望の割込み処理などに確保しておく(他のタスクや処理では使用しない)ことによって、前記タスクや割込み処理において汎用レジスタを待避したりする必要がなく、高速化が図られる。また、前記タスクや割込み処理に確保する汎用レジスタ数は任意にできるから、タスクや処理の間で、使用する汎用レジスタを相互に融通し合うことも容易である。   By adding the omissible word, all of the general-purpose registers can be directly selected by an instruction, so that there are few parts that impair the ease of programming. In addition, by securing a part of an arbitrary amount of general-purpose registers for each desired task or desired interrupt processing (not used for other tasks or processing), the general-purpose registers can be set in the task or interrupt processing. There is no need to evacuate and speed up is achieved. In addition, since the number of general-purpose registers reserved for the task and interrupt processing can be arbitrarily set, it is easy to interchange the general-purpose registers to be used between tasks and processing.

前記ワードを付加することによって、指定できる汎用レジスタのアクセスは、RAMなどのメモリのアクセスより、一般に高速にできるから、汎用レジスタ数を増加するとともに、複数の汎用レジスタの転送命令によって、複数の汎用レジスタとメモリとの転送を高速に実行可能にすることにより、CPUの処理速度を向上できる。また、いわゆるロードストア型の命令セットを持ち、メモリの内容に対して直接演算できないようなプロセッサについては、直接処理できるデータ量を増加でき、また、メモリのアクセスを高速化することができ、処理速度を向上することができる。   The general-purpose register that can be specified by adding the word can be accessed at a higher speed than the access of the memory such as the RAM. The processing speed of the CPU can be improved by enabling transfer between the register and the memory at high speed. For processors that have a so-called load store type instruction set and cannot directly operate on the memory contents, the amount of data that can be directly processed can be increased, and the memory access speed can be increased. Speed can be improved.

複数レジスタ転送命令で指定できる汎用レジスタを増加する場合には容易に対処できる。   When the number of general-purpose registers that can be specified by a multiple register transfer instruction is increased, it can be easily handled.

〔4〕オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUにおいて、アドレス空間に対応するサイズ(例えば32ビット、MOVM.L命令)の汎用レジスタに対する上記転送命令と、アドレス空間の小さいCPUのアドレス空間に対応するサイズ(例えば16ビット、MOVM.W命令)の汎用レジスタに対する上記転送命令とを備えることによって、後者のサイズの上記転送命令を、下位互換性をもつ、アドレス空間の小さいCPUでも容易に実現可能にできる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUでも複数汎用レジスタの転送命令を実現可能にできる。   [4] When there is a CPU having a wide address space and a CPU having a small address space while maintaining compatibility at the object level, a size corresponding to the address space (for example, 32 bits, MOVM. L instruction) for the general-purpose register and the transfer instruction for the general-purpose register of a size (for example, 16 bits, MOVM.W instruction) corresponding to the address space of the CPU having a small address space. The above transfer instruction can be easily realized even by a CPU having a backward compatibility and a small address space. In other words, by using the same method, it is possible to realize a transfer instruction for a plurality of general-purpose registers even with a CPU having a large address space and a CPU having a small address space while maintaining compatibility at the object level.

ソースプログラムレベルまたはオブジェクトプログラムレベルで、既存のCPUの命令セットを包含した上で、上記命令を追加することによって、ソフトウェア資産を有効に利用することができ、使用者のソフトウェア開発効率を向上することができる。ソースプログラムレベルまたはオブジェクトプログラムレベルで互換性を保つことによる利点と前記転送命令を追加することの利点の双方を享受することができる。   By including the instruction set of the existing CPU at the source program level or the object program level and adding the above instructions, the software assets can be used effectively, and the software development efficiency of the user is improved. Can do. Both of the advantages of maintaining compatibility at the source program level or the object program level and the advantages of adding the transfer instruction can be enjoyed.

〔5〕既存のCPUと、ソフトウェア開発装置を共通に利用可能にし、CPUを選択する手段を設けることによって、使用者の不所望の費用を抑止できる。また、Cコンパイラなどは共通に機能向上などを行うことが可能であるから、ソフトウェア開発装置の開発効率を向上することができる。開発効率を向上することによって、開発に必要な資源を削減し、削減した資源を以って、機能向上に振り当てることも可能になる。   [5] By making the existing CPU and the software development apparatus available in common and providing a means for selecting the CPU, it is possible to suppress undesired costs of the user. Further, since the C compiler and the like can improve the functions in common, the development efficiency of the software development apparatus can be improved. By improving the development efficiency, it is possible to reduce the resources required for development, and use the reduced resources to allocate functions.

既存のCPUと、エミュレーション用インタフェースを共通化し、ひいては、同じエミュレータのハードウェアを共有できる。エミュレーション用インタフェースを共通化したり、エミュレータのハードウェアを共通化することによって、開発環境を早く整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   The existing CPU and the emulation interface can be shared, and the same emulator hardware can be shared. By making the interface for emulation common and the hardware of the emulator in common, the development environment can be quickly prepared, and the resources necessary for emulator development can be minimized.

前記検討課題Eの解決手段に関する発明の実施の形態は一例であり、その要旨を逸しない範囲において種々変更可能である。   The embodiment of the invention relating to the means for solving the examination subject E is merely an example, and various modifications can be made without departing from the scope of the invention.

例えば、CPUの命令セットやレジスタ構成、アドレス空間は変更可能である。CPUのアーキテクチャもロードストアアーキテクチャに限定されない。但し、アドレス空間上の大部分より、高速に利用できるレジスタ手段を持っていることが望ましい。また、複数レジスタの転送命令の詳細な仕様についても種々変更可能である。データサイズとしては、バイトサイズを持ってもよい。CPUの論理的な構成、複数レジスタの転送命令の論理的な実現方法についても種々変更可能である。アドレスバッファはインクリメントではなく、デクリメント機能を持つようにし、アドレスの大きい方からアクセスするようにしてもよい。さらに、内部バス幅や内部バス構成なども変更可能である。さらにまた、互換性を維持すべきCPUは、アドレス空間や汎用レジスタの本数が異なるほか、命令の種類とアドレッシングモード及びデータのサイズで定義されるような命令セットが異なるようなものであってもよい。   For example, the CPU instruction set, register configuration, and address space can be changed. The CPU architecture is not limited to the load store architecture. However, it is desirable to have register means that can be used at a higher speed than most of the address space. The detailed specifications of the transfer instruction of a plurality of registers can be variously changed. The data size may have a byte size. Various modifications can be made to the logical configuration of the CPU and the logical implementation method of the transfer instruction of the plurality of registers. The address buffer may have a decrement function instead of increment, and may be accessed from the larger address. Furthermore, the internal bus width, internal bus configuration, and the like can be changed. Furthermore, CPUs that should maintain compatibility may differ in address space and the number of general-purpose registers, and may have different instruction sets as defined by instruction type, addressing mode, and data size. Good.

マイクロコンピュータのその他の機能ブロックについても何等制約されない。データ処理システムである応用分野もプリンタに限定されない。前記EXDMACなどは好適な例として示されているもので、種々変更可能であることは言うまでもない。   There are no restrictions on other functional blocks of the microcomputer. An application field that is a data processing system is not limited to a printer. The EXDMAC and the like are shown as preferred examples, and needless to say, various changes can be made.

以上の説明では主として本発明者によってなされた発明をその背景となった利用分野であるシングルチップマイクロコンピュータに適用した場合について説明したが、それに限定されるものではなく、CPU及びDRAM等を搭載したシステムLSI、システム・オン・チップ化されたVLSI等のデータ処理装置に広く適用可能である。本発明は少なくとも、命令を解読して処理し、演算処理を行なうデータ処理装置に適用することができる。   In the above description, the case where the invention made mainly by the present inventor is applied to the single chip microcomputer which is the field of use behind the invention has been described. The present invention can be widely applied to data processing apparatuses such as system LSIs and system-on-chip VLSIs. The present invention can be applied to at least a data processing apparatus that decodes and processes instructions and performs arithmetic processing.

《検討課題Aに関する発明の効果》
検討課題Aに関する発明の効果は以下の通りである。すなわち、汎用レジスタを指定するレジスタ指定フィールドを、2つの部分に分割し、この2つの部分を命令コードの基本単位上の別のワードに配置するとともに、一方のワードを省略可能とし、省略可能なワードを省略すると、暗黙的な指定が行われるようにする。また、省略可能なワードには、レジスタ指定フィールドの一部のみを持つようにし、演算の種類などは指定しないようにする。したがって、暗黙的に指定可能な汎用レジスタのみを使用していれば、省略可能のワードを省略できるから、命令コードを増加させることがなく、命令コードを増加させないことよって、処理速度を低下させることがない。
<< Effects of Invention on Examination A >>
The effects of the invention relating to the examination subject A are as follows. That is, the register specification field for specifying the general-purpose register is divided into two parts, these two parts are arranged in different words on the basic unit of the instruction code, and one word can be omitted, and can be omitted. If the word is omitted, an implicit specification is made. The optional word has only a part of the register specification field, and does not specify the type of operation. Therefore, if only general-purpose registers that can be specified implicitly are used, omissible words can be omitted, so the instruction code is not increased and the instruction code is not increased, thereby reducing the processing speed. There is no.

前記省略可能なワードを付加することによって、命令によって直接汎用レジスタの全てを選択できるから、プロラムの容易性を損うことがない。また、任意の量の汎用レジスタの一部を、所望のタスク毎や所望の割込み処理などに確保しておく(他のタスクや処理では使用しない)ことによって、前記タスクや割込み処理において汎用レジスタを待避したりする必要がなく、高速化が図れる。更に、前記タスクや割込み処理に確保する汎用レジスタ数は任意にできるから、タスクや処理の間で、使用する汎用レジスタを相互に融通し合うことも容易になる。   By adding the omissible word, all of the general-purpose registers can be directly selected by an instruction, so that the programability is not impaired. In addition, by securing a part of an arbitrary amount of general-purpose registers for each desired task or desired interrupt processing (not used in other tasks or processing), the general-purpose registers can be set in the task or interrupt processing. There is no need to evacuate and speed up can be achieved. Furthermore, since the number of general-purpose registers reserved for the task and interrupt processing can be arbitrarily set, it is easy to interchange general-purpose registers to be used between tasks and processing.

前記ワードを付加することによって、指定できる汎用レジスタのアクセスは、RAM等のメモリのアクセスより、一般に高速にできるから、汎用レジスタ数を増加することにより、高速に処理できるデータ量を増加させ、ひいてはCPUの処理速度を向上できる。また、いわゆるロードストア型の命令セットを持ち、メモリの内容に対して直接演算できないようなプロセッサについては、汎用レジスタを増加することにより、直接処理できるデータ量を増加でき、また、メモリのアクセス頻度を低減することができ、処理速度を向上することができる。   By adding the word, a general-purpose register that can be specified can be accessed generally faster than a memory such as a RAM. Therefore, by increasing the number of general-purpose registers, the amount of data that can be processed at a high speed is increased. The processing speed of the CPU can be improved. For processors that have a so-called load / store type instruction set and cannot directly operate on the contents of memory, the amount of data that can be directly processed can be increased by increasing the number of general-purpose registers. Can be reduced, and the processing speed can be improved.

《検討課題Bに関する発明の効果》
検討課題Bに関する発明の効果は以下の通りである。すなわち、既存の、メモリ・レジスタ間の転送命令コードの単数または複数、そしてレジスタ・レジスタ間の演算命令コードの内、複数の命令コードを組合せ、これに前置命令コードを前置結合する。前記前置命令コードに結合されたメモリ・レジスタ間転送命令のコードを実行する場合は、汎用レジスタではなく、CPU内の、テンポラリレジスタの様な、プログラム上解放されていない(換言すれば命令コードには明示されていない)ラッチ手段とメモリとの間でデータ転送を行なう。更に、前記前置命令コードに結合されたレジスタ・レジスタ間の演算命令のコードを引き続き実行する場合は、演算対象の内の単数または複数のデータを前記ラッチ手段から読み出すようにする。その演算結果をメモリに格納する場合には、前記転送命令のコードを実行したときに使用したメモリのアドレスを、別のラッチ手段に格納し、上記演算命令の演算結果を前記ラッチ手段に格納するとともに、メモリ・レジスタ間の転送命令のコードを自ら生成し(即ち、プログラムに明示されていなくても生成し)、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。
<< Effects of Invention Regarding Examination Problem B >>
The effects of the invention relating to the examination subject B are as follows. In other words, one or a plurality of existing instruction codes for transfer between memory and registers, and a plurality of instruction codes among arithmetic instruction codes between registers and registers are combined, and a pre-instruction code is pre-coupled thereto. When executing the memory-register transfer instruction code combined with the prefix instruction code, it is not a general-purpose register, but is not released in the program like the temporary register in the CPU (in other words, the instruction code Data transfer is performed between the latch means and the memory. Further, when the operation instruction code between the register and the register coupled to the prefix instruction code is to be continuously executed, one or a plurality of data in the operation object is read from the latch means. When storing the operation result in the memory, the memory address used when the code of the transfer instruction is executed is stored in another latch means, and the operation result of the operation instruction is stored in the latch means. In addition, the code for the transfer instruction between the memory and the register is generated by itself (that is, generated even if it is not explicitly specified in the program), and the latch is stored with the operation result by using the content of the latch means storing the address as the address. The contents of the means are written as data into the memory.

このとき、データ処理装置にとって、メモリ・レジスタ間の転送命令、レジスタ・レジスタ間の演算命令の命令コードは既存のものであるから、それら命令コード単独の実行では従来同様に動作し、既存の命令実行を阻害しない。したがって、既存の命令のみを使用している既存のソフトウェア資産を有効に利用できる。データ処理装置は、ソフトウェア資産に関する上位互換を維持して、機能向上を実現できる。   At this time, since the instruction code of the transfer instruction between the memory and the register and the operation instruction between the register and the register are already existing for the data processing apparatus, the execution of the instruction code alone operates in the same manner as in the past. Does not impede execution. Therefore, existing software assets that use only existing instructions can be effectively used. The data processing apparatus can achieve functional improvement while maintaining upward compatibility with respect to software assets.

また、既存の汎用レジスタ或いはロード・ストア・アーキテクチャのメリットを保持し、前記前置命令コードは、アドレッシングモードや演算の内容によらず共通に使用できるから、追加する命令コードを最低限にすることができる。   In addition, it retains the merits of existing general-purpose registers or load / store architecture, and the prefixed instruction code can be used in common regardless of the addressing mode and the contents of the operation. Can do.

メモリからラッチ手段へのデータ読み込み、演算、ラッチ手段の内容に基づくメモリへのライト動作の指示は、既存の命令に対して、使用するレジスタが相違なるのみであるから、既存の命令動作を大きく変更することなく、利用できる。   Instructions for reading data from the memory to the latch means, operations, and write operations to the memory based on the contents of the latch means are different from the existing instructions only in the registers used. Can be used without change.

これによって、設計資産を有効に利用し、メモリ上のデータへの演算を可能にすることによる論理規模の増加を最小限にすることができる。   As a result, it is possible to minimize the increase in the logical scale due to the effective use of the design assets and the operation on the data on the memory.

メモリ上のデータを演算可能とすることによって、直接処理できるデータ量を増加でき、また、汎用レジスタの退避/復帰などを省くことができ、処理速度を向上することができる。   By making the data in the memory operable, the amount of data that can be directly processed can be increased, saving / restoring of general purpose registers can be omitted, and the processing speed can be improved.

オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の小さいCPUが存在する場合には、アドレス空間の広いCPUで、前記ワードを付加し、存在する転送命令、演算命令を組合せることによって、下位互換性をもつ、アドレス空間の小さいCPUでもメモリ上のデータを直接的に演算可能にすることができる。換言すれば、同一の方法で、オブジェクトレベルで互換性を保ちつつ、アドレス空間の広いCPUとアドレス空間の狭いCPUでもメモリ上のデータを直接的に演算可能にすることができる。   When there is a CPU with a wide address space and a CPU with a small address space while maintaining compatibility at the object level, the CPU adds a word and combines existing transfer instructions and arithmetic instructions with a CPU with a wide address space. As a result, it is possible to directly calculate data on the memory even with a CPU having a low compatibility and a small address space. In other words, by using the same method, while maintaining compatibility at the object level, it is possible to directly calculate data on the memory even with a CPU having a wide address space and a CPU having a narrow address space.

オブジェクトレベルで互換性を保つことによる利点とメモリ上のデータを直接的に演算可能にすることの利点の双方を享受することができる。   It is possible to enjoy both the advantages of maintaining compatibility at the object level and the advantages of allowing the data on the memory to be directly operated.

既存の命令を組合せ、新規の命令機能を実現しているので、将来的な機能拡張や高速化に対する余裕を、既存のCPUと同等程度に保持できる。   Since a new instruction function is realized by combining existing instructions, a margin for future function expansion and speeding up can be maintained at the same level as an existing CPU.

また、既存のCPUとエミュレーション用インタフェースを共通化することができ、ひいては、同じエミュレータのハードウェアを共有できる。エミュレータのハードウェアを共通化することによって、早く開発環境を整えることができ、また、エミュレータの開発に必要な資源を最小限にすることができる。   In addition, the existing CPU and the emulation interface can be shared, so that the hardware of the same emulator can be shared. By making the emulator hardware common, it is possible to quickly establish a development environment and minimize the resources required for emulator development.

《検討課題Cに関する発明の効果》
検討課題Cに関する発明の効果は以下の通りである。すなわち、レジスタ構成、命令とアドレッシングモードの組合せ等の点で、一方が他方を包含しないような異なる命令セットを含む複数のデータ処理装置例えばCPUを提供することにより、各種適用分野のソフトウェア上の要求に応えたり、利用者の様々な好みに応えたり、別のCPUのアセンブリ言語によるプログラムからも比較的近い命令セットCPUを選択可能でき、機能を向上したCPUへの移行を容易化することができる。
<< Effects of Invention on Examination Problem C >>
The effects of the invention relating to the examination subject C are as follows. That is, by providing a plurality of data processing devices, for example, CPUs including different instruction sets such that one does not include the other in terms of register configuration, combinations of instructions and addressing modes, etc., software requirements in various application fields It is possible to select an instruction set CPU that is relatively close to other CPU assembly language programs in response to various user preferences, and to facilitate the transition to a CPU with improved functions. .

前記の、一方が他方の命令セットを包含しない、複数のCPUに対して、いずれのCPUをも包含する命令セットを持った上位のCPUを準備することによって、ソフトウェア資産の有効利用を可能にしつつ、性能/機能の向上したCPUを用意することができる。ソフトウェア資産の有効利用によって、使用者のソフトウェア開発の開発効率を向上することができる。   While preparing an upper CPU having an instruction set that includes any CPU for a plurality of CPUs, one of which does not include the instruction set of the other, enabling effective use of software assets A CPU with improved performance / function can be prepared. Effective utilization of software assets can improve the development efficiency of software development for users.

上位CPUは、有効なアドレスのビット数と、ベクタ及びスタックの単位サイズ、或いは実効アドレスの計算方法を、切り替える動作モード、例えばマキシマムモード、準マキシマムモードとミニマムモードを用意しておくことによって、メモリの使用方法も含めて上位互換とすることができる。   The host CPU prepares an operation mode for switching the number of effective address bits, vector and stack unit sizes, or effective address calculation methods, for example, a maximum mode, a quasi-maximum mode, and a minimum mode. It is possible to make it upward compatible, including how to use.

開発に当たっては、既存のCPU(下位CPUになるCPU)に対して、汎用レジスタを拡張し、命令とアドレッシングモードの組合せを拡張した上位のCPUを開発する。下位CPUは上位CPUの命令セットのサブセットを持つことになる。これにより、上位CPUの論理的規模の増大を最小限にしつつ、性能・機能・使い勝手などを向上することができると共に、前記別の下位CPUの開発を容易にし、開発効率を向上できる。前記上位CPUの、更に上位のCPUを開発する場合には、前記上位のCPUに対する互換性を維持すれば、前記複数のCPUとの互換性を、自動的に維持することができるから、ソフトウェア資産の有効利用を実現しつつ、将来的な機能や性能の向上を図ったCPUを実現し易くなる。換言すれば、個別の応用分野やシステムに適した複数のCPUを提供するとともに、複数のCPUの総体的な開発費用を低減したり、開発効率を向上したりすることができる。   In the development, a general-purpose register is expanded with respect to an existing CPU (a CPU that becomes a lower CPU), and a higher-level CPU in which a combination of an instruction and an addressing mode is expanded is developed. The lower CPU will have a subset of the upper CPU instruction set. This can improve performance, function, usability and the like while minimizing an increase in the logical scale of the upper CPU, and also facilitates development of the other lower CPU and improves development efficiency. When developing an upper CPU of the upper CPU, compatibility with the plurality of CPUs can be automatically maintained if compatibility with the upper CPU is maintained. It becomes easy to realize a CPU that improves future functions and performance while realizing the effective use of. In other words, it is possible to provide a plurality of CPUs suitable for individual application fields and systems, reduce the overall development cost of the plurality of CPUs, and improve the development efficiency.

汎用レジスタを拡張するために、汎用レジスタを指定するレジスタ指定フィールドを、2つの部分に分割し、この2つの部分を命令コードの基本単位上の別のワードに配置するとともに、一方のワードを省略可能とし、省略可能なワードを省略すると、暗黙的な指定が行われるようにする。省略可能なワードには、レジスタ指定フィールドの一部のみを持つようにし、演算の種類などは指定しないようにする。これにより、暗黙的に指定可能な汎用レジスタのみを使用していれば、省略可能なワードを省略できる。前記拡張された処理を指定する新規な命令コードを個別的に追加しないから、命令コードが増えず(命令コードのビット数が増えず)、命令の実行処理速度を低下させることがない。前記省略可能な命令コードを付加することによって、命令によって汎用レジスタの全てを選択できるから、プロラムの容易性を損うことがない。また、任意の量の汎用レジスタの一部を、所望のタスク毎や所望の割込み処理などに確保しておく(他のタスクや処理では使用しない)ことによって、前記タスクや割込み処理において汎用レジスタを待避したりする必要がなく、高速化が図れる。また、前記タスクや割込み処理に確保する汎用レジスタ数は任意にできるから、タスクや処理の間で、使用する汎用レジスタを相互に融通し合うことも容易である。   In order to extend the general-purpose register, the register specification field that specifies the general-purpose register is divided into two parts, these two parts are placed in separate words on the basic unit of the instruction code, and one word is omitted. Yes, if an optional word is omitted, an implicit specification is made. An optional word has only a part of the register specification field and does not specify the type of operation. This allows omissible words to be omitted if only general-purpose registers that can be implicitly specified are used. Since a new instruction code specifying the expanded process is not individually added, the instruction code does not increase (the number of bits of the instruction code does not increase), and the instruction execution processing speed does not decrease. By adding the optional instruction code, all of the general-purpose registers can be selected according to the instruction, so that the ease of programming is not impaired. In addition, by securing a part of an arbitrary amount of general-purpose registers for each desired task or desired interrupt processing (not used in other tasks or processing), the general-purpose registers can be set in the task or interrupt processing. There is no need to evacuate and speed up can be achieved. In addition, since the number of general-purpose registers reserved for the task and interrupt processing can be arbitrarily set, it is easy to interchange the general-purpose registers to be used between tasks and processing.

一般に、レジスタのアクセスはメモリのアクセスより高速であるから、汎用レジスタ数を増加することにより、高速に処理できるデータ量を増加させることができ、ひいてはCPUの処理速度を向上できる。   In general, register access is faster than memory access. By increasing the number of general-purpose registers, the amount of data that can be processed at high speed can be increased, and the processing speed of the CPU can be improved.

命令とアドレッシングモードの組合せを拡張するために、既存の、メモリ・レジスタ間の転送命令の単数または複数、レジスタ・レジスタ間の演算命令、の内、複数の命令コードを組合せ、これを結合させる命令拡張用前置命令コードを採用する。前記命令拡張用前置命令コードに続いて、メモリ・レジスタ間命令を実行する場合は、汎用レジスタではなく、CPU内の、テンポラリレジスタの様な、プログラム上解放されていないラッチ手段とメモリの間でデータ転送を行なう。更に、引き続きレジスタ・レジスタ間の演算命令を実行する場合は、演算対象の内の単数または複数のデータを前記ラッチ手段から読み出すようにする。その演算結果のメモリに格納する場合には、前記転送命令で使用したメモリのアドレスを、別のラッチ手段に格納し、前記演算命令の演算結果を前記ラッチ手段に格納するとともに、メモリ・レジスタ間の転送命令を自ら生成し(即ち、プログラムに明示されていなくても生成し)、前記アドレスを格納したラッチ手段の内容をアドレスとして、前記演算結果を格納したラッチ手段の内容をデータとして、メモリへの書込みを行なう。   In order to expand the combinations of instructions and addressing modes, one or more of existing transfer instructions between memory and registers, arithmetic instructions between registers and registers, and instructions that combine and combine multiple instruction codes Adopt extension prefix instruction code. When an instruction between memory and register is executed following the pre-instruction code for instruction extension, it is not a general-purpose register, but between a latch means such as a temporary register in the CPU that is not released in the program and the memory. To transfer data. Further, when a calculation instruction between registers and registers is subsequently executed, one or a plurality of pieces of data to be calculated are read from the latch means. When storing the operation result in the memory, the memory address used in the transfer instruction is stored in another latch means, the operation result of the operation instruction is stored in the latch means, and between the memory registers The transfer instruction is generated by itself (that is, generated even if not specified in the program), the contents of the latch means storing the address are used as addresses, and the contents of the latch means storing the operation results are used as data. Write to.

このとき、メモリ・レジスタ間の転送命令、レジスタ・レジスタ間の演算命令の命令コードは既存のものであるから、単独では従来同様に動作し、既存の命令実行を阻害しない。従って、既存の命令のみを使用している既存のソフトウェア資産を有効に利用できる。データ処理装置は、ソフトウェア資産に関する上位互換を維持して、機能向上を実現できる。   At this time, since the instruction codes of the transfer instruction between the memory and the register and the operation instruction between the register and the register are already existing, the operation code alone does not hinder the execution of the existing instruction. Therefore, it is possible to effectively use existing software assets that use only existing instructions. The data processing apparatus can achieve functional improvement while maintaining upward compatibility with respect to software assets.

アドレス空間全体に対応するビット長のプログラムカウンタを設けて、プログラム用としてはアドレス空間全体、少なくとも大部分をリニアに利用可能にするとともに、比較的小規模なデータを扱える程度に、データ転送のアドレッシングモードを縮小したり、転送データのデータサイズを限定したりして、所望の応用分野などでの使い勝手を損なわずに、論理的規模を縮小できる。   A bit-length program counter corresponding to the entire address space is provided so that the entire address space, at least most of which can be used linearly for programming, and data transfer addressing to the extent that relatively small data can be handled By reducing the mode or limiting the data size of the transfer data, the logical scale can be reduced without impairing usability in a desired application field.

データアクセス時に、使用できるアドレス空間乃至は効率よく使用できるアドレス空間を小さくし、かかるアドレス空間を2つに分割することによって、使い勝手を損なわずに、上位CPUとのアドレス空間上の互換性を維持するとともに、上位CPUに実効アドレス計算方法などを切り替える動作モードを予め用意しておくことにより、ソフトウェア上の互換性を維持することができる。   By reducing the usable address space or the efficient usable address space during data access and dividing the address space into two, compatibility in the address space with the host CPU is maintained without deteriorating usability. In addition, software compatibility can be maintained by preparing in advance an operation mode for switching the effective address calculation method and the like to the host CPU.

プログラム用のアドレス空間を広げることにより、C言語などの高級言語を使用したプログラミングなどに対する適性を向上できる。また、スタックポインタを切替え可能にすることによって、OSなどのタスク管理時のスタックの容量の不所望の増加を抑止できる。   By expanding the address space for the program, suitability for programming using a high-level language such as C language can be improved. In addition, by making the stack pointer switchable, an undesired increase in the capacity of the stack during task management such as an OS can be suppressed.

また、開発装置については、前記上位のCPUの命令セットについてのソフトウェア開発装置を用意し、更に、一方が他方の命令セットを包含しない、複数のCPUに対しても共通に利用可能にし、利用者がCPUを選択できるようにすることによって、ソフトウェア開発装置の開発効率を向上することができる。使用者にとっては、前記、複数のCPUを使用してもソフトウェア開発装置が共通であるから、不所望な費用を発生させなくてよい。前記、複数のCPUの内での移行が容易になり、開発効率を向上することができる。   As for the development device, a software development device for the instruction set of the upper CPU is prepared. Further, the development device can be commonly used for a plurality of CPUs, one of which does not include the other instruction set. By enabling the CPU to select the CPU, the development efficiency of the software development apparatus can be improved. For the user, even if a plurality of CPUs are used, since the software development apparatus is common, it is not necessary to generate undesired costs. Migration among the plurality of CPUs is facilitated, and development efficiency can be improved.

ソフトウェア開発装置上で、アセンブリ言語などの、汎用的な機能を持つ汎用レジスタの記述を、複数種類許すようにすることによって、別のCPUからの移行を比較的容易にすることができる。   By allowing a plurality of types of descriptions of general-purpose registers having general-purpose functions, such as assembly language, on the software development apparatus, migration from another CPU can be made relatively easy.

また、エミュレータについては、上位CPUと下位CPUとで、エミュレーション用インタフェースを共通化することができ、また、上位CPUのエミュレーション用論理回路を開発することによって、これを下位CPUにも利用でき、エミュレーション用プロセッサを含めた開発効率を向上できる。また、同じエミュレータのハードウェアを共通でき、これによって、逸早く開発環境を整えることができるとともに、また、エミュレータの開発に必要な資源を最小限にすることができる。エミュレータに搭載する逆アセンブラは、上位CPUのものを開発するとともに、エミュレータ上で対象のCPUを選択する手段を設けることによって、実質的に一つの逆アセンブラでよいことになるから、開発効率を更に向上できる。   As for the emulator, the upper CPU and the lower CPU can share the emulation interface, and by developing the emulation logic circuit for the upper CPU, it can be used for the lower CPU. The development efficiency including the processor can be improved. In addition, the hardware of the same emulator can be shared, so that the development environment can be quickly established and the resources required for emulator development can be minimized. As the disassembler installed in the emulator is developed for the host CPU and means for selecting the target CPU on the emulator is provided, one disassembler can be practically used. It can be improved.

《検討課題Dに関する発明の効果》
検討課題Dに関する発明の効果は以下の通りである。すなわち、既存の命令コード乃至命令コードの1部のワードを組合せて、ビット条件分岐命令/ビット条件サブルーチン命令を実現することによって、既存の命令実行を阻害することがなく、既存のソフトウェア資産を有効に利用できるようになる。そして、既存のCPUと互換性を維持しつつ、また、論理的・物理的規模の増大を最小限にすることができる。更に、メモリ上の任意のアドレスのデータのビットの状態を判定して、分岐及びサブルーチン分岐を可能にできる。その上、CPUの使い勝手の向上、命令コード長の短縮、及び処理性能の向上に寄与する事ができる。特に、複数のビットの状態に応じて、分岐先ひいては処理内容を変更するような処理の、プログラム容量の短縮と処理速度の向上を実現できる。
<< Effects of Invention on Examination D >>
The effects of the invention relating to the examination subject D are as follows. In other words, by combining the existing instruction code or part of the word of the instruction code to realize the bit conditional branch instruction / bit conditional subroutine instruction, the existing software assets can be used without hindering the execution of the existing instruction. Will be available to you. Further, while maintaining compatibility with existing CPUs, an increase in logical and physical scale can be minimized. Further, it is possible to determine the state of the bit of data at an arbitrary address on the memory, and to enable branching and subroutine branching. In addition, it is possible to contribute to improving the usability of the CPU, shortening the instruction code length, and improving the processing performance. In particular, it is possible to realize a reduction in program capacity and an improvement in processing speed of processing for changing the branch destination and the processing content according to the state of a plurality of bits.

《検討課題Eに関する発明の効果》
検討課題Eに関する発明の効果は以下の通りである。すなわち、複数の汎用レジスタとメモリ間、又は複数の汎用レジスタ間での転送命令を備えることによって、汎用レジスタのビット長より大きいデータであっても、容易に扱うことができ、使い勝手を向上するとともに、データのリード/ライトに対して、命令のリードの頻度を低減して、高速化を図ることができる。
<< Effects of Invention on Examination Problem E >>
The effects of the invention relating to the examination subject E are as follows. In other words, by providing a transfer instruction between a plurality of general-purpose registers and memories, or between a plurality of general-purpose registers, even data larger than the bit length of the general-purpose registers can be handled easily, improving usability. With respect to data read / write, it is possible to reduce the frequency of instruction read and increase the speed.

単一の命令で、複数の汎用レジスタ・メモリ間等の転送を行なうことによって、相対的に、命令コードのリード回数を低減して、データ処理を高速化することができる。また、データのリード/ライトを連続して行なうことによって、外部メモリに対するバースト動作などを有効に利用できる。   By transferring data between a plurality of general-purpose registers and memories with a single instruction, it is possible to relatively reduce the number of instruction code reads and speed up data processing. Further, by continuously reading / writing data, a burst operation for an external memory can be used effectively.

複数の汎用レジスタを指定する固定の組合わせにすることによって、命令コード長を短縮でき、更に、各命令の実行ステート数を固定にすることにより、内部の条件分岐を行うことをなくし、内部論理を簡潔にし、論理規模を縮小できる。   By using a fixed combination that specifies multiple general-purpose registers, the instruction code length can be shortened. Furthermore, by fixing the number of execution states of each instruction, internal conditional branching is eliminated, and internal logic Can be simplified and the logical scale can be reduced.

複数レジスタの転送を指示する命令コードと、既存の単一の汎用レジスタの転送命令の命令コードを組合せて、複数の汎用レジスタの転送命令を実現するとともに、単一の汎用レジスタの転送命令と共通化した動作を行なうようにすることにより、論理的規模の増加を最小限にすることができる。既存の単一の汎用レジスタの転送命令のアドレッシングモードを共通に利用可能にできる。既存の単一の汎用レジスタの転送命令のアドレッシングモードを利用可能にすることによって、プログラムの作成を容易にし、使い勝手を向上できる。   Combines the instruction code that instructs the transfer of multiple registers with the instruction code of an existing single general-purpose register transfer instruction to realize a transfer instruction for multiple general-purpose registers, and is shared with a single general-purpose register transfer instruction By performing the optimized operation, an increase in logical scale can be minimized. The addressing mode of the transfer instruction of the existing single general-purpose register can be commonly used. By making available an addressing mode for an existing single general-purpose register transfer instruction, it is possible to facilitate program creation and improve usability.

上記転送命令の実効アドレスの計算は、演算器で1回のみ行なうようにし、アドレスバッファにインクリメント(またはデクリメント)機能とインクリメント(またはデクリメント)結果を保持する機能を備えることによって、命令動作を単純にし、既存の転送命令と共通化を図ることができ、論理的な規模の増加を最小限にすることができる。実効アドレスの計算の回数を低減して、高速化を図ることができる。   The effective address of the transfer instruction is calculated only once by the arithmetic unit, and the instruction operation is simplified by providing an increment (or decrement) function and an increment (or decrement) function in the address buffer. Thus, it can be shared with existing transfer instructions, and an increase in logical scale can be minimized. Speeding up can be achieved by reducing the number of effective address calculations.

レジスタの本数の異なる複数レジスタ転送命令を複数命令サポートすることによって、また、ワードサイズとロングワードサイズなど、データサイズの異なる複数レジスタ転送命令を複数命令サポートすることによって、プログラムの作成を容易にし、使い勝手を向上することができる。   Supporting multiple register transfer instructions with different numbers of registers, and supporting multiple register transfer instructions with different data sizes, such as word size and longword size, make program creation easier, Usability can be improved.

検討課題A,B,Cに関する発明に係るシングルチップマイクロコンピュータのCPUを詳細に例示するブロック図である。It is a block diagram which illustrates in detail the CPU of the single chip microcomputer based on the invention regarding the examination subjects A, B, and C. 検討課題A,B,Cに係るデータ処理装置の一例であるシングルチップマイクロコンピュータのブロック図である。It is a block diagram of a single chip microcomputer which is an example of a data processor concerning examination subjects A, B, and C. CPUに内蔵されている汎用レジスタ及び制御レジスタの構成を示す説明図である。It is explanatory drawing which shows the structure of the general purpose register | resistor and control register which are incorporated in CPU. 第1の下位互換のCPUにおける汎用レジスタ及び制御レジスタの構成を示す説明図である。It is explanatory drawing which shows the structure of the general purpose register | resistor and control register in 1st downward compatible CPU. 第2の下位互換のCPUにおける汎用レジスタ及び制御レジスタの構成を示す説明図である。It is explanatory drawing which shows the structure of the general purpose register and control register in 2nd downward compatible CPU. CPUのアドレス空間に関する説明図である。It is explanatory drawing regarding the address space of CPU. 上位CPU2のマキシマムモードにおける実効アドレス計算方法を図8と共に示す説明図である。It is explanatory drawing which shows the effective address calculation method in the maximum mode of the high-order CPU2 with FIG. 上位CPU2のマキシマムモードにおける実効アドレス計算方法を図7と共に示す説明図である。It is explanatory drawing which shows the effective address calculation method in the maximum mode of the high-order CPU2 with FIG. CPUの機械語の命令フォーマットの一例を示すフォーマット図である。It is a format figure which shows an example of the instruction format of the machine language of CPU. CPUのメモリに対する転送命令の詳細な命令フォーマットを例示する説明図である。It is explanatory drawing which illustrates the detailed command format of the transfer command with respect to the memory of CPU. メモリデータに対する直接的な演算命令の命令フォーマットとしてイミディエイトを使用しない前置命令コード、EA1、EA2、演算の形態を例示する説明図である。It is explanatory drawing which illustrates the form of the pre-instruction code which does not use an immediate as an instruction format of a direct operation instruction with respect to memory data, EA1, EA2, and an operation. メモリデータに対する直接的な転送命令の命令フォーマットとしてイミディエイトを使用しない前置命令コード、EA1、EA2の形態を例示する説明図である。It is explanatory drawing which illustrates the form of the front instruction code | cord | chord and EA1 and EA2 which do not use an immediate as an instruction format of the direct transfer instruction | command with respect to memory data. メモリデータに対する直接的な演算命令の命令フォーマットとしてイミディエイトを使用する前置命令コード、EA2、演算(イミディエイト)の形態を例示する説明図である。It is explanatory drawing which illustrates the form of the front instruction code which uses immediate as an instruction format of a direct arithmetic instruction with respect to memory data, EA2, and an operation (immediate). メモリデータに対する直接的な転送命令の命令フォーマットとしてイミディエイトを使用する前置命令コード、EA2、転送(イミディエイト)の形態を例示する説明図である。It is explanatory drawing which illustrates the form of the front instruction code which uses immediate as an instruction format of a direct transfer instruction with respect to memory data, EA2, and transfer (immediate). 前置命令コードのフォーマットを例示するフォーマット図である。It is a format figure which illustrates the format of a prefix instruction code. データ転送命令に関するCPUのアドレッシングモードの組合せを示した説明図である。It is explanatory drawing which showed the combination of the addressing mode of CPU regarding a data transfer command. 加算命令に関するCPUのアドレッシングモードの組合せを示した説明図である。It is explanatory drawing which showed the combination of the addressing mode of CPU regarding an addition command. レジスタセレクタの一部と命令レジスタの詳細を示すブロック図である。It is a block diagram which shows the detail of a part of register selector and an instruction register. レジスタセレクタの選択論理の一部を論理記述によって図20と共に示す説明図である。It is explanatory drawing which shows a part of selection logic of a register selector with FIG. 20 by logic description. レジスタセレクタの選択論理の一部を論理記述によって図19と共に示す説明図である。FIG. 20 is an explanatory diagram showing a part of selection logic of the register selector together with FIG. 19 by a logical description. スタックポインタにも使用可能なレジスタに関するレジスタセレクタの選択論理の一例を論理記述によって図22と共に示す説明図である。FIG. 23 is an explanatory diagram showing an example of selection logic of a register selector relating to a register that can also be used as a stack pointer, together with FIG. スタックポインタにも使用可能なレジスタに関するレジスタセレクタの選択論理の一例を論理記述によって図21と共に示す説明図である。FIG. 22 is an explanatory diagram showing an example of selection logic of a register selector related to a register that can also be used as a stack pointer, together with FIG. 命令デコーダに含まれる転送命令コード(mov)の解読論理を図24及び図25と共に例示する論理記述の説明図である。It is explanatory drawing of the logic description which illustrates the decoding logic of the transfer instruction code (mov) contained in an instruction decoder with FIG.24 and FIG.25. 命令デコーダに含まれる転送命令コード(mov)の解読論理を図23、及び図25と共に例示する論理記述の説明図である。It is explanatory drawing of the logic description which illustrates the decoding logic of the transfer instruction code (mov) contained in an instruction decoder together with FIG. 23 and FIG. 命令デコーダに含まれる転送命令コード(mov)の解読論理を図23及び図24と共に例示する論理記述の説明図である。It is explanatory drawing of the logic description which illustrates the decoding logic of the transfer instruction code (mov) contained in an instruction decoder with FIG.23 and FIG.24. 命令デコーダに含まれる演算命令コード(exe)の解読論理を図27と共に示す説明図である。It is explanatory drawing which shows the decoding logic of the operation instruction code (exe) contained in an instruction decoder with FIG. 命令デコーダに含まれる演算命令コード(exe)の解読論理を図26と共に示す説明図である。It is explanatory drawing which shows the decoding logic of the operation instruction code (exe) contained in an instruction decoder with FIG. 命令デコーダに含まれ、内部で生成されるライト型転送命令と同等の動作を行なう命令コード(mov.st)の解読論理を図29及び図30と共に示す説明図である。FIG. 31 is an explanatory diagram showing decoding logic of an instruction code (mov.st) included in the instruction decoder and performing the same operation as an internally generated write type transfer instruction. 命令デコーダに含まれ、内部で生成されるライト型転送命令と同等の動作を行なう命令コード(mov.st)の解読論理を図28及び図30と共に示す説明図である。FIG. 31 is an explanatory diagram showing the decoding logic of an instruction code (mov.st) included in the instruction decoder and performing the same operation as an internally generated write-type transfer instruction together with FIGS. 28 and 30. 命令デコーダに含まれ、内部で生成されるライト型転送命令と同等の動作を行なう命令コード(mov.st)の解読論理を図28及び図29と共に示す説明図である。FIG. 30 is an explanatory diagram showing the decoding logic of an instruction code (mov.st) included in the instruction decoder and performing the same operation as an internally generated write type transfer instruction together with FIGS. 28 and 29. 前置命令コードを伴わない加算命令の実行タイミングを例示する動作タイミング図である。It is an operation | movement timing diagram which illustrates the execution timing of the addition instruction | command which does not accompany a prefix instruction code. レジスタ拡張用前置命令コードが付加された加算命令の実行タイミングを例示する動作タイミング図である。It is an operation | movement timing diagram which illustrates the execution timing of the addition instruction to which the prefix instruction code for register expansion is added. レジスタグループフィールドを持つ前置命令コード、メモリ・レジスタ型演算の前置命令コード、MOV.W @aa:16,R0に相当する命令コード、及びADD.W R0,R1に相当する命令コードを組合せて1命令とみなされる命令を実行したときの動作タイミングを例示するタイミング図である。A prefix instruction code having a register group field, a prefix instruction code of a memory / register type operation, MOV. W @aa: 16, an instruction code corresponding to R0, and ADD. FIG. 10 is a timing diagram illustrating operation timing when an instruction regarded as one instruction is executed by combining instruction codes corresponding to W R0 and R1. レジスタ・メモリ型の加算命令(ADD.W R1,@aa:16)の実行タイミングを示すタイミング図である。It is a timing chart showing an execution timing of a register memory type addition instruction (ADD.WR1, @aa: 16). メモリ・メモリ型の加算命令(ADD.W @ER1,@aa:16)の実行タイミングを示すタイミング図である。It is a timing chart showing the execution timing of a memory / memory type addition instruction (ADD.W @ ER1, @aa: 16). メモリ・メモリ型の転送命令(MOV.W @ER1,@aa:16)の実行タイミングを示すタイミング図である。It is a timing chart showing the execution timing of a memory-memory type transfer instruction (MOV.W @ ER1, @aa: 16). イミディエイト・メモリ型の加算命令(ADD.W #xx ,@aa:16)の実行タイミングを示すタイミング図である。FIG. 10 is a timing chart showing execution timing of an immediate memory type addition instruction (ADD.W # xx, @aa: 16). イミディエイト・メモリ型の転送命令(MOV.W #xx,@aa:16)の実行タイミングを示すタイミング図である。FIG. 10 is a timing chart showing the execution timing of an immediate memory type transfer instruction (MOV.W #xx, @aa: 16). 命令デコーダDECに含まれる演算命令コード(exe)の解読論理の一部に関する論理記述の別の例を図40及び図41と共に示す説明図である。FIG. 42 is an explanatory diagram showing another example of the logic description regarding a part of the decoding logic of the operation instruction code (exe) included in the instruction decoder DEC, together with FIGS. 40 and 41. 命令デコーダDECに含まれる演算命令コード(exe)の解読論理の一部に関する論理記述の別の例を図39及び図41と共に示す説明図である。FIG. 42 is an explanatory diagram showing another example of the logic description regarding a part of the decoding logic of the operation instruction code (exe) included in the instruction decoder DEC together with FIGS. 39 and 41. 命令デコーダDECに含まれる演算命令コード(exe)の解読論理の一部に関する論理記述の別の例を図39及び図40と共に示す説明図である。FIG. 41 is an explanatory diagram showing another example of the logic description regarding a part of the decoding logic of the operation instruction code (exe) included in the instruction decoder DEC together with FIGS. 39 and 40. CPUの開発環境の概略を示す説明図である。It is explanatory drawing which shows the outline of the development environment of CPU. CPUのシステム開発装置におけるCPU選択方法を例示する説明図である。It is explanatory drawing which illustrates the CPU selection method in the system development apparatus of CPU. CPUのアセンブラが出力するリストの一例を示す説明図である。It is explanatory drawing which shows an example of the list | wrist which the assembler of CPU outputs. マイクロコンピュータのためのエミュレータのブロック図である。It is a block diagram of the emulator for microcomputers. CPUのためのエミュレータによるトレースリストを例示する説明図である。It is explanatory drawing which illustrates the trace list by the emulator for CPU. マイクロコンピュータのエミュレーション用プロセッサの一例を示すブロック図である。It is a block diagram which shows an example of the processor for emulation of a microcomputer. 第2の下位CPUの別のプログラミングモデルを示す説明図である。It is explanatory drawing which shows another programming model of a 2nd low-order CPU. CPUのアドレスマップの別の例を示す説明図である。It is explanatory drawing which shows another example of the address map of CPU. 図49に示される第2の下位CPUのアドレスマップにおける実効アドレスの計算方法を図51と共に例示する説明図である。FIG. 52 is an explanatory diagram illustrating, together with FIG. 51, a method for calculating an effective address in the address map of the second lower CPU shown in FIG. 49. 図49に示される第2の下位CPUのアドレスマップにおける実効アドレスの計算方法を図50と共に例示する説明図である。FIG. 50 is an explanatory diagram illustrating, together with FIG. 50, an effective address calculation method in the address map of the second lower CPU shown in FIG. 49. 命令拡張用前置命令コード、MOV.W #xx,R0に相当する命令コードに前記ディスティネーション情報を付加した命令コードを組合せて1命令とみなされる命令を実行したときのタイミング図である。Prefix instruction code for instruction expansion, MOV. FIG. 10 is a timing chart when an instruction regarded as one instruction is executed by combining an instruction code corresponding to W #xx, R0 with an instruction code added with the destination information. 検討課題Dに関する発明のマイクロコンピュータが有するCPUの一例を示すブロック図である。It is a block diagram which shows an example of CPU which the microcomputer of the invention regarding the examination subject D has. 図53のCPUにおけるビットテスト命令の命令フォーマットを例示する説明図である。FIG. 54 is an explanatory diagram illustrating an instruction format of a bit test instruction in the CPU of FIG. 53; 図53のCPUにおけるビット条件分岐命令の命令フォーマットを図56及び図57と共に示す説明図である。FIG. 57 is an explanatory diagram showing an instruction format of a bit conditional branch instruction in the CPU of FIG. 53 together with FIGS. 56 and 57; 図53のCPUにおけるビット条件分岐命令の命令フォーマットを図55及び図57と共に示す説明図である。FIG. 57 is an explanatory diagram showing an instruction format of a bit conditional branch instruction in the CPU of FIG. 53 together with FIGS. 55 and 57; 図53のCPUにおけるビット条件分岐命令の命令フォーマットを図55及び図56と共に示す説明図である。57 is an explanatory diagram showing an instruction format of a bit conditional branch instruction in the CPU of FIG. 53 together with FIGS. 55 and 56. FIG. 図53のCPUにおけるビット条件分岐命令を考慮したときの別の命令フォーマットにおける命令コードの組み合わせを例示する説明図である。FIG. 54 is an explanatory diagram exemplifying combinations of instruction codes in another instruction format when a bit conditional branch instruction in the CPU of FIG. 53 is considered. テンポラリデータレジスタTRDの判定回路の論理構成及び分岐制御論理を論理記述で例示する説明図である。It is explanatory drawing which illustrates the logic structure of the determination circuit of temporary data register TRD, and a branch control logic by a logic description. ビットテスト命令及びビット条件分岐命令の一部(第1のワード)に対する命令デコーダDECの論理構成を図61及び図62と共に論理記述で例示する説明図である。FIG. 67 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC with respect to a part of a bit test instruction and a bit conditional branch instruction (first word) in a logical description together with FIGS. 61 and 62; ビットテスト命令及びビット条件分岐命令の一部(第1のワード)に対する命令デコーダDECの論理構成を図60及び図62と共に論理記述で例示する説明図である。FIG. 65 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a bit test instruction and a part (first word) of a bit conditional branch instruction with a logical description together with FIGS. 60 and 62; ビットテスト命令及びビット条件分岐命令の一部(第1のワード)に対する命令デコーダDECの論理構成を図60及び図61と共に論理記述で例示する説明図である。FIG. 62 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a bit test instruction and a part (first word) of a bit conditional branch instruction with a logical description together with FIGS. 60 and 61; 条件分岐命令の一部に対する命令デコーダDECの論理構成を図64及び図65と共に論理記述によって例示する説明図である。FIG. 66 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a conditional branch instruction by a logical description together with FIGS. 64 and 65; 条件分岐命令の一部に対する命令デコーダDECの論理構成を図63及び図65と共に論理記述によって例示する説明図である。FIG. 66 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a conditional branch instruction by a logical description together with FIGS. 63 and 65; 条件分岐命令の一部に対する命令デコーダDECの論理構成を図63及び図64と共に論理記述によって例示する説明図である。FIG. 65 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a conditional branch instruction with a logical description together with FIGS. 63 and 64; サブルーチン分岐命令の一部に対する命令デコーダDECの論理構成を図67及び図68と共に論理記述によって例示する説明図である。FIG. 69 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a subroutine branch instruction with a logical description together with FIGS. 67 and 68; サブルーチン分岐命令の一部に対する命令デコーダDECの論理構成を図66及び図68と共に論理記述によって例示する説明図である。FIG. 69 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a subroutine branch instruction with a logical description together with FIGS. 66 and 68; サブルーチン分岐命令の一部に対する命令デコーダDECの論理構成を図66及び図67と共に論理記述によって例示する説明図である。FIG. 68 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for a part of a subroutine branch instruction with a logical description together with FIGS. 66 and 67; 他の演算命令に対する命令デコーダDECの論理構成を図70と共に論理記述によってを例示する説明図である。FIG. 71 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC with respect to another operation instruction by using a logical description together with FIG. 70. 他の演算命令に対する命令デコーダDECの論理構成を図69と共に論理記述によってを例示する説明図である。FIG. 70 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC with respect to another operation instruction in conjunction with FIG. 69 by a logical description. 更に他の演算命令に対する命令デコーダDECの論理構成を図72と共に論理記述で例示する説明図である。FIG. 75 is an explanatory diagram illustrating a logical configuration of an instruction decoder DEC for another operation instruction in conjunction with FIG. 72 by a logical description. 更に他の演算命令に対する命令デコーダDECの論理構成を図71と共に論理記述で例示する説明図である。FIG. 72 is an explanatory diagram illustrating the logical configuration of the instruction decoder DEC with respect to another operation instruction as well as the logical description together with FIG. 71; ビット条件分岐命令の第1の例(BBS #0,@FFFFFE,$+20)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the 1st example (BBS # 0, @FFFFFE, $ + 20) of a bit condition branch instruction. ビット条件サブルーチン分岐命令の例(BBSR #5,@FFFE00,$+300)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the example (BBSR # 5, @ FFFE00, $ + 300) of a bit condition subroutine branch instruction. ビットテスト命令の第1の例(BTST #0,@FFFFFE)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the 1st example (BTST # 0, @FFFFFE) of a bit test instruction. ビットテスト命令の第2の例(BTST #1,@ER0+)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the 2nd example (BTST # 1, @ ER0 +) of a bit test instruction. ビットセット命令の例(BSET #2,@ER0+)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the example (BSET # 2, @ ER0 +) of a bit set instruction. ビット条件分岐命令の第2の例(BBC #0,@ER0+,$+20)の実行タイミングを例示するタイミングチャートである。It is a timing chart which illustrates the execution timing of the 2nd example (BBC # 0, @ ER0 +, $ + 20) of a bit condition branch instruction. 検討課題Eの本発明に係るデータ処理装置の一例であるマイクロコンピュータのブロック図である。It is a block diagram of the microcomputer which is an example of the data processing apparatus which concerns on this invention of the examination subject E. CPUのアドレス空間を示す説明図である。It is explanatory drawing which shows the address space of CPU. 複数汎用レジスタの転送命令(MOVM)の機能を例示する説明図である。It is explanatory drawing which illustrates the function of the transfer instruction (MOVM) of multiple general purpose registers. 複数汎用レジスタの転送命令(MOVM)によるデータ転送のデータ配置を例示する説明図である。It is explanatory drawing which illustrates the data arrangement | positioning of the data transfer by the transfer instruction (MOVM) of a multiple general purpose register. 複数汎用レジスタの転送命令(MOVM)のような命令を示す前置命令コード(命令拡張用前置命令コード)を例示する説明図である。It is explanatory drawing which illustrates the prefix instruction code (prefix instruction code for instruction expansion) which shows instructions, such as a transfer instruction (MOVM) of a multiple general purpose register. 検討か課題Eの発明に係るデータ処理装置の一例であるCPUの詳細な一例を示すブロック図である。It is a block diagram which shows a detailed example of CPU which is an example of the data processor which concerns on invention of examination or the subject E. FIG. レジスタセレクタの一部と命令レジスタの詳細を示すブロック図である。It is a block diagram which shows the detail of a part of register selector and an instruction register. レジスタセレクタに入力される制御信号s1〜s3の機能を例示する説明図である。It is explanatory drawing which illustrates the function of the control signals s1-s3 input into a register selector. アドレスバッファを例示するブロック図である。It is a block diagram which illustrates an address buffer. レジスタ・レジスタ間のワードサイズの転送命令(MOV及びMOVM命令)に対するデコーダの制御論理の一部を論理記述によって示す説明図である。It is explanatory drawing which shows a part of decoder control logic with respect to the transfer instruction (MOV and MOVM instruction) of the word size between a register and a register by a logic description. 図88の後に続く残りの論理記述を示す説明図である。FIG. 89 is an explanatory diagram of the remaining logical description following FIG. 88. 16ビット絶対アドレスによる転送命令(MOV及びMOVM命令)に対するデコーダの制御論理の一部を論理記述によって示す説明図である。It is explanatory drawing which shows a part of decoder control logic with respect to the transfer instruction (MOV and MOVM instruction) by a 16-bit absolute address by a logic description. 図90の後に続く残りの論理記述の説明図である。FIG. 91 is an explanatory diagram of the remaining logical description following FIG. 90. 図91の後に続く残りの論理記述の説明図である。92 is an explanatory diagram of the remaining logical description following FIG. 91. FIG. 図88及び図89に記載の論理記述の制御によるレジスタ・レジスタ間の転送命令(MOV及びMOVM命令)による制御動作に対応されるフローチャートである。90 is a flowchart corresponding to a control operation by a register-register transfer instruction (MOV and MOVM instruction) under the control of the logical description shown in FIGS. 88 and 89. FIG. 図90乃至図92に記載の論理記述の制御による16ビット絶対アドレスによる転送命令(MOV及びMOVM命令)による制御動作に対応されるフローチャートである。93 is a flowchart corresponding to a control operation by a transfer instruction (MOV and MOVM instruction) with a 16-bit absolute address by the control of the logical description shown in FIGS. 90 to 92; レジスタ−レジスタ型の第1の転送命令(MOV.L ER0,ER1)、第2の転送命令(MOV.L ER8,ER17)、及び複数レジスタの転送命令の第1の例(MOVM.W R0−R1,E28−E29)の実行タイミングを例示するタイミングチャートである。Register-register type first transfer instruction (MOV.L ER0, ER1), second transfer instruction (MOV.L ER8, ER17), and first example of multiple register transfer instruction (MOVM.W R0- It is a timing chart which illustrates the execution timing of R1, E28-E29). 複数レジスタの転送命令の第2の例(MOVM.L @aa:16,ER0−ER1)の実行シーケンスを例示するタイミングチャートである。It is a timing chart which illustrates the execution sequence of the 2nd example (MOVM.L @aa: 16, ER0-ER1) of the transfer instruction of a plurality of registers. 複数レジスタの転送命令の第3の例(MOVM.W R10−R11,@ER6)の実行シーケンスを例示するタイミングチャートである。It is a timing chart which illustrates the execution sequence of the 3rd example (MOVM.W R10-R11, @ ER6) of the transfer instruction of a plurality of registers. CPUの開発環境の概略を例示する説明図である。It is explanatory drawing which illustrates the outline of the development environment of CPU. マイクロコンピュータのエミュレーション用プロセッサを例示するブロック図である。It is a block diagram which illustrates the processor for emulation of a microcomputer. マイクロコンピュータをプリンタ制御に用いたマイクロコンピュータシステムを例示するブロック図である。1 is a block diagram illustrating a microcomputer system using a microcomputer for printer control.

符号の説明Explanation of symbols

1 シングルチップマイクロコンピュータ
2 CPU
3 割込みコントローラ
30 内部バス
31 割込み要求信号
DEC 命令デコーダ
200 pfのデコード論理
201 movのデコード論理
202 exeのデコード論理
CHG 命令変更部
IR1、IR2 命令レジスタ
mskint 割込みマスク信号
mod(MODS,MODD) モディファイ制御信号
mkmov 命令コード発生信号
EXEC 実行部
INTC 割込み制御部
RSEL レジスタセレクタ
RDB リードデータバッファ
WDB ライトデータバッファ
TRA,TRD テンポラリレジスタ
PC プログラムカウンタ
ER0〜ER7 汎用レジスタ
AB アドレスバッファ
GB,WB,DB バス
IDB 内部データバス
IAB 内部アドレスバス
ALU 算術論理演算器
2A CPU
bc ビットコンディションフィールド
36 分岐制御信号
37 分岐制御論理
38 判定回路
AU 算術論理演算器
501 マイクロコンピュータ
502 CPU
510 バスコントローラ
r1、r2 レジスタフィールド
gr1、gr2 省略可能な命令コードのレジスタフィールド
LGR1,LGR2 命令レジスタ内のgr1、gr2のラッチ回路
LAT1,LAT2 レジスタセレクタ内のgr2、r2のラッチ回路
LOG1,LOG2 レジスタセレクタ内のr1、r2の制御ロジック
s1〜s3 レジスタフィールド値の制御信号
1 Single-chip microcomputer 2 CPU
3 interrupt controller 30 internal bus 31 interrupt request signal DEC instruction decoder 200 pf decode logic 201 mov decode logic 202 exe decode logic CHG instruction change unit IR1, IR2 instruction register mskint interrupt mask signal mod (MODS, MODD) modify control signal mkmov Instruction code generation signal EXEC Execution unit INTC Interrupt control unit RSEL Register selector RDB Read data buffer WDB Write data buffer TRA, TRD Temporary register PC Program counter ER0 to ER7 General purpose register AB Address buffer GB, WB, DB bus IDB Internal data bus IAB Internal address bus ALU arithmetic logic unit 2A CPU
bc bit condition field 36 branch control signal 37 branch control logic 38 decision circuit AU arithmetic logic unit 501 microcomputer 502 CPU
510 bus controller r1, r2 register field gr1, gr2 optional instruction code register field LGR1, LGR2 latch circuit for gr1, gr2 in the instruction register LAT1, LAT2 latch circuit for gr2, r2 in the register selector LOG1, LOG2 register selector Control logic of s1 and r2 in s1 to s3 Control signal of register field value

Claims (10)

命令セットに含まれる命令コードを読み込んで動作するデータ処理装置であって、
アドレス空間上のデータを読み込んで、前記データの所定のビットが所定の状態であることに呼応して分岐を行なう分岐命令を前記命令セットに含み、
前記分岐命令は、命令コードの基本単位の複数倍の情報を含んで構成され、
前記分岐命令の第1の基本単位情報は、アドレス空間上の指定されたデータを読み込んで、プログラミング上解放されていないラッチ手段に格納する処理を指示し、
前記分岐命令の第2の基本単位情報は、前記ラッチ手段に格納したデータの所定のビットを検査して、検査結果に従って分岐するかしないかの処理を指示するデータ処理装置。
A data processing device that operates by reading an instruction code included in an instruction set,
The instruction set includes a branch instruction that reads data on an address space and performs a branch in response to a predetermined bit of the data being in a predetermined state,
The branch instruction is configured to include information that is multiple times the basic unit of an instruction code,
The first basic unit information of the branch instruction indicates a process of reading the designated data on the address space and storing it in the latch means not released for programming,
The second basic unit information of the branch instruction is a data processing device for inspecting a predetermined bit of data stored in the latch means and instructing whether to branch according to the inspection result.
前記第1の基本単位情報は、アドレス空間上のデータの指定方法に応じて複数種類の中から使用可能とされ、
前記第2の基本単位情報は、分岐先アドレスの指定方法に応じて複数種類の中から使用可能とされ、
前記分岐命令は、前記第1の基本単位情報と第2の基本単位情報の種類の組合せに応じた動作を指示する請求項1記載のデータ処理装置。
The first basic unit information can be used from a plurality of types according to a data designation method in the address space,
The second basic unit information can be used from a plurality of types according to a branch destination address designation method.
The data processing device according to claim 1, wherein the branch instruction instructs an operation according to a combination of types of the first basic unit information and the second basic unit information.
演算結果を反映するフラグ手段を更に有し、
前記第2の基本単位情報は、独立した条件分岐命令として機能することが可能であって、前記独立した条件分岐命令として機能する時には、前記フラグ手段の所定の単数又は複数のビットを検査し、その検査結果に従って分岐する指示を与える請求項1又は2記載のデータ処理装置。
A flag means for reflecting the calculation result;
The second basic unit information can function as an independent conditional branch instruction, and when functioning as the independent conditional branch instruction, inspects a predetermined bit or bits of the flag means, The data processing apparatus according to claim 1 or 2, wherein an instruction to branch according to the inspection result is given.
命令セットに含まれる命令コードを読み込んで動作するデータ処理装置であって、
メモリとレジスタ間のデータ転送を行う転送命令と、レジスタに格納したデータの所定のビットを検査して、検査結果に従って分岐するかしないかの動作を行う分岐命令とを前記命令セットに含み、
前置命令コード、前記転送命令の命令コード、及び前記分岐命令の命令コードを順次読み込んで、1つの命令として解釈し、アドレス空間上の指定されたデータを読み込んで、プログラミング上解放されていないラッチ手段に格納し、前記ラッチ手段に格納したデータの所定のビットを検査して、検査結果に従って分岐するかしないかの動作を行うデータ処理装置。
A data processing device that operates by reading an instruction code included in an instruction set,
The instruction set includes a transfer instruction for performing data transfer between the memory and the register, and a branch instruction for inspecting a predetermined bit of data stored in the register and performing an operation of whether to branch according to the inspection result,
Latch that is not released for programming by reading the prefix instruction code, the instruction code of the transfer instruction, and the instruction code of the branch instruction sequentially, interpreting them as one instruction, reading the specified data in the address space A data processing apparatus for checking whether a predetermined bit of data stored in the means and stored in the latch means is checked and branching according to the check result.
演算結果を反映するフラグ手段を更に有し、前記前置命令コードと共に一つの命令として解釈された前記転送命令は、前記フラグ手段の変化を抑止する請求項4記載のデータ処理装置。   5. The data processing apparatus according to claim 4, further comprising flag means for reflecting an operation result, wherein the transfer instruction interpreted as one instruction together with the prefix instruction code suppresses change of the flag means. 前記ラッチ手段に結合されたビット検査手段を有し、
前記ビット検査手段は、前記前置命令コードと共に一つの命令として解釈される前記分岐命令の所定のビットに従って、検査結果の出力を行い、
前記前置命令コードと共に一つの命令として解釈される前記分岐命令は、前記検査結果の出力に呼応して、分岐するかしないかの判定を行う請求項4又は5項記載のデータ処理装置。
Bit inspection means coupled to the latch means;
The bit check means outputs a check result according to a predetermined bit of the branch instruction interpreted as one instruction together with the prefix instruction code,
6. The data processing apparatus according to claim 4, wherein the branch instruction interpreted as one instruction together with the prefix instruction code determines whether or not to branch in response to the output of the inspection result.
命令コードをデコードするデコード手段を有し、
前記デコード手段は、前記前置命令コードと共に一つの命令として解釈される前記転送命令を解読して、後続の分岐命令の命令コードに対して動作の変更を指示する制御信号を発生する請求項4乃至6の何れか1項記載のデータ処理装置。
A decoding means for decoding the instruction code;
5. The decoding means decodes the transfer instruction interpreted as one instruction together with the prefix instruction code, and generates a control signal for instructing an operation change to an instruction code of a subsequent branch instruction. The data processing device according to any one of 1 to 6.
前記前置命令コードと共に一つの命令として解釈される前記転送命令及び分岐命令を実行するとき、前記転送命令の命令コードで規定される処理と前記分岐命令の命令コードで規定される処理との間に割込み処理の挿入を禁止する請求項4乃至7の何れか1項記載のデータ処理装置。   When executing the transfer instruction and the branch instruction interpreted as one instruction together with the prefix instruction code, between the process specified by the instruction code of the transfer instruction and the process specified by the instruction code of the branch instruction 8. The data processing apparatus according to claim 4, wherein insertion of interrupt processing is prohibited. 命令セットに含まれる命令コードを読み込んで動作するデータ処理装置であって、
アドレス空間上のデータを読み込み、読み込んだデータを用いてデータ処理を行う複合命令を前記命令セットに含み、
前記複合命令は、命令コードの基本単位の複数倍の情報を含んで構成され、
前記複合命令の第1の基本単位情報は、アドレス空間上の指定されたデータを読み込んで、プログラミング上解放されていないラッチ手段に格納する処理を指示し、
前記複合命令の第2の基本単位情報は、前記ラッチ手段に格納したデータを用いた所定のデータ処理を指示するデータ処理装置。
A data processing device that operates by reading an instruction code included in an instruction set,
The instruction set includes a compound instruction that reads data on the address space and performs data processing using the read data,
The compound instruction is configured to include information multiple times the basic unit of an instruction code,
The first basic unit information of the compound instruction instructs a process of reading specified data on the address space and storing it in a latch means that is not released for programming,
The second basic unit information of the compound instruction is a data processing device that instructs predetermined data processing using data stored in the latch means.
前記ラッチ手段はテンポラリデータレジスタ又はテンポラリアドレスレジスタである請求項9記載のデータ処理装置。   10. A data processing apparatus according to claim 9, wherein the latch means is a temporary data register or a temporary address register.
JP2006189410A 1999-04-30 2006-07-10 Data processor Pending JP2006313561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006189410A JP2006313561A (en) 1999-04-30 2006-07-10 Data processor

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP12345099 1999-04-30
JP15189099 1999-05-31
JP19160899 1999-07-06
JP32051899 1999-11-11
JP2006189410A JP2006313561A (en) 1999-04-30 2006-07-10 Data processor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2005263193A Division JP3839835B2 (en) 1999-04-30 2005-09-12 Data processing apparatus and microcomputer

Publications (1)

Publication Number Publication Date
JP2006313561A true JP2006313561A (en) 2006-11-16

Family

ID=37534988

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006189410A Pending JP2006313561A (en) 1999-04-30 2006-07-10 Data processor

Country Status (1)

Country Link
JP (1) JP2006313561A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009163442A (en) * 2007-12-28 2009-07-23 Fujitsu Ltd Arithmetic processing unit and method for extending instruction
US7742951B2 (en) 2006-06-08 2010-06-22 Whirlpool Corporation Method of demonstrating a household appliance
US7808368B2 (en) 2005-06-09 2010-10-05 Whirlpool Corporation Appliance network for a networked appliance and an audio communication accessory
JP2011013865A (en) * 2009-06-30 2011-01-20 Fujitsu Ltd Operation processor and control method
US8571942B2 (en) 2005-06-09 2013-10-29 Whirlpool Corporation Method of product demonstration
US8676656B2 (en) 2005-06-09 2014-03-18 Whirlpool Corporation Method for product demonstration
US8816828B2 (en) 2005-06-09 2014-08-26 Whirlpool Corporation Recipe wand and recipe book for use with a networked appliance
US9619228B2 (en) 2010-03-29 2017-04-11 Renesas Electronics Corporation Data processor with a load instruction that branches based on a control register value and a bit or bits read from memory

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62107339A (en) * 1985-11-05 1987-05-18 Oki Electric Ind Co Ltd Instruction constituting method for microcomputer
JPS6482131A (en) * 1987-09-24 1989-03-28 Mitsubishi Electric Corp Data processor
JPH03116230A (en) * 1989-06-21 1991-05-17 Oki Micro Design Miyazaki:Kk Instruction extending method for microcomputer
JPH03141434A (en) * 1989-06-19 1991-06-17 Nec Corp Microcomputer
JPH04306735A (en) * 1991-04-04 1992-10-29 Toshiba Corp Asynchronous interruption inhiobition mechanism
JPH06242988A (en) * 1993-02-20 1994-09-02 Yokogawa Hewlett Packard Ltd Address sending-out circuit and trace list output method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62107339A (en) * 1985-11-05 1987-05-18 Oki Electric Ind Co Ltd Instruction constituting method for microcomputer
JPS6482131A (en) * 1987-09-24 1989-03-28 Mitsubishi Electric Corp Data processor
JPH03141434A (en) * 1989-06-19 1991-06-17 Nec Corp Microcomputer
JPH03116230A (en) * 1989-06-21 1991-05-17 Oki Micro Design Miyazaki:Kk Instruction extending method for microcomputer
JPH04306735A (en) * 1991-04-04 1992-10-29 Toshiba Corp Asynchronous interruption inhiobition mechanism
JPH06242988A (en) * 1993-02-20 1994-09-02 Yokogawa Hewlett Packard Ltd Address sending-out circuit and trace list output method

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8571942B2 (en) 2005-06-09 2013-10-29 Whirlpool Corporation Method of product demonstration
US7808368B2 (en) 2005-06-09 2010-10-05 Whirlpool Corporation Appliance network for a networked appliance and an audio communication accessory
US8816828B2 (en) 2005-06-09 2014-08-26 Whirlpool Corporation Recipe wand and recipe book for use with a networked appliance
US8786412B2 (en) 2005-06-09 2014-07-22 Whirlpool Corporation Appliance network for a networked appliance and a remote user interface
US8676656B2 (en) 2005-06-09 2014-03-18 Whirlpool Corporation Method for product demonstration
US8688530B2 (en) 2006-06-08 2014-04-01 Whirlpool Corporation System for product demonstration
US7742951B2 (en) 2006-06-08 2010-06-22 Whirlpool Corporation Method of demonstrating a household appliance
US8682735B2 (en) 2006-06-08 2014-03-25 Whirlpool Corporation Method for product demonstration
JP2009163442A (en) * 2007-12-28 2009-07-23 Fujitsu Ltd Arithmetic processing unit and method for extending instruction
EP2083352A2 (en) 2007-12-28 2009-07-29 Fujitsu Limited Processing unit
US8281112B2 (en) 2007-12-28 2012-10-02 Fujitsu Limited Processor decoding extension instruction to store plural address extension information in extension register for plural subsequent instructions
US8601239B2 (en) 2009-06-30 2013-12-03 Fujitsu Limited Extended register addressing using prefix instruction
JP2011013865A (en) * 2009-06-30 2011-01-20 Fujitsu Ltd Operation processor and control method
US9619228B2 (en) 2010-03-29 2017-04-11 Renesas Electronics Corporation Data processor with a load instruction that branches based on a control register value and a bit or bits read from memory

Similar Documents

Publication Publication Date Title
JP2001202243A (en) Data processor
JP2006313561A (en) Data processor
JPH03282904A (en) Programmable controller
JP4226085B2 (en) Microprocessor and multiprocessor system
JP4004915B2 (en) Data processing device
JP4073721B2 (en) Data processing device
JP3839835B2 (en) Data processing apparatus and microcomputer
JP3432532B2 (en) Data processing device
JP3786575B2 (en) Data processing device
JP3851008B2 (en) Processor, semiconductor integrated circuit having the same, processing apparatus, and instruction processing method
US20020004877A1 (en) Method and system for updating user memory in emulator systems
JP3740321B2 (en) Data processing device
JP4545777B2 (en) Data processing device
JP3760093B2 (en) Microcomputer
JP2002132499A (en) Data processing apparatus and recording medium
JP2636821B2 (en) Parallel processing unit
JP3539951B2 (en) Data processing device
JP2001297002A (en) Data processor
JP4498338B2 (en) Data processing device
JP4382076B2 (en) Data processing device
JP2785820B2 (en) Parallel processing unit
JP2927281B2 (en) Parallel processing unit
JPH08263290A (en) Data processor
JP2001337821A (en) Data processing device
JP2002007140A (en) Recording medium and system development device and microcomputer

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080812

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081021

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081222

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090407