Stripped down Assembly language
Interpreter
This is a simplistic assembly language interpreter which recognizes a
small subset of the assembly language and interprets and execute it.
The comments say which instructions are actually supported and what
format they are expected to be in. In general, I have stuck to the
Intel syntax of writing instructions with destination followed by
source [inst_name dest, src]. Also, the instructions perform the same
function when they have the same name as in the IA32 reference. A noted
difference is that:
- There is a dynamically growing run-time stack.
- There is no stack pointer [sp]. This is however supplemented by
the 'peek' instruction, which peeks into an index from the top of the
stack. 0 being the stack top [ST].
- Instructions are case sensitive, and should al be in lower case.
- Variable names are case sensitive.
- Underscore characters are allowed in variable and label names.
- There are 6 General Purpose Registers available. [r1 ~ r6].
You can download the source and a few test programs here.
This will compile using any ISO standard C++ compiler such as g++ [You
can download it from: gcc.gnu.org]