JP2985201B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2985201B2
JP2985201B2 JP2001856A JP185690A JP2985201B2 JP 2985201 B2 JP2985201 B2 JP 2985201B2 JP 2001856 A JP2001856 A JP 2001856A JP 185690 A JP185690 A JP 185690A JP 2985201 B2 JP2985201 B2 JP 2985201B2
Authority
JP
Japan
Prior art keywords
instruction
micro
data
address
specifying
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001856A
Other languages
Japanese (ja)
Other versions
JPH03204724A (en
Inventor
博志 勝田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP2001856A priority Critical patent/JP2985201B2/en
Publication of JPH03204724A publication Critical patent/JPH03204724A/en
Application granted granted Critical
Publication of JP2985201B2 publication Critical patent/JP2985201B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、マイクロコンピュータに関し、特にその内
部レジスタに対するスタック操作の命令処理方式に関す
る。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to an instruction processing method for stack operation on an internal register.

〔従来の技術〕[Conventional technology]

近年、プリンタ,ディスク装置等の各種OA機器や、エ
ンジン制御等の自動車電装機器を始めとして、マイクロ
コンピュータの応用分野はますます広がりつつあるが、
これらの装置が高度化するに伴い、マイクロコンピュー
タが処理すべき情報量も大きくなってきており、マイク
ロコンピュータのより一層の高性能化が望まれている。
一方、これら分野のような装置組み込みの用途では、装
置自体が小型化,低価格化の一途をたどっており、マイ
クロコンピュータもより安価でコンパクトな機器構成が
可能なものが望まれている。
In recent years, the application fields of microcomputers are expanding more and more, including various OA equipment such as printers and disk drives, and automotive electrical equipment such as engine controls.
As these devices become more sophisticated, the amount of information to be processed by the microcomputer is increasing, and further enhancement of the performance of the microcomputer is desired.
On the other hand, in applications in which devices are incorporated in such fields, the size of devices themselves is continually being reduced, and the cost of such devices is continually reduced.

このようなマイクロコンピュータは、通常、汎用レジ
スタと呼ばれる内部レジスタを備えており、これら内部
レジスタ間あるいはメモリ等の外部デバイスとの間での
データ転送,算術論理演算等の各種命令を実行する。
Such a microcomputer usually has internal registers called general-purpose registers, and executes various instructions such as data transfer between these internal registers or an external device such as a memory, and arithmetic and logic operations.

これら命令の中で、特に複数の汎用レジスタの内容を
一時的に外部メモリに記憶させる場合に使用する命令と
して、PUSH/POP post命令が知られている。PUSH post
命令は、一命令で、postパラメータで指定される複数の
汎用レジスタの内容をマイクロコンピュータ内部のスタ
ックポインタ(以下、SPという)により指定される外部
メモリのスタック領域に積み重ねて格納する処理を行
う。また、POP post命令は、一命令で、スタック領域
に格納されている複数のデータをpostパラメータで指定
される汎用レジスタにそれぞれ戻す処理を行う。
Among these instructions, a PUSH / POP post instruction is known as an instruction used particularly when the contents of a plurality of general-purpose registers are temporarily stored in an external memory. PUSH post
One instruction executes a process of stacking and storing the contents of a plurality of general-purpose registers specified by the post parameter in a stack area of an external memory specified by a stack pointer (hereinafter, referred to as SP) inside the microcomputer. The POP post instruction performs a process of returning a plurality of data stored in the stack area to the general-purpose register specified by the post parameter with one instruction.

第6図は、このPUSH post命令の命令コード構成の一
例を示した図、第7図は、汎用レジスタGRの構成の一例
を示した図である。命令コードの2バイト目は、各ビッ
トが、第7図の8個の汎用レジスタGR0〜GR7にそれぞれ
1対1に対応している。例えば、ビット0,2,4が1の場
合、汎用レジスタGR0,GR2,GR4がスタックに退避され、
ビット7のみ1の場合、処理対象となる汎用レジスタは
GR7のみである。
FIG. 6 is a diagram showing an example of the instruction code configuration of the PUSH post instruction, and FIG. 7 is a diagram showing an example of the configuration of the general-purpose register GR. In the second byte of the instruction code, each bit has one-to-one correspondence with each of the eight general-purpose registers GR0 to GR7 in FIG. For example, if bits 0, 2, and 4 are 1, the general registers GR0, GR2, and GR4 are saved on the stack,
When only bit 7 is 1, the general-purpose register to be processed is
GR7 only.

第8図は従来のマイクロプログラム制御のマイクロコ
ンピュータにおけるPUSH post命令のマイクロプログラ
ム処理のフローチャートを示し、その動作について説明
する。ここで、このマイクロコンピュータは、前述の汎
用レジスタ,SP以外に、通常の命令で算術論理演算等の
各種データ処理を実現するためにマイクロプログラムで
制御する内部テンポラリレジスタTA,TB及びシフタを備
えている。
FIG. 8 shows a flowchart of microprogram processing of a PUSH post instruction in a conventional microcomputer controlled by a microprogram, and its operation will be described. Here, in addition to the general-purpose registers and SP described above, the microcomputer includes internal temporary registers TA and TB and a shifter that are controlled by a microprogram in order to realize various data processing such as arithmetic and logic operations using ordinary instructions. I have.

まず、第1のステップ201で命令コードの2バイト目
を内部テンポラリレジスタTAに格納し、ステップ202で
レジスタ選択変数として7を内部テンポラリレジスタTB
に格納する。続いてステップ203でTA値を左シフトし、
ステップ204でシフトした結果キャリー(以下、CYとい
う)が1ならば、SPをデクリメント(ステップ205)し
て、TB値に基づきGR7を選択し、SPが示すアドレスにGR7
の内容を転送(ステップ206)した後、TBをデクリメン
ト(ステップ207)してステップ203に分岐する。また、
ステップ204の結果キャリーCYが0ならば、スタック操
作は行わず、TBをデクリメント(ステップ209)した
後、ステップ203を再び実行する。以上、ステップ208で
TBが0になるまで繰り返すことにより、postデータで指
定されているGR7からGR0までの汎用レジスタの退避処理
を実現する。
First, in the first step 201, the second byte of the instruction code is stored in the internal temporary register TA, and in step 202, 7 is set as the register selection variable in the internal temporary register TB.
To be stored. Then, in step 203, the TA value is shifted to the left,
If the carry (hereinafter referred to as CY) shifted in step 204 is 1, the SP is decremented (step 205), GR7 is selected based on the TB value, and GR7 is added to the address indicated by SP.
Is transferred (step 206), the TB is decremented (step 207), and the process branches to step 203. Also,
If the carry CY in step 204 is 0, the stack operation is not performed, the TB is decremented (step 209), and then step 203 is executed again. As above, in step 208
By repeating until TB becomes 0, the saving processing of the general-purpose registers from GR7 to GR0 specified by the post data is realized.

PUSH/POP post命令は、主としてサブルーチンコール
や割り込み処理等のプログラムの流れが一時的に変わる
ような場合に、汎用レジスタの内容に影響を与えないよ
う一時的に汎用レジスタの内容を退避しておく目的に使
用される。
The PUSH / POP post instruction temporarily saves the contents of general-purpose registers so that the contents of general-purpose registers are not affected when the flow of a program such as a subroutine call or interrupt processing changes temporarily. Used for purpose.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

上述した従来の命令処理では、マイクロプログラム処
理でpostデータの各ビットの1をサーチすることによ
り、所定の汎用レジスタを選択してスタックに退避して
いた。従って、命令の語長が短いのにもかかわらず処理
が複雑なために、命令の実行時間が長いものとなってい
た。さらに、例えばPUSH post命令の場合、ビット0の
み1の場合でも、ビット7からビット1までのpostデー
タのシフトと、レジスタ選択変数のデクリメントの処理
も行う必要があるなど、命令の実行時間の上で非常に効
率の悪いものとなっていた。特に、高速な処理実行を必
要とする割り込み処理においては、このPUSH/POP post
命令の命令実行時間がオーバヘッドとなり、問題となる
場合があり、より高速な命令処理方式が望まれていた。
In the above-described conventional instruction processing, a predetermined general-purpose register is selected and saved on the stack by searching for 1 in each bit of the post data by microprogram processing. Therefore, the execution time of the instruction is long because the processing is complicated despite the short word length of the instruction. Further, in the case of a PUSH post instruction, for example, even if only bit 0 is 1, it is necessary to shift post data from bit 7 to bit 1 and decrement a register selection variable. And it was very inefficient. In particular, in interrupt processing that requires high-speed processing, this PUSH / POP post
There is a case where an instruction execution time of an instruction causes an overhead, which may cause a problem, and a faster instruction processing method has been desired.

また、処理を高速化するために、postデータの1のビ
ットを検出し、対応する汎用レジスタの選択を行う専用
のハードウェアを設け、指定された汎用レジスタの内容
をマイクロプログラム処理でスタックに退避した後、自
動的にそのビットが0にリセットされるように構成する
ことにより、必要最小限の実行クロック数で処理を行う
方式が知られている。しかし、このような専用ハードウ
ェアによる手法では、そのハードウェアがpostデータの
判別以外の用途には使用できないにもかかわらず、複雑
で規模も大きくなり、安価なマイクロコンピュータで採
用する方式としては適切でない。
In order to speed up the processing, dedicated hardware for detecting one bit of post data and selecting the corresponding general-purpose register is provided, and the contents of the specified general-purpose register are saved on the stack by microprogram processing. After that, a method is known in which the bit is automatically reset to 0 so that the processing is performed with the minimum necessary number of execution clocks. However, such a method using dedicated hardware is complicated and large in scale, although the hardware cannot be used for purposes other than post data discrimination, and it is suitable as a method adopted by inexpensive microcomputers. Not.

本発明の目的は、このような従来の問題点を改善し、
高速なPUSH/POP post命令処理を最小限のハードウェア
で実現することのできるマイクロコンピュータを提供す
ることにある。
An object of the present invention is to improve such conventional problems,
An object of the present invention is to provide a microcomputer capable of realizing high-speed PUSH / POP post instruction processing with minimum hardware.

〔課題を解決するための手段〕[Means for solving the problem]

本発明のマイクロコンピュータの構成は、処理データ
を記憶するデータメモリと、 実行すべきプログラムを記憶するプログラムメモリ
と、 このプログラムメモリのアドレスを順次生成するプロ
グラムカウンタと、前記プログラムメモルから読込んだ
命令コードを記憶する命令レジスタと、各種命令処理の
マイクロプログラムを記憶するマイクロROMと、このマ
イクロROMおよび前記命令レジスタの各出力を入力しそ
のマイクロROMのアドレスを生成するマイクロアドレス
生成部とを含み、前記マイクロプログラムのシーケンス
制御を行うと共に、前記マイクロROMから動作指示信号
を出力する命令実行制御部と、 複数の内部レジスタと、前記データメモリのスタック領
域のアドレスを指定するスタックポインタと、前記動作
指示信号に従って、少くとも1つ以上の前記内部レジス
タと前記スタックポインタで指定されるメモリとの間で
データ転送を単一の命令で実行する命令処理を行う論理
演算部とを含むデータ処理部とを備え、前記マイクロRO
Mには、前記動作指定信号を前記データ処理部制御のア
ドレス情報として前記内部レジスタを指定するフィール
ドと、前記マイクロプログラム実行中のステップの次の
ステップのアドレスを指定するフィールドと、前記マイ
クロプログラムの分岐条件を指定するフィールドとを有
することを特徴とする。
The configuration of the microcomputer of the present invention includes a data memory for storing processing data, a program memory for storing a program to be executed, a program counter for sequentially generating addresses of the program memory, and an instruction read from the program memory. An instruction register for storing codes, a micro-ROM for storing micro-programs for various instruction processing, and a micro-address generation unit for inputting each output of the micro-ROM and the instruction register and generating an address of the micro-ROM, An instruction execution control unit that controls the sequence of the microprogram and outputs an operation instruction signal from the microROM; a plurality of internal registers; a stack pointer that specifies an address of a stack area of the data memory; According to the traffic light, A data processing unit including a logical operation unit that performs an instruction process for executing data transfer between one or more of the internal registers and a memory specified by the stack pointer with a single instruction. RO
In M, a field for specifying the internal register using the operation specifying signal as address information for controlling the data processing unit, a field for specifying an address of a step next to a step during execution of the microprogram, And a field for specifying a branch condition.

本発明において、命令レジスタとマイクロアドレス生
成部との間に、その命令レジスタの命令コードの上位ビ
ットまたは下位ビットが全て「0」であることを判定す
るゲート回路を有し、このゲート回路の判定出力により
前記マイクロアドレス生成部への入力を少なくすること
もできる。さらに、マイクロROMにおけるマイクロプロ
グラムの分岐条件を指定するフィールドにおいて、その
分岐条件として転送対象の複数の内部レジスタのそれぞ
れを指定するビットフィールドを含むものとすることが
できる。
According to the present invention, a gate circuit is provided between the instruction register and the micro address generation unit to determine that all the upper bits or lower bits of the instruction code of the instruction register are “0”, The output can reduce the number of inputs to the microaddress generation unit. Further, the field for specifying the branch condition of the microprogram in the micro ROM may include a bit field for specifying each of a plurality of internal registers to be transferred as the branch condition.

〔実施例〕〔Example〕

以下本発明の実施例について図面を参照して説明す
る。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.

第1図は、本発明の一実施例のマイクロコンピュータ
の内部構成を示したブロック図である。本実施例は、命
令実行制御部1と、データ処理部2と、プログラムメモ
リ5と、データメモリ6と、これらをつなぐデータバス
3とから構成される。
FIG. 1 is a block diagram showing an internal configuration of a microcomputer according to one embodiment of the present invention. This embodiment includes an instruction execution control unit 1, a data processing unit 2, a program memory 5, a data memory 6, and a data bus 3 connecting these.

命令実行制御部1は、データバス3から読み込んだ命
令コードに基づき、所定のマイクロプログラムを順次実
行するためのシーケンス制御を行うとともに、データ処
理部2に対する動作指定信号4を出力する。データ処理
部2は、動作指定信号4の指定に基づき、データ転送,
算術論理演算等の各命令処理を行う。また、データバス
3には、マイクロコンピュータが実行するプログラムを
記憶するプログラムメモリ5と、処理データを記憶する
データメモリ6が接続されている。
The instruction execution control unit 1 performs sequence control for sequentially executing a predetermined microprogram based on the instruction code read from the data bus 3, and outputs an operation designation signal 4 to the data processing unit 2. The data processing unit 2 performs data transfer,
Each instruction processing such as arithmetic logic operation is performed. The data bus 3 is connected to a program memory 5 for storing a program executed by the microcomputer and a data memory 6 for storing processing data.

命令実行制御部1は、命令実行に伴いプログラムメモ
リ5のアドレスを順次生成するプログラムカウンタPC10
と、プログラムメモリ5から読込んだ命令コードを記憶
する8ビットの命令レジスタIR11と、命令毎のマイクロ
プログラムを記憶するマイクロROM12と、IR11及びマイ
クロROM12の出力を入力としマイクロROM12のアドレスを
生成するマイクロアドレス生成部13とから構成される。
The instruction execution control unit 1 includes a program counter PC10 for sequentially generating addresses of the program memory 5 as the instruction is executed.
And an 8-bit instruction register IR11 for storing an instruction code read from the program memory 5, a micro ROM 12 for storing a micro program for each instruction, and an output of the IR 11 and the micro ROM 12 to generate an address of the micro ROM 12. And a micro address generation unit 13.

第2図は、第1図のマイクロROM12の出力のフォーマ
ット図である。この出力は、動作指定信号4の状態を指
定する動作指定フィールドと、1命令中のマイクロプロ
グラムにおける現在実行中のステップの次のステップの
マイクロROM12のアドレスを指定する次アドレス指定フ
ィールドと、マイクロプログラムの分岐条件を指定する
分岐指定フィールドとから成る。
FIG. 2 is a format diagram of the output of the micro ROM 12 of FIG. This output includes an operation designating field for designating the state of the operation designating signal 4, a next address designating field for designating the address of the micro ROM 12 next to the currently executing step in the microprogram in one instruction, And a branch designation field for designating the branch condition.

また、第1図のマイクロアドレス生成部13では、命令
の実行開始タイミングではIR11の出力を選択して、IR11
の値に基づいて対応する命令のマイクロプログラムの開
始アドレスを生成する。第一ステップ目以降のタイミン
グでは、次アドレス指定フィールドが、マイクロアドレ
ス生成部13におけるマイクロROM12のアドレスに用いら
れ、次ステップのアドレスが生成される。分岐指定フィ
ールドは、マイクロアドレス生成部13におけるアドレス
修飾条件の指定に用いられる。以上の様にして、順次各
ステップのマイクロROM12の内容が読出され、動作指定
フィールドの状態によりデータ処理部2は一連の所定の
命令動作を行う。
In addition, the micro address generation unit 13 in FIG. 1 selects the output of IR11 at the instruction execution start timing, and
Generates the start address of the microprogram of the corresponding instruction based on the value of. At the timing after the first step, the next address designation field is used for the address of the micro ROM 12 in the micro address generation unit 13, and the address of the next step is generated. The branch specification field is used for specifying an address modification condition in the micro address generation unit 13. As described above, the contents of the micro ROM 12 in each step are sequentially read, and the data processing unit 2 performs a series of predetermined instruction operations according to the state of the operation designation field.

データ処理部2は、GR0からGR7までの8本のレジスタ
から成る汎用レジスタ20と、算術論理演算部ALU21と、
データメモリ6のスタック領域の先頭アドレスを指定す
るSP22とから構成される。
The data processing unit 2 includes a general-purpose register 20 including eight registers GR0 to GR7, an arithmetic and logic operation unit ALU21,
SP22 for designating the start address of the stack area of the data memory 6.

次に、GR0からGR7までの汎用レジスタ20のうち、post
データで指定した複数のレジスタをデータメモリ6のス
タック領域に退避する、PUSH post命令の命令動作につ
いて、第3図のマイクロプログラム処理のフローチャー
トを用いて説明する。ここで、postデータの構成は、第
6図の構成と同じである。
Next, among general-purpose registers 20 from GR0 to GR7, post
The instruction operation of the PUSH post instruction for saving a plurality of registers specified by data to the stack area of the data memory 6 will be described with reference to the microprogram processing flowchart of FIG. Here, the configuration of the post data is the same as the configuration of FIG.

まず、ステップ101で命令コードの2バイト目をIR11
に格納し、分岐指定フィールドにより、IR11の内容をア
ドレス修飾条件に指定して分岐(ステップ102)する。I
R11値が00000001B(Bは2進数)ならば、SP22をデクリ
メント(ステップ103)して、SP22が示すアドレスにGR0
の内容を転送(ステップ104)した後、命令を終了す
る。また、ステップ102でIR11値が00000011Bならば、SP
22をデクリメント(ステップ105),GR1の内容を転送
(ステップ106)、し、続いてSP22をデクリメント(ス
テップ103),GR0の内容を転送(ステップ104)する。さ
らに、IR11値が11111111Bならば、GR7からGR0の全ての
内容をSP22をデクリメントしながら転送する。同様に、
IR11値が00000000Bならば、転送は行わず直ちに命令を
終了する。IR11のその他の値についても同様に転送され
る。
First, in step 101, the second byte of the instruction code is
, And the content of IR11 is designated as the address modification condition by the branch designation field, and the process branches (step 102). I
If the R11 value is 00000001B (B is a binary number), SP22 is decremented (step 103), and GR0 is added to the address indicated by SP22.
Is transferred (step 104), and the instruction is terminated. If the IR11 value is 00000011B in step 102, the SP
22 is decremented (step 105) and the contents of GR1 are transferred (step 106), and then SP22 is decremented (step 103) and the contents of GR0 are transferred (step 104). Further, if the IR11 value is 11111111B, all contents of GR7 to GR0 are transferred while decrementing SP22. Similarly,
If the IR11 value is 00000000B, the instruction is immediately terminated without performing the transfer. The other values of IR11 are similarly transferred.

このようにIR11の内容に従い、指定された汎用レジス
タの組合せのみをスタック領域に退避するマイクロプロ
グラム処理をそれぞれ用意しておき、各々に分岐させて
処理を実行する。
In this way, according to the contents of IR11, microprogram processing for saving only the designated combination of general-purpose registers in the stack area is prepared, and the processing is executed by branching to each.

ここでIR11の組合せは256通りであり、全ての汎用レ
ジスタの組合せのマイクロプログラムステップが必要で
あるが、マイクロROM12は、通常マスクROMで構成するた
め、デバイスの集積度が一般のランダムロジックに比べ
て極めて高く、専用のハードウェアは一切必要としない
ため、最小限のハードウェア構成が可能である。また、
POP post命令についても同様の手法で実現できる。
Here, there are 256 combinations of IR11, and microprogram steps for all combinations of general-purpose registers are necessary.However, since microROM12 is usually composed of a mask ROM, the degree of device integration is lower than that of general random logic. Since it is extremely expensive and does not require any dedicated hardware, a minimum hardware configuration is possible. Also,
The POP post instruction can be implemented in a similar manner.

第4図は、本発明の第二の実施例のマイクロコンピュ
ータの内部構成を示したブロック図であり、本実施例
は、マイクロプログラムの分岐をpostデータを上位と下
位の4ビットに分割して行うようにしたものである。本
実施例は、第1の実施例に対しIR11とマイクロアドレス
生成部13との間にゲート回路14,15が挿入されている。
FIG. 4 is a block diagram showing the internal configuration of a microcomputer according to a second embodiment of the present invention. In this embodiment, the branch of the microprogram is divided into upper and lower 4 bits of post data. It is something to do. This embodiment is different from the first embodiment in that gate circuits 14 and 15 are inserted between the IR 11 and the microaddress generation unit 13.

命令実行制御部1は、第一の実施例と同じプログラム
カウンタPC10,IR11,マイクロROM12,マイクロアドレス生
成部13と、IR11の上位4ビットと下位4ビットとをそれ
ぞれデコードし、全4ビットが0であることを検出し、
マイクロアドレス生成部13にアドレス修飾条件として検
出信号16,17を出力するゲート回路14,15とから構成され
る。上記4ビットが0000Bの場合、上位ゼロ検出信号16
が論理値「1」になる。また、下位4ビットが0000Bの
場合、下位ゼロ検出信号17が論理値「1」になる。ここ
で、命令実行制御部1のシーケンス制御と関連するハー
ドウェアの基本的な動作については、第一の実施例と同
じであり、その説明は省略する。また、データ処理部2,
データバス3,動作指定信号4,プログラムメモリ5及びデ
ータメモリ6も第一の実施例と同様である。
The instruction execution control unit 1 decodes the same program counters PC10, IR11, micro ROM 12, and micro address generation unit 13 as in the first embodiment, and decodes the upper 4 bits and lower 4 bits of IR11, and sets all 4 bits to 0. Is detected,
And gate circuits 14 and 15 for outputting detection signals 16 and 17 to the microaddress generation unit 13 as address modification conditions. If the above 4 bits are 0000B, the upper zero detection signal 16
Becomes the logical value “1”. When the lower 4 bits are 0000B, the lower zero detection signal 17 has a logical value "1". Here, the basic operation of the hardware related to the sequence control of the instruction execution control unit 1 is the same as that of the first embodiment, and the description is omitted. Also, the data processing unit 2,
The data bus 3, the operation designation signal 4, the program memory 5, and the data memory 6 are the same as in the first embodiment.

次に、第二の実施例のPUSH post命令の命令動作につ
いて、第5図のマイクロプログラム処理のフローチャー
トを用いて説明する。ここでpostデータの構成は、第6
図の構成と同じである。
Next, the instruction operation of the PUSH post instruction of the second embodiment will be described with reference to the microprogram processing flowchart of FIG. Here, the structure of post data is the sixth
The configuration is the same as that shown in FIG.

まず、ステップ101で命令コードの2バイトめをIR11
に格納し、分岐指定フィールドにより、上位ゼロ検出信
号16,下位ゼロ検出信号17の状態をアドレス修飾条件に
指定して分岐(ステップ102)する。上位ゼロ信号16が
論理値「1」ならば、続いて分岐指定フィールドによ
り、IR11の上位4ビットの内容をアドレス修飾条件に指
定して分岐(ステップ111)する。IR11値が0001Bなら
ば、SP22をデクリメント(ステップ103)して、SP22が
示すアドレスにGR4の内容を転送(ステップ104)する。
また、ステップ103でIR11値が0011Bならば、SP22がデク
リメント(ステップ105)、GR5の内容を転送(ステップ
106)した後、SP22をデクリメント(ステップ103),GR4
の内容を転送(ステップ104)する。同様に、RI11値が1
111Bならば、GR7からGR4の全ての内容をSP22をデクリメ
ントしながら転送する。
First, in step 101, the second byte of the instruction code is IR11
The state of the upper zero detection signal 16 and the lower zero detection signal 17 is designated by the branch designation field as an address modification condition, and branching is performed (step 102). If the high-order zero signal 16 has the logical value "1", the branch specifying field is used to specify the contents of the high-order 4 bits of IR11 as the address modification condition and branch (step 111). If the IR11 value is 0001B, SP22 is decremented (step 103), and the contents of GR4 are transferred to the address indicated by SP22 (step 104).
If the IR11 value is 0011B in step 103, SP22 decrements (step 105), and transfers the contents of GR5 (step 105).
106) After that, decrement SP22 (step 103), GR4
Is transferred (step 104). Similarly, if the RI11 value is 1
If it is 111B, transfer all the contents of GR7 to GR4 while decrementing SP22.

次に、下位ゼロ信号17が論理値「1」ならば、続いて
IR11の下位4ビットの内容をアドレス修飾条件に指定し
て分岐(ステップ113)する。IR11値が0001Bならば、SP
22をデクリメント(ステップ114)して、SP22が示すア
ドレスにGR0の内容を転送(ステップ115)する。また、
ステップ113でIR11値が0011Bならば、SP22をデクリメン
ト(ステップ116),GR1の内容を転送(ステップ117)し
た後、SP22をデクリメント(ステップ114),GR0の内容
を転送(ステップ115)する。同様に、IR11値が1111Bな
らば、GR3からGR0の全ての内容をSP22をデクリメントし
ながら転送する。
Next, if the lower zero signal 17 is a logical value "1",
The contents of the lower 4 bits of IR11 are designated as address modification conditions, and branching is performed (step 113). If IR11 value is 0001B, SP
22 is decremented (step 114), and the contents of GR0 are transferred to the address indicated by SP22 (step 115). Also,
If the IR11 value is 0011B in step 113, SP22 is decremented (step 116) and the contents of GR1 are transferred (step 117), and then SP22 is decremented (step 114) and the contents of GR0 are transferred (step 115). Similarly, if the IR11 value is 1111B, all contents of GR3 to GR0 are transferred while decrementing SP22.

なお、ステップ101で、上位ゼロ信号16が論理値
「0」で下位ゼロ信号17が論理値「1」ならば、直接ス
テップ113に分岐し、GR7からGR4に関する処理は行わな
い。また、上位ゼロ信号16が論理値「1」で下位ゼロ信
号17が論理値「0」ならば、GR7からGR7に関する処理の
みを実行後、命令を終了(ステップ112)する。同様
に、ステップ102で上位ゼロ信号16と下位ゼロ信号17が
共に論理値「0」ならば、直ちに命令を終了する。IR11
のその他の値についても同様である。
In step 101, if the upper zero signal 16 is a logical value "0" and the lower zero signal 17 is a logical value "1", the flow directly branches to step 113, and the processing for GR7 to GR4 is not performed. If the high-order zero signal 16 is a logical value “1” and the low-order zero signal 17 is a logical value “0”, only the processing from GR7 to GR7 is executed, and the instruction is terminated (step 112). Similarly, if both the high-order zero signal 16 and the low-order zero signal 17 have the logical value "0" in step 102, the instruction is immediately terminated. IR11
The same applies to other values of.

このように、IR11を上位と下位の4ビットに分割し、
その内容に従い、指定された4種類の汎用レジスタの組
合せのみをスタック領域に退避するマイクロプログラム
処理をそれぞれ用意しておき、各々に分岐させて処理を
実行する。ここで、IR11の組合せは、上位4ビット,下
位4ビット合わせて32通りであり、また、ゲート回路1
4,15も、通常のNORゲートでよく、最小限のハードウエ
アで実現できる。
Thus, IR11 is divided into upper and lower 4 bits,
According to the contents, microprogram processing for saving only the combination of the designated four types of general-purpose registers in the stack area is prepared, and the processing is executed by branching to each of them. Here, there are 32 combinations of IR11 including the upper 4 bits and lower 4 bits, and the gate circuit 1
4 and 15 can also be normal NOR gates and can be realized with minimum hardware.

また、POP post命令についても、このハードウエア
をそのまま利用して同様に実現できる。
In addition, the POP post instruction can be similarly implemented using this hardware as it is.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明の方式によれば、PUSH/P
OP post命令を、postデータに基づくマイクロプログラ
ムの分岐により、指定された汎用レジスタのみをスタッ
ク領域に退避する処理を行うことができるため、命令の
実行クロック数が最小になると共に、postデータの1の
ビットをサーチする複雑な専用のハードウエアを必要と
せず、従来のハードウエアをそのまま利用できるため、
高速でかつ安価なマイクロコンピュータを容易に実現で
きる効果がある。
As described above, according to the method of the present invention, PUSH / P
The OP post instruction can be processed by saving the designated general-purpose register to the stack area by branching the microprogram based on the post data. Because it does not require complicated dedicated hardware for searching the bits of
There is an effect that a high-speed and inexpensive microcomputer can be easily realized.

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

第1図は本発明のマイクロコンピュータの第1の実施例
のブロック図、第2図は第1図のマイクロROM12の出力
フォーマットを示した図、第3図は第1図のマイクロプ
ログラム処理のフローチャート、第4図は本発明のマイ
クロコンピュータの第2の実施例のブロック図、第5図
は第4図のマイクロプログラム処理のフロチャート、第
6図は一般のPUSH post命令の命令コードの構成図、第
7図は第6図に用いられる汎用レジスタの構成図、第8
図は従来のマイクロコンピュータにおけるマイクロプロ
グラム処理の一例のフローチャートである。 1……命令実行制御部、2……データ処理部、3……デ
ータバス、4……動作指定信号、5……プログラムメモ
リ、6……データメモリ、10……プログラムカウンタ
(PC)、11……命令レジスタ(IR)、12……マイクロRO
M、13……マイクロアドレス生成部、14,15……ゲート回
路、16……上位ゼロ検出信号、17……下位ゼロ検出信
号、20……汎用レジスタ、21……算術論理演算部、(AL
U)、22……スタックポインタ(SP)、101〜115,201〜2
08……処理ステップ。
FIG. 1 is a block diagram of a first embodiment of the microcomputer of the present invention, FIG. 2 is a diagram showing an output format of the micro ROM 12 of FIG. 1, and FIG. 3 is a flowchart of the micro program processing of FIG. FIG. 4 is a block diagram of a microcomputer according to a second embodiment of the present invention, FIG. 5 is a flowchart of the microprogram processing of FIG. 4, and FIG. 6 is a configuration diagram of instruction codes of a general PUSH post instruction. FIG. 7 is a block diagram of a general-purpose register used in FIG. 6, and FIG.
FIG. 1 is a flowchart of an example of a microprogram process in a conventional microcomputer. 1 ... instruction execution control unit, 2 ... data processing unit, 3 ... data bus, 4 ... operation designation signal, 5 ... program memory, 6 ... data memory, 10 ... program counter (PC), 11 …… Instruction register (IR), 12 …… Micro RO
M, 13: Micro address generation unit, 14, 15: Gate circuit, 16: Upper zero detection signal, 17: Lower zero detection signal, 20: General purpose register, 21: Arithmetic logic operation unit, (AL
U), 22 ... Stack pointer (SP), 101-115, 201-2
08 …… Processing steps.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】処理データを記憶するデータメモリと、 実行すべきプログラムを記憶するプログラムメモリと、 このプログラムメモリのアドレスを順次生成するプログ
ラムカウンタと、前記プログラムメモリから読込んだ命
令コードを記憶する命令レジスタと、各種命令処理のマ
イクロプログラムを記憶するマイクロROMと、このマイ
クロROMおよび前記命令レジスタの各出力を入力しその
マイクロROMのアドレスを生成するマイクロアドレス生
成部とを含み、前記マイクロプログラムのシーケンス制
御を行うと共に、前記マイクロROMから動作指示信号を
出力する命令実行制御部と、 複数の内部レジスタと、前記データメモリのスタック領
域のアドレスを指定するスタックポインタと、前記動作
指示信号に従って、少くとも1つ以上の前記内部レジス
タと前記スタックポインタで指定されるメモリとの間で
データ転送を単一の命令で実行する命令処理を行う論理
演算部とを含むデータ処理部とを備え、前記マイクロRO
Mには、前記動作指定信号を前記データ処理部制御のア
ドレス情報として前記内部レジスタを指定するフィール
ドと、前記マイクロプログラム実行中のステップの次の
ステップのアドレスを指定するフィールドと、前記マイ
クロプログラムの分岐条件を指定するフィールドとを有
することを特徴とするマイクロコンピュータ。
1. A data memory for storing processing data, a program memory for storing a program to be executed, a program counter for sequentially generating addresses of the program memory, and an instruction code read from the program memory. An instruction register, a micro-ROM for storing micro-programs for processing various instructions, and a micro-address generation unit for inputting outputs of the micro-ROM and the instruction register and generating an address of the micro-ROM; An instruction execution control unit that performs sequence control and outputs an operation instruction signal from the micro ROM, a plurality of internal registers, a stack pointer that specifies an address of a stack area of the data memory, and a small number according to the operation instruction signal. And at least one of the internal cash registers And a data processing unit including a logic operation unit which performs instruction processing to execute data transfer in a single instruction with the memory specified data and by the stack pointer, the micro RO
M has a field for specifying the internal register using the operation specifying signal as address information for controlling the data processing unit, a field for specifying an address of a step next to a step during execution of the microprogram, A field for designating a branch condition.
【請求項2】命令レジスタとマイクロアドレス生成部と
の間に、その命令レジスタの命令コードの上位ビットま
たは下位ビットが全て「0」であることを判定するゲー
ト回路を有し、このゲート回路の判定出力により前記マ
イクロアドレス生成部への入力を少なくした請求項1記
載のマイクロコンピュータ。
2. A gate circuit between an instruction register and a micro-address generation unit, the gate circuit determining whether the upper bit or the lower bit of the instruction code of the instruction register is all "0". 2. The microcomputer according to claim 1, wherein the number of inputs to said micro address generation unit is reduced by a judgment output.
【請求項3】マイクロROMにおけるマイクロプログラム
の分岐条件を指定するフィールドにおいて、その分岐条
件として転送対象の複数の内部レジスタのそれぞれを指
定するビットフィールドを含むものである請求項1記載
のマイクロコンピュータ。
3. The microcomputer according to claim 1, wherein the field for specifying the microprogram branch condition in the microROM includes a bit field for specifying each of a plurality of internal registers to be transferred as the branch condition.
JP2001856A 1990-01-08 1990-01-08 Microcomputer Expired - Fee Related JP2985201B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001856A JP2985201B2 (en) 1990-01-08 1990-01-08 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001856A JP2985201B2 (en) 1990-01-08 1990-01-08 Microcomputer

Publications (2)

Publication Number Publication Date
JPH03204724A JPH03204724A (en) 1991-09-06
JP2985201B2 true JP2985201B2 (en) 1999-11-29

Family

ID=11513186

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001856A Expired - Fee Related JP2985201B2 (en) 1990-01-08 1990-01-08 Microcomputer

Country Status (1)

Country Link
JP (1) JP2985201B2 (en)

Also Published As

Publication number Publication date
JPH03204724A (en) 1991-09-06

Similar Documents

Publication Publication Date Title
US4181942A (en) Program branching method and apparatus
US4037211A (en) Address extending control unit
EP0238090B1 (en) Microcomputer capable of accessing internal memory at a desired variable access time
JP2845433B2 (en) Integrated circuit device
JPH10124310A (en) Arithmetic processor and microprocessor
US5046040A (en) Microprogram control apparatus using don't care bits as part of address bits for common instructions and generating variable control bits
US5301338A (en) System including central processing unit
JP2551167B2 (en) Microcomputer
JP2985201B2 (en) Microcomputer
US5483566A (en) Method and apparatus for modifying the contents of a register via a command bit
US6005502A (en) Method for reducing the number of bits needed for the representation of constant values in a data processing device
JPH056281A (en) Information processor
JPH0831033B2 (en) Data processing device
JPH0683618A (en) Flag control circuit
JPH0612253A (en) Microcomputer
JP3024410B2 (en) Programmable controller
JPS6398735A (en) Microcontroller
JPH02191042A (en) Interruption control system
SU883904A1 (en) Command sequence control device
SU1737440A1 (en) Device for software processing of digital data
JPH01316826A (en) Register file address circuit
JPH0625966B2 (en) Micro program controller
JPS6113345A (en) Processor of tagged data
JPH06100965B2 (en) Micro program controller
JPS63229530A (en) Interruption control system

Legal Events

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

Free format text: PAYMENT UNTIL: 20081001

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20091001

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees