JPS61217833A - Arithmetic processor - Google Patents

Arithmetic processor

Info

Publication number
JPS61217833A
JPS61217833A JP60056176A JP5617685A JPS61217833A JP S61217833 A JPS61217833 A JP S61217833A JP 60056176 A JP60056176 A JP 60056176A JP 5617685 A JP5617685 A JP 5617685A JP S61217833 A JPS61217833 A JP S61217833A
Authority
JP
Japan
Prior art keywords
stack
memory
information
instruction
buffer
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
JP60056176A
Other languages
Japanese (ja)
Inventor
Takayuki Fujita
孝行 藤田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP60056176A priority Critical patent/JPS61217833A/en
Publication of JPS61217833A publication Critical patent/JPS61217833A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To increase the processing speed of an arithmetic processor by giving an access to a stack memory of a main memory only in case the arithmetic processing is impossible within a stack memory of the arithmetic processor. CONSTITUTION:When a bush instruction is read out, a control circuit 22 gives -1 to a top stack pointer SPT 22 and delivers the information from a memory data register 9 to write it to an address indicated by the pointer SPT 22 of a stack buffer 20. Then -1 is given to a bottom stack pointer SPB 21 together with -1 given to a stack pointer register 4 after the information is written to the buffer 20 and a full state is obtained with SPT=SPB. Then the contents of the buffer 20 shown by the SPB 21 are read out to an internal bus 10. Then the buffer 20 is made idle by an amount equivalent to a piece of information for the next instruction. The information read out to an internal bus 10 is stored in an address of a stack memory 15 shown by a stack pointer register 4 via a memory register 9.

Description

【発明の詳細な説明】 しMZ#i分野」 本発明はメインメモリ等の記憶装置より命令を読み込み
、該読み込んだ命令コードに従い演算処理を実行する演
算処理装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an arithmetic processing device that reads instructions from a storage device such as a main memory and executes arithmetic processing according to the read instruction code.

し従来技術」 従来、この種の演算処理装置においては、メインメモリ
に実行手順である命令プログラムが格納されており、こ
のメインメモリ中の命令プログラム列をプログラムカウ
ンタの保持イ直に対応した番地より順次読み出し実行す
るとともに、プログラムの’Mhに伴い使用するスタッ
クメモリをメインメモリ上に持ち、演算処理装置内にス
タックポインタレジスタを有している。
Conventionally, in this type of arithmetic processing device, an instruction program, which is an execution procedure, is stored in the main memory, and the instruction program sequence in the main memory is stored from the address corresponding to the holding point of the program counter. It has a stack memory on the main memory that is sequentially read and executed and is used in conjunction with the 'Mh' of the program, and has a stack pointer register in the arithmetic processing unit.

この従来の演算処理装置の概略ブロック図を第1図に示
す。
A schematic block diagram of this conventional arithmetic processing device is shown in FIG.

図中3は全体の制御を司どる制御回路、4はスタックメ
モリ15上のスタックの先頭アドレスを指示するスタッ
クポインタレジスタ、5は次に実行する命令語のメモリ
アドレスを指示するプログラムカウンタ、6はメモリ1
4よりプログラムカウンタ5の内容に従って読み出され
た命令を格納する命令レジスタである。7は命令レジス
タ6の命令の解析を行なう命令デコーダ、8はメモリ1
4のアドレスを指定するメモリアドレスレジスタ、9は
メモリ14にSt込み、又はメモリ14より読み出した
データを一時格納するメモリデータレジスタである。1
3はメモリ制御回路、14はプログラム命令列が記憶さ
れていると共に、演算処理装置での処理において発生す
るデータを一時記憶するメモリで、スタックメモリ15
はメモリ14のスタック領域である。
In the figure, 3 is a control circuit that manages the overall control, 4 is a stack pointer register that indicates the top address of the stack on the stack memory 15, 5 is a program counter that indicates the memory address of the next instruction to be executed, and 6 is a memory 1
This is an instruction register that stores instructions read out from program counter 5 according to the contents of program counter 5. 7 is an instruction decoder that analyzes instructions in instruction register 6; 8 is memory 1;
A memory address register 4 designates an address, and a memory data register 9 temporarily stores data loaded into the memory 14 or read out from the memory 14. 1
3 is a memory control circuit; 14 is a memory that stores program instruction sequences and temporarily stores data generated during processing in the arithmetic processing unit; a stack memory 15;
is a stack area of the memory 14.

いまスタックメモリ15上に新しく情報を格納する命令
(以下ブツシュ命令と呼ぶ)がメモリ14より読み出さ
れ英社されると、スタックポインタレジスタ4は−1さ
れ、スタックポインタレジスタ4の示すスタックメモリ
15上にメモリデータレジスタ8を介して情報が書き込
まれる。またスタックメモリ15上から情報を取り出す
(以下ポツプ命令と呼ぶ)時は、スタックポインタレジ
スタ4の示すスタックメモリ15のアドレスから、情報
がメモリデータレジスタ9を通して読み出され、スタッ
クポインタレジスタは+1される。
When an instruction to newly store information on the stack memory 15 (hereinafter referred to as a bushing instruction) is read out from the memory 14 and stored, the stack pointer register 4 is decremented by -1, and the stack memory 15 indicated by the stack pointer register 4 is read out from the memory 14 and stored. Information is written onto the memory data register 8 via the memory data register 8. Also, when taking out information from the stack memory 15 (hereinafter referred to as a pop instruction), the information is read from the address of the stack memory 15 indicated by the stack pointer register 4 through the memory data register 9, and the stack pointer register is incremented by 1. .

しかし、この従来の方法においては、ブツシュ命令やポ
ツプ命令が実行される度に、スタックポインタレジスタ
4よりメモリアドレスレジスタ8にアドレスを出力して
アドレスを確定させ、データバスにデータを載せるとい
う行程を必要とするためメインメモリへのアクセスの頻
度が高くなり、am処理装置の処理スピードを低下させ
る原因になっていた。
However, in this conventional method, every time a bush instruction or a pop instruction is executed, the address is output from the stack pointer register 4 to the memory address register 8, the address is determined, and the data is placed on the data bus. As a result, the frequency of access to the main memory increases, causing a reduction in the processing speed of the am processing device.

し目的j 本発明は上述の欠点に鑑みなされたもので、その目的と
する所は、演算処理装置に一定量のスタックメモリを備
え、このスタックメモリの容量内で処理でさない場合の
み、メインメモリのスタックメモリをアクセスするよう
にして、メインメモリへのアクセスの頻度を減少させる
ことにより、処理速度の高速化を実現した演算処理装置
を提供することにある。
The present invention was made in view of the above-mentioned drawbacks, and its purpose is to provide an arithmetic processing unit with a certain amount of stack memory, and only when the processing cannot be performed within the capacity of this stack memory, the main An object of the present invention is to provide an arithmetic processing device that achieves increased processing speed by accessing a stack memory of a memory and reducing the frequency of access to a main memory.

L実施例] 以下、図面を参照して本発明に係る一実施例を詳説する
L Embodiment] Hereinafter, one embodiment of the present invention will be described in detail with reference to the drawings.

第2図は本発明に係る一実施例のブロック図であり、第
1図と同様構成には同一番号を附してあり、同一構成に
ついての説明は重複するので省略する。
FIG. 2 is a block diagram of an embodiment according to the present invention, in which the same components as in FIG. 1 are given the same numbers, and the description of the same components will be omitted since it will be redundant.

!!82図において、2は全体の制御を司どる制御回路
であり、制御回路2では命令デコーダ7で解析された実
行すべき命令の解析結果に従って、内部メモリ2aに内
蔵されているマイクロプログラムが選択され、命令処理
に対応する各種信号の出力、及び、各種信号の読取り、
判別処理が実行される。ここで、制御回路2はマイクロ
プログラム内蔵タイプではなく、論理回路で全てが形成
されたものでもよいことはいうまでもない。
! ! In FIG. 82, 2 is a control circuit that manages the overall control, and in the control circuit 2, a microprogram built in the internal memory 2a is selected according to the analysis result of the instruction to be executed analyzed by the instruction decoder 7. , outputting various signals corresponding to command processing, reading various signals,
Determination processing is executed. Here, it goes without saying that the control circuit 2 is not of the type with a built-in microprogram, but may be formed entirely of logic circuits.

20は演箕装置内に持ったスタックバッファで、スタッ
クバッファ20のスタックポインタの基底値を指示する
5PB21と、現在のスタックポインタ値を格納する5
PT22とで指示されるエリアへの書さ込みや読み込み
がなされる。21はスタックの底を示すポインタで基底
スタックポインタ(SPB)、22はスタックの上部を
示すポインタでトップスタックポインタ(SPT)、2
3は比較回路で5PB21と5PT22の比較をとり、
一致しているときは一致信号24を制御回路2に出力す
る。
Reference numeral 20 denotes a stack buffer held in the playback device; 5PB21 indicates the base value of the stack pointer of the stack buffer 20; and 5PB stores the current stack pointer value.
Writing and reading are performed in the area designated by PT22. 21 is a pointer indicating the bottom of the stack, the base stack pointer (SPB); 22 is a pointer indicating the top of the stack, the top stack pointer (SPT); 2
3 is a comparison circuit that compares 5PB21 and 5PT22,
When they match, a match signal 24 is output to the control circuit 2.

第3図(L)〜(C)は、第2図のスタックバッファ2
0が8個の情報を格納できる場合を例にとり、スタック
バッファ20の状態を解り易く説明した図である0図中
、斜線の入った箇所は、有効な情報がスつている所を示
している。又スタックバッファ20のメモリ数が8個で
あるため、2つのスタック用ポインタ5PT22.5P
B21は3ビツトでθ〜7の値を取る様になっている。
FIGS. 3(L) to (C) show the stack buffer 2 in FIG.
This is a diagram that explains the state of the stack buffer 20 in an easy-to-understand manner, taking as an example the case where 0 can store 8 pieces of information. In the 0 diagram, the diagonally shaded areas indicate where valid information is stored. . Also, since the number of memories in the stack buffer 20 is eight, two stack pointers 5PT22.5P
B21 has 3 bits and takes a value from θ to 7.

従って7の時インクリメントするとOとなり、0の時デ
クリメントすると7となる事は周知の事とする。
Therefore, it is well known that when it is incremented when it is 7, it becomes O, and when it is decremented when it is 0, it becomes 7.

図3(a)はCPUの初期状態でスタックバッファ20
は空であり、5PT22.5PB21は同じ所を示して
いる0図3(b)、図3(C)はスタックバッファ20
の状態の例で5PB21で示した所よりS PT22の
所までの、斜線で示されたアドレスに有効な情報が入っ
ている。
FIG. 3(a) shows the stack buffer 20 in the initial state of the CPU.
is empty, and 5PT22.5PB21 indicates the same location.0 Figures 3(b) and 3(C) show the stack buffer 20.
In this example, valid information is contained in the diagonally shaded addresses from the location indicated by 5PB21 to the location indicated by SPT22.

第4図、第5図の内部メモリ2aに内蔵されたプログラ
ムのフローチャートをもとに、ブツシュ命令、ポツプ命
令時のスタックの動作について説明する。
The operation of the stack at the time of a push instruction or a pop instruction will be explained based on the flowcharts of the program stored in the internal memory 2a shown in FIGS. 4 and 5.

第4図はブツシュ命令時の動作を示したもので、ブツシ
ュ命令がメモリ14より読み出され命令デコーダ7によ
りブツシュ命令と判断されると、制御回路2はバス25
を介して5PT22を−1しくステップ40)、ステッ
プ41でメモリデータレジスタ9より内部バス10に、
スタックバッファ20に書き込む情報を出力し、スタッ
クバッファ20の5PT22で指示されたアドレスにそ
の情報を書き込む、ステップ42で比較回路23よりの
一致信号24を調べ、5PT22と5PB21が同じに
なったかをみる。一致しないときはブツシュ命令の処理
を終了して、次の命令のフェッチサイクルに入る。
FIG. 4 shows the operation at the time of the Bush command. When the Bush command is read from the memory 14 and determined by the instruction decoder 7 to be a Bush command, the control circuit 2
5PT22 by -1 via step 40), and from the memory data register 9 to the internal bus 10 in step 41,
Outputs the information to be written to the stack buffer 20 and writes the information to the address specified by 5PT22 of the stack buffer 20. In step 42, check the match signal 24 from the comparison circuit 23 to see if 5PT22 and 5PB21 are the same. . If they do not match, processing of the bushing instruction is terminated and the next instruction fetch cycle begins.

いまwIJ3図(C)に示したような状態でブツシュ命
令が実行されると、5PT22は−1されてlとなり、
スタックバッファ20の1番地に情報ヤ が書き込まれ5PT=SPBとなって、スタックバッフ
ァ20がフルの状態になる。このときはステップ43に
進み、5PB21を−1して、ステップ44でスタック
ポインタレジスタ4を−1し、次にステップ45に進み
、5PB21で示されたスタックバッファ20の内容を
内部バスlOに読み出す、これを前記第3図(C)の例
により説明すると、5PB21は−1されOとなり、ス
タックバッファ20のθ番地の内容が読み出される。こ
れはスタックバッファ20の情報の中で一番最初に格納
された情報である。このようにしてスタックバッファ2
0を1情報分空けておき、次の命令に備える0次にステ
ップ46に進み、ステップ45で内部バスlOに読み出
した情報をメモリレジスタ9を介してスタックポインタ
レジスタ4で示されるスタックメモリ15のアドレスに
格納する。
When the bush instruction is executed in the state shown in wIJ3 diagram (C), 5PT22 is incremented by -1 and becomes l.
Information Y is written to address 1 of the stack buffer 20, 5PT=SPB, and the stack buffer 20 becomes full. In this case, the process proceeds to step 43, and 5PB21 is decremented by 1. In step 44, the stack pointer register 4 is decremented by 1. Next, the process proceeds to step 45, and the contents of the stack buffer 20 indicated by 5PB21 are read to the internal bus IO. To explain this using the example of FIG. 3(C), 5PB21 is -1 and becomes O, and the contents of address .theta. of the stack buffer 20 are read out. This is the first information stored in the stack buffer 20. In this way stack buffer 2
0 is left open for one piece of information to prepare for the next instruction.Next, the process proceeds to step 46, where the information read out to the internal bus IO in step 45 is transferred to the stack memory 15 indicated by the stack pointer register 4 via the memory register 9. Store in address.

第5図はポツプ命令の動作を示したフローチャートで、
まずメモリ14より読み出した命令が命令テコ−グアに
よってデコードされ、ポツプ命令と判断されると、ステ
ップ50でスタックノくツファ20が空かどうかをみる
。スタックバッファ20が空でないときはステップ51
に進み、5rT22で示されるスタックバッファ20の
アドレスよりの情報を内部バス10に読み出し、メモリ
データレジスタ9にセットする。この情報は命令に応じ
てプログラムカウンタ5や、各種レジスタにセットされ
る。ステップ52で5PT22を1カウントアツプして
ポツプ命令の処理を終了する。
Figure 5 is a flowchart showing the operation of the pop instruction.
First, the instruction read from the memory 14 is decoded by the instruction lever, and if it is determined to be a pop instruction, it is checked in step 50 whether the stack buffer 20 is empty. If the stack buffer 20 is not empty, step 51
, the information from the address of the stack buffer 20 indicated by 5rT22 is read onto the internal bus 10 and set in the memory data register 9. This information is set in the program counter 5 and various registers according to instructions. At step 52, 5PT22 is counted up by 1 and the process of the pop instruction is completed.

スタックバッファ20が空のときはステップ53に進み
1通常の演箕処理装置におけるポツプ命令の動作と同様
にスタックポインタレジスタ4の示すスタックメモリ1
5のアドレスより情報を取り出し、メモリデータレジス
タ9にセットし、この情報は命令に応じて各種レジスタ
にセットされる。ステップ54ではスタックポインタレ
ジスタ4を1つカウントアツプして処理を終了する。
When the stack buffer 20 is empty, the process advances to step 53 and the stack memory 1 indicated by the stack pointer register 4 is stored in the same way as the operation of a pop instruction in a normal playback processing device.
Information is taken out from address 5 and set in memory data register 9, and this information is set in various registers according to instructions. In step 54, the stack pointer register 4 is counted up by one, and the process ends.

ま′たスタックバッファ20が空のときは、スタックメ
モリ15から情報を取り出し、一度スタックへツファ2
0にセットしてから取り出すようにしてもよい。
Also, when the stack buffer 20 is empty, information is retrieved from the stack memory 15 and transferred to the stack once.
It may be set to 0 and then taken out.

なお本実施例ではスタックバッファ20のスタックレベ
ルを8個で説明したがこれに限定されるものでない。
In this embodiment, the stack buffer 20 has eight stack levels, but the present invention is not limited to this.

以上説明した様に1本実施例によれば通常メインメモリ
14上に置かれるスタックのうち、ある一定量のスタッ
クメモリを高速アクセスできるように演箕処理装置内に
持たせることにより、ブツシュ命令、ポツプ命令、サブ
ルーチンコール命令、割り込み時等に発生するスタック
メモリアクセスのアクセス時間を大幅に短縮することが
できるため、処理スピードの速い演箕処理装置が得られ
るという大、tな効果がある。
As explained above, according to the present embodiment, a certain amount of stack memory out of the stack usually placed on the main memory 14 is provided in the processing unit so as to be able to access it at high speed, so that the commands can be read as follows. Since the access time for stack memory accesses that occur during pop instructions, subroutine call instructions, interrupts, etc. can be greatly reduced, this has the great effect of providing a processing device with high processing speed.

「効果」 以上説明した様に本発明によれば一定量のスタックメモ
リを演箕処理装置内に備えることにより、処理速度を高
速化できる演箕処理装置を提供できる。
"Effects" As explained above, according to the present invention, by providing a certain amount of stack memory in the entry processing apparatus, it is possible to provide a entry processing apparatus capable of increasing the processing speed.

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

第1図は従来の演箕処理装置の命令読込み処理部のブロ
ック構成図、 第2図は本発明に係る一実施例のブロック構成図、 第3図(a)〜(C)は本実施例の演箕処理装置内のス
タックの状態例を示す図、 第4図は本実施例のブツシュ命令の処理フローチャート
。 第5図は本実施例のポツプ命令の処理フローチャートで
ある。 図中2.3・・・制御回路、2a・・・内部メモリ、5
・・・プログラムカウンタ、6・・・命令レジスタ、7
・・・命令デコーダ、lO・・・内部バス、13・・・
メモリ制御回路、14・・・メモリ、15・・・スタッ
クメモリ。 20・・・スタックバッファ、21・・・スタック基底
ポインタ(SPB)、22・・・スタックポインタ(S
PT)、23・・・比較回路 、24・・・一致信号で
ある。 特許出願人   キャノン株式会社 代理人 弁理士    大 塚 康 徳第3図 (G) (b)                   (C)
第4図
FIG. 1 is a block diagram of an instruction reading processing section of a conventional machine processing device; FIG. 2 is a block diagram of an embodiment of the present invention; and FIGS. 3(a) to (C) are diagrams of the present embodiment. FIG. 4 is a processing flowchart of a bush command in this embodiment. FIG. 5 is a processing flowchart of the pop instruction in this embodiment. In the figure 2.3...Control circuit, 2a...Internal memory, 5
...Program counter, 6...Instruction register, 7
...Instruction decoder, lO...Internal bus, 13...
Memory control circuit, 14... memory, 15... stack memory. 20... Stack buffer, 21... Stack base pointer (SPB), 22... Stack pointer (S
PT), 23... Comparison circuit, 24... Match signal. Patent applicant Yasunori Otsuka, agent for Canon Co., Ltd., patent attorney Figure 3 (G) (b) (C)
Figure 4

Claims (2)

【特許請求の範囲】[Claims] (1)記憶手段より情報を読み込み、該読み込んだ情報
に従つて演算処理を実行する演算処理装置であつて、ス
タツクを記憶するスタツク記憶手段を設け、該スタツク
記憶手段の容量を越えた時のみ、前記記憶手段にスタツ
クを記憶するようにしたことを特徴とする演算処理装置
(1) An arithmetic processing device that reads information from a storage means and executes arithmetic processing according to the read information, and is provided with a stack storage means for storing a stack, and only when the capacity of the stack storage means is exceeded. , an arithmetic processing device characterized in that a stack is stored in the storage means.
(2)スタツク記憶手段の最初のスタツク位置を指示す
る第1の指示手段、現在のスタツク位置を指示する第2
の指示手段を備え、該スタツク記憶手段に情報格納後、
前記第1の指示手段と前記第2の指示手段が等しくなつ
た時、前記スタツク記憶手段の容量を越えたと判断する
ようにしたことを特徴とする特許請求範囲第1項記載の
演算処理装置。
(2) A first instruction means for indicating the first stack position of the stack storage means, and a second instruction means for indicating the current stack position.
after storing the information in the stack storage means,
2. An arithmetic processing device according to claim 1, wherein when said first instruction means and said second instruction means become equal, it is determined that the capacity of said stack storage means has been exceeded.
JP60056176A 1985-03-22 1985-03-22 Arithmetic processor Pending JPS61217833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60056176A JPS61217833A (en) 1985-03-22 1985-03-22 Arithmetic processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60056176A JPS61217833A (en) 1985-03-22 1985-03-22 Arithmetic processor

Publications (1)

Publication Number Publication Date
JPS61217833A true JPS61217833A (en) 1986-09-27

Family

ID=13019793

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60056176A Pending JPS61217833A (en) 1985-03-22 1985-03-22 Arithmetic processor

Country Status (1)

Country Link
JP (1) JPS61217833A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63163539A (en) * 1986-12-24 1988-07-07 Nec Corp System for increasing operating speed of information processor

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59202991A (en) * 1983-05-02 1984-11-16 Mitsubishi Heavy Ind Ltd Shaft bracket having slanted wing cross section

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59202991A (en) * 1983-05-02 1984-11-16 Mitsubishi Heavy Ind Ltd Shaft bracket having slanted wing cross section

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63163539A (en) * 1986-12-24 1988-07-07 Nec Corp System for increasing operating speed of information processor

Similar Documents

Publication Publication Date Title
KR100309615B1 (en) High Speed Programmable Logic Controllers (PLC)
JPS6159554A (en) Cache memory control circuit
JPH0248931B2 (en)
JPS5995660A (en) Data processor
JP2000501872A (en) Processing system and method for reading and reproducing information in a RAM structure
JPS61217833A (en) Arithmetic processor
JPH08255476A (en) Apparatus and method for memory extended stack in data-processing system
US6742073B1 (en) Bus controller technique to control N buses
US6237071B1 (en) Multiaccess circuit including arbitration capabilities to effectively perform pipeline and suspend operations according to its priority
JPS6011943A (en) Inspection system for test program
JPS6286442A (en) Data processor
JPH0683986A (en) Single chip microcomputer
JPH0795288B2 (en) Microcomputer
JPS61175731A (en) Microprogram control system
JPH01318128A (en) Cache error processing system
JPH024011B2 (en)
JPS61195429A (en) Arithmetic processing unit
JPH05342378A (en) Evaluation chip
JPS6028014B2 (en) microprocessor
JPH0319570B2 (en)
JPH06175883A (en) Program debugger
JPS63317857A (en) Memory access circuit
JPS6014335A (en) Information processor
JPH0235330B2 (en)
JPS6222165A (en) Control system for access to main storage device