Data processing: software development – installation – and managem – Software program development tool – Translation of code
Reexamination Certificate
1999-10-18
2002-08-20
Morse, Gregory (Department: 2122)
Data processing: software development, installation, and managem
Software program development tool
Translation of code
C717S163000
Reexamination Certificate
active
06438745
ABSTRACT:
This application is based on application No. H10-299553 filed in Japan, the content of which is hereby incorporated by reference.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to a program conversion apparatus, and in particular to a so-called binary translator which converts an object program that is designed to run in a given execution environment into an object program that can run in a different execution environment.
2. Background Art
Binary translators receive object programs that are designed to run on certain platforms, convert the received object programs into object programs that can run on other platforms, and output the generated object programs. It should be noted here that the conversion of object programs means the generation of outputted programs from inputted object programs.
Here, the term “object program” means a program in the executable format on a certain platform, such as a program that includes machine instructions generated by compiling a source program written in a high-level language. Also, the term “platform” means a basic environment in which an object program is executed, such as a real processor, basic functions of an OS (operating system), and a virtual machine.
The selection of a platform is an important concern in the design of a computer system or a home appliance, since this places various restrictions, such as the instruction format, on the object programs that will run on such system. To generate object programs that satisfy these restrictions, a compiler that converts a source program written in a high-level language into an intermediate representation and converts the intermediate representation into an object program that conforms to a target platform may be used.
A conventional binary translator uses similar techniques to a compiler to convert an object program into an object program that satisfies the restrictions of the target platform. That is, a conventional binary translator converts an inputted program into an intermediate representation which includes contents of instructions and data that are extracted from the inputted program, and generates an object program that conforms to the target platform according to the intermediate representation.
As new program development techniques have been devised, more and more object programs are now designed to call libraries. As a result, certain object programs cannot run by themselves on platforms.
Here, the term “library” is a generic name for program modules that are external to object programs and can be called by the object programs. External program modules are, for instance, parts of OSs and function libraries including standard input-output functions of C language.
Object programs that include library calls pass arguments to call libraries, receive return values that are execution results from the libraries, and use the return values. Therefore, object programs are written so that they meet the conditions and requirements concerning arguments and return values for the libraries called by the object programs.
As a result, in recent years, the execution environments of object programs have come to include libraries in addition to platforms that are conventionally included in the execution environments.
Therefore, the conversion by conventional binary translators is not effective when the execution environments for object programs outputted from the binary translators does not include the same libraries as the execution environments for object programs before the conversion by the binary translators. Note that the same libraries before and after the conversion means libraries that are the same except for differences caused by the differences between platforms.
In other words, even if the conventional binary translators that are designed to overcome the differences between platforms are used to convert inputted object programs into other object programs corresponding to target platforms, the generated object programs cannot be executed due to the lack of the called library.
SUMMARY OF THE INVENTION
In view of the stated problems, the object of the present invention is to provide a program conversion apparatus (a binary translator) for converting an inputted object program that calls libraries into an outputted object program that runs in an execution environment which includes libraries that are different from the libraries called by the inputted object program.
The stated object is achieved by a program conversion apparatus for converting a first object program that runs on a first platform into a second object program that runs on the second platform, the first object program including source library call instructions that call source libraries, the source libraries being external modules that are designed to run on the first platform, the program conversion apparatus including: a library correspondence information storing unit for holding library correspondence information that associates the source libraries with target libraries and includes argument correspondence information, where the target libraries are external modules each of which is capable of running on the second platform and has the same feature as one of the source libraries, and the argument correspondence information shows a correlation between conditions required by source arguments and conditions required by target arguments, the source arguments being arguments of the source libraries and the target arguments being arguments of the target libraries; a library call instruction detecting unit for detecting a source library call instruction included in the first object program; an instruction converting unit for converting the detected source library call instruction into a target library call instruction by referring to the library correspondence information, where the target library call instruction is to be included in the second object program and calls a target library corresponding to a source library called by the detected source library call instruction; an argument setting instruction detecting unit for detecting an argument setting instruction included in the first object program, the argument setting instruction setting a value in a source argument of the called source library; and an argument setting instruction converting unit for converting the detected argument setting instruction into a target argument setting instruction by referring to the argument correspondence information, where the target argument setting instruction is to be included in the second object program and sets the value set in the source argument of the called source library as a target argument of the corresponding target library to meet a condition required by the target argument of the corresponding target library.
The following is the explanation of the reason why the stated object is achieved by the program conversion apparatus having this construction.
In some cases, even if the same libraries as the source libraries called by the first object program do not exist on the second platform, target libraries that have the same features as the source libraries exist on the second platform. It should be noted here that in this specification, the term “same features” of libraries means the same functions of the libraries. For instance, when libraries having the same features are executed, the same execution results are obtained. In other words, there are cases where even if the same libraries as the source libraries called by the first object program do not exist on the second platform, the execution environment of the first object program is similar to that of the second object program. An example of such is where to perform a general function of displaying a character sequence on a screen, a source library receives (1) a pointer specifying a memory area for storing the character string as the first argument and (2) 1-byte data showing the number of bytes of the character string as the second argument, and a target library receives (a) 2-byte data showing the number of bytes of the character str
Kanamaru Tomokazu
Tominaga Nobuki
Matsushita Electric - Industrial Co., Ltd.
Morse Gregory
Nguyen-Ba Hoang-Vu Antony
Price and Gess
LandOfFree
Program conversion apparatus does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Program conversion apparatus, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Program conversion apparatus will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2925485