Chris Preston - Projects

Clifford Engine Instructions

You can interact with the Engine by giving it a list of numbers. This represents a program in Clifford Code, described below. The Engine will execute the code and output the number at the top of the stack when the program terminates.

Clifford code is made up of a list of whitespace-separated numbers that are processed in sequence. Each instruction is made up of one or more digits, depending on the type of instruction. The first digit always specifies the type of instruction.

Instructions

0 "Push" (takes 1 argument)

Pushes its argument onto the stack

1 "Pop" (takes 1 argument)

Discards the number at the top of the stack

2 "Add" (takes 0 arguments)

Removes the top two numbers from the stack and pushes the sum back to the stack

3 "Subtract" (takes 0 arguments)

Removes the top two numbers from the stack and pushes the difference back to the stack

4 "Multiply" (takes 0 arguments)

Removes the top two numbers from the stack and pushes the product back to the stack

5 "Divide" (takes 0 arguments)

Removes the top two numbers from the stack and pushes the quotient back to the stack

Experimental Instructions

10 "If Greater Than"

Description coming soon...

19 "End If"

Description coming soon...