go to previous page   go to home page   go to next page hear noise highlighting

Answer:

An interpreter is an executable program, which consists of machine instructions, like all programs that execute directly on the processor.

Of course, a programmer creates an interpreter by writing it in a high level language and compiling it into the executable program.


Virtual Machine

Interpreting a source program on a virtual processor

When an interpreter is running a BASIC source program, both the interpreter and the source program are in main memory. The interpreter consists of machine instructions that the hardware can execute directly. The BASIC source program consists of commands that the interpreter can perform.

From the perspective of the BASIC program, it looks like the commands in BASIC are being directly executed by some sort of machine. The figure has been modified to show this.

This is really the same as the previous figure, but now a box has been drawn around the actual (hardware) processor and the interpreter that it is executing. The combination looks like a machine that can directly execute BASIC commands. It is as if BASIC commands are the machine language for combination of processor and interpreter.

The word virtual is used in situations where software has been used to make something that looks like the real thing. In this case it looks like we have a machine that can directly execute BASIC, so we can say that we have a BASIC virtual machine.


QUESTION 14:

Do you think that a BASIC source program could be translated into an executable file of machine instructions?


go to previous page   go to home page   go to next page