Answer:
To the source program, where the change is easy to make. The changed source program is then translated into a new executable program.
Program Translation
Here is a picture that shows what usually happens with programs written in "C" (Java is different; it will be discussed in the next chapter.)
Here is an overview of what goes on:
- The source file is created using a text editor.
- It contains instructions in a high level language.
- It contains bytes that represent characters.
- The source file is kept on the hard disk.
- The source file can not be run by the processor.
- A translator (compiler) program translates the source file into an executable file.
- The source file remains unchanged; a new executable file is created.
- The executable file contains machine instructions.
- A translator translates from a specific high level language (like C) into machine instructions for a specific processor type (like Pentium).
- The executable file is also kept on hard disk.
- The program is run by copying machine language from the executable file into main memory. The processor directly executes these machine language instructions.
The above is what goes on with most languages: Ada, Pascal, C, C++, FORTRAN and others. Java adds a few more steps, which will be discussed in the next chapter.
QUESTION 10:
A source program has been written in the "C" language. The file has been copied onto the hard disk of a Pentium-based computer and also onto the hard disk of an Motorola-based computer. What must now be done so that the program can execute on both computers?