mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
rename 'string' to 'litstring'
This commit is contained in:
parent
b6967eba48
commit
fe234b5259
3 changed files with 37 additions and 37 deletions
68
README.md
68
README.md
|
@ -33,37 +33,37 @@ bye
|
||||||
|
|
||||||
# Builtin Words
|
# Builtin Words
|
||||||
|
|
||||||
| code | name | stack effect | semantics |
|
| code | name | stack effect | semantics |
|
||||||
|:----:|:---------|:----------------|:-----------------------------|
|
|:----:|:----------|:----------------|:-----------------------------|
|
||||||
| Q | quit | ( -- ) | Exit the process |
|
| Q | quit | ( -- ) | Exit the process |
|
||||||
| C | cell | ( -- n ) | The size of Cells |
|
| C | cell | ( -- n ) | The size of Cells |
|
||||||
| h | &here | ( -- a-addr ) | The address of 'here' cell |
|
| h | &here | ( -- a-addr ) | The address of 'here' cell |
|
||||||
| l | &latest | ( -- a-addr ) | The address of 'latest' cell |
|
| l | &latest | ( -- a-addr ) | The address of 'latest' cell |
|
||||||
| k | key | ( -- c ) | Read character |
|
| k | key | ( -- c ) | Read character |
|
||||||
| t | type | ( c -- ) | Print character |
|
| t | type | ( c -- ) | Print character |
|
||||||
| j | jump | ( -- ) | Unconditional branch |
|
| j | jump | ( -- ) | Unconditional branch |
|
||||||
| J | 0jump | ( n -- ) | Jump if a == 0 |
|
| J | 0jump | ( n -- ) | Jump if a == 0 |
|
||||||
| f | find | ( c -- xt ) | Get execution token of c |
|
| f | find | ( c -- xt ) | Get execution token of c |
|
||||||
| x | execute | ( xt -- ... ) | Run the execution token |
|
| x | execute | ( xt -- ... ) | Run the execution token |
|
||||||
| @ | fetch | ( a-addr -- w ) | Load value from addr |
|
| @ | fetch | ( a-addr -- w ) | Load value from addr |
|
||||||
| ! | store | ( w a-addr -- ) | Store value to addr |
|
| ! | store | ( w a-addr -- ) | Store value to addr |
|
||||||
| ? | cfetch | ( c-addr -- c ) | Load byte from addr |
|
| ? | cfetch | ( c-addr -- c ) | Load byte from addr |
|
||||||
| $ | cstore | ( c c-addr -- ) | Store byte to addr |
|
| $ | cstore | ( c c-addr -- ) | Store byte to addr |
|
||||||
| d | dfetch | ( -- a-addr ) | Get data stack pointer |
|
| d | dfetch | ( -- a-addr ) | Get data stack pointer |
|
||||||
| D | dstore | ( a-addr -- ) | Set data stack pointer |
|
| D | dstore | ( a-addr -- ) | Set data stack pointer |
|
||||||
| r | rfetch | ( -- a-addr ) | Get return stack pointer |
|
| r | rfetch | ( -- a-addr ) | Get return stack pointer |
|
||||||
| R | rstore | ( a-addr -- ) | Set return stack pointer |
|
| R | rstore | ( a-addr -- ) | Set return stack pointer |
|
||||||
| i | docol | ( -- a-addr ) | Get the interpreter function |
|
| i | docol | ( -- a-addr ) | Get the interpreter function |
|
||||||
| e | exit | ( -- ) | Exit current function |
|
| e | exit | ( -- ) | Exit current function |
|
||||||
| L | lit | ( -- n ) | Load immediate |
|
| L | lit | ( -- n ) | Load immediate |
|
||||||
| S | string | ( -- c-addr u ) | Load string literal |
|
| S | litstring | ( -- c-addr u ) | Load string literal |
|
||||||
| + | add | ( a b -- c ) | c = (a + b) |
|
| + | add | ( a b -- c ) | c = (a + b) |
|
||||||
| - | sub | ( a b -- c ) | c = (a - b) |
|
| - | sub | ( a b -- c ) | c = (a - b) |
|
||||||
| * | mul | ( a b -- c ) | c = (a * b) |
|
| * | mul | ( a b -- c ) | c = (a * b) |
|
||||||
| / | div | ( a b -- c ) | c = (a / b) |
|
| / | div | ( a b -- c ) | c = (a / b) |
|
||||||
| % | mod | ( a b -- c ) | c = (a % b) |
|
| % | mod | ( a b -- c ) | c = (a % b) |
|
||||||
| & | and | ( a b -- c ) | c = (a & b) |
|
| & | and | ( a b -- c ) | c = (a & b) |
|
||||||
| \| | or | ( a b -- c ) | c = (a \| b) |
|
| \| | or | ( a b -- c ) | c = (a \| b) |
|
||||||
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
|
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
|
||||||
| < | less | ( a b -- c ) | c = (a < b) |
|
| < | less | ( a b -- c ) | c = (a < b) |
|
||||||
| = | equal | ( a b -- c ) | c = (a == b) |
|
| = | equal | ( a b -- c ) | c = (a == b) |
|
||||||
|
|
|
@ -442,7 +442,7 @@ alias-builtin rp! R
|
||||||
alias-builtin docol i
|
alias-builtin docol i
|
||||||
alias-builtin exit e
|
alias-builtin exit e
|
||||||
alias-builtin lit L
|
alias-builtin lit L
|
||||||
alias-builtin string S
|
alias-builtin litstring S
|
||||||
alias-builtin div /
|
alias-builtin div /
|
||||||
alias-builtin mod %
|
alias-builtin mod %
|
||||||
alias-builtin and &
|
alias-builtin and &
|
||||||
|
@ -1128,7 +1128,7 @@ char 0 char B - constant string-overflow-error \ -18
|
||||||
\ immediate mode: the string is stored to temporary buffer.
|
\ immediate mode: the string is stored to temporary buffer.
|
||||||
: s"
|
: s"
|
||||||
state @ if
|
state @ if
|
||||||
compile string
|
compile litstring
|
||||||
here 0 , \ save location of length and fill dummy
|
here 0 , \ save location of length and fill dummy
|
||||||
0 \ length of the string
|
0 \ length of the string
|
||||||
begin key dup '"' <> while
|
begin key dup '"' <> while
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
00000298: 9c82 0408 ad50 adff lodsl; pushl %eax; next;
|
00000298: 9c82 0408 ad50 adff lodsl; pushl %eax; next;
|
||||||
000002a0: 2000 0000 0000 0000
|
000002a0: 2000 0000 0000 0000
|
||||||
|
|
||||||
000002a8: 9082 0408 0153 0000 S: string
|
000002a8: 9082 0408 0153 0000 S: litstring
|
||||||
000002b0: b482 0408 ad56 5001 lodsl; pushl %esi; pushl %eax
|
000002b0: b482 0408 ad56 5001 lodsl; pushl %esi; pushl %eax
|
||||||
000002b8: c683 c603 83e6 fcad addl %eax,%esi; addl $3,%esi; andl $~3,%esi;next;
|
000002b8: c683 c603 83e6 fcad addl %eax,%esi; addl $3,%esi; andl $~3,%esi;next;
|
||||||
000002c0: ff20 0000 0000 0000
|
000002c0: ff20 0000 0000 0000
|
||||||
|
|
Loading…
Reference in a new issue