In a program executing apparatus, a code reading section reads intermediate codes
into a storage unit. A data-reference analyzing section determines whether the
operands of instructions in the intermediate codes stored in the storage unit require
a data reference. Each data reference is analyzed for instructions requiring the
data reference. A code rewriting section rewrites the operands of the instructions
according to the analysis information obtained by the data-reference analyzing
section. An address updating section updates the addresses of address-related instructions.
After all intermediate codes are interpreted, a main interpreting and executing
section starts interpreting and executing the intermediate codes.