JPS59144090A - Stack memory device - Google Patents

Stack memory device

Info

Publication number
JPS59144090A
JPS59144090A JP58018602A JP1860283A JPS59144090A JP S59144090 A JPS59144090 A JP S59144090A JP 58018602 A JP58018602 A JP 58018602A JP 1860283 A JP1860283 A JP 1860283A JP S59144090 A JPS59144090 A JP S59144090A
Authority
JP
Japan
Prior art keywords
register
stack
contents
pointer
access
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
JP58018602A
Other languages
Japanese (ja)
Inventor
Haruo Akimoto
晴雄 秋元
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 JP58018602A priority Critical patent/JPS59144090A/en
Publication of JPS59144090A publication Critical patent/JPS59144090A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To attain a memory access using the increment or decrement value and to accelerate the memory access by using selectively plural pointer registers to perform an access to a stack memory. CONSTITUTION:Pointer registers 12a-12c showing the addresses of a stack memory 14 are provided along with addition/subtraction circuits 18a-18c which add or subtract (1) to and from the contents of each pointer register, and a stack control circuit 22 for each addition/subtraction circuit. Then one of registers 12a-12c is defined as a reference register, and other pointer registers are controlled so that they have the contents obtained by adding or subtracting (1) to or from the contents of the reference register. The access of the memory 14 using an address obtained by adding or subtracting one by one to or from the contents of the reference register is carried out by using selectively the pointer registers which received addition or subtraction.

Description

【発明の詳細な説明】 発明の技術分野 本発明はスタックメモリ装置に関し、スタックメモリの
アドレスを示すポインタレジスタを複数化してスタック
アクセスを高速化しようとするものである。
DETAILED DESCRIPTION OF THE INVENTION Technical Field of the Invention The present invention relates to a stack memory device, and is intended to speed up stack access by providing a plurality of pointer registers indicating stack memory addresses.

従来技術と問題点 計算機で主記憶から読出したデータの一時的格納または
割込み発生時などのレジスタ内容の一時的退避に、スタ
ックが使用される。スタックメモリは本質的には普通の
メモリで、アドレスとデータ格納領域を持つが、アクセ
スの仕方が若干異なる。
Prior Art and Problems Stacks are used in computers to temporarily store data read from main memory or to temporarily save register contents when an interrupt occurs. Stack memory is essentially ordinary memory, with addresses and data storage areas, but the way it is accessed is slightly different.

即ち普通のメモリではランダムアクセスであるのに対し
、スタックでは逐次的つまりあるアドレスでアクセスし
たら次はそのアドレスに+1したアドレス又は−1した
アドレスでアクセスするという方式をとる。第1図は従
来のスタックメモリ装置の概要を示すブロック図で、1
0は中央処理装置、12はポインタレジスタ、14はス
タック(メモリ)、16はデータレジスタである。スタ
ック14のアクセスに当り中央処理装置10は線11を
通してレジスタ12にアドレスをセントし、スタック1
4は該アドレスつまりレジスタ12の内容によりアクセ
スされ、読取りならスタック14から読出されたデータ
がレジスタ16を介して中央処理装置10へ取込まれ、
書込みなら中央処理装置10がレジスタ16へ送ったデ
ータがスタック14に書込まれる。次のアクセスは、中
央処理装置が線12を通してポインタレジスタ12にそ
の内容のインクレメントまたはデクレメントを指示し、
上記のアドレスより1大きい又は1小さいアドレスによ
りなされることが多い。かけはなれたアドレスに対する
アクセスは中央処理装置10が当該アドレスをポインタ
レジスタにセットすることにより行なわれる。
That is, while a normal memory is accessed randomly, a stack uses a method in which access is made sequentially, that is, if a certain address is accessed, the next address is accessed using an address that is +1 or -1 from that address. FIG. 1 is a block diagram showing an overview of a conventional stack memory device.
0 is a central processing unit, 12 is a pointer register, 14 is a stack (memory), and 16 is a data register. To access stack 14, central processing unit 10 writes an address to register 12 through line 11, and accesses stack 14.
4 is accessed by the address, that is, the contents of the register 12, and in the case of reading, the data read from the stack 14 is taken into the central processing unit 10 via the register 16,
In the case of writing, data sent by the central processing unit 10 to the register 16 is written to the stack 14. The next access causes the central processing unit to instruct pointer register 12 via line 12 to increment or decrement its contents;
This is often done using an address that is one larger or one smaller than the above address. Access to a distant address is performed by the central processing unit 10 setting the address in a pointer register.

スタックメモリ特にレジスタの内容を一時退避させ、再
びそれを取戻すのが主用途のスタック(制御スタック)
では、インクレメントまたはデクレメントによるアクセ
スが非常に多い。こ−でスタックのアクセスに要する時
間を考えるに、ポインタレジスタにアドレスをロードし
てアクセスする場合は、当該命令の読取り、解読、実行
即ちロード、これによるスタックアクセスとなり、イン
クレメントまたはデクレメントによるアクセスも同様に
当該命令の読取り、解読、実行この場合は+1または一
1処理、処理済みレジスタ内容によるスタックアクセス
となり、ロードの場合と同様なマシンサイクルを要する
Stack memory A stack whose main purpose is to temporarily save the contents of registers in particular and restore them again (control stack)
, there are very many increment or decrement accesses. Considering the time required to access the stack, when accessing by loading an address into the pointer register, the instruction is read, decoded, and executed (that is, loaded), and the stack is accessed by this, and the stack is accessed by incrementing or decrementing. Similarly, reading, decoding, and executing the instruction in question involves +1 or -1 processing, stack access based on the processed register contents, and requires the same machine cycles as loading.

発明の目的 本発明はインクレメントまたはデクレメントによるスタ
ックアドレスの場合でも、ポインタレジスタに演算を行
なった後にスタックに対するアドレス信号が発生し、こ
のためスタックアクセスが遅れるという欠点を改善しよ
うとするものである。
OBJECTS OF THE INVENTION The present invention aims to improve the disadvantage that even in the case of a stack address by incrementing or decrementing, an address signal for the stack is generated after an operation is performed on a pointer register, resulting in a delay in stack access. .

発明の構成 本発明はスタックメモリのアドレスを示すポインタレジ
スタと、該ボ゛インタレジスタの内容に1を加算または
減算する加減算回路を有するスタックメモリ装置におい
て、ポインタレジスタおよび加減算回路を複数組設け、
またこれらの加減算回路の制御回路を設けて、該ポイン
タレジスタの1つを基準レジスタとし他のポインタレジ
スタを基準レジスタの内容に1づつ加算したもの及び減
算したものに制御し、基準レジスタの内容に1づつ加算
または減算したアドレスによるスタックメモリのアクセ
スは、前記基準レジスタの内容に1づつ加算又は減算し
たポインタレジスタを選択使用して実行するようにして
なることを特徴とするが、次に実施例を参照しながらこ
れを説明する。
Structure of the Invention The present invention provides a stack memory device having a pointer register indicating an address of a stack memory and an addition/subtraction circuit for adding or subtracting 1 to the contents of the pointer register, in which a plurality of sets of pointer registers and addition/subtraction circuits are provided,
In addition, a control circuit for these adder/subtracter circuits is provided, and one of the pointer registers is set as a reference register, and the other pointer registers are controlled to add and subtract 1 from the contents of the reference register, so that the contents of the reference register are The access to the stack memory using the address added or subtracted by 1 is performed by selectively using the pointer register which is added or subtracted by 1 to the contents of the reference register. This will be explained with reference to.

発明の実施例 第2図は本発明の実施例を示す。第1図と同じ部分には
同じ符号が付しである。第1図と比較すれば明らかなよ
うに本発明ではポインタレジスタを3個設け、各々に加
減算回路18a〜18Cを設け、またこれらのレジスタ
の選択回路20およびスタック制御回路22を設ける。
Embodiment of the invention FIG. 2 shows an embodiment of the invention. The same parts as in FIG. 1 are given the same reference numerals. As is clear from a comparison with FIG. 1, in the present invention, three pointer registers are provided, each of which is provided with an addition/subtraction circuit 18a-18C, and a selection circuit 20 and a stack control circuit 22 for these registers.

ポインタレジスタは1つ本例では12aを基準とし、他
の2つのレジスタ12b、12cはインクレメントまた
はデクレメントした値即ち基準レジスタ12aの内容に
+1した値、−1した値を持つようにする。
In this example, one pointer register 12a is used as a reference, and the other two registers 12b and 12c have values that are incremented or decremented, that is, values that are +1 and -1 from the contents of the reference register 12a.

本回路では基準レジスタの内容によるアクセスの場合ス
タック制御回路22は選択回路20に基準レジスタ12
aの選択を指示する。これに対して基準レジスタの内容
をデクレメントした値によるアクセスの場合は選択回路
20にレジスタ12bを選択させ、同時に加減算回路1
8a〜18cには各レジスタ128〜12Cの内容の1
減算を指示し、基準レジスタの内容をインクレメントし
た値によるアクセスの場合は選択回路20にレジスタ1
2Cを選択させ、同時に加減算回路18a〜18cに各
レジスタの内容の1加算を指示する。
In this circuit, in the case of access based on the contents of the reference register, the stack control circuit 22 sends the selection circuit 20 to the reference register 12.
Instruct to select a. On the other hand, in the case of access using a value obtained by decrementing the contents of the reference register, the selection circuit 20 selects the register 12b, and at the same time the addition/subtraction circuit 1
8a to 18c contain 1 of the contents of each register 128 to 12C.
In the case of access by incrementing the contents of the reference register by instructing subtraction, the selection circuit 20 selects register 1.
2C is selected, and at the same time instructs the addition/subtraction circuits 18a to 18c to add 1 to the contents of each register.

新たな値をポインタレジスタに格納してスタックをアク
セスする場合はポインタレジスタ128〜12Cに該値
を格納したのち、選択回路20によりレジスタ12aを
選択させると共に加減算回路18bに1減算、加減算回
路18Cに1加算を指示する。
When accessing the stack by storing a new value in a pointer register, the value is stored in the pointer registers 128 to 12C, and then the selection circuit 20 selects the register 12a, subtracts 1 to the addition/subtraction circuit 18b, and subtracts 1 to the addition/subtraction circuit 18C. Instructs to add 1.

具体例でこれを説明すると、第3図に示すように命令1
はアドレス100をポインタレジスタにロードせよ、命
令2はポインタレジスタの内容に+1したアドレスを読
出せ、命令3は更にポインタレジスタの内容に+1した
アドレスを読出せ、であったとすると、先ず期間T1で
命令1の読出し、解読、実行が行なわれ、ポインタレジ
スタ12a〜12cにアドレス100がロードされる。
To explain this with a concrete example, as shown in Figure 3, command 1
Load address 100 into the pointer register, instruction 2 reads the address that is +1 to the contents of the pointer register, and instruction 3 further reads the address that is +1 to the contents of the pointer register. Instruction 1 is read, decoded, and executed, and address 100 is loaded into pointer registers 12a-12c.

中央処理装置10からポインタレジスタ12a〜12C
へ送られるデータ(アドレス)は1つく共通という意味
。異ならせるなら3回のデータ転送が必要)であるから
、上記ロード時点ではポインタレジスタ12a〜12c
の内容は全て同じで本例では100である。次のマシン
サイクルでレジスタ内容の更新が行なわれ、基準レジス
タ12aの内容はそのま−、デクレメント、インクレメ
ント各レジスタ12b、12Cの内容は−1,+1され
て99,100となる。本例では触れていないが次の命
令がスタックアクセスであれば選択回路20により基準
レジスタ12aが選択され、その内容100をアドレス
とするスタックアクセスが行なわれる。
Pointer registers 12a to 12C from central processing unit 10
This means that the data (address) sent to is the same. 3 data transfers are required to make the data different), so at the time of the above loading, the pointer registers 12a to 12c
The contents are all the same and are 100 in this example. The contents of the registers are updated in the next machine cycle, and the contents of the reference register 12a remain as they are, and the contents of the decrement and increment registers 12b and 12C are incremented by -1 and +1 to become 99,100. Although not mentioned in this example, if the next instruction is a stack access, the selection circuit 20 selects the reference register 12a, and stack access is performed using its contents 100 as an address.

本例では次の命令2はPR+1リードであり、期間T2
でこの命令が読出され、解読され、実行される。上記の
レジスタ更新はこの読出しサイクルと重なる。命令2は
P R+ 117−ドであるから実行は+1の内容を持
つレジスタ12cにより行なわれる、即ちスタック14
の101番地が読出される。次は期間T3に入って命令
3の続出し、解読、実行が行なわれ、この続出し中にレ
ジスタ更新、この場合は全レジスタ128〜12Cに対
する+1処理が行なわれ、実行は命令がPR1+117
−ドであるから+1の内容を持つレジスタ12Cにより
行なわれる。この命令実行後、全レジスタの更新が行な
われる。この第3図から明らかなように命令がインクレ
メントしてアクセスせよの場合はインクレメントレジス
タを採用すればよく、この命令を解読して+1処理し、
然るのちにアクセスするという2段階処理は必要ない。
In this example, the next instruction 2 is PR+1 read, and the period T2
This instruction is read, decoded, and executed. The above register update overlaps with this read cycle. Since instruction 2 is a P R+ 117- code, execution is performed by the register 12c with the content of +1, that is, the stack 14
Address 101 is read out. Next, in period T3, instruction 3 is sequentially output, decoded, and executed. During this sequence, registers are updated, in this case, +1 processing is performed on all registers 128 to 12C, and the execution is executed when the instruction is PR1+117.
Since it is a - code, the register 12C having the content of +1 is used. After executing this instruction, all registers are updated. As is clear from Fig. 3, if the instruction requires incrementing and accessing, an increment register can be used, and this instruction is decoded and processed by +1.
There is no need for a two-step process of subsequent access.

デクレメントしてアクセスの場合も同様で、−1処理し
てアクセスの必要はなく、デクレメントレジスタを選択
するという1ステップ動作で済む。こうして本発明では
スタックアクセスタイムの短縮が図られる。
The same applies to the case of decrementing and accessing, there is no need to perform -1 processing and access, and a one-step operation of selecting the decrement register is sufficient. In this way, according to the present invention, the stack access time can be shortened.

なおポインタレジスタにアドレスをセットし、そのアド
レスでスタックをアクセスし、次いでインクレメントし
たアドレスでスタックをアクセスし、次もインクレメン
トしたアドレスでスタックをアクセスし、・・・・・・
という場合の選択されるポインタレジスタは12a、1
2c、12c・・・・・・であり、またポインタレジス
タにアドレスをセットし、そのアドレスでスタックをア
クセスし、次いでデクレメントしたアドレスでスタック
をアクセスし、次もデクレメントしたアドレスでスタッ
クをアクセスし、・・・・・・という場合の選択される
ポインタレジスタは12a、12b、12b・・・・・
・である。以下これに準じ、そしてレジスタ更新は次の
命令の読出しサイクル中に行なわれる。パイプライン処
理の場合は先行命令の実行と後続命令の読出し等が並行
して行なわれるので上記とは若干異なるが、実行サイク
ルは2〜3マシンサイクルを要するのが普通で、そして
スタックアクセスが済んだらポインタレジスタの内容は
変更してもよいから、バイブライン処理の場合でも第3
図に準じた動作、換言すればアクセスタイム短縮を期待
できる。なお実施例ではポインタレジスタを3組設けた
が、これは+2を格納するポインタレジスタを付加した
りして3組以上としてもよい。
Also, set an address in the pointer register, access the stack with that address, then access the stack with the incremented address, access the stack with the incremented address, etc.
In this case, the selected pointer registers are 12a, 1
2c, 12c..., set an address in the pointer register, access the stack with that address, then access the stack with the decremented address, and then access the stack with the decremented address. In this case, the selected pointer registers are 12a, 12b, 12b, etc.
・It is. This is followed accordingly, and register updating is performed during the read cycle of the next instruction. In the case of pipeline processing, the execution of the preceding instruction and the reading of the subsequent instruction are performed in parallel, so this is slightly different from the above, but the execution cycle usually takes 2 to 3 machine cycles, and then the stack access is completed. Since the contents of the sloppy pointer register can be changed, even in the case of vibe line processing, the third
In other words, shortening of access time can be expected. Although three sets of pointer registers are provided in the embodiment, three or more sets may be provided by adding a pointer register storing +2.

発明の詳細 な説明したように本発明によれば、ポインタレジスタを
3個用意し、その1つは基準レジスタ、残りの2つは基
準レジスタの内容を1減算した値及び1加算した値とす
るので、インクレメントまたはデクレメント値によるス
タックのアクセスはポインタレジスタを選択するという
操作で実行でき、スタックアクセスを高速化できる効果
が得られる。
As described in detail, according to the present invention, three pointer registers are prepared, one of which is a reference register, and the remaining two have values obtained by subtracting 1 and adding 1 to the contents of the reference register. Therefore, accessing the stack using an increment or decrement value can be performed by selecting a pointer register, and the effect of speeding up stack access can be obtained.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は従来のスタックメモリ装置の概要を示すブロッ
ク図、第2図は本発明の実施例を示すブロック図、第3
図は動作説明図である。 図面で、10は中央処理装置、12はポインタレジスタ
、14はスタックメモリ、16はデータレジスタ、18
は加減算回路、20は選択回路、22はスタック制御回
路である。 0 (”)    (’J    − 000 ◆ 壷 命  Q−匡 匡
FIG. 1 is a block diagram showing an overview of a conventional stack memory device, FIG. 2 is a block diagram showing an embodiment of the present invention, and FIG.
The figure is an explanatory diagram of the operation. In the drawing, 10 is a central processing unit, 12 is a pointer register, 14 is a stack memory, 16 is a data register, 18
2 is an addition/subtraction circuit, 20 is a selection circuit, and 22 is a stack control circuit. 0 ('') ('J - 000 ◆ Pot life Q-Kan

Claims (1)

【特許請求の範囲】[Claims] スタックメモリのアドレスを示すポインタレジスタと、
該ポインタレジスタの内容に1を加算または減算する加
減算回路を有するスタックメモリ装置において、ポイン
タレジスタおよび加減算回路を複数組設け、またこれら
の加減算回路の制御回路を設けて、該ポインタレジスタ
の1つを基準レジスタとし他のポインタレジスタを基準
レジスタの内容に1づつ加算したもの及び減算したもの
に制御し、基準レジスタの内容に1づつ加算または減算
したアドレスによるスタックメモリのアクセスは、前記
基準レジスタの内容に1づつ加算又は減算したポインタ
レジスタを選択使用して実行するようにしてなることを
特徴とするスタックメモリ装置。
A pointer register indicating the stack memory address,
In a stack memory device having an addition/subtraction circuit that adds or subtracts 1 to the contents of the pointer register, a plurality of sets of pointer registers and addition/subtraction circuits are provided, a control circuit for these addition/subtraction circuits is provided, and one of the pointer registers is The reference register is used as a reference register, and other pointer registers are controlled to add or subtract 1 from the contents of the reference register, and access to the stack memory using an address that adds or subtracts 1 from the contents of the reference register is based on the contents of the reference register. 1. A stack memory device characterized in that execution is performed by selectively using a pointer register that is added or subtracted by 1 to .
JP58018602A 1983-02-07 1983-02-07 Stack memory device Pending JPS59144090A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58018602A JPS59144090A (en) 1983-02-07 1983-02-07 Stack memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58018602A JPS59144090A (en) 1983-02-07 1983-02-07 Stack memory device

Publications (1)

Publication Number Publication Date
JPS59144090A true JPS59144090A (en) 1984-08-17

Family

ID=11976185

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58018602A Pending JPS59144090A (en) 1983-02-07 1983-02-07 Stack memory device

Country Status (1)

Country Link
JP (1) JPS59144090A (en)

Similar Documents

Publication Publication Date Title
JPS59144090A (en) Stack memory device
JPH03184135A (en) Data processor
JP2595992B2 (en) Electronic musical instrument
JP2716563B2 (en) Data write control method
JPS6382530A (en) Semiconductor storage device
JPH02190968A (en) Vector processor
JPS60218146A (en) Storage device address control system
JP3124361B2 (en) Memory data loading device
JPH01243120A (en) Firmware control device
JPS59189407A (en) Sequence control device
JPS62296231A (en) Subroutine processing system in microprogram processor
JPS63288331A (en) Information processor
JPH0683639A (en) Register device
JPS6250854B2 (en)
JPH04303247A (en) Microcomputer device
JPS60114937A (en) Microprogram processing unit
JPS60247708A (en) Programmable controller
JPH08292889A (en) Stack device
JPH0442328A (en) Interruption control system for information processor
JPH0264828A (en) Address trace circuit
JPS59212957A (en) Microprogram controller
JPH0245860A (en) Data transferring device
JPH07105073A (en) Scratch pad memory controller
JPH036735A (en) Data processor
JPH0561684A (en) Method for storing program