Fix stack notation

This commit is contained in:
Koichi Nakamura 2021-01-02 09:35:07 +09:00
parent 8741d78b4d
commit d218a9eda2

28
core.fs
View file

@ -26,26 +26,26 @@ l!
\ List of builtin words:
\ 'Q' ( -- ) Exit the process
\ 'C' ( -- n ) The size of Cells
\ 'h' ( -- addr ) The address of 'here' cell
\ 'l' ( -- addr ) The address of 'latest' cell
\ 'h' ( -- a-addr ) The address of 'here' cell
\ 'l' ( -- a-addr ) The address of 'latest' cell
\ 'k' ( -- c ) Read character
\ 't' ( c -- ) Print character
\ 'j' ( -- ) Unconditional branch
\ 'J' ( a -- ) Jump if a == 0
\ 'J' ( n -- ) Jump if a == 0
\ 'f' ( c -- xt ) Get execution token of c
\ 'x' ( xt -- ... ) Run the execution token
\ '@' ( addr -- a ) Load value from addr
\ '!' ( a addr -- ) Store value to addr
\ '?' ( addr -- c ) Load byte from addr
\ '$' ( c addr -- ) Store byte to addr
\ 'd' ( -- addr ) Get data stack pointer
\ 'D' ( addr -- ) Set data stack pointer
\ 'r' ( -- addr ) Get return stack pointer
\ 'R' ( addr -- ) Set return stack pointer
\ 'i' ( -- addr ) Get the interpreter function
\ '@' ( a-addr -- w ) Load value from addr
\ '!' ( w a-addr -- ) Store value to addr
\ '?' ( c-addr -- c ) Load byte from addr
\ '$' ( c c-addr -- ) Store byte to addr
\ 'd' ( -- a-addr ) Get data stack pointer
\ 'D' ( a-addr -- ) Set data stack pointer
\ 'r' ( -- a-addr ) Get return stack pointer
\ 'R' ( a-addr -- ) Set return stack pointer
\ 'i' ( -- a-addr ) Get the interpreter function
\ 'e' ( -- ) Exit current function
\ 'L' ( -- a ) Load immediate
\ 'S' ( -- addr len) Load string literal
\ 'L' ( -- u ) Load immediate
\ 'S' ( -- a-addr u ) Load string literal
\ '+' ( a b -- c ) c = (a + b)
\ '-' ( a b -- c ) c = (a - b)
\ '*' ( a b -- c ) c = (a * b)