A data processor for executing a computer program in a FORTH-like language, which program contains a sequence of instructions, some of which instructions are directly executable on the hardware of the processor and others of which instructions are part of a repertory of indirectly executable instructions, each of which indirectly executable instructions is associated with a respective associated subprogram, said data processor comprising:
- a) a main memory for storing the program, including those instructions which are indirectly executable, and the associated subprograms;
- b) a first stack-type memory for containing a calling address for calling a called one of said associated sub-programs and a return address following the calling address;
- c) at least one operational unit for directly executing instructions;
- d) a second stack-type memory for containing parameters used by said program and the associated sub-programs;
- and
- e) at least one instruction-decoding member associated with the at least one operational unit, the instruction-decoding member including
- i) means for comparing instructions in the sequence of instructions with a set of directly executable instructions;
- and
- ii) means, responsive to the means for comparing, for
- A) causing direct execution of the directly executable instructions from the program;
- or
- B) calling, using addresses in the first stack-type memory, relevant ones of the associated sub-programs for instructions in the program that are part of the repertory,
- so that a programmer or compiler writing the program need not mark the sequence of instructions indicating which instructions are directly executable and which are in the repertory, and so that the program can be readily ported from the data processor to another processor which other processor either
- directly executes at least one instruction from the repertory of the data processor or
- does not directly execute one instruction which is directly executable in the data processor.