hammerheadjs
Version:
An array based virtual machine written in Nodejs
35 lines (34 loc) • 1.38 kB
Plain Text
###File that contains a prefixed instructions and their function###
--------------------------------------------------------------------
aaa-aam ---> Increase Pointer
aan-aaz ---> Decrease Pointer
aaA-aaP ---> Set pointer specific
aaQ-aaV ---> multiply pointer
aaW-aaZ ---> floor divide pointer
aba-abr ---> load integer
abs-abx ---> load decimal-float
aby ---> load true boolean
abz ---> load false boolean
abA ---> load empty string
abB ---> load empty array
abC ---> load empty object
abD ---> load null
abE ---> load undefined
abF ---> sets return value to current cell
abG ---> sets return to forward cell
abH ---> sets return to previous cell
abI-abZ ---> adds integer to current cell
aca-acq ---> subtracts integers from current cell
acr-acE ---> multiply integers from current cell
acF-acM ---> divide integers in current cell
acN-acZ ---> floor division of integers in current cell
ada ---> repeat previous instruction 1 time
adb ---> repeat previous instruction 2 times
adc ---> repeat previous instruction 5 times
add ---> repeat previous instruction 10 times
ade-adm ---> repeating previous instruction X times
adn-adz ---> jump forward some number of instructions
adA-adJ ---> add value of forward cell to current
adK-adT ---> add value of previous cell to current
adU-aed ---> subtract forward cell from current
aee-aen ---> subtract previous cell from current cell