Class: Machine11

Six~ Machine11

Example 6/11: branches, stepping, and tracing.


new Machine11()

Source:

Extends

Classes

Memory

Methods


Add()

stack: ... a b -> ... a+b

Inherited From:
Source:

Branch()

stack: ... -> ... | pc: a

Source:

Bzero()

stack: ... bool -> ... | pc: !bool? a

Source:

Divide()

stack: ... a b -> ... a/b

Inherited From:
Source:

Eq()

stack: ... a b -> ... a == b

Source:

Ge()

stack: ... a b -> ... a >= b

Source:

Gt()

stack: ... a b -> ... a > b

Source:

Input()

stack: ... -> ... input

Inherited From:
Source:

Le()

stack: ... a b -> ... a <= b

Source:

Load()

stack: ... -> ... memory[addr]

Inherited From:
Source:

Lt()

stack: ... a b -> ... a < b

Source:

Minus()

stack: ... a -> ... -a

Inherited From:
Source:

Multiply()

stack: ... a b -> ... a*b

Inherited From:
Source:

Ne()

stack: ... a b -> ... a != b

Source:

Pop()

stack: ... val -> ...

Inherited From:
Source:

Print()

stack: ... n*val -> ...

Source:

Push()

stack: ... -> ... result

Inherited From:
Source:

Puts()

stack: ... val -> ... | puts(val)

Inherited From:
Source:

Store()

stack: ... val -> ... val | memory[a]: val

Inherited From:
Source:

Subtract()

stack: ... a b -> ... a-b

Inherited From:
Source:

gen()

returns code.length

Inherited From:
Source:

ins()

returns instruction function

Inherited From:
Source:

run()

Returns stack machine executable

Overrides:
Source:

toString()

Represents code as text

Inherited From:
Source:

trace()

Returns trace function, if any

Source: