Stripped down Assembly language Interpreter


Home Programs Home


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:
  1. There is a dynamically growing run-time stack.
  2. 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].
  3. Instructions are case sensitive, and should al be in lower case.
  4. Variable names are case sensitive.
  5. Underscore characters are allowed in variable and label names.
  6. 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]






Hosted by www.Geocities.ws

1