JP2573711B2 - Micro subroutine control method - Google Patents

Micro subroutine control method

Info

Publication number
JP2573711B2
JP2573711B2 JP2058929A JP5892990A JP2573711B2 JP 2573711 B2 JP2573711 B2 JP 2573711B2 JP 2058929 A JP2058929 A JP 2058929A JP 5892990 A JP5892990 A JP 5892990A JP 2573711 B2 JP2573711 B2 JP 2573711B2
Authority
JP
Japan
Prior art keywords
subroutine
memory
output
microinstruction
circuit
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 - Lifetime
Application number
JP2058929A
Other languages
Japanese (ja)
Other versions
JPH03260726A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2058929A priority Critical patent/JP2573711B2/en
Publication of JPH03260726A publication Critical patent/JPH03260726A/en
Application granted granted Critical
Publication of JP2573711B2 publication Critical patent/JP2573711B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔目 次〕 〔概 要〕 〔産業上の利用分野〕 〔従来の技術〕 従来のマイクロサブルーチン制御系を示す図(第4
図) 第4図のマイクロサブルーチン制御系のネスティング
説明のためのマイクロプログラム及びタイムチャートの
例を示す図(第5図) 〔発明が解決しようとする課題〕 〔課題を解決するための手段〕 〔作 用〕 〔実施例〕 本発明の一実施例を示す図(第2図) 二重のネスティングをせつめいするマイクロプログラ
ム及びタイムチャートの例を示す図(第3図) 〔発明の効果〕 〔概 要〕 既存ハードウェアに僅かのハードウェアを追加して多
重ネスティングを可能にしたマイクロサブルーチン制御
方式に関し、 マイクロサブルーチンの多重ネスティングを為すこと
を目的とし、 制御メモリのアドレス系内に第1の選択回路を設け、
主メモリの書き込み系及び読み出し系内に第2の選択回
路を設け、制御メモリのアドレスを主メモリに書き込
み、そして読み出して前記制御メモリのアドレス系に供
給するように構成した。
DETAILED DESCRIPTION OF THE INVENTION [Table of Contents] [Overview] [Industrial Application Field] [Prior Art] FIG.
FIG. 4 is a diagram showing an example of a microprogram and a time chart for explaining nesting of the micro-subroutine control system in FIG. 4 (FIG. 5) [Problems to be solved by the invention] [Means for solving the problems] [ Operation] [Example] Diagram showing an embodiment of the present invention (FIG. 2) Diagram showing an example of a microprogram and time chart for double nesting (FIG. 3) [Effect of the invention] [ Outline] Regarding the micro subroutine control method which enables multiple nesting by adding a small amount of hardware to the existing hardware, with the aim of performing multiple nesting of micro subroutines, the first selection in the address system of the control memory Circuit,
A second selection circuit is provided in the write system and the read system of the main memory, so that the address of the control memory is written to the main memory, read, and supplied to the address system of the control memory.

〔産業上の利用分野〕[Industrial applications]

本発明は、既存ハードウェアに僅かのハードウェアを
追加して多重ネスティングを可能にしたマイクロサブル
ーチン制御方式に関する。
The present invention relates to a micro subroutine control method that enables multiple nesting by adding a small amount of hardware to existing hardware.

コンピュータシステム等においては、そのマクロ命令
の実行をマイクロプログラムで行なうように構成される
場合がある。そのようなマイクロプログラム制御を採用
したコンピュータシステムにおいても、マイクロサブル
ーチンが用いられている。マイクロプログラムの複雑化
を抑えるようにマイクロプログラムのマイクロサブルー
チンは、構成されている。マイクロプログラムにおいて
も、そのマイクロサブルーチンのネスティングが必要に
なり、そのネスティング段数に制限を付せずしてそのネ
スティングを行ない得ることが、必要になる場合も、又
存在する。
A computer system or the like may be configured to execute the macro instruction by a microprogram. Micro-subroutines are also used in computer systems employing such microprogram control. The micro subroutine of the micro program is configured to suppress the complexity of the micro program. Even in a micro program, there is a case where nesting of the micro subroutine is required and it is necessary to be able to perform the nesting without limiting the number of nesting steps.

〔従来の技術〕[Conventional technology]

従来のマイクロサブルーチン制御系を第4図に示す。
この図において、制御メモリ2から読み出されたメイン
ルーチンのマイクロ命令は、CPU19内にあるマイクロ命
令レジスタ(MiR)30へセットされると同時に、そのマ
イクロ命令がサブルーチン呼び出しマイクロ命令である
とき、呼び出されたサブルーチンからのリターンアドレ
スはリターンアドレス入力レジスタ(MiA)38にセット
される。マイクロ命令レジスタ30のNA部31には、ネック
ストアドレス〔マイクロプログラムにおいて次に実行す
べきマイクロプログラムアドレス〕が入っており、BC部
33には、分岐条件情報ビット(ステータスレジスタ34の
内容のゲート制御を行なう。)が入っている。ステータ
レジスタ34の内容は、前記マイクロサブルーチン制御系
によってセットされたマイクロ命令レジスタ30のE部35
の内容(マイクロ命令の実行規定情報ビット)に従って
動作を規律されるCPUによって、セットされる。
FIG. 4 shows a conventional micro subroutine control system.
In this figure, the microinstruction of the main routine read from the control memory 2 is set in a microinstruction register (MiR) 30 in the CPU 19 and is called when the microinstruction is a subroutine call microinstruction. The return address from the subroutine is set in the return address input register (MiA) 38. The NA section 31 of the microinstruction register 30 contains the next address (the microprogram address to be executed next in the microprogram) and the BC section.
33 contains a branch condition information bit (for performing gate control of the contents of the status register 34). The contents of the status register 34 are stored in the E section 35 of the micro instruction register 30 set by the micro subroutine control system.
Is set by the CPU whose operation is regulated in accordance with the contents (the execution instruction information bits of the micro instruction).

そのBC部33は、前述のサブルーチンの呼び出し制御に
供されるが、これを説明すると、次のようになる。サブ
ルーチンの読み出しは、その読み出しマイクロ命令のマ
イクロプログラムアドレスのLSBは“0"とするようにコ
ーディングされる(後述)。そのサブルーチン読み出し
マイクロ命令の実行(マイクロ命令の実行サイクル)に
おいて、該サブルーチン読み出しマイクロ命令の読み出
しにおいてリターンアドレス入力レジスタ38にセットさ
れたリターンアドレス(第5図のアドレス“M"参照)
は、リターンアドレス出力レジスタ(BMiA)40へコピー
される(サブルーチンからのリターンアドレスの準備が
為される)。前記制御メモリ2から読み出されてマイク
ロ命令レジスタ30へセットされた前記サブルーチン読み
出しマイクロ命令(第5図のCALL“SUB"参照)のネック
ストアドレス(NA)のLSB“0"はマルチプレクサ36にお
いて除かれてリターンアドレス入力レジスタ38にセット
され、前記マイクロ命令のNA部31のアドレスによる制御
メモリ2のアクセス、即ち、サブルーチンへの分岐が行
なわれる。第5図のMは、マイクロアドレスM1のLSB
“0"を除いたものを示す。
The BC unit 33 is used to control the above-mentioned subroutine call. This will be described below. The subroutine read is coded so that the LSB of the microprogram address of the read microinstruction is "0" (described later). In the execution of the subroutine read microinstruction (the microinstruction execution cycle), the return address set in the return address input register 38 in the reading of the subroutine read microinstruction (see the address "M" in FIG. 5).
Is copied to the return address output register (BMiA) 40 (the return address from the subroutine is prepared). The LSB "0" of the next address (NA) of the subroutine read microinstruction (see CALL "SUB" in FIG. 5) read from the control memory 2 and set in the microinstruction register 30 is removed by the multiplexer 36. The result is set in the return address input register 38, and the access of the control memory 2 by the address of the NA section 31 of the microinstruction, that is, the branch to the subroutine is performed. M in FIG. 5 is the LSB of the micro address M1.
Indicates those excluding "0".

次のマイクロ命令サイクルからサブルーチンの実行に
入る。そして、そのサブルーチンの処理が終了し、マイ
クロ命令レジスタ30にセットされたマイクロ命令のBCフ
ィールドによりサブルーチンからのリターン(第5図の
RTN参照)が指示されると、このマイクロ命令サイクル
においてリターンアドレス出力レジスタ40にセットされ
ていたアドレスのLSBを“1"としたアドレス(第5図の
アドレスM1参照)をマルチプレクサ36から制御メモリ2
へ与える。これにより、サブルーチンがコーディングさ
れたマイクロ命令の次のマイクロ命令からメインルーチ
ンの実行が行なわれる、つまりサブルーチンからのリタ
ーンが行なわれる。
Subroutine execution is started from the next microinstruction cycle. Then, the processing of the subroutine is completed, and the return from the subroutine is performed according to the BC field of the microinstruction set in the microinstruction register 30 (FIG. 5).
When RTN is specified, the address in which the LSB of the address set in the return address output register 40 is set to "1" in this microinstruction cycle (see address M1 in FIG. 5) is transferred from the multiplexer 36 to the control memory 2 (see FIG. 5).
Give to. As a result, the main routine is executed from the microinstruction next to the microinstruction in which the subroutine is coded, that is, the return from the subroutine is performed.

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

前述の従来方式によれば、サブルーチンへの分岐は出
来るが、そのサブルーチンから次のサブルーチン等への
分岐を重ねることは出来ない。サブルーチンからのリタ
ーンに用いるアドレスを保持して置くハードウェアとし
ては、リターンアドレス出力レジスタ40しかないからで
ある。従って、この従来方式では、サブルーチンの中か
ら、更にサブルーチンを呼び出すと言うサブルーチンの
ネスティングは行ない得ない。
According to the above-described conventional method, a branch to a subroutine can be made, but a branch from that subroutine to the next subroutine cannot be repeated. This is because there is only a return address output register 40 as hardware that holds an address used for return from a subroutine. Therefore, in this conventional method, nesting of a subroutine for calling a subroutine from another subroutine cannot be performed.

本発明は、斯かる問題点に鑑みて創作されたもので、
ハードウェア増を最小限に抑えつつ、しかもハードウェ
アの制限を受けずにマイクロサブルーチンの多重ネステ
ィングをマイクロプログラムの中で遂行し得るマイクロ
サブルーチン制御方式を提供することをその目的とす
る。
The present invention has been created in view of such problems,
It is an object of the present invention to provide a micro-subroutine control method capable of performing multiple nesting of micro-subroutines in a microprogram while minimizing an increase in hardware and without being restricted by hardware.

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

第1図は、請求項1記載の発明の原理ブロック図を示
す。この図に示すように、請求項1記載の発明は、制御
メモリ2と、入力保持部4及び出力保持部6を有するリ
ターンアドレス出力部8と、前記制御メモリ2から読み
出されたマイクロ命令がサブルーチン呼び出しマイクロ
命令であるときリターンアドレスを前記入力保持部4に
保持させる制御系10と、主メモリ12と、演算回路14と、
演算回路−メモリデータ転送系16と、メモリ−演算回路
データ転送系18と、前記入力保持部4及び前記演算回路
14の出力と、前記出力保持部6の入力との間に設けられ
た第1の選択回路20と、前記出力保持部6及び前記メモ
リ−演算回路データ転送系18の出力と、前記演算回路14
の入力との間に設けられた第2の選択回路22と、メイン
ルーチンからサブルーチンの呼び出し、又は或るサブル
ーチンから多重度の1つ深いサブルーチンの呼び出しに
際して、前記入力保持部4に保持された当該多重度での
リターンアドレスを前記第1の選択回路20、前記出力保
持部6、前記第2の選択回路22、前記演算回路14、及び
前記演算回路−メモリデータ転送系16を経て前記主メモ
リ12へ転送して前記主メモリ12に書き込ませる書き込み
制御手段24と、或るサブルーチンから多重度の1つ浅い
サブルーチン、又はメインルーチンへの復帰に際して、
当該多重度でのリターンアドレスを前記主メモリ12から
読み出して前記メモリ−演算回路データ転送系18、前記
第2の選択回路22、前記演算回路14、及び前記第1選択
回路20を経て前記出力保持部6に保持させる読み出し制
御手段26とを設け、多重サブルーチンネスティング処理
を行うように構成される。
FIG. 1 is a block diagram showing the principle of the present invention. As shown in FIG. 1, the invention according to claim 1 includes a control memory 2, a return address output unit 8 having an input holding unit 4 and an output holding unit 6, and a microinstruction read from the control memory 2. A control system 10 for holding a return address in the input holding unit 4 when it is a subroutine call microinstruction, a main memory 12, an arithmetic circuit 14,
Arithmetic circuit-memory data transfer system 16, memory-arithmetic circuit data transfer system 18, the input holding unit 4, and the arithmetic circuit
A first selection circuit 20 provided between an output of the output holding unit 6 and an input of the output holding unit 6; an output of the output holding unit 6 and the output of the memory-arithmetic circuit data transfer system 18;
The second selection circuit 22 provided between the input holding unit 4 and the second selection circuit 22 provided between the input holding unit 4 when the subroutine is called from the main routine, or when the subroutine is called one level deeper from a certain subroutine. The return address at the multiplicity is transferred to the main memory 12 via the first selection circuit 20, the output holding unit 6, the second selection circuit 22, the arithmetic circuit 14, and the arithmetic circuit-memory data transfer system 16. Writing control means 24 for transferring the data to the main memory 12 and writing the data to the main memory 12;
The return address at the multiplicity is read from the main memory 12 and the output is held via the memory-arithmetic circuit data transfer system 18, the second selection circuit 22, the arithmetic circuit 14, and the first selection circuit 20. A reading control means 26 to be held by the unit 6 is provided to perform a multiple subroutine nesting process.

〔作 用〕(Operation)

制御メモリ2に格納されているマイクロプログラムの
各マイクロ命令が、順次に読み出されて実行されること
により、データ処理システム内に所要の処理が進められ
て行く。その処理において、制御メモリ2から読み出さ
れたマイクロ命令がサブルーチン呼び出しマイクロ命令
であると、リターンアドレス出力系の入力保持部4にリ
ターンアドレスが保持される。
By sequentially reading and executing each microinstruction of the microprogram stored in the control memory 2, required processing proceeds in the data processing system. In this process, if the microinstruction read from the control memory 2 is a subroutine call microinstruction, the return address is held in the input holding unit 4 of the return address output system.

そのサブルーチン呼び出しマイクロ命令の実行による
メインルーチンからサブルーチンの呼び出し、又は或る
サブルーチンから多重度の1つ深いサブルーチンの呼び
出しに際して、前記入力保持部4に保持された当該多重
度でのリターンアドレスは、書き込み制御手段24によっ
て前記第1の選択回路20、前記出力保持部6、前記第2
の選択回路22、前記演算回路14、及び前記演算回路−メ
モリデータ転送系16を経て前記メモリ12へ転送されて前
記主メモリ12に書き込まれる。
When a subroutine is called from the main routine by executing the subroutine call microinstruction or a subroutine is called from a certain subroutine, the return address at the multiplicity held in the input holding unit 4 is written. The control unit 24 controls the first selection circuit 20, the output holding unit 6, the second
Is transferred to the memory 12 via the selection circuit 22, the arithmetic circuit 14, and the arithmetic circuit-memory data transfer system 16 and written into the main memory 12.

又、前述のようにして読み出されたサブルーチンにお
いて更にネスティングが為されるときも、同様である。
The same applies when nesting is further performed in the subroutine read as described above.

前述のようにして、そのマイクロプログラムに多重ネ
スティングされたサブルーチンから順次各サブルーチン
を経てのメインルーチンへのリターンは、前述のように
して前記主メモリ12へ格納されたリターンアドレスのう
ちの、ネスティング多重度の低いリターンアドレス(ネ
スティングの最も深いサブルーチンから戻るためのリタ
ーンアドレス)から順次に読み出して行う。主メモリ12
から読み出されたリターンアドレスは、読み出し制御手
段26によって前記主メモリ12から読み出されて前記メモ
リ−演算回路データ転送系18、前記第2の選択回路22、
前記演算回路14、及び前記第1選択回路20を経て前記出
力保持部6に保持されてリターン(復帰)後の制御メモ
リ2からのマイクロ命令の読み出しに用いられる。
As described above, the return from the subroutine nested in the microprogram to the main routine through each subroutine in sequence is the nesting multiple of the return addresses stored in the main memory 12 as described above. The read operation is performed by sequentially reading from the return address having a low severity (return address for returning from the deepest nesting subroutine). Main memory 12
The return address read from the memory is read from the main memory 12 by the read control means 26, and the memory-arithmetic circuit data transfer system 18, the second selection circuit 22,
It is held in the output holding unit 6 via the arithmetic circuit 14 and the first selection circuit 20, and is used for reading a microinstruction from the control memory 2 after return (return).

前述のようなマイクロサブルーチンの多重ネスティン
グにおいて、新規に設けたハードウェアとしては、第1
の選択回路20と、第2の選択回路22のうちの、請求項1
記載の発明で必要となる拡張部分だけである。従って、
僅かなハードウェアの追加で、そのハードウェア量の制
限を少しも受けることなしにマイクロサブルーチンの多
重ネスティングをマイクロプログラムに自在に設定する
ことができる。
In the multiple nesting of micro subroutines as described above, the newly provided hardware includes the first
2. The selection circuit 20 of the first and second selection circuits 22.
Only the extensions required for the described invention. Therefore,
With the addition of a small amount of hardware, multiple nesting of micro subroutines can be freely set in a microprogram without any restriction on the amount of hardware.

〔実施例〕〔Example〕

第2図は請求項1記載の発明の一実施例を示す。この
図に示されるCPU29には、第4図に示される構成要素、
即ち制御メモリ2、マイクロ命令レジスタ30、アンド回
路32、ステータスレジスタ34、マルチプレクサ36、リタ
ーンアドレス入力レジスタ38、及びリターンアドレス出
力レジスタ40のほかに、主メモリ12に接続されるドライ
バ56及びレシーバ58、リードバッファ(RB)46、ライト
バッファ(WB)50、汎用レジスタ44、マルチプレクサ4
8、及び算術論理演算回路(ALU)49、並びに配線52、配
線54、マルチプレクサ42が示されている。前述のような
ドライバ56及びレシーバ58、リードバッファ46、ライト
バッファ50、汎用レジスタ44、マルチプレクサ48、及び
ALU49は、従来のCPUに設けられているものである。但
し、マルチプレクサ48は、配線52をも収容し得るように
拡張されている。そして、マルチプレクサ42及びマルチ
プレクサ48は、マイクロ命令でアクセス可能なアドレス
を割り当てられている、即ち本発明におけるCPU29にお
けるマイクロ命令が実行されることによって、図示しな
いCPU29内のハードウェアを経て供給される選択信号に
よって、それらの各入力へ供給されて来るアドレスのう
ちの1つを選択するように構成されている。
FIG. 2 shows an embodiment of the first aspect of the present invention. The CPU 29 shown in this figure includes the components shown in FIG.
That is, in addition to the control memory 2, the micro instruction register 30, the AND circuit 32, the status register 34, the multiplexer 36, the return address input register 38, and the return address output register 40, a driver 56 and a receiver 58 connected to the main memory 12, Read buffer (RB) 46, write buffer (WB) 50, general-purpose register 44, multiplexer 4
8, and an arithmetic logic circuit (ALU) 49, a wiring 52, a wiring 54, and a multiplexer 42 are shown. Driver 56 and receiver 58 as described above, read buffer 46, write buffer 50, general-purpose register 44, multiplexer 48, and
The ALU 49 is provided in a conventional CPU. However, the multiplexer 48 is extended so as to be able to accommodate the wiring 52 as well. The multiplexer 42 and the multiplexer 48 are assigned addresses that can be accessed by microinstructions, that is, the selections supplied via hardware in the CPU 29 (not shown) by the execution of the microinstructions in the CPU 29 of the present invention. The signal is configured to select one of the addresses provided to their respective inputs.

第2図において、リターンアドレス入力レジスタ38
は、第1図の入力保持部4に対応し、リターンアドレス
出力レジスタ40は、第1図の出力保持部6に対応する。
リターンアドレス入力レジスタ38、リターンアドレス出
力レジスタ40、マルチプレクサ36は、第1図のリターン
アドレス出力系8に対応し、制御メモリ2のマイクロ命
令、マイクロ命令レジスタ30等は、第1図の制御系10に
対応する。ALU49は、第1図の演算回路14に対応する。
ライトバッファ50、ドライバ56は、第1図の算術論理演
算回路−メモリデータ転送系16に対応し、レシーバ58、
リードバッファ46、汎用レジスタ44は、第1図のメモリ
−算術論理演算回路データ転送系18に対応する。マルチ
プレクサ42は、第1図の第1の選択回路20に対応し、マ
ルチプレクサ48は、第1図の第2の選択回路22に対応す
る。
In FIG. 2, the return address input register 38
Corresponds to the input holding unit 4 in FIG. 1, and the return address output register 40 corresponds to the output holding unit 6 in FIG.
The return address input register 38, the return address output register 40, and the multiplexer 36 correspond to the return address output system 8 in FIG. 1, and the microinstruction and the microinstruction register 30 of the control memory 2 correspond to the control system 10 in FIG. Corresponding to The ALU 49 corresponds to the arithmetic circuit 14 in FIG.
The write buffer 50 and the driver 56 correspond to the arithmetic and logic operation circuit-memory data transfer system 16 in FIG.
The read buffer 46 and the general-purpose register 44 correspond to the memory-arithmetic logic operation circuit data transfer system 18 in FIG. The multiplexer 42 corresponds to the first selection circuit 20 in FIG. 1, and the multiplexer 48 corresponds to the second selection circuit 22 in FIG.

前述のようなシステム構成におけるマイクロサブルー
チン呼び出し動作を以下に説明する。
The operation of calling the micro subroutine in the above system configuration will be described below.

メイルーチンから第一段目のサブルーチンへの分岐、
そしてそこからのリターンは、前述した従来のマイクロ
サブルーチン制御方式と全く同じであるので、その説明
は繰り返さない。(第3図の(A)及び(B)中の
は、第一段目のサブルーチン呼び出しマイクロ命令を示
す。
Branch from the main routine to the first subroutine,
Then, the return from there is exactly the same as the above-described conventional micro subroutine control method, and the description thereof will not be repeated. ((A) and (B) of FIG. 3 show a subroutine call microinstruction in the first stage.

次に、第一段目のサブルーチンの中で第二段目のサブ
ルーチンを呼び出す場合の動作例を、第3図を参照して
説明する。
Next, an example of the operation when the second-stage subroutine is called from the first-stage subroutine will be described with reference to FIG.

第3図の(A)のサブルーチンにおける処理が進んで
第3図の(A)の(4)に示すマイクロ命令(第3図の
(A)及び(B)中の参照)の実行に入ると、このマ
イクロ命令の実行によりリターンアドレス出力レジスタ
40のマイクロアドレスM1は、配線52、マルチプレクサ4
8、そしてALU49を介してライトバッファ50へ転送され
(第3図の(B)の(3)及び(5)参照)、そして、
第3図の(A)の(5)に示すマイクロ命令(第3図の
(A)及び(B)中の参照)の実行によりライトバッ
ファ50のリターンアドレスMは、ドライバ56を介して主
メモリ12内の第二段目のサブルーチン対応の記憶位置へ
書き込まれる(第3図の(B)の(5)及び(6)参
照)。前記2つのマイクロ命令による前記リターンアド
レス出力レジスタ40のリターンアドレスMの、配線52、
マルチプレクサ48、そしてALU49を介してライトバッフ
ァ50への転送制御、及びライトバッファ50からドライバ
56を経て主メモリ12への転送制御は、従来のリードバッ
ファ46、又は汎用レジスタ44からマルチプレクサ48、AL
U49、そしてライトバッファ50へのデータ転送制御、及
びライトバッファ50からドライバ56を経て主メモリ12へ
の転送制御に準じて行なわれる。
When the processing in the subroutine of FIG. 3 (A) proceeds and the execution of the microinstruction shown in (4) of FIG. 3 (A) (refer to (A) and (B) of FIG. 3) starts. By executing this microinstruction, return address output register
40 micro-addresses M1, wiring 52, multiplexer 4
8, and transferred to the write buffer 50 via the ALU 49 (see (3) and (5) in FIG. 3B), and
Execution of the microinstruction shown in (5) of FIG. 3 (A) (refer to (A) and (B) of FIG. 3) causes the return address M of the write buffer 50 to become the main memory via the driver 56. It is written into the storage position corresponding to the second-stage subroutine in 12 (see (5) and (6) in FIG. 3B). The wiring 52 of the return address M of the return address output register 40 by the two microinstructions,
Transfer control to write buffer 50 via multiplexer 48 and ALU 49, and driver from write buffer 50
The transfer control to the main memory 12 via 56 is performed by controlling the conventional read buffer 46 or the general-purpose register 44 to the multiplexer 48 and the AL.
U49 and data transfer control to the write buffer 50 and transfer control from the write buffer 50 to the main memory 12 via the driver 56 are performed.

この第一段目のサブルーチンへのリターン処理を行な
った後に、第二段目のサブルーチンを呼び出すマイクロ
命令(第3図の(A)及び(B)中の参照)の実行を
行なって、前述のメインルーチンから第一段目のサブル
ーチンへの分岐と同様に、メインルーチンへのリターン
処理を行ない、第一段目のサブルーチンを再開させるマ
イクロ命令アドレス生成用アドレスA(前述と同様A0の
LSBを除いたもの)をリターンアドレス出力レジスタ40
にセットさせる(第3図の(B)の(3)参照)。そし
て、前記第二段目のサブルーチンを呼び出すマイクロ命
令(第3図の(A)及び(B)中の参照)の実行によ
って呼び出された前記第二段目のサブルーチンの処理
(第3図ので示すマイクロ命令以降参照)を行なう。
その処理終了でリターンマイクロ命令(第3図の(A)
及び(B)中の参照)の実行を行なうと、前述のサブ
ルーチンからメインルーチンへのリターンの場合と同様
の処理、つまり前述の第二段目のサブルーチンの呼び出
しマイクロ命令の次のマイクロ命令を呼び出す処理とな
る。これをマイクロプログラムステップで言えば、第3
図の(A)のステップ(11)からステップ(7)へ飛
ぶ。即ち、第一段目のサブルーチンへ戻る。
After performing the return processing to the first-stage subroutine, the micro-instruction for calling the second-stage subroutine (see FIGS. 3A and 3B) is executed, and As in the case of branching from the main routine to the first-stage subroutine, a return process to the main routine is performed, and a micro-instruction address generation address A (A0 in the same manner as described above) for restarting the first-stage subroutine.
(Excluding LSB) is returned address output register 40
(See (3) of FIG. 3 (B)). Then, the processing of the subroutine of the second stage called by execution of the microinstruction (refer to (A) and (B) of FIG. 3) for calling the subroutine of the second stage (shown in FIG. 3) (Refer to the micro instruction).
At the end of the processing, a return microinstruction ((A) in FIG. 3)
And (B), the same processing as in the case of returning from the subroutine to the main routine, that is, the microinstruction next to the microinstruction of the second subroutine is called. Processing. In micro program steps, this is the third
The process jumps from step (11) to step (7) in FIG. That is, the process returns to the first subroutine.

そして、その第一段目のサブルーチンの処理が開始さ
れ、リターンアドレス出力レジスタ40のリターンアドレ
ス生成用アドレスAを用いてそのサブルーチンでのマイ
クロ命令(第3図の(A)及び(B)中の参照)の実
行を行なうと、第3図の(B)の(3)に示すように主
メモリ12へ退避されており、前記マイクロ命令の実行
により主メモリ12から読み出された(メインルーチンか
らサブルーチンの呼び出しを行なったマイクロ命令の)
次のマイクロ命令のアドレス(リターンアドレス)を生
成するリターンアドレス生成用アドレスMが、レシーバ
58を経てリードバッファ46へ転送され、そして第3図の
(A)及び(B)中ので示すマイクロ命令を実行する
ことにより第一段目のサブルーチンからメインルーチン
への前記アドレスMをリターンアドレス出力レジスタ40
へセットすることが出来る(第3図の(B)の(3)参
照)。このリターンアドレス出力レジスタ40への前記ア
ドレスMのセットは、リードバッファ46からマルチプレ
クサ48、ALU49、配線54、そしてマルチプレクサ42を介
して行なわれる。
Then, the processing of the first-stage subroutine is started, and the micro-instruction in the subroutine ((A) and (B) of FIG. 3) is performed using the return address generation address A of the return address output register 40. (See (3) of FIG. 3B), the program is saved in the main memory 12, and is read from the main memory 12 by executing the microinstruction (from the main routine). Of the microinstruction that called the subroutine)
The return address generation address M for generating the address (return address) of the next microinstruction is transmitted to the receiver.
The address M from the first-stage subroutine to the main routine is output as a return address by executing the microinstruction indicated by (a) and (b) in FIG. Register 40
(See (3) of FIG. 3 (B)). The setting of the address M in the return address output register 40 is performed from the read buffer 46 through the multiplexer 48, the ALU 49, the wiring 54, and the multiplexer 42.

そして、その次のマイクロ命令サイクルが開始された
ときに、制御メモリ2から読み出されるマイクロ命令
は、第3図の(A)及び(B)に示すマイクロ命令と
なる。つまり、メインルーチンの実行、即ち第3図の
(A)のステップ(2)からの実行が再開される。
When the next microinstruction cycle starts, the microinstructions read from the control memory 2 are the microinstructions shown in FIGS. 3A and 3B. That is, the execution of the main routine, that is, the execution from step (2) in FIG. 3A is restarted.

なお、前記実施例においては、二重のネスティングの
場合について説明したが、三重以上のネスティングをマ
イクロプログラムの中に構築することが出来る。そのた
めのアドレス退避処理、及び退避アドレス読み出し処理
は、前述と同様にマイクロ命令を用いて前述のアドレス
退避/読み出し系の中で達成し得る。但し、そのマイク
ロ命令によるリターンアドレス出力レジスタ40のアドレ
スのライトバッファ50への退避、及びライトバッファ50
からリードバッファ46への読み出しにおいてそのネステ
ィングに応じた格納、及び読み出しを行なうようにする
ことを要する。
In the above embodiment, the case of double nesting has been described. However, triple or more nesting can be constructed in a microprogram. The address saving process and the saved address reading process therefor can be achieved in the above-described address saving / reading system using a microinstruction in the same manner as described above. However, the address of the return address output register 40 is saved to the write buffer 50 by the microinstruction, and the write buffer 50
It is necessary to perform storage and readout according to the nesting in reading from the read buffer 46 to the read buffer 46.

又、退避されるリターンアドレス生成用アドレスは、
前述のようにLSBなしの場合でなく、リターンアドレス
そのものであってもよい。本願明細書でのリターンアド
レスはその意味で理解されたい。
Also, the saved return address generation address is
The return address itself may be used instead of the case without the LSB as described above. The return address in this specification should be understood in that sense.

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

以上述べたところから明らかなように請求項1記載の
発明によれば、ハードウェアの僅かな付加で、マイクロ
サブルーチンの多重ネスティングをハードウェア量の制
限を少しも受けることなしにマイクロプログラムの中に
自在に設定することが出来る。
As is apparent from the above description, according to the first aspect of the present invention, with a small addition of hardware, multiple nesting of micro subroutines can be incorporated into a microprogram without any restriction on the amount of hardware. Can be set freely.

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

第1図は請求項1記載の発明の原理ブロック図、 第2図は請求項1記載の発明の一実施例を示す図、 第3図は二重のネスティングを説明するマイクロプログ
ラム及びタイムチャートの例を示す図、 第4図は従来のマイクロサブルーチン制御系を示す図、 第5図は第4図に示すマイクロサブルーチン制御系にお
けるネスティングを説明するマイクロプログラム及びタ
イムチャートの例を示す図である。 第1図及び第2図において、 2は制御メモリ、 4は入力保持部(リターンアドレス入力レジスタ38)、 6は出力保持部(リターンアドレス出力レジスタ40)、 8はリターンアドレス出力系(リターンアドレス入力レ
ジスタ38、リターンアドレス出力レジスタ40、マルチプ
レクサ36)、 10は制御系(制御メモリ2のマイクロ命令、マイクロ命
令レジスタ30)、 12は主メモリ、 14は演算回路(ALU49)、 16は演算回路−メモリデータ転送系(ライトバッファ5
0、ドライバ56)、 18はメモリ−演算回路データ転送系(レシーバ58、リー
ドバッファ46、汎用レジスタ44)、 20は第1の選択回路(マルチプレクサ36)、 22は第2の選択回路(マルチプレクサ48)である。
FIG. 1 is a block diagram of the principle of the invention described in claim 1, FIG. 2 is a diagram showing an embodiment of the invention described in claim 1, and FIG. 3 is a microprogram and time chart for explaining double nesting. FIG. 4 is a diagram showing an example, FIG. 4 is a diagram showing a conventional micro subroutine control system, and FIG. 5 is a diagram showing an example of a microprogram and a time chart for explaining nesting in the micro subroutine control system shown in FIG. 1 and 2, 2 is a control memory, 4 is an input holding unit (return address input register 38), 6 is an output holding unit (return address output register 40), 8 is a return address output system (return address input). Register 38, return address output register 40, multiplexer 36), 10 is a control system (micro instruction of control memory 2, micro instruction register 30), 12 is main memory, 14 is arithmetic circuit (ALU49), 16 is arithmetic circuit-memory Data transfer system (write buffer 5
0, driver 56), 18 is a memory-arithmetic circuit data transfer system (receiver 58, read buffer 46, general-purpose register 44), 20 is a first selection circuit (multiplexer 36), and 22 is a second selection circuit (multiplexer 48). ).

───────────────────────────────────────────────────── フロントページの続き (72)発明者 野々村 一泰 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 渡部 徹 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 竹野 巧 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 加藤 慎哉 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (56)参考文献 特開 昭61−98444(JP,A) 特開 昭60−243744(JP,A) 特開 昭58−80742(JP,A) ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Kazuyasu Nonomura 1015 Uedanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Prefecture Inside Fujitsu Limited (72) Inventor Toru 1015 Kamikodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Fujitsu Limited (72) Inventor Takumi Takeno 1015 Uedanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Inside Fujitsu Co., Ltd. (72) Inventor Shinya Kato 1015 Ueodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Fujitsu Co., Ltd. (56) References JP Akira 61-98444 (JP, A) JP-A-60-243744 (JP, A) JP-A-58-80742 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】制御メモリと、 入力保持部及び出力保持部を有するリターンアドレス出
力部と、 前記制御メモリから読み出されたマイクロ命令がサブル
ーチン呼び出しマイクロ命令であるときリターンアドレ
スを前記入力保持部に保持される制御系と、 主メモリと、 演算回路と、 演算回路−メモリデータ転送系と、 メモリ−演算回路データ転送系と、 前記入力保持部及び前記演算回路の出力と、前記出力保
持部の入力との間に設けられた第1の選択回路と、 前記出力保持部及び前記メモリ−演算回路データ転送系
の出力と、前記演算回路の入力との間に設けられた第2
の選択回路と、 メインルーチンからサブルーチンの呼び出し、又は或る
サブルーチンから多重度の1つ深いサブルーチンの呼び
出しに際して、前記入力保持部に保持された当該多重度
でのリターンアドレスを前記第1の選択回路、前記出力
保持部、前記第2の選択回路、前記演算回路、及び前記
演算回路−メモリデータ転送系を経て前記主メモリへ転
送して前記主メモリに書き込ませる書き込み制御手段
と、 或るサブルーチンから多重度の1つ浅いサブルーチン、
又はメインルーチンへの復帰に際して、当該多重度での
リターンアドレスを前記主メモリから読み出して前記メ
モリ−演算回路データ転送系、前記第2の選択回路、前
記演算回路、及び前記第1選択回路を経て前記出力保持
部に保持させる読み出し制御手段とを設けて多重サブル
ーチンネスティング処理を行うようにしたことを特徴と
するマイクロサブルーチン制御方式。
A control memory; a return address output section having an input holding section and an output holding section; and a return address is sent to the input holding section when a microinstruction read from the control memory is a subroutine call microinstruction. A control system to be held, a main memory, an operation circuit, an operation circuit-memory data transfer system, a memory-operation circuit data transfer system, an output of the input holding unit and the output of the operation circuit, and A first selection circuit provided between the input and the input, an output of the output holding unit and the output of the memory-arithmetic circuit data transfer system, and a second selector provided between the input of the arithmetic circuit.
And a return circuit at the multiplicity stored in the input holding unit when the subroutine is called from the main routine or the subroutine is called one level deeper from a certain subroutine. Writing control means for transferring the data to the main memory via the output holding unit, the second selection circuit, the arithmetic circuit, and the arithmetic circuit-memory data transfer system and writing the data in the main memory; One shallow subroutine of multiplicity,
Alternatively, when returning to the main routine, the return address at the multiplicity is read from the main memory and passed through the memory-arithmetic circuit data transfer system, the second selection circuit, the arithmetic circuit, and the first selection circuit. A micro-subroutine control method, wherein a read control unit for holding the output in the output holding unit is provided to perform a multiple subroutine nesting process.
JP2058929A 1990-03-09 1990-03-09 Micro subroutine control method Expired - Lifetime JP2573711B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2058929A JP2573711B2 (en) 1990-03-09 1990-03-09 Micro subroutine control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2058929A JP2573711B2 (en) 1990-03-09 1990-03-09 Micro subroutine control method

Publications (2)

Publication Number Publication Date
JPH03260726A JPH03260726A (en) 1991-11-20
JP2573711B2 true JP2573711B2 (en) 1997-01-22

Family

ID=13098526

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2058929A Expired - Lifetime JP2573711B2 (en) 1990-03-09 1990-03-09 Micro subroutine control method

Country Status (1)

Country Link
JP (1) JP2573711B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6198444A (en) * 1984-10-19 1986-05-16 Nec Corp Control memory system
JPS60243744A (en) * 1985-05-13 1985-12-03 Hitachi Ltd Information processor

Also Published As

Publication number Publication date
JPH03260726A (en) 1991-11-20

Similar Documents

Publication Publication Date Title
US4187539A (en) Pipelined data processing system with centralized microprogram control
EP0476722B1 (en) Data processing system
JPS6161436B2 (en)
US4388682A (en) Microprogrammable instruction translator
JPH0346850B2 (en)
JPS62197830A (en) Data processing system
US4136383A (en) Microprogrammed, multipurpose processor having controllable execution speed
JPH0769791B2 (en) Microprocessor
JPH0414385B2 (en)
US3840864A (en) Multiple memory unit controller
US5420997A (en) Memory having concurrent read and writing from different addresses
US4674063A (en) Information processing apparatus having a sequence control function
US4754424A (en) Information processing unit having data generating means for generating immediate data
US4812970A (en) Microprogram control system
JP2573711B2 (en) Micro subroutine control method
US5151993A (en) Data processor performing operation on data having length shorter than one-word length
KR910001708B1 (en) Central processing unit
RU2066067C1 (en) Central processor for multiple-processor computer system
JPS6148174B2 (en)
JPS6148735B2 (en)
JPS61114341A (en) Processing system
JP2000029508A (en) Programmable controller
JPS5896346A (en) Hierarchical arithmetic system
JP2716563B2 (en) Data write control method
JPH0338613B2 (en)