An implementation of the Human Resource Machine programming language by Tomorrow Corporation.
Prerequisites:
- Java Runtime Environment 1.7 or newer
- optional Human Resource Machine Soundtrack playing in the background
Download the zip (Windows) or tgz (Linux) file from Bintray, extract it and call the start script in the bin directory, e. g. HRMReproductionMechanism YourSource.hrm.
You can also execute the interpreter directly from source: gradlew run -Pargs=YourSource.hrm.
INBOXreads the next hand value from stdinOUTBOXwrites the current hand value to stdoutCOPYFROM #ADDRreads a hand value from the given floor tileCOPYTO #ADDRstores the current hand value in the given floor tileADD #ADDRadds the given floor tile's value to the current hand valueSUB #ADDRsubtracts the given floor tile's value from the current hand valueBUMPUP #ADDRincreses the given floor tile's value by oneBUMPDN #ADDRdecreses the given floor tile's value by one#LABEL:defines a label you can jump toJUMP #LABELcontinues execution at the given labelJUMPZ #LABELcontinues execution at the given label only if the current hand value is zeroJUMPN #LABELcontinues execution at the given label only if the current hand value is negative--orCOMMENTmark the beginning of a new comment line- An address
#ADDRmay be specified either directly as a#NUMBERor indirectly via[#NUMBER], in which case the value of floor tile#NUMBERwill be used as address.
- As replacement for the graphical representation of jump targets you can declare labels and use those to designate a jump's destination.
- Binary content e.g. comments and custom floor tile names are ignored.
- Lots of tiles are available on the floor, per default there are 9000.
- You can enable literal mode with
-Dliteral=true, which preinitializes all floor tiles with their their index. This allows you toCOPYFROM 23to get 23 into your hands, as long as you haven't put anything on tile 23. - The instruction
DUMPwill print debugging information.
Implemented:
- ANTLRv4 based parser
- direct interpreter
- nice stack trace in case of error
TODO:
- optimizations
- compiler
- marketing brochures