Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atkinssj/vm
A simple programming language interpreter, written in python.
https://github.com/atkinssj/vm
Last synced: 25 days ago
JSON representation
A simple programming language interpreter, written in python.
- Host: GitHub
- URL: https://github.com/atkinssj/vm
- Owner: AtkinsSJ
- Created: 2010-08-06T01:21:36.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-08-07T01:47:05.000Z (over 14 years ago)
- Last Synced: 2024-05-01T21:41:03.829Z (8 months ago)
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
*So-Far Unnamed Thingy* is a simple command interpreter I wrote for
fun using Python. Programs are text files, with a single instruction on
each line. Some instructions take an argument, which comes after the
instruction name, separated by a space. Whitespace at the beginning of
lines has no effect.Storage
=======There are two storage areas - the memory, and the accumulator. The
memory is a theoretically-infinite set of integers, addressable using
integers. The accumulator is where calculations are carried out. All
integers are potentially infinite in length.Pointers
========Any instruction which takes a memory address as its argument can also
take a pointer. (eg, using a memory location to store a memory address)
Pointers are specified by prefixing the address with a P, eg 'P23'.Input/Output
============Values can be read-in from the user using GET and GETC, for getting
integers and characters respectively. PRINT and PRINTC output a given
variable as an integer or character. PRINTSTRING outputs the given
string, but this output is not currently alterable during runtime.Command Listing
===============ADD: Add value from address
ADDVAL: Add value
AND: Performs a bitwise AND on the accumulator and the given address
DEBUG: Outputs all memory, and accumulator values
END: Ends the program
GET: Get a value from the user and store it at the address
GETC: Get a character from the user and store the ascii value at the address
GOTO: Go straight to the given line of the program (Files start line 1)
IFNEG: Only executes next instruction if the value of the accumulator is < 0
IFPOS: Only executes next instruction if the value of the accumulator is > 0
LOAD: Load value from address
LOADVAL: Load given value
NOT: Doews a binary-invert on the accumulator
OR: Performs a bitwise OR on the accumulator and the given address
PRINT: Output value from address
PRINTC: Outputs value from address, as ASCII character
PRINTSTRING: Outputs the remainder of the line to the user
SKIP: Jump over the given number of lines.
STORE: Save current value to address
XOR: Performs a bitwise XOR on the accumulator and the given addressREM is used to denote a comment.