JPS61204740A - Overlay controlling system for program - Google Patents

Overlay controlling system for program

Info

Publication number
JPS61204740A
JPS61204740A JP4477785A JP4477785A JPS61204740A JP S61204740 A JPS61204740 A JP S61204740A JP 4477785 A JP4477785 A JP 4477785A JP 4477785 A JP4477785 A JP 4477785A JP S61204740 A JPS61204740 A JP S61204740A
Authority
JP
Japan
Prior art keywords
subroutine
program
routine
memory
execution
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
JP4477785A
Other languages
Japanese (ja)
Inventor
Shoji Yamada
昇司 山田
Makoto Yamanouchi
山之内 誠
Takashi Nakamura
中村 昂
Isao Satani
勲 佐谷
Yoshiaki Sakata
坂田 良明
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP4477785A priority Critical patent/JPS61204740A/en
Publication of JPS61204740A publication Critical patent/JPS61204740A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To curtail the memory capacity required for executing a program by using an overlay controlling system of a dynamic link type, and loading only a subroutine required for the execution, onto a memory at each time point. CONSTITUTION:When a program is being executed by a base address shown by a base register 1, an execution of a subroutine X is started by an instruction 'CALLX'. Usually a control is shifted to the subroutine X, but in this case,the control is shifted to a dummy routine 2 of the same name. The dummy routine 2 is prepared at every subroutine, and jumped to a program link control routine 4 by setting consecutive numbers of the subroutine. In the program link control routine 4, such processings as loading of the routine concerned, a change of the base register, and a stack adjustment, etc. are executed by the subroutine consecutive numbers. In an address management table 10, a load address on a memory of each subroutine is stored, and if it is unloaded, a special value such as 'O' is set in advance.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、プログラム実行時に必要なサブルーチン等の
ルーチンをダイナミックリンク型でオーバーレイ制御す
る方式で、限られたメモリ容量で大規模プログラムを実
行するのに好適なプログラムのオーバーレイ制御方式に
関する。
[Detailed Description of the Invention] [Field of Application of the Invention] The present invention is a system that uses a dynamic link type to overlay control routines such as subroutines necessary when executing a program, and is capable of executing a large-scale program with a limited memory capacity. This invention relates to a program overlay control method suitable for

〔発明の背景〕[Background of the invention]

従来のプログラム自身で行うオーバーレイ制御は、メモ
リ上のロードアドレス及びロードされるサブルーチンの
内容があらかじめ固定された計画オーバーレイ方式が殆
どである。この方式では各オーバーレイファイル上のサ
ブルーチン群と他のオーバーレイファイル上のサブルー
チン群との排他的実行性が必要であるが、プログラム規
模が大きくなるとサブルーチン数の増大と相互関係の複
雑さにより、排他的なオーバーレイファイルの設定がr
illlとなっていた。この場合は、共通的に使用され
るサブルーチンを各オーバーレイファイルに重複して格
納する、または常駐部に移動させる処置が必要となり、
いずれに於ても必要なメモリ容量の増大を引き起こして
来た。また各オーバーレイファイルのサブルーチン群間
の排他実行性が保証できたとしても、サブルーチンの追
加・削除・構成変更は全サブルーチンの相互の呼び出し
関係を把握する必要があり、プログラム規模が大きい時
にはその実施は回置であった。
Most conventional overlay control performed by the program itself is a planned overlay method in which the load address on memory and the content of the subroutine to be loaded are fixed in advance. This method requires exclusive execution between the subroutines on each overlay file and the subroutines on other overlay files, but as the program size increases, the number of subroutines increases and the interrelationships become more complex. The overlay file settings are
It was ill. In this case, it is necessary to store commonly used subroutines in duplicate in each overlay file or move them to the resident section.
In either case, the required memory capacity has increased. Furthermore, even if exclusive execution between subroutine groups in each overlay file can be guaranteed, adding, deleting, or changing the configuration of subroutines requires understanding the mutual calling relationships of all subroutines, which is difficult to implement when the scale of the program is large. It was a rotation.

以上の計画オーバーレイ方式の問題点を解決するには、
実行が要求されたサブルーチンを、要求時点でオーバー
レイファイルよりメモリ上の空きエリアにロードし、呼
び出しアドレスを実行時に確定させるダイナミックリン
ク機能が必要である。
To solve the problems of the above planning overlay method,
A dynamic link function is required that loads the subroutine requested to be executed into a free area in memory from the overlay file at the time of request, and determines the calling address at the time of execution.

この機能を利用すれば、メモリ上には実際に実行される
サブルーチンのみがロードされる為に必要メモリ量は減
少し、かつサブルーチン間相互の排他関係を考慮する必
要がなくなる。しかしダイナミックリンク機能は一般に
O8が備えており。
By using this function, only the subroutines that are actually executed are loaded onto the memory, so the amount of memory required is reduced, and there is no need to consider mutually exclusive relationships between subroutines. However, dynamic link functionality is generally provided in O8.

利用可能な環境が限定される上に、この機能を利用する
為にはO8のシステムコール手続きに従いプログラムの
修正が必要となる。
In addition to the limited environments in which it can be used, in order to use this function, it is necessary to modify the program according to the O8 system call procedure.

以上の状況より、スタック機構とペースレジスタ機構を
備えたマイクロプロセッサに於いて、O8機能を前提と
せず、かつ既存プログラムの修正を必要としない形での
ダイナミックリンク型のオーバーレイ制御方式の実現が
実用上有効である。
Based on the above circumstances, it has become practical to realize a dynamic link type overlay control method in a microprocessor equipped with a stack mechanism and a pace register mechanism, without assuming O8 functionality and without requiring modification of existing programs. above is valid.

なお、この種のオーバーレイ制御方式に関連するものと
しては、特開昭58−217052号。
Note that Japanese Patent Application Laid-Open No. 58-217052 is related to this type of overlay control method.

特開昭59−53944号、特開昭59−24344号
などが挙げられる。
Examples include JP-A-59-53944 and JP-A-59-24344.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、プログラム中で実行要求されたサブル
ーチンを、要求時点でオーバーレイファイルよりメモリ
上の空きエリアにロードして実行を行うダイナミックリ
ンク型のオーバーレイ制御機能を提供し、プログラム実
行に必要なメモリ容量の削減効果を有するプログラムの
オーバーレイ制御方式を提供することにある。
An object of the present invention is to provide a dynamic link type overlay control function that loads and executes a subroutine requested for execution in a program from an overlay file into a free area of memory at the time of request, and performs the subroutines required for program execution. An object of the present invention is to provide a program overlay control method that has the effect of reducing memory capacity.

〔発明の概要〕[Summary of the invention]

従来のダイナミックリンク制御は、この機能を有するO
8を利用することで実現されている為に適用可能範囲が
限定され、かつ利用するO8固有のプログラム記述を必
要とした。
Conventional dynamic link control uses O
Since it is realized by using O8, the scope of applicability is limited and requires program description specific to O8.

本発明は、O8機能を利用せずにプログラム自身でダイ
ナミックリンク機能を実現するもので、これにより使用
するO8の種類を問わず、適用範囲が広く汎用性が高い
The present invention realizes the dynamic link function by the program itself without using the O8 function, and thus has a wide range of application and high versatility regardless of the type of O8 used.

さらに本発明の適用に於ては、既存プログラムの修正が
不要な為に、従来方式との互換性も維持可能である。本
発明は主として、「プログラムリンク制御サブルーチン
」と「ダミールーチン」の機能によっている。前者は実
行要求されたサブルーチンのメモリ上へのロード及び実
行制御を行うものであり、各サブルーチンの実行開始ア
ドレスが逐次変化する点を、ペースレジスタの変更・回
復により実現するものである。後者はプログラム中で呼
ばれたサブルーチンの実行準備手続きを行い、「プログ
ラムリンク制御ルーチン」が必要とする情報をセットす
るものである。また「ダミールーチン」の付加により、
既存プログラム中でのサブルーチンの呼び出し命令の変
更を不要としている。
Furthermore, in applying the present invention, since there is no need to modify existing programs, compatibility with conventional systems can be maintained. The present invention mainly relies on the functions of a "program link control subroutine" and a "dummy routine." The former is to load the subroutine requested for execution onto the memory and control the execution, and the point that the execution start address of each subroutine changes sequentially is realized by changing and restoring the pace register. The latter performs execution preparation procedures for subroutines called in the program and sets information required by the "program link control routine." Also, with the addition of a "dummy routine",
This eliminates the need to change subroutine call instructions in existing programs.

〔発明の実施例〕[Embodiments of the invention]

以下1本発明の一実施例を第1図の全体構成図と第2図
の処理流れ図で説明する。
An embodiment of the present invention will be described below with reference to the overall configuration diagram in FIG. 1 and the processing flowchart in FIG. 2.

まず第1図により本発明の基本方式を述べる。First, the basic system of the present invention will be described with reference to FIG.

図中の1のペースレジスタで示すペースアドレスでプロ
グラムを実行中に命令rCALL  XJにより、サブ
ルーチンXの実行を開始する。通常は6のサブルーチン
Xへ制御を移すが、本方式では同一名称のダミールーチ
ンである2へ制御が移行される。2は各サブルーチン毎
に用意し、サブルーチン一連Nαを設定して4のプログ
ラムリンク制御ルーチンヘジャンプさせる。4ではサブ
ルーチン一連Nαにより当該ルーチンのロード、ペース
レジスタの変更及びスタック調整などの処理を行うがそ
の詳細を第2図に示従い説明する。第2図より、まずサ
ブルーチン一連淘で指定された該当ルーチンがメモリ上
にロードされているか否かを調べる。具体的には第1図
の10のアドレス管理テーブルを参照する。10には各
サブルーチンのメモリ上のロードアドレスが格納されて
おり、もし未ロードならばOなどの特殊な値が設定され
ている。
While the program is being executed at the pace address indicated by pace register 1 in the figure, execution of subroutine X is started by instruction rCALL XJ. Normally, control is transferred to subroutine X 6, but in this method control is transferred to subroutine 2, which is a dummy routine with the same name. 2 is prepared for each subroutine, and a series of subroutines Nα is set to jump to the program link control routine 4. 4, a series of subroutines Nα performs processing such as loading the routine, changing the pace register, and adjusting the stack, the details of which will be explained with reference to FIG. Referring to FIG. 2, it is first checked whether the routine specified by the subroutine series selection is loaded onto the memory. Specifically, the address management table 10 in FIG. 1 is referred to. 10 stores the load address on the memory of each subroutine, and if it has not been loaded, a special value such as O is set.

未ロードと判断された時は、メモリ上の空きエリアの先
頭をロードアドレスとし、第1図の3のプログラムライ
ブラリより該当ルーチンをメモリ上にロードする。同時
にロードアドレスを10に登録する。次にペースレジス
タ値をサブルーチンXのロードアドレス値に変更し、第
1図の5を指すように設定する。但しこのままでは第1
図の7のシステムスタック上のリターンアドレスが旧ペ
ースレジスタ値(第1図の1)を基にしている為、サブ
ルーチンXの実行終了後に正しい戻りアドレスとならな
い。そこでペースレジスタ値変更の直前で、7に格納さ
れているリターンアドレスを第1図の8のユーザスタッ
ク上へ退避させる。そして7上のリターンアドレス値を
、5のペースレジスタ値を基とした第1図の9のダミー
リターンルーチンの先頭へ戻るように変更する。
When it is determined that the routine has not been loaded, the beginning of the empty area on the memory is set as the load address, and the corresponding routine is loaded onto the memory from the program library 3 in FIG. At the same time, register the load address as 10. Next, change the pace register value to the load address value of subroutine X and set it to point to 5 in FIG. However, if this continues, the first
Since the return address on the system stack shown in FIG. 7 is based on the old pace register value (1 in FIG. 1), it will not be the correct return address after execution of subroutine X is completed. Therefore, immediately before changing the pace register value, the return address stored in 7 is saved onto the user stack 8 in FIG. Then, the return address value above 7 is changed to return to the beginning of the dummy return routine 9 in FIG. 1, which is based on the pace register value 5.

以上の処理を4のプログラムリンク制御ルーチンで行っ
た後に、第1図の6のサブルーチンXの実行が行われる
。実行終了後のリターン命令(RETVRN)により、
7上のリターンアドレスを参照して9のダミーり久−ン
ルーチンに制御が移る。9ではペースレジスタ値を1の
位置へ戻し、8のユーザスタック上に退避して置いた真
のリターンアドレスを7へ回復させ、真の戻りアドレス
制御を移す。従ってrCALL  XJの次の命令語の
実行が行われる。
After the above processing is performed in the program link control routine 4, subroutine X 6 in FIG. 1 is executed. By the return command (RETVRN) after execution is completed,
Referring to the return address above 7, control is transferred to the dummy repeat routine 9. At step 9, the pace register value is returned to the position 1, the true return address saved and placed on the user stack at step 8 is restored to 7, and control of the true return address is transferred. Therefore, the next instruction word of rCALL XJ is executed.

〔発明の効果〕〔Effect of the invention〕

本発明によれば1次のような効果がある。 According to the present invention, there are first-order effects.

(1)  ダイナミックリンク型のオーバーレイ制御方
式により、各時点では実行に必要なサブルーチンのみが
メモリ上にロードされる為、プログラム実行に必要なメ
モリ容量の削減が期待できる。
(1) Because the dynamic link type overlay control method loads only the subroutines necessary for execution into memory at each point in time, it is expected that the memory capacity required for program execution will be reduced.

(2)  計画オーバーレイ方式と比較して、サブルー
チン相互の排他性考慮が不要となり、オーバーレイファ
イルのモジュール管理が容易となる。
(2) Compared to the planned overlay method, there is no need to consider the mutual exclusivity of subroutines, and module management of overlay files becomes easier.

(3)  プログラム自身にオーバーレイ制御機能を付
加する方式の為にoS側に特殊機能を必要とせず、かつ
既存プログラム部分の修正が不要な為に適用範囲が広い
(3) Since the overlay control function is added to the program itself, no special functions are required on the OS side, and there is no need to modify existing program parts, so the range of application is wide.

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

第1図は本発明の全体構成を示す図、第2図は本発明の
ダイナミックリンク制御の流れを示す図である。 1・・・ペースレジスタ値(通常状態)、2・・・ダミ
ールルーチン、3・・・プログラムライブラリ。 4・・・プログラムリンク制御装置、5・・・ペースレ
ジスタ値(ダイナミックリンク実行時)、6・・・サブ
ルーチンX、7・・・システムスタック、8・・・ユー
ザスタック、9・・・ダミーリターンルーチン。 10・・・アドレス管理テーブル。 ¥/国 第2目 (QALLX/I呟の命午〕 m−「−− タ゛ミール−チン プロ2−24′ノン2 制4岬ルーチン ターS−リターン ルーケン m−」−一一
FIG. 1 is a diagram showing the overall configuration of the present invention, and FIG. 2 is a diagram showing the flow of dynamic link control of the present invention. 1... Pace register value (normal state), 2... Dummy routine, 3... Program library. 4...Program link control device, 5...Pace register value (during dynamic link execution), 6...Subroutine X, 7...System stack, 8...User stack, 9...Dummy return routine. 10...Address management table. ¥/Country 2nd item (QALLX/I's life) m-"--Tamil-Chimpuro 2-24'Non 2 System 4 Cape Routineter S-Return Luken m-"-11

Claims (1)

【特許請求の範囲】[Claims] プログラムリンク制御ルーチン、ダミールーチン、ダミ
ーリターンルーチン、によりプログラムによるダイナミ
ックリンクを行なうことを特徴とするプログラムのオー
バーレイ制御方式。
A program overlay control method is characterized in that dynamic linking is performed by programs using a program link control routine, a dummy routine, and a dummy return routine.
JP4477785A 1985-03-08 1985-03-08 Overlay controlling system for program Pending JPS61204740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4477785A JPS61204740A (en) 1985-03-08 1985-03-08 Overlay controlling system for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4477785A JPS61204740A (en) 1985-03-08 1985-03-08 Overlay controlling system for program

Publications (1)

Publication Number Publication Date
JPS61204740A true JPS61204740A (en) 1986-09-10

Family

ID=12700843

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4477785A Pending JPS61204740A (en) 1985-03-08 1985-03-08 Overlay controlling system for program

Country Status (1)

Country Link
JP (1) JPS61204740A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04147337A (en) * 1990-10-10 1992-05-20 Fujitsu Ltd Method of using transient module
JP2000089959A (en) * 1998-07-31 2000-03-31 Sony United Kingdom Ltd Data processor and data processing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04147337A (en) * 1990-10-10 1992-05-20 Fujitsu Ltd Method of using transient module
JP2000089959A (en) * 1998-07-31 2000-03-31 Sony United Kingdom Ltd Data processor and data processing method

Similar Documents

Publication Publication Date Title
JPH0544054B2 (en)
US7434222B2 (en) Task context switching RTOS
JPS61204740A (en) Overlay controlling system for program
JPH0895772A (en) Computer system and program substituting method
JPS63201756A (en) File replacing method for on-line system
JPH01131925A (en) Program patch system
JPH0540635A (en) Dynamic deactivating method and device for program exit
JPH02224122A (en) Dynamic link system for memory patch data
JPS62169243A (en) Program loading system
JPH03163630A (en) Stack control method for processor
JPH0675757A (en) Link system for virtual space resident program
JPH04308940A (en) Automatic assignment management system for resource in virtual computer system
JPH07134650A (en) Dynamic linking method for program
JPS58142451A (en) Interruption control system
JPH0262633A (en) Inter-program communication system
JPH05265846A (en) Memory managing system
JPH03105552A (en) Loading system for control program of service processor
JPH01193941A (en) Test system for input and output processing
JPH0421028A (en) Register managing method
JPS6337439B2 (en)
JPH04219837A (en) Data taking-over system
JPH0344328B2 (en)
JPH04182741A (en) Computer
JPH0831036B2 (en) Program upward compatibility guarantee method
JPH01185729A (en) Overlay structure program execution system