Interpreter for stack-based languages
AssigneeATI International SRL
InventorDaniel D. Grove
Life of this patent
Estimating the term…
Abstract
The present invention provides an improved interpreter for stack-based languages. In one embodiment, a method includes executing a first interpreter for a first state, and executing a second interpreter for a second state. In particular, the first state indicates that no elements of a stack are stored in registers of a microprocessor, and a second state indicates that an element of the stack is stored in a register of the microprocessor.
Claims21
A method for providing a multi-state interpreter for an stack-based programming language, said multi-state interpreter being adapted to run on a microprocessor having a plurality of registers, said method comprising:
- providing, for a first state of said multi-state interpreter, a first interpreter for said stack-based programming language operates with a stack with no elements of said stack stored in said registers;
- providing, for a second state of said multi-state interpreter, a second interpreter for said stack-based programming language, which operates said stack with an element of said stack stored in one of said register;
- executing said first interpreter in said first state until an instruction of said programming language is encountered that requires accessing said element, whereupon, said first interpreter transfers said element from said stack to said resister;
- transitioning said multi-state interpreter from said first state to said second state;
- and
- executing said second interpreter in said second state.
A computer-readable medium comprising:
- a multi-state interpreter for an stack-based programming language, said multi-state interpreter being adapted to run on a microprocessor having a plurality of registers, said multi-state interpreter comprising:
- for a first state of said multi-state interpreter, a first interpreter for said stack-based programming language that operates with a stack with no elements of said stack stored in said registers;
- and
- for a second state of said multi-state interpreter, a second interpreter for said stack-based programming language that operates said stack with an element of said stack stored in one of said register;
- wherein said second interpreter (1) executes said first interpreter in said first state until an instruction of said programming language is encountered that requires accessing said element whereupon said first interpreter transfers said element from said stack to said register;
- (2) transitioning said multi-state interpreter from said first state to said second state;
- and (3) executes said second interpreter in said second state.
A computer system comprising:
- a memory;
- a microprocessor including a plurality of registers;
- and
- a storage device storing a multi-state interpreter for an stack-based programming language, said multi-state interpreter being adapted to run on said microprocessor using said registers, said multi-state interpreter comprising:
- for a first state of said multi-state interpreter, a first interpreter for said stack-based programming language that operates with a stack with no elements of said stack stored in said registers;
- and
- for a second state of said multi-state interpreter, a second interpreter for said stack-based programming language that operates said stack with an element of said stack stored in one of said register;
- wherein said multi-state interpreter (1) executes said first interpreter in said first state until an instruction of said programming language is encountered that requires accessing said element, whereupon, said first interpreter transfers said element firm said stack to said register;
- (2) transitioning said multi-state interpreter from said first state to said second state;
- and (3) executes said second interpreter in said second state.
Dependencies are inferred from the claim text.