JPH0561673A - Dynamic link system for object program - Google Patents
Dynamic link system for object programInfo
- Publication number
- JPH0561673A JPH0561673A JP22201291A JP22201291A JPH0561673A JP H0561673 A JPH0561673 A JP H0561673A JP 22201291 A JP22201291 A JP 22201291A JP 22201291 A JP22201291 A JP 22201291A JP H0561673 A JPH0561673 A JP H0561673A
- Authority
- JP
- Japan
- Prior art keywords
- branch
- instruction
- branch instruction
- range
- branchable
- 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
- 238000000034 method Methods 0.000 claims description 19
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、プログラムの実行中に
動的にオブジェクトプログラムをメモリ中に読み込み参
照解決を行なう、オブジェクトプログラムの動的リンク
方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of dynamically linking an object program, which dynamically reads the object program into a memory during execution of the program and performs reference resolution.
【0002】[0002]
【従来の技術】従来のオブジェクトプログラムの動的リ
ンク方式では、参照解決を行なうときに、分岐先へその
まま分岐するようになっている。2. Description of the Related Art In the conventional dynamic linking method of an object program, when performing reference resolution, a branch is made to the branch destination as it is.
【0003】[0003]
【発明が解決しようとする課題】上記した従来の従来の
オブジェクトプログラムの動的リンク方式では、たとえ
ば、プログラムの命令部が0x400000番地から始
まり、データ部が0x10000000番地から始ま
り、動的に読み込むオブジェクトプログラムがデータ部
に読み込まれ、コンパイラが生成する分岐命令の分岐可
能な範囲が分岐命令を含む256メガバイトのアドレス
空間内に限定されている場合(図2)に、データ部中に
ある動的に読み込んだオブジェクトプログラム内の分岐
命令から、命令部中にある手続きを呼び出すことができ
なかった。In the conventional dynamic linking method of the conventional object program described above, for example, the instruction part of the program starts at the address 0x400000, the data part starts at the address 0x10000000, and the object program is dynamically read. Is read in the data part, and the branchable range of the branch instruction generated by the compiler is limited to the 256-megabyte address space containing the branch instruction (Fig. 2), the dynamic reading in the data part is performed. However, the procedure in the instruction part could not be called from the branch instruction in the object program.
【0004】本発明の目的は、上記のような場合でも任
意の手続きを呼び出すことができるようにすることにあ
る。An object of the present invention is to make it possible to call an arbitrary procedure even in the above case.
【0005】[0005]
【課題を解決するための手段】本発明のオブジェクトプ
ログラムの動的リンク方式は、プログラムの実行中に、
動的にオブジェクトプログラムをメモリ中に読み込み、
読み込んだプログラムをザブルーチンとして呼び出すこ
とができるよう参照解決を行なうオブジェクトプログラ
ムの動的リンク方式において、分岐命令の分岐先が、分
岐命令の分岐可能な範囲内にあるかどうかを判断する分
岐可能範囲判断手段と、分岐命令の分岐先が、分岐命令
の分岐可能な範囲内にある場合に、分岐命令から分岐先
に分岐するよう参照解決を行う第1の参照解決手段と、
分岐命令の分岐先が、分岐命令の分岐可能な範囲内にな
い場合に、オブジェクトプログラム中の分岐命令から分
岐可能な範囲内に、分岐先まで分岐可能な命令を生成
し、分岐先へは生成した命令から分岐するよう参照解決
を行ない、オブジェクトプログラム中の分岐命令からは
生成した命令へ分岐するよう参照解決を行なう第2の参
照解決手段とを有することを特徴とする。The dynamic linking method of an object program according to the present invention, during execution of the program,
Dynamically load the object program into memory,
In the dynamic linking method of the object program that performs reference resolution so that the read program can be called as a sub routine, the branchable range judgment that determines whether the branch destination of the branch instruction is within the branchable range of the branch instruction Means, and first reference resolution means for performing reference resolution so as to branch from the branch instruction to the branch destination when the branch destination of the branch instruction is within the branchable range of the branch instruction.
If the branch destination of the branch instruction is not within the branchable range of the branch instruction, a branchable instruction up to the branch destination is generated within the branchable range of the object program, and a branch destination is generated. A second reference solving means for performing reference resolution so as to branch from the specified instruction, and performing reference resolution so as to branch to the generated instruction from the branch instruction in the object program.
【0006】[0006]
【実施例】次に、本発明のオブジェクトプログラムの動
的リンク方式について図面を参照して説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, a dynamic linking method of an object program according to the present invention will be described with reference to the drawings.
【0007】図1は本発明の一実施例のフローチャート
を示す。FIG. 1 shows a flow chart of an embodiment of the present invention.
【0008】図1において、動的リンク方式は、処理1
01で分岐命令の分岐先が、分岐命令の分岐可能範囲内
にあるかどうかを調べ、範囲内であれば処理110を、
範囲外であれば処理120を選択する。In FIG. 1, the dynamic link method is a process 1
In 01, it is checked whether the branch destination of the branch instruction is within the branchable range of the branch instruction.
If it is out of the range, the process 120 is selected.
【0009】まず、分岐先が分岐命令の分岐可能範囲内
にある時の処理110を説明する。処理110は、単に
分岐先のアドレスを、分岐命令の分岐先アドレスに設定
する。たとえば、図3(a)のプログラムで、分岐命令
301の分岐先302が、分岐命令301の分岐可能範
囲内にある場合、分岐命令301は処理110の処理後
図3(b)の命令311となる。First, the processing 110 when the branch destination is within the branchable range of the branch instruction will be described. The process 110 simply sets the branch destination address to the branch destination address of the branch instruction. For example, in the program of FIG. 3A, if the branch destination 302 of the branch instruction 301 is within the branchable range of the branch instruction 301, the branch instruction 301 is the same as the instruction 311 of FIG. Become.
【0010】次に、分岐先が分岐命令の分岐可能範囲外
にある時の処理120を説明する。処理120は、ま
ず、処理121で、分岐命令の分岐可能範囲内に図4の
命令列を生成する。Next, the processing 120 when the branch destination is out of the branchable range of the branch instruction will be described. In the process 120, first, in the process 121, the instruction sequence of FIG. 4 is generated within the branchable range of the branch instruction.
【0011】ここで命令401は、指定されたアドレス
を、指定されたレジスタに取り出す命令、命令402
は、指定されたレジスタの内容を分岐先アドレスとし
て、任意のアドレスに分岐することが可能な分岐命令で
ある。Here, the instruction 401 is an instruction for fetching the designated address into the designated register, that is, the instruction 402.
Is a branch instruction capable of branching to an arbitrary address with the content of the specified register as the branch destination address.
【0012】次に、処理122で、分岐命令の分岐先ア
ドレスに処理121で生成した命令列のアドレスを設定
する。たとえば、図3(a)のプログラムで、分岐命令
301の分岐先302が、分岐命令301の分岐可能範
囲外にある場合、分岐命令301は処理120の処理後
321となり、処理121で生成した命令列は、32
3、324となる。ここで命令323は、分岐命令32
1の分岐可能範囲内におかれる。Next, in process 122, the address of the instruction sequence generated in process 121 is set to the branch destination address of the branch instruction. For example, in the program of FIG. 3A, when the branch destination 302 of the branch instruction 301 is outside the branchable range of the branch instruction 301, the branch instruction 301 becomes 321 after the processing 120, and the instruction generated in the processing 121. 32 rows
3,324. Here, the instruction 323 is the branch instruction 32.
It is placed within the branchable range of 1.
【0013】動的にリンクしたプログラムの実行時の動
作を図3の動作を図3の命令列を用いて説明する。The operation at the time of execution of the dynamically linked program will be described with reference to the operation shown in FIG. 3 and the instruction sequence shown in FIG.
【0014】まず、分岐先が分岐命令の分岐可能範囲内
にある場合の動作を図3(b)の命令列を用いて説明す
る。分岐命令311の分岐先312は、分岐命令311
の分岐可能範囲内にあるため、分岐命令311は単に分
岐先312に分岐する。First, the operation when the branch destination is within the branchable range of the branch instruction will be described with reference to the instruction sequence of FIG. The branch destination 312 of the branch instruction 311 is the branch instruction 311.
The branch instruction 311 simply branches to the branch destination 312 because it is within the possible branch range.
【0015】次に、分岐先が分岐命令の分岐可能範囲外
にある場合の動作を図3(c)の命令列をいて説明す
る。分岐命令321の本来の分岐先322は、分岐命令
321の分岐可能範囲外にあるため、分岐命令321か
ら分岐することができない。Next, the operation when the branch destination is outside the branchable range of the branch instruction will be described with reference to the instruction sequence of FIG. Since the original branch destination 322 of the branch instruction 321 is outside the branchable range of the branch instruction 321, the branch instruction 321 cannot branch.
【0016】そこで分岐命令321は、まず、処理12
1が生成した命令323に分岐する。命令323は分岐
命令321の本来の分岐先322のアドレスをレジスタ
に取り出す。次に、命令323がレジスタに取り出した
アドレスに命令324から分岐することで、分岐命令3
21から分岐先321への分岐が完了する。Therefore, the branch instruction 321 first executes the process 12
1 branches to the instruction 323 generated by 1. The instruction 323 fetches the address of the original branch destination 322 of the branch instruction 321 into a register. Next, by branching from the instruction 324 to the address fetched by the instruction 323 into the register, the branch instruction 3
The branch from 21 to the branch destination 321 is completed.
【0017】[0017]
【発明の効果】本発明によれば、動的にメモリ中に読み
込むオブジェクトプログラム中の分岐命令が分岐できる
範囲を制限されている場合でも、分岐可能な範囲の外に
ある手続きを呼び出すことができる。According to the present invention, even if the branching range of the branch instruction in the object program dynamically read into the memory is limited, the procedure outside the branching range can be called. ..
【図1】本発明の一実施例のフローチャートを示す。FIG. 1 shows a flow chart of an embodiment of the present invention.
【図2】従来技術の説明で用いる例のメモリ配置図を示
す。FIG. 2 is a memory layout diagram of an example used in the description of the related art.
【図3】本発明の実施例の説明に用いるオブジェクトプ
ログラムのリストを示す。FIG. 3 shows a list of object programs used to describe an embodiment of the present invention.
【図4】図1の処理121で生成する命令列のリストを
示す。FIG. 4 shows a list of instruction sequences generated in processing 121 of FIG.
Claims (1)
クトプログラムをメモリ中に読み込み、読み込んだプロ
グラムをザブルーチンとして呼び出すことができるよう
参照解決を行なうオブジェクトプログラムの動的リンク
方式において、 分岐命令の分岐先が、分岐命令の分岐可能な範囲内にあ
るかどうかを判断する分岐可能範囲判断手段と、 分岐命令の分岐先が、分岐命令の分岐可能な範囲内にあ
る場合に、分岐命令から分岐先に分岐するよう参照解決
を行う第1の参照解決手段と、 分岐命令の分岐先が、分岐命令の分岐可能な範囲内にな
い場合に、オブジェクトプログラム中の分岐命令から分
岐可能な範囲内に、分岐先まで分岐可能な命令を生成
し、分岐先へは生成した命令から分岐するよう参照解決
を行ない、オブジェクトプログラム中の分岐命令からは
生成した命令へ分岐するよう参照解決を行なう第2の参
照解決手段とを有することを特徴とするオブジェクトプ
ログラムの動的リンク方式。1. A branch of a branch instruction in a dynamic linking method of an object program, which dynamically reads an object program into a memory during execution of the program and performs reference resolution so that the read program can be called as a sub routine. A branchable range determining means for determining whether the destination is within the branchable range of the branch instruction, and a branching destination from the branch instruction when the branch destination of the branch instruction is within the branchable range of the branch instruction. A first reference resolution means for performing reference resolution so as to branch to a branch instruction; and, if the branch destination of the branch instruction is not within the branchable range of the branch instruction, within the branchable range of the branch instruction in the object program, An object program that generates instructions that can branch to the branch destination and performs reference resolution to branch from the generated instructions to the branch destination. A dynamic linking method for an object program, comprising: second reference resolution means for performing reference resolution so as to branch from a branch instruction to a generated instruction.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22201291A JPH0561673A (en) | 1991-09-03 | 1991-09-03 | Dynamic link system for object program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22201291A JPH0561673A (en) | 1991-09-03 | 1991-09-03 | Dynamic link system for object program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0561673A true JPH0561673A (en) | 1993-03-12 |
Family
ID=16775729
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP22201291A Pending JPH0561673A (en) | 1991-09-03 | 1991-09-03 | Dynamic link system for object program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0561673A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014010661A (en) * | 2012-06-29 | 2014-01-20 | Fujitsu Ltd | Program, method and device for branch address management |
-
1991
- 1991-09-03 JP JP22201291A patent/JPH0561673A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014010661A (en) * | 2012-06-29 | 2014-01-20 | Fujitsu Ltd | Program, method and device for branch address management |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPS62115542A (en) | Information processor | |
| JPH06124207A (en) | Subroutine branch instruction execution method | |
| JPS5890247A (en) | Pipeline controlling system of information processor | |
| JP3325309B2 (en) | Subroutine return instruction processing unit | |
| JPS6116334A (en) | Data processor | |
| JP3012618B1 (en) | Debugging method of inspected program and its debugging method | |
| JPH0259829A (en) | Microcomputer | |
| JPH02278428A (en) | Branch control system | |
| JPS5936838A (en) | Controlling method of interface | |
| JPH0424731B2 (en) | ||
| JPS61223948A (en) | Microprogram control method | |
| JPH03232051A (en) | Semaphore access control method | |
| JPH0527972A (en) | Instruction prefetch device | |
| JPH04309129A (en) | Branching device | |
| JPH0447337B2 (en) | ||
| JPH05100842A (en) | Instruction processor | |
| JPH01140239A (en) | Instruction executing address preserving processing system | |
| JPH0194437A (en) | Information processor | |
| JPH0198023A (en) | Conditional subroutine calling system | |
| JPH08235135A (en) | Parallel computer with communication register | |
| JPH01204145A (en) | Microprogram controller | |
| JPH0192862A (en) | Data processor | |
| JPH03263127A (en) | Instruction execution control system | |
| JPH05204638A (en) | Pipeline processor | |
| JPS62194544A (en) | Instruction pre-read control system |