A computer-readable medium storing therein a computer program for executing, using a computer, a program conversion process targeting a processor for 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 computer program comprising:
- a first-instruction-set-information generating step, performed by the compiler, of generating 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;
- an indefinite-branch-information generating step, performed by the compiler, of generating 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;
- a branch instruction generating step, performed by the linker, of generating the branch instruction for executing the branch procedure, by 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
- a processing step of dynamically selecting one of a plurality of instruction sets by executing a branch-with-mode-change instruction and interpreting and executing a machine instruction according to the selected instruction set.