diff options
Diffstat (limited to 'spec.md')
-rw-r--r-- | spec.md | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -12,10 +12,10 @@ SWP ( a b -- b a ) swap top two values of the stack ROT ( a b c -- b c a ) rotates top three values of the stack to the left DUP ( a -- a a ) duplicates top of the stack OVR ( a b -- a b a ) duplicates second value at the top of the stack -EQU ( a b -- bool ) push 0001 if a == b, 0001 otherwise -NEQ ( a b -- bool ) push 0001 if a != b, 0001 otherwise -GTH ( a b -- bool ) push 0001 if a > b, 0001 otherwise -LTH ( a b -- bool ) push 0001 if a < b, 0001 otherwise +EQU ( a b -- bool ) push 0001 if a == b, 0000 otherwise +NEQ ( a b -- bool ) push 0001 if a != b, 0000 otherwise +GTH ( a b -- bool ) push 0001 if a > b, 0000 otherwise +LTH ( a b -- bool ) push 0001 if a < b, 0000 otherwise JEZ x ( cond -- ) conditional jump to x if cond != 0 JNZ x ( cond -- ) conditional jump to x if cond == 0 JMP x ( -- ) jump to x @@ -23,8 +23,8 @@ JRT x ( -- ) jump to x and store PC+2 to return stack RET ( -- ) return from call, or quit if not in call LDA ( addr -- value ) push value at absolute address to top of the stack STA ( val addr -- ) write a value to an absolute address -RED ( -- value ) read short from stdin -WRT ( value -- ) write short to stdout +RED ( -- value ) read byte from stdin +WRT ( value -- ) write byte to stdout ADD ( a b -- a+b ) SUB ( a b -- a-b ) MUL ( a b -- a*b ) |