Patent ID: 7254807

Claim:
A program conversion apparatus compiling a first source program that describes an external entry into a first machine instruction sequence and a second source program that describes a branch procedure to the external entry into a second machine instruction sequence, and linking a plurality of machine instruction sequences including the first and second machine instruction sequences, to generate an executable program, each of the first and second machine instruction sequences being composed of one or more machine instructions that each belong to one of the instruction sets, the program conversion apparatus comprising: a memory storing (i) a compiler that includes a first-instruction-set-information generating unit operable to generate first-instruction-set-information when the first source program is compiled, the first-instruction-set-information showing an instruction set to which a machine instruction for executing a procedure described at the external entry belongs, and an indefinite-branch-information generating unit operable to generate indefinite-branch-information when the second source program is compiled, the indefinite-branch-information showing a location at which a branch instruction for executing the branch procedure is to be placed, and showing that an instruction set to which a machine instruction placed at the external entry belongs is indefinite; and (ii) a linker that includes a branch instruction generating unit operable to generate the branch instruction for executing the branch procedure, using a branch-with-mode-change instruction for making the processor select the instruction set shown by the first-instruction-set-information, at the location shown by the indefinite-branch-information, when the plurality of machine instruction sequences are linked, and links a plurality of machine instruction sequences to the executable program, using the branch instruction; and a processor operable to execute the compiler and the linker that dynamically selects one of a plurality of instruction sets by executing a branch-with-mode-change instruction and interprets and executes a machine instruction according to the selected instruction set.