Class: Machine04

Seven~ Machine04

Example 7/04: function calls.


new Machine04()

Source:

Extends

Classes

Memory

Methods


Add()

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

Inherited From:
Source:

Branch()

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

Inherited From:
Source:

Bzero()

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

Inherited From:
Source:

Call()

stack: ... -> ... old-pc | pc: addr

Source:

Divide()

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

Inherited From:
Source:

Entry()

stack: ... old-pc -> ,,, 0 old-pc

Source:

Eq()

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

Inherited From:
Source:

Ge()

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

Inherited From:
Source:

Gt()

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

Inherited From:
Source:

Input()

stack: ... -> ... input

Inherited From:
Source:

Le()

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

Inherited From:
Source:

Load()

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

Inherited From:
Source:

Lt()

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

Inherited From:
Source:

Minus()

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

Inherited From:
Source:

Multiply()

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

Inherited From:
Source:

Ne()

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

Inherited From:
Source:

Pop()

stack: ... val -> ...

Inherited From:
Source:

Print()

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

Inherited From:
Source:

Push()

stack: ... -> ... result

Inherited From:
Source:

Puts()

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

Inherited From:
Source:

Return()

stack: ... old-pc -> ... | pc: old-pc

Source:

ReturnValue()

stack: ... x old-pc result -> ... result old-pc result

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

Inherited From:
Source:

toString()

Represents code as text

Inherited From:
Source:

trace()

Returns trace function, if any

Inherited From:
Source: