JPS5843043A - Call instruction system for data processor - Google Patents

Call instruction system for data processor

Info

Publication number
JPS5843043A
JPS5843043A JP56141341A JP14134181A JPS5843043A JP S5843043 A JPS5843043 A JP S5843043A JP 56141341 A JP56141341 A JP 56141341A JP 14134181 A JP14134181 A JP 14134181A JP S5843043 A JPS5843043 A JP S5843043A
Authority
JP
Japan
Prior art keywords
register
subroutine
stack
contents
program
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.)
Granted
Application number
JP56141341A
Other languages
Japanese (ja)
Other versions
JPS6156816B2 (en
Inventor
Masayoshi Matsushita
松下 政好
Shigeki Yamada
茂樹 山田
Norio Sato
佐藤 規男
Mitsuru Fujisawa
藤沢 充
Akira Ikuta
昭 生田
Shigeo Ochiai
落合 重夫
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
Hitachi Ltd
NEC Corp
Nippon Telegraph and Telephone Corp
Oki Electric Industry Co Ltd
Original Assignee
Fujitsu Ltd
Hitachi Ltd
NEC Corp
Nippon Telegraph and Telephone Corp
Oki Electric Industry Co Ltd
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 Fujitsu Ltd, Hitachi Ltd, NEC Corp, Nippon Telegraph and Telephone Corp, Oki Electric Industry Co Ltd, Nippon Electric Co Ltd filed Critical Fujitsu Ltd
Priority to JP56141341A priority Critical patent/JPS5843043A/en
Publication of JPS5843043A publication Critical patent/JPS5843043A/en
Publication of JPS6156816B2 publication Critical patent/JPS6156816B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • G06F9/4486Formation of subprogram jump address

Abstract

PURPOSE:To realize easily a reentrant subroutine, by performing automatically the evacuation of the register group, the security of a working area and the setting of a static link respectively on a stack and by means of hardwares when the subroutine is called. CONSTITUTION:The contents of a general-purpose register 3 is evacuated to a work register 5. The register 3 is shown by a static link address designating register number of an instruction which is read out by a main storage device 1. Then a program status word 4 is pushed down to a stack, and the contents of the head address of a subroutine is evacuated to a work register 6. The contents of the register 3 is pushed down to a stack in accordance with a register save pattern. The contents of a work register 9 is subtracted by an operator 10, and the contents of the register 6 and the static link address of the register 5 are pushed down to the stack. Finally the contents of the word 4 receives the addition of (1) through the operator 10, and the head address of the main body of the subroutine program is obtained for execution.

Description

【発明の詳細な説明】 本発明はシー)処理装置における効率的なサブルーチン
呼び出し命令方式に関するものである。       
   ′           。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an efficient subroutine call command system in a processor.
′.

データ処理装置においてす少ルーチン呼び出しが生ずる
と、それまで実行していたプログラム処理を中断し、サ
ブルーチンでの処理の実行に移行した後、元のプログラ
ムへ復帰しその壺行を再開する。したがって実行中のプ
ログラムからサブルーチンプログラムへ切替える際必要
な処理として、実行中のプログラムを後で再開するため
に再開情報を退避する処理と、サブルーチンを実行する
だめの準備処理とがある。
When a small routine call occurs in the data processing device, the program processing that was being executed up to that point is interrupted, the process moves to a subroutine, and then the original program is returned and the processing is resumed. Therefore, the processes necessary when switching from a program in progress to a subroutine program include a process to save restart information in order to restart the program in execution later, and a process to prepare before executing the subroutine.

前者は例えばプログラムカウンタや使用中のレジ哀夕の
内容の退避などであり、後者は例えばサブルーチンで使
用する作業エリアの確保である。ここで、プログラム構
造゛にブロック構造を採用すると、後者にさら(静的り
ンク(靜鎖、スタティックチェインとも呼ぶ)の設定が
必要となる。静的り゛ンクはブロック構造の約束に従い
該ナログラム?コン・ぐイル時点で静的に定まるもので
、実行する・プログ1.ラムの参照データiたはプログ
ラム、を一義的に定める。これは実行するプログラム固
有のデータロックを参照の許される親データブロックに
次々とアドレスリンクする事により実、現できる。
The former is, for example, saving the contents of a program counter or a cash register in use, and the latter is, for example, securing a work area for use in a subroutine. Here, if a block structure is adopted as the program structure, it is also necessary to set up a static link (also called a static chain) for the latter.Static links are set up according to the conventions of the block structure. ?It is statically determined at the time of execution, and uniquely defines the reference data i or program of the program to be executed.This is the parent that is allowed to reference the data lock specific to the executed program This can be realized by linking addresses to data blocks one after another.

従札プログラムにおいてサブルーチンiび出口が実行さ
れると、ハードウェアでは中断時のプログラムステータ
ス語ps、w(プログラム・カウレタとプロセッサステ
ータス情報・)のみを例えばスタックに退避してサブル
ーチンの先頭番地から実行を開始するため、前記レジス
タ”町゛の退避、作業エリアの!1保、静的リンクの設
定などの処理はすべてソフトウェアにより行なわなけれ
ばならず、サブルーチン呼び出し回数が多い場合には、
ソフトウェアのオーツ々ヘッドが増大し、本来の有効な
処理に割当てられる時間が相対的に減少−、データ処理
装置の処理能力が大幅に低下する欠点があった。
When subroutine i and exit are executed in the subordinate program, the hardware saves only the program status words ps and w (program counter and processor status information) at the time of interruption to the stack, and executes the subroutine from the first address. In order to start the process, all processes such as saving the register, saving the work area, and setting static link must be performed by software, and if the number of subroutine calls is large,
This has had the disadvantage that the automatic head count of the software has increased, and the time allotted for actual effective processing has been relatively reduced, resulting in a significant reduction in the processing capacity of the data processing device.

またスタック構造によ・つては、ソフトウェア−では静
的リンクをスタック上に設定する ができず、・他め制
御用ノ々ツファ領域を用いて実現していた。この場合プ
ログラムの再帰呼び出、シ(同じプログラムを多重に呼
び出す)を実現するには複雑な制御用ノ々ツファの管理
が必要となり、ソフトウェアのオーツ々ヘツPはさらに
大幅に増゛゛:二::ニにシ、a’It#’*f6fc
kl>、xpエク!構とサブルーチン呼び出し命令を有
す、るデータ処理装置において、サブルーチン内にスタ
ックへ退避すべきレジズタ群を指定する第1の制御情報
フィールPと、サブルーチンで使用するスタック上の作
業エリアのサイズを指定する第2の制御情報フィールド
を起ち、さらにサブルーチン呼び出′し命令の中に、今
回のスタック□。
Also, depending on the stack structure, it was not possible to set static links on the stack using software, and this was accomplished using a separate control area. In this case, in order to realize program recursive calling (calling the same program multiple times), it is necessary to manage complex control networks, and the software's automatic cost increases even further. : Ni Nishi, a'It#'*f6fc
kl>, xp Ex! In a data processing device having a structure and a subroutine call instruction, a first control information field P that specifies a group of registers to be saved to the stack in a subroutine and a size of a work area on the stack used in the subroutine is specified. A second control information field is added to the current stack □ in the subroutine call instruction.

上のデー゛タブ吃りりを以前のデータブロックに静的に
リンクするための第3の制御情報フィールドをもち、サ
ブルーチン呼び出し命令実行時に、前記第1の制御情報
フィールドの内容、に従ってスタック上に複数のし・レ
ス、りの内容を゛退避し、前記第2の制御情報フィール
ドの内容に従ンクを設定するノ・−ドウエアー構を有し
、これにより効率のよいサブルーチン呼び出しを実行し
得るようにしたもの、で、以下図面について詳細に説明
する。
It has a third control information field for statically linking the above data block to the previous data block. The present invention has a node-ware structure that saves the contents of the entry, reply, and ri and sets a link according to the contents of the second control information field, so that efficient subroutine calls can be executed. The drawings will be described in detail below.

図面は本発明の実施例を示すものである。第1図は本発
明方式によるデータ処理−置を示すもので、1はサブル
ーチン呼び出し命令、サブルーチンプログラム、スタッ
ク タなどを含む主記憶装置(MM)、2は1語32ビツト
の論理仕様を有する中央処理装置(OPtJ)で、汎用
レジスタ3.プログラムカウンタス語(P8W)4.第
1のワークレジスタ(WRI)5゜第2のワークレジス
タ(’wa2)6.デコーダ7゜メモリアト、レスレジ
スタ(M A a ) s *第3のワークレジスタ(
WB2)9.演算器及びシフト器(ALU AND 5
HIFTER)10 、データノ々ツファレジ裏夕(D
BR)11 、プロセッサノ々ス(BUS)ST ON
g)回路(Pl’LM)14.命令解釈実行制御部(O
TL)15を含む。
The drawings illustrate embodiments of the invention. FIG. 1 shows a data processing system according to the present invention, in which 1 is a main memory (MM) containing subroutine call instructions, subroutine programs, stackers, etc., and 2 is a central processor having logic specifications of 32 bits per word. In the device (OPtJ), general-purpose register 3. Program counter language (P8W)4. First work register (WRI) 5° Second work register ('wa2) 6. Decoder 7゜Memory At, Res Register (M A a ) s *Third Work Register (
WB2)9. Arithmetic unit and shifter (ALU AND 5
HIFTER) 10, Data Nonotsufaregi Urayu (D
BR) 11, Processor Nose (BUS) ST ON
g) Circuit (Pl'LM)14. Instruction interpretation execution control unit (O
TL) Contains 15.

命令の実行は、プログラムステータス語4に含まれるプ
ログラムカウンタの内容がプロセッサノ々ス12を介し
てメモリアドレスレジスタ8に設定され、メモリアドレ
スレジスタ8の示す゛の番地の内容がデータノ々ツファ
レ ゛ジで月1に読み取られ、命令解釈実行制御部15によ
る制御の下に行なわれる。命令実行後プログラムカウン
タは1加算され次の命令の格納番地を示す。
To execute an instruction, the contents of the program counter included in the program status word 4 are set in the memory address register 8 via the processor node 12, and the contents of the address indicated by the memory address register 8 are set in the data node buffer. The command interpretation and execution control unit 15 reads the command on the first day of the month. After the instruction is executed, the program counter is incremented by 1 and indicates the storage address of the next instruction.

命令実行に伴なう主記憶装置lの内容の読み取り、誓き
込みも対象となる番地をメモリアドレスレジスタ8に設
定し、データノ々ツフデレジスタ11を介して行なう。
Reading and writing of the contents of the main memory device 1 in conjunction with the execution of an instruction is also performed by setting the target address in the memory address register 8 and via the data transfer register 11.

またスタックノ々ツファは主記憶装置It1の一部・を
割り当て、スタックポインタ(sp)で最新番地を示す
事により実績している。本実施例では、   汎用レジ
スタ3の中のレジスタR14をメタッ゛クポインタとし
て使用、している。スタックノ々ツファへの書き込みは
スタックポインタの内容を1減算し、その値をメモリア
ドレスレジスタ8゛に設定しデータノ々ツファレジスタ
11、に書き込みデータを設定することにより行なわれ
る。この事よりスタックは高位アドレスから低位アrと
称する。逆にスタックノ々ツ7アからの読み出しは、ス
タックポインタの内容をメモリアドレスレジスタ8に設
定することによりデータノz′ツファレジスタ11に読
み出される。その後スタックポインタは1加算される。
In addition, the stack node has been successfully implemented by allocating a part of the main memory It1 and indicating the latest address with the stack pointer (sp). In this embodiment, register R14 in the general-purpose register 3 is used as a link pointer. Writing to the stack buffer is performed by subtracting 1 from the contents of the stack pointer, setting the value in the memory address register 8', and setting write data in the data buffer register 11. For this reason, the stack is called a low address r from a high address. Conversely, reading from the stack node 7a is performed by setting the contents of the stack pointer in the memory address register 8, thereby reading the data to the data node z' buffer register 11. Thereafter, the stack pointer is incremented by one.

上記スタックノ々ツファからの読み出し動作を、ポツプ
アップと称する。           ゛ 第2図は本発明におけ今すブルーチンi出し裾令の形式
を示すものであり、101はサブはスタック上へ設定す
べき静的リンクアドレスを退避しである汎用レジスタ番
号(1’t)、103はサブルーチンの先頭番地(JP
A)である。
The operation of reading from the stack buffer is called pop-up.゛Figure 2 shows the format of the current blue routine i issuing instruction in the present invention, and 101 is the general-purpose register number (1't ), 103 is the start address of the subroutine (JP
A).

第3図はサブルーチンプログラムの構成を示′すもので
、201は該サブルーチンで使用するスタック上の作業
エリアサイズ指定フィールr(YARN)、202は該
サブルーチンでスタック上に退避すべきレジスタ詳を示
すレジスタセーブノソ搭ン(R8P)であ′る。203
は作業エリアサイズ指定フィールド201とレジスタセ
ープノぞタン202の総称でエントリノぞタン(EP)
と称する。204は元のプログラムへの復帰命令である
。゛パ 第4図は筆記レジスタセーブノξタン202の形式を示
すもので、ビット位置番号θ〜15が゛レジお夕番号R
O〜R1”5に対応し、1が立っているビット位置番号
のし)スタが退避の対象となっている。      ・
      ゛第5図はサブルーチン呼び出し命苓実行
時のスタックの状態を・示す説明図であり、、また第6
明する。  、−゛ べろ手順でサブルーチン呼び出し倉荷なう。
FIG. 3 shows the structure of a subroutine program. 201 is a work area size designation field r (YARN) on the stack used in the subroutine, and 202 shows details of registers to be saved on the stack in the subroutine. It is a register saver (R8P). 203
is the general term for the work area size specification field 201 and the register save button 202, and is the entry point (EP).
It is called. 204 is an instruction to return to the original program. Figure 4 shows the format of the writing register save button ξ button 202, where the bit position numbers θ to 15 are the register number R.
Corresponding to O~R1"5, the bit position number 1) star where 1 is set is the target of saving. -
゛Figure 5 is an explanatory diagram showing the state of the stack at the time of execution of a subroutine call.
I will clarify. , - Now call the subroutine using the vero procedure.

(1)命令の中に、ある静的リーン、クアドレス指定ル
ジスタ番号102で示す汎用レジスタ3の内容を読み取
り第1のワークレジスタ5に退避する。
(1) In a certain static lean command, the contents of the general-purpose register 3 indicated by the register number 102 are read and saved in the first work register 5.

°(2)現在実行中のプログラム状態を示しているプロ
グラムステータス語4をスタックへブツシュダウンする
。こあ動作終了後スタック、ポインタは第5図9SPO
で示す位置となる。
(2) Push down the program status word 4, which indicates the state of the currently executing program, onto the stack. After the operation is completed, the stack and pointer are shown in Figure 5, 9SPO.
The position is shown in .

(3)゛命令のオペラン・ドアドレス部で示されるサブ
ルーチンの先頭番地103の内容を読み出し、エントリ
ノぞタン203,4して第2のワークレジスタ6に退避
する。その後エントリノリン203の上位16ビツト、
を作業エリアサイズ指是フイニルド201として第3の
ワークレジスタ9に退避し、下位16ビツトをレジスタ
セーブノぐタン202として第4のワークレジスタ13
に退避する。   1、(4)第4のワークレジスタ1
3はFRM回路14により最右端910ピット位置を検
出されデコーダ、7を通して対応する汎用し1ジスタ3
の各レジスタが選択される。選択されたレジスタの内、
容がスタックへブツシュダウンされ、RM回路14は最
右端♀1をOに変換 したノニタンを出力し、プロセッサノ々ス12を通して
再度第4のワークレジスタ13に格納以下この動作がく
り返され対応する レジスタが次々とスタックにブツシュダウンされ第4の
ワークレジスタ13の内容がすべて0になった時点で動
作終了となる。この時スタックポインタは第5図・のS
PIで示す位置となる。
(3) Read the contents of the start address 103 of the subroutine indicated by the operand address part of the instruction, set the entry numbers 203 and 4, and save it to the second work register 6. After that, the upper 16 bits of Entry Norin 203,
is saved in the third work register 9 as the working area size limit 201, and the lower 16 bits are saved as the register save button 202 in the fourth work register 13.
evacuate to. 1, (4) Fourth work register 1
3 detects the rightmost 910 pit position by the FRM circuit 14 and outputs the corresponding general-purpose register 3 through the decoder and 7.
Each register is selected. Of the selected registers,
The data is pushed down to the stack, and the RM circuit 14 converts the rightmost ♀1 to O, outputs a nonitan, and stores it again in the fourth work register 13 through the processor node 12. This operation is repeated until the corresponding register is stored. are pushed down onto the stack one after another, and the operation ends when the contents of the fourth work register 13 become all 0. At this time, the stack pointer is S in Figure 5.
The position is indicated by PI.

(5)第3のワークレジスタ9の内容が示す作業エリア
サイ、ズ語分スタックポインタの内容が演算器10で減
算される。この動作によりlスタックポインタは第5図
のsP2で示す位置となる。これによりスタック内に作
業エリアが作・業エリアサイズ語分確保された゛ことに
なる。
(5) The work area size indicated by the contents of the third work register 9 and the contents of the stack pointer are subtracted by the arithmetic unit 10. This operation brings the l stack pointer to the position indicated by sP2 in FIG. As a result, a work area corresponding to the work area size is secured in the stack.

・ (6)  第2のワークレジスタ6の内−容、つま
りエントリノぐタン203をスタックにブツシュダウン
する。この動作によりスタックポイレタは第5図のs、
p3で乍す位置となる。、エントリ、ノぐタン203は
サブルーチン処理が終了゛     イズおよびし・レ
スタ群金識別する牟め悴必要である。
(6) Push down the contents of the second work register 6, that is, the entry button 203, onto the stack. This operation causes the stack pointer to move to s in Figure 5.
This will be the position at p3. , entry, button 203 is required to identify the size and Resta group when subroutine processing is completed.

(7)第1のワークレジスタ5に退避゛しである。(7) Saving to the first work register 5.

静的リングアドレスを子タックにブツシュダウンする。Shush down static ring addresses to child tack.

これにより今回のサブルーチンで使用するデータブロッ
クが親データブロックスタックポインタは第5図の、9
P4で示す位置となる。
As a result, the parent data block stack pointer of the data block used in this subroutine is 9 in Figure 5.
The position is indicated by P4.

(8)°最後にプログラムス夢−タス語4に含まれるプ
ログラムカウレタの内容を演算器’10を通して1加算
しサブルーチンプログラム筆体の先頭番地を求めサブル
ーチンプログラムの実行を開始する。        
   −この時点でハードウェアによるサブルーチン呼
び出し動作は終了し、以後番ソフトウェアに引継ぐ事に
な°る。
(8) Finally, the contents of the program counter included in the program 4 are added by 1 through the arithmetic unit '10 to find the starting address of the subroutine program cursive, and the execution of the subroutine program is started.
- At this point, the subroutine calling operation by the hardware is completed, and the next step is taken over by the software.

以上説明したハードウェア機構を用いる事により効率の
よいサブルーチン呼び出しを実゛現できる。
By using the hardware mechanism described above, efficient subroutine calls can be realized.

次に以上述べたハードウェアによるレジスタ群の退避5
作業、m IJアの確保および静的リンクの設定機能を
使?てブロック構造をもつプログラム構成の実施例およ
びスタックの状態につぃヤ述べる゛。
Next, save the register group using the hardware described above 5
Is it possible to use the functions to secure mIJ and set static links? This section describes an example of a program structure with a block structure and the state of the stack.

第7図はブロック構造プログラムの例を示すもので、現
在実行中のサブルーチン5UB−Aより5UB−B、5
uBL−c、5oB−nの各サブルーチを示している。
FIG. 7 shows an example of a block structure program, in which subroutines 5UB-A, 5UB-B, and 5
Each subroutine of uBL-c and 5oB-n is shown.

   ′ 第8図は各サブルーチンが順次呼び出された時、スタッ
ク上に実現されるデータブロックとその静的リンクの状
況を示している。各データブーロックは゛第5図を用い
て前述した如き構成をもち、AO’、AI 、’A2 
、、A31d各デニタブロツクのアドレスである。
' Figure 8 shows the data blocks realized on the stack and their static links when each subroutine is called in sequence. Each data block has the configuration as described above with reference to FIG.
, , A31d is the address of each deniter block.

今すjルーチン5UB−Aが実行中でサブA/−チンS
UB二Aのデータブロックが第8図の符号401で示さ
れ、その静的リンク設定エリア405にはサブルーチン
5OB−Aが呼び出される以前ノ親チータブロックのア
ドレスAが設定されてチン5UB−Bの使用する作業エ
リアのサイズ、退避の必要なレジスタ群の指定を前記サ
ブルーチン5UB−Bの先頭番地にあるエン、トリノミ
タン203に設定し、ブロック構造の約束に従ってサブ
ルーチン5tJB−Bはサブルーチン5UB−Aのデー
タブロックにリンクされる本のとすると(コンノリル時
点で定まってい、る)、サブルーチン8UB−A (現
在実行中)のデータブロック401のアドレスAOを例
えば汎用レジスタ3の、レジスタ番号、R1に設定し、
本発明によるサブルーチン呼び出し金令301を実行す
ると、第8図のスタック上には補記ハードウェアの動′
作終了後、サブルーチン8UB−Bのデータブロック4
”02が確保され、静的リンク設定エリアにはサブルー
チン5UB−Aのデータブロック401のアドレスAO
が設定される。
Currently, routine 5UB-A is being executed and sub-A/-chin S is running.
The data block of UB2A is indicated by reference numeral 401 in FIG. 8, and the address A of the parent cheat block before subroutine 5OB-A is called is set in its static link setting area 405, and the address A of the parent cheat block of UB2A is set in the static link setting area 405. The size of the work area to be used and the specification of the register group that needs to be saved are set in the encoder 203 at the start address of the subroutine 5UB-B, and the subroutine 5tJB-B saves the data of the subroutine 5UB-A according to the block structure convention. Assuming that the book is linked to the block (as determined at the time of Connoril), the address AO of the data block 401 of subroutine 8UB-A (currently being executed) is set to the register number R1 of general-purpose register 3, for example,
When the subroutine call command 301 according to the present invention is executed, the operation of the supplementary hardware is displayed on the stack of FIG.
After completing the operation, data block 4 of subroutine 8UB-B
"02 is secured, and address AO of data block 401 of subroutine 5UB-A is reserved in the static link setting area.
is set.

以下同様にじてサゾルーチ:/’5UB−0のデータブ
ロツ′り403がサブルー1チン5UB−Bのデータブ
ロック402にリンクされるが、サブルーチン5UB−
0の実行中にサブルーチン5UB−Dのサブルーチン呼
び出しを行なった一合、サブルーチン5UB−Dのデー
タブロック404が確保され、静的リンク設定エリアK
aサブルーチンS U B −0とSUB、→のブロッ
ク構造の深さの差により約束されており、コンノξイラ
がコン7ぐイル時点で決定する。
Similarly, data block 403 of SAZORUCHI:/'5UB-0 is linked to data block 402 of subroutine 1chin 5UB-B, but subroutine 5UB-
If subroutine 5UB-D is called during execution of subroutine 0, data block 404 of subroutine 5UB-D is secured and static link setting area K
This is determined by the difference in the depth of the block structures of the a subroutine SUB-0 and SUB, and is determined by the controller ξ when the controller is executed.

上記静的リンクなスタン、り上に設定することにより、
他のデータブロック内の参照はスタック上の静的リンク
を順次たどる事により簡単に行なえる。今サブルーチン
5UB−Dからは自分自身のケータブロック404とサ
ブルーチン5UB−人のデ」タブロック401内にある
データおよびプログラムの工′ントリのみ参照可能とな
り、サブルーチン5IJB−B 、サブルーチン5UB
−C!とけ干渉しないプログラム構造(ブロック構造)
を静的リン(はサブルーチンを呼ぶ側のプログラムで管
理、設定するものであシ、本発明によるサブルーチン呼
び出し命令を使用しない場合、呼び側プログラムで本実
施例に示すスタックの位置(第5図の8P4)に静的リ
ンク値を設定することは、スタックの伸張方向より考え
て不可能である。
By setting the static link above,
References in other data blocks can be easily made by sequentially following static links on the stack. Now, from subroutine 5UB-D, only the data and program entries in its own data block 404 and subroutine 5UB-person's data block 401 can be referenced, and subroutine 5IJB-B, subroutine 5UB
-C! Program structure that does not interfere with melting (block structure)
The static link (is something that is managed and set by the program that calls the subroutine.If the subroutine call instruction according to the present invention is not used, the stack position shown in this embodiment (shown in Figure 5) is It is impossible to set a static link value to 8P4) considering the stack extension direction.

以上説明した如く本発明はサブルーチン呼び出し時に、
レジスタ群の退避、作業エリアの確保および静的リンク
の設定をスタック上にノ・−゛rウェア(ファームウェ
アを含む)により自動的に行なうようにしたので、次の
利点が生ずる。
As explained above, in the present invention, when calling a subroutine,
Saving the register group, securing the work area, and setting the static link are automatically performed by software (including firmware) on the stack, resulting in the following advantages.

(1)  スタック上にレジスタ群の退避エリーアや作
業エリアの確保を自動的に行うことにより1、再入可能
門サブルーチンが容易に実現できる。
(1) By automatically securing a save area and a work area for register groups on the stack, 1. A reentrant subroutine can be easily realized.

ここでサブルーチンが再入可能とは、あるユーザが該サ
ブルーチン′を実行中に他のユーザが同じサブルーチン
を実行し始めることができることを意味し、マルチプロ
グラミングシするための一次記憶)を共有する上で有用
である。
Here, the reentrancy of a subroutine means that while one user is executing the subroutine, another user can start executing the same subroutine. It is useful in

(2)  スタック上に静的リンクを設定することに。(2) Setting up static links on the stack.

より、参照可能な親データブロックへのアクセスは静的
リンクを順次たどるのみで行なえるので、サブルーチン
の再帰呼び出しが可能なブロック構造をもつプログラム
が容易に実現できる。
Therefore, a referable parent data block can be accessed simply by sequentially following static links, so a program with a block structure that allows recursive calling of subroutines can be easily realized.

(3)上記処理(レジスタ群の退避、作業エリアの確堡
および静的リンクの設定)はファームウェアを含む/%
’  )4ウエアで行われるため、バー−ウェアまたは
ファームウェアの有する並列処理機能を用いて高速化で
きる。この結果、効率のよいサブルーチン呼び出し力!
実現できる。さらに副次的にソフトウェアの8C述も簡
明にカる。
(3) The above processing (saving the register group, securing the work area, and setting the static link) includes firmware/%
) Since it is performed by 4ware, it can be accelerated by using the parallel processing function of barware or firmware. As a result, efficient subroutine calling ability!
realizable. Additionally, the 8C description of software is also explained in a concise manner.

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

図面は本発明の一霞施例を示すもので、第1図はデータ
処理装置の構成図、第2図はサブルーチン呼び出し命令
の形式を示す図、第3図は 。 エントリノぐタンを含むサブルーチンプログラムの構成
図、第4図はエントリノぞタンの中のレジス声七−ブA
タンの形式を示す図、第5図はサブルーチン呼び出し命
令実行時のスタックの状・態を示す説明図、第6図は本
発明の実行シーケンス図、第7図はブロック構造プログ
ラム構造例を示す説明図、第8図は第7図におけるサブ
ルーチン呼び出し時のスタック上のデータブロックのり
、ンク状態を示すm開園である。 1・・・主記憶装置(MM)、2・・・中央処理装置(
CPU)、3・・・汎用レジスタ、4・・・プログラム
ステータス語(PF3W)、5,6,9,13・・・第
1゜第2.第3.第4の各レジスタ(WRI、WB2゜
WB2 、V14 )、7・・・デコーダ、8・・・メ
モリアドレスレジスタ(MAR)、10−・・演算器お
よびシフゝト器(ALU AND 8HIFTER)、
11・・身−タフ9ツフアレシスタ(DBI’L)、1
2・・・プロセッサノ々ス、14・・・F蒜M回路、1
5・・・命令解釈実行布制御部′       ゛ 沖
電気工業株式会社・    、(他4名) 代理人弁理士 5PO−一伽 第6図 311− 第8図 手続補正書(自発) 昭和57年6月1日 特許庁長官′島 1)春 樹 殿 i−件の表示 昭和56年 特許願 第1 、発明の名称 データ処理装置の呼び出し命令方式 3袖正をする者 事件との関係 特許出願人 住 所 東京都港区虎ノ門1丁目7番12号名 称 (
029)  沖電気工業株式会社(他4名)代表者  
橋 本 南海男 5補正の対象 「明細書の図面の簡単な説明の欄」 6補正の内容 (1)明細書の第18頁16行目の「各」と「し」との
間K「ワーク」を加入する。 (2)  図中、第3図および第8図を別紙のとおり補
正する。
The drawings show an embodiment of the present invention; FIG. 1 is a block diagram of a data processing device, FIG. 2 is a diagram showing the format of a subroutine call command, and FIG. 3 is a diagram showing the format of a subroutine call command. The configuration diagram of the subroutine program including the entry button, Figure 4 is the Regis voice 7-B A in the entry button.
FIG. 5 is an explanatory diagram showing the state and state of the stack when a subroutine call instruction is executed, FIG. 6 is an execution sequence diagram of the present invention, and FIG. 7 is an explanatory diagram showing an example of the block structure program structure. FIG. 8 is an open diagram showing the state of data blocks on the stack and links when the subroutine in FIG. 7 is called. 1... Main memory (MM), 2... Central processing unit (
CPU), 3... General-purpose register, 4... Program status word (PF3W), 5, 6, 9, 13... 1st, 2nd. Third. 4th register (WRI, WB2゜WB2, V14), 7... Decoder, 8... Memory address register (MAR), 10-... Arithmetic unit and shifter (ALU AND 8HIFTER),
11...Body-Tough 9 Tsuhuareshita (DBI'L), 1
2...Processor nose, 14...F garlic M circuit, 1
5...Command Interpretation Execution Control Unit' ゛ Oki Electric Industry Co., Ltd. (4 others) Representative Patent Attorney 5PO - Ichigo Figure 6 311 - Figure 8 Procedural Amendment (Voluntary) June 1982 July 1st, Commissioner of the Japan Patent Office 'Shima' 1) Haruki, Display of items 1981 Patent application No. 1, Name of the invention Method of invoking command for data processing device 3 Relationship with the case of person who corrects sleeves Patent applicant's residence Location 1-7-12 Toranomon, Minato-ku, Tokyo Name (
029) Representative of Oki Electric Industry Co., Ltd. (4 others)
Nankai Hashimoto Subject of the 5th amendment "Column for brief explanation of drawings in the specification" Contents of the 6th amendment (1) Between "each" and "shi" on page 18, line 16 of the specification K "work" ” to join. (2) In the figures, Figures 3 and 8 will be corrected as shown in the attached sheet.

Claims (1)

【特許請求の範囲】[Claims] スタック機構とサブルーチン呼び出し命令を有するデー
タ処理装置において、サブルーチン内にスタックへ退避
すべきレジスタ群を指定する第1の制御情報フィールド
と、サブルーチンで使用するスタック上の作業エリアの
サイズを指定する第2の制御情報フィールドをもち、さ
全実行時に、前記第1の制御情報フィー/l/)’の内
容に従ってスタック上に作業エリアを碓・床し、ア機構
を有することを特徴とするデータ処理装置の呼び出し命
令方式。            −
In a data processing device having a stack mechanism and a subroutine call instruction, the first control information field specifies a group of registers to be saved to the stack in the subroutine, and the second control information field specifies the size of a work area on the stack used in the subroutine. A data processing device having a control information field, and having a mechanism for setting and flooring a work area on a stack according to the contents of the first control information field /l/)' at the time of full execution. Call command method. −
JP56141341A 1981-09-08 1981-09-08 Call instruction system for data processor Granted JPS5843043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56141341A JPS5843043A (en) 1981-09-08 1981-09-08 Call instruction system for data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56141341A JPS5843043A (en) 1981-09-08 1981-09-08 Call instruction system for data processor

Publications (2)

Publication Number Publication Date
JPS5843043A true JPS5843043A (en) 1983-03-12
JPS6156816B2 JPS6156816B2 (en) 1986-12-04

Family

ID=15289701

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56141341A Granted JPS5843043A (en) 1981-09-08 1981-09-08 Call instruction system for data processor

Country Status (1)

Country Link
JP (1) JPS5843043A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6297038A (en) * 1985-10-23 1987-05-06 Fuji Electric Co Ltd Program executing system
JPS62286128A (en) * 1986-05-16 1987-12-12 インテル・コ−ポレ−シヨン Stack frame cash and control mechanism used therefor
JPH0199130A (en) * 1987-08-06 1989-04-18 Otto Muller Stack controller for computer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
THE INSTITUTE OF ELECTRICAL AND ELECTRONICS ENGINEERS INC=1979M2 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6297038A (en) * 1985-10-23 1987-05-06 Fuji Electric Co Ltd Program executing system
JPS62286128A (en) * 1986-05-16 1987-12-12 インテル・コ−ポレ−シヨン Stack frame cash and control mechanism used therefor
JPH0199130A (en) * 1987-08-06 1989-04-18 Otto Muller Stack controller for computer

Also Published As

Publication number Publication date
JPS6156816B2 (en) 1986-12-04

Similar Documents

Publication Publication Date Title
JPH0353328A (en) Register saving recoverying method and processor
KR970016945A (en) Multi-instruction execution method and superscalar microprocessor
JPS6259812B2 (en)
JPS5843043A (en) Call instruction system for data processor
JPH0795278B2 (en) Processing device interrupt control method
CA2163691A1 (en) Distributed completion control in a microprocessor
JP2585818B2 (en) Program call processor
JPH01217635A (en) Register saving system
JP4833792B2 (en) Data analysis system
JP2671160B2 (en) Exception handling method
JPH0247728A (en) Fault processing management system
JPS61117635A (en) Virtual storage control system
JPH0222736A (en) Central processing unit
CA2044896C (en) Pipelined processor with simultaneous instruction execution
JPH10312298A (en) Virtual computer system
JPS62254237A (en) Inter-printer type branch instruction executing system
JPH04264625A (en) Register control system
JPH0333954A (en) Information processor
JPH03218524A (en) Instruction processor
JPH0348365A (en) Exception processing system
JPH01222329A (en) System for executing program including condition branching instruction
JPH0421028A (en) Register managing method
JPH02299030A (en) Interruption processing method
JPH02231639A (en) Calling system for service program
JPS5911438A (en) Electronic device having print function