Program execution apparatus and program conversion method

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000, C717S152000

Reexamination Certificate

active

06301702

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to an apparatus for executing a program which contains immediate data, and a program conversion method for generating an instruction which the apparatus can carry out.
2. Description of the Prior Art
In this specification, “a program execution apparatus” means an apparatus which executes a program for processing data, the program having been converted into such a data format that allows the apparatus to execute the program (that is, an instruction expressed in a machine code). A micro processor is a typical example of such an apparatus. The apparatus is not necessarily composed of a single component.
“A program conversion method” means a method for converting a program into such a data format that allows the program execution apparatus to execute the program. Such a method is generally employed by a compiler which uses a high level language. In the following, programs before and after format conversion are both referred to as a program unless it will cause confusion.
A program execution apparatus reads a program from a memory for execution. Accompanying recent developments in electronic products causing them to have complex functions, the size of a program to be executed by such an apparatus has tended to increase, which often causes the cost of program memory hardware to be higher than that of a central processing unit (CPU). Thus, reduction of a program size has been urgently desired.
This is particularly a serious problem when such a program execution apparatus is expected to have a high performance. If a micro processor is taken as an example, the initially developed 8-bit processor has recently been losing its position in the mainstream and is gradually being replaced by 16 or 32 bit processors. As the tendency towards greater bit size becomes more established, the size of a basic instruction code also becomes larger, which resultantly causes an increase in program size.
In order to solve the above problem, a method has been suggested for reducing the basic size of an instruction code to be smaller than the basic size of data to be processed. For instance, Matsushita Electric, Industry Corp. produces a 16-bit micro processor MN10200 which employs an 8-bit code for a basic instruction. Nihon Electric, Corp. produces a 32-bit micro processor V850 which employs a 16-bit code for a basic instruction.
This approach, however, still has a problem with an immediate instruction which is an instruction having immediate data therein. That is, since immediate data which is contained in an immediate instruction is generally large, a single unit of basic instruction code is not sufficient to include such large immediate data. In order to prepare an immediate instruction which contains 8-bit immediate data, the foregoing MN10200 requires an immediate instruction code which is larger than 8 bits, for example 16 bits. When the immediate data is 16 bits, an immediate instruction code must be larger. Since this micro processor is a 16-bit type, the processor would naturally process 16-bit immediate data. The above described situation where a longer immediate instruction code is required in order to contain long immediate data is true with a V850 32-bit micro processor. It should be noted that this situation often exists for other micro processors.
SUMMARY OF THE INVENTION
The present invention has been conceived in order to overcome the above problems, and therefore aims to provide a program conversion method for encoding immediate data at the time of converting a program into a desired program format, thereby reducing the sizes of an instruction code and the program. The present invention further provides a program execution apparatus which decodes the thus encoded immediate data for executing a program.
A program execution apparatus of the present invention comprises: a fetch section capable of sequentially fetching instructions, including an immediate instruction; a decoding section capable of decoding fetched instructions; and an execution section capable of executing decoded instructions, wherein the decoding section includes a judgement section capable of judging whether a fetched immediate instruction includes immediate data which has been encoded, the program execution apparatus further comprising a data decoding section capable of decoding immediate data which has been encoded.
According to the program execution apparatus of the present invention, instructions including immediate instructions are sequentially fetched and decoded so that the execution section carries out the fetched instruction. When a fetched immediate instruction includes immediate data which has been encoded according to a given rule, the encoded immediate data is first decoded when the instruction is decoded. Whether the immediate data is encoded or not is judged by referring to a specific bit within the immediate instruction.
Since the present program execution apparatus can deal with encoded and thereby shortened immediate data, it is possible to reduce the size of a program to be processed by the apparatus and the number of instruction codes, while improving the performance of the apparatus.
According to one aspect of the invention, the data decoding section includes an expanding section capable of expanding encoded immediate data into a binary data string according to a value of the encoded immediate data.
For decoding, encoded immediate data is expanded into a binary string such that, with the value of the encoded immediate data is N, only bit (N+1) of the expanded data is set differently from all other bits of the expanded data.
According to another aspect of the present invention, the immediate instruction includes a bit which indicates if a subtraction operation is necessary for contained immediate data, wherein the data decoding section refers to the bit and, when the bit indicates that the subtraction operation is necessary, subtracts one from data represented by the binary string, thereby generating another binary string.
According to another aspect of the present invention, the data decoding section further includes a memory section capable of storing correspondence of immediate data before decoding and immediate data resulting from decoding, and a conversion section capable of converting data according to the correspondence stored in the memory section.
In this case, a circuit can be made of a simple structure, causing only a small conversion delay.
A program conversion method of the present invention comprises a step of encoding predetermined immediate data of all immediate data in the program before conversion.
Through this step, predetermined immediate data of all immediate data in the program are encoded so as to be converted later, wherein frequent or pre-specified immediate data, or data items having a predetermined numerical characteristic are encoded.
If frequent and/or pre-specified immediate data are encoded, it is possible to further reduce the size of an entire instruction code. Also, if immediate data which has predetermined numerical characteristic is encoded, it is possible to carry out the-encoding operation more easily and efficiently.
According to another aspect of the present invention, when the program includes an operation for manipulating the (N)th bit of data, the program conversion method further comprises steps of obtaining (N−1) so as to use (N−1) being encoded immediate data; selecting a basic operation which allows the intended bit manipulation; replacing the bit manipulation operation with the basic operation which has (N−1) as immediate data; and executing a conversion operation.
Through these steps, (N−1) is first obtained and used as encoded immediate data. A basic operation which allows the intended manipulation is then selected, so that the bit manipulation operation is replaced by the selected basic operation having (N−1) as immediate data, before conversion.
With this arrangement, since an instruction for a bit manipulation operation can be expre

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Program execution apparatus and program conversion method 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 execution apparatus and program conversion method, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Program execution apparatus and program conversion method will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2581472

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.