JPH0243629A - Stack pointer control system - Google Patents
Stack pointer control systemInfo
- Publication number
- JPH0243629A JPH0243629A JP19518288A JP19518288A JPH0243629A JP H0243629 A JPH0243629 A JP H0243629A JP 19518288 A JP19518288 A JP 19518288A JP 19518288 A JP19518288 A JP 19518288A JP H0243629 A JPH0243629 A JP H0243629A
- Authority
- JP
- Japan
- Prior art keywords
- stack pointer
- contents
- stack
- bit
- address
- 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
Links
Landscapes
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
1E1里
本発明はスタックポインタの制御方式に関し、特にスタ
ック操作に必要なアドレス生成のためのスタックポイン
タの制御方式に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a stack pointer control method, and more particularly to a stack pointer control method for generating addresses necessary for stack operations.
良水亘迷
従来、スタック操作を行うためには、アドレス生成部で
演算実行部のスタックポインタの値を使用してアドレス
を生成し、このアドレスによりスタック操作を行ってい
る。Wataru Ryomizu Conventionally, in order to perform a stack operation, an address is generated in an address generation section using the value of the stack pointer of an arithmetic execution section, and the stack operation is performed using this address.
従って、連続したスタック操作では、演算実行部でのス
タックポインタの更新が終了するのを待って次のスタッ
ク操作のためのアドレス生成を行わなければならないこ
とになる。よって、アドレス生成部では、スタックポイ
ンタの更新の間アドレス生成処理が停止するという欠点
がある。Therefore, in consecutive stack operations, it is necessary to wait until the update of the stack pointer in the arithmetic execution unit is completed before generating an address for the next stack operation. Therefore, the address generation unit has a disadvantage that the address generation process is stopped while the stack pointer is updated.
良朋!Ll的
そこで、本発明はこの様な従来技術の欠点を解決すべく
なされたものであって、その目的とするところは、連続
したスタック操作を高速に行うことが可能なスタックポ
インタの制御方式を提供することにある。Good friend! Therefore, the present invention has been made to solve the drawbacks of the prior art, and its purpose is to provide a stack pointer control method that allows continuous stack operations to be performed at high speed. It is about providing.
九匪百璽蔦
本発明によるスタックポインタ制御方式は、スタック操
作のためのアドレスを格納する第1スタックポインタと
、このスタックポインタとは別の第2タックポインタと
、前記第1スタックポインタの内容の更新に応答してこ
の第1スタックポインタの内容を前記第2スタックポイ
ンタに書込む書込手段と、前記第2スタックポインタの
内容を更新する更新手段と、前記第2スタックポインタ
の内容の有効無効を示すための有効ビット格納手段と、
前記第1スタックポインタの内容の更新に応答して前記
有効ビット格納手段を無効を示すビットとし、前記書込
手段により前記第2スタックポインタの内容の書込みが
なされたときに前記有効ビット格納手段を有効を示すビ
ットとするビット書換手段とを設け、前記有効ビットが
有効を示す場合に前記第2スタックポインタの内容を使
用してアドレス生成を行い、前記有効ビットが無効を示
す場合に前記第1スタックポインタの内容を使用してア
ドレス生成をなすようにしたことを特徴としている。A stack pointer control method according to the present invention includes a first stack pointer that stores an address for stack operation, a second stack pointer that is different from this stack pointer, and a stack pointer that stores the contents of the first stack pointer. writing means for writing the contents of the first stack pointer into the second stack pointer in response to an update; updating means for updating the contents of the second stack pointer; and validating or invalidating the contents of the second stack pointer. effective bit storage means for indicating;
In response to updating the contents of the first stack pointer, the valid bit storage means is set to a bit indicating invalidity, and when the contents of the second stack pointer are written by the writing means, the valid bit storage means is set to a bit indicating invalidity. a bit rewriting means for generating a bit indicating validity, generating an address using the contents of the second stack pointer when the valid bit indicates valid; and generating an address using the contents of the second stack pointer when the valid bit indicates invalid; The feature is that the address is generated using the contents of the stack pointer.
火良画 次に本発明の実施例について図面を参照して説明する。Fire painting Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明の一実施例のブロック図で!)る。Figure 1 is a block diagram of one embodiment of the present invention! ).
アドレス生成と演算実行はパイプライン方式で処理され
ており、命令読出しfillioから送られた命令はア
ドレス生成部1のデコーダ7と命令キュー11とに同時
に入り、数段の命令キュー11を通った後、演算実行部
2のデコーダ8に入る。パイプライン制御機構9ではア
ドレス生成と演算実行の実行時機の制御が行なわれる。Address generation and operation execution are processed in a pipeline system, and the instructions sent from the instruction read fillio enter the decoder 7 of the address generation unit 1 and the instruction queue 11 at the same time, and after passing through several stages of the instruction queue 11. , enters the decoder 8 of the calculation execution unit 2. The pipeline control mechanism 9 controls the execution timing of address generation and arithmetic execution.
パイプライン制御fi構9には、スタックポインタ4の
ハザードの管理をするためのセマフォ12がある。この
セマフォの初めは値が0であり、スタックポインタ4の
値を変更する命令がアドレス生成部1のデコーダ7に入
るとセマフォ12の値が+1され、演算実行部2のデコ
ーダ8に入るとセマフォ12の値が−1される様に制御
されている。The pipeline control fi structure 9 includes a semaphore 12 for managing hazards of the stack pointer 4. The value of this semaphore is 0 at the beginning, and when an instruction to change the value of the stack pointer 4 enters the decoder 7 of the address generation section 1, the value of the semaphore 12 is incremented by 1, and when it enters the decoder 8 of the operation execution section 2, the semaphore The value of 12 is controlled to be -1.
仮スタックポインタ3の有、動性を示す有効ピッ1〜5
は命令によって制御され、この有効ビット5はスタック
ポインタ4に新たなスタックを指す値を格納する命令が
アドレス生成部1のデコーダ7に入ったときにOにされ
、仮スタックポインタ3にスタックポインタ4の値を格
納したのち1にされる。Valid pins 1 to 5 indicating the presence and dynamicity of temporary stack pointer 3
is controlled by an instruction, and this valid bit 5 is set to O when an instruction to store a value pointing to a new stack in the stack pointer 4 enters the decoder 7 of the address generation unit 1, and the valid bit 5 is set to O when the instruction to store a value pointing to a new stack in the stack pointer 4 enters the decoder 7 of the address generation unit 1. After storing the value of , it is set to 1.
更新機構6では、スタック操作のアドレス生成に使われ
た仮スタックポインタ3またはスタックポインタ4の値
が選択器14を介して加算器15に入り更新される。更
新値13はスタック操作の種類やデータの長さなどから
生成される。In the update mechanism 6, the value of the temporary stack pointer 3 or stack pointer 4 used to generate the address for stack operation is entered into the adder 15 via the selector 14 and updated. The update value 13 is generated based on the type of stack operation, the length of data, etc.
以下、スタック操作命令の実行の流れについて説明する
。命令読出し機構10からスタック操作命令がアドレス
生成部1のデコーダ7に入ると、まず有効ビット5の値
が調べられる。有効ビット5の値が1ならば、仮スタッ
クポインタ3の値がアドレス生成に使用される。このと
き仮スタックポインタ3の値は更新機構61こより更新
され再び仮スタックポインタ3に格納される。The flow of execution of stack manipulation instructions will be described below. When a stack manipulation instruction from the instruction reading mechanism 10 enters the decoder 7 of the address generation section 1, the value of the valid bit 5 is first checked. If the value of valid bit 5 is 1, the value of temporary stack pointer 3 is used for address generation. At this time, the value of the temporary stack pointer 3 is updated by the update mechanism 61 and stored in the temporary stack pointer 3 again.
有効ビット5の値がOならば、演算実行部2のスタック
ポインタ4の値がアドレス生成に使用される。このアド
レス生成に使用されたスタックポインタ4の値は更新機
構6により更新され、仮スタックポインタ3に格納され
る。このとき有効ビット5の値は1にされる。有効ビッ
ト5の値が0のときパイプライン制御機構9のスタック
ポインタ4のためのセマフオ12の値が0でなければ、
セマフォ12の値が0になるのを待ってから前述の有効
ビットの値が0のときの処理が実行されることになる。If the value of the valid bit 5 is O, the value of the stack pointer 4 of the arithmetic execution unit 2 is used for address generation. The value of the stack pointer 4 used to generate this address is updated by the update mechanism 6 and stored in the temporary stack pointer 3. At this time, the value of valid bit 5 is set to 1. If the value of the semaphore 12 for the stack pointer 4 of the pipeline control mechanism 9 is not 0 when the value of the valid bit 5 is 0,
After waiting for the value of the semaphore 12 to become 0, the process described above when the value of the valid bit is 0 is executed.
以上の如く構成することにより、連続したスタック操作
におけるアドレス生成は仮スタックポインタ3及び更新
機構6により行うことができるので、高遠なスタック操
作が可能となるのである。With the above configuration, addresses can be generated in successive stack operations using the temporary stack pointer 3 and the update mechanism 6, making it possible to perform advanced stack operations.
1皿五夏逮
蒸上の如く、本発明によれば、アドレス生成部に仮の第
2のスタックポインタを設けておき、連続したスタック
操作の場合には、この仮のスタックポインタを用いるこ
とによって、連続したスタック操作の場合の高速性が得
られるという効果がある。As described above, according to the present invention, a temporary second stack pointer is provided in the address generation section, and in the case of continuous stack operations, this temporary stack pointer is used. , which has the effect of providing high speed in the case of continuous stack operations.
図は本発明の実施例のシステムブロック図である。 主要部分の符号の説明 1・・・・・・アドレス生成部 2・・・・・・演算実行部 3・・・・・・仮スタックポインタ 4・・・・・・スタックポインタ 5・・・・・・有効ビット 6・・・・・・更新機構 The figure is a system block diagram of an embodiment of the present invention. Explanation of symbols of main parts 1...Address generation section 2... Arithmetic execution unit 3...Temporary stack pointer 4...Stack pointer 5... Valid bit 6...Update mechanism
Claims (1)
タックポインタと、このスタックポインタとは別の第2
タックポインタと、前記第1スタックポインタの内容の
更新に応答してこの第1スタックポインタの内容を前記
第2スタックポインタに書込む書込手段と、前記第2ス
タックポインタの内容を更新する更新手段と、前記第2
スタックポインタの内容の有効無効を示すための有効ビ
ット格納手段と、前記第1スタックポインタの内容の更
新に応答して前記有効ビット格納手段を無効を示すビッ
トとし、前記書込手段により前記第2スタックポインタ
の内容の書込みがなされたときに前記有効ビット格納手
段を有効を示すビットとするビット書換手段とを設け、
前記有効ビットが有効を示す場合に前記第2スタックポ
インタの内容を使用してアドレス生成を行い、前記有効
ビットが無効を示す場合に前記第1スタックポインタの
内容を使用してアドレス生成をなすようにしたことを特
徴とするスタックポインタ制御方式。(1) A first stack pointer that stores an address for stack operations, and a second stack pointer that is different from this stack pointer.
a tack pointer; a writing means for writing the contents of the first stack pointer into the second stack pointer in response to an update of the contents of the first stack pointer; and an updating means for updating the contents of the second stack pointer. and the second
a valid bit storage means for indicating whether the contents of the stack pointer are valid or invalid; and responsive to updating of the contents of the first stack pointer, the valid bit storage means is set to a bit indicating invalidity; bit rewriting means for changing the valid bit storage means to a bit indicating validity when the contents of the stack pointer are written;
When the valid bit indicates valid, the contents of the second stack pointer are used to generate the address, and when the valid bit indicates invalid, the contents of the first stack pointer are used to generate the address. A stack pointer control method characterized by:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19518288A JPH0243629A (en) | 1988-08-04 | 1988-08-04 | Stack pointer control system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19518288A JPH0243629A (en) | 1988-08-04 | 1988-08-04 | Stack pointer control system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0243629A true JPH0243629A (en) | 1990-02-14 |
Family
ID=16336814
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP19518288A Pending JPH0243629A (en) | 1988-08-04 | 1988-08-04 | Stack pointer control system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0243629A (en) |
-
1988
- 1988-08-04 JP JP19518288A patent/JPH0243629A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5247635A (en) | Vector processing system for invalidating scalar cache memory block indicated by address in tentative vector store instruction | |
| KR840001728A (en) | Microprocessor | |
| JPH0243629A (en) | Stack pointer control system | |
| JPH02189658A (en) | Cache memory | |
| JP3132566B2 (en) | Instruction precedence controller | |
| JPS6125168B2 (en) | ||
| JPH05257807A (en) | Cache memory controller | |
| JPH03218524A (en) | Instruction processor | |
| JPH04107634A (en) | Memory data bypass control system | |
| JPS6142076A (en) | Vector mask information control device | |
| JPS61216039A (en) | System for generating and controlling program | |
| JPS6010483A (en) | Stack memory control system | |
| JPS59123976A (en) | Storage control system of vector data | |
| JPS54148335A (en) | Buffer control system | |
| JP2000056991A (en) | Micro computer programmable controller provided with multi-task function and its control method | |
| JPS61112237A (en) | Data processor | |
| JPH0462649A (en) | Fetch control system for instruction data to instruction cache | |
| JPH01255933A (en) | Sweeping-out control system | |
| JPH09185512A (en) | Method for storing program into rom | |
| JPS60112140A (en) | Access system of stack | |
| JPH02254541A (en) | Control system for conditional branch instruction | |
| JPS5928288A (en) | Buffer memory control circuit | |
| JPH05313888A (en) | Instruction buffer system | |
| JPH03175542A (en) | Queue operation instruction executing system | |
| JPH0319570B2 (en) |