rename 'string' to 'litstring'

This commit is contained in:
Koichi Nakamura 2021-01-03 09:36:41 +09:00
parent b6967eba48
commit fe234b5259
3 changed files with 37 additions and 37 deletions

View file

@ -33,37 +33,37 @@ bye
# Builtin Words
| code | name | stack effect | semantics |
|:----:|:---------|:----------------|:-----------------------------|
| Q | quit | ( -- ) | Exit the process |
| C | cell | ( -- n ) | The size of Cells |
| h | &here | ( -- a-addr ) | The address of 'here' cell |
| l | &latest | ( -- a-addr ) | The address of 'latest' cell |
| k | key | ( -- c ) | Read character |
| t | type | ( c -- ) | Print character |
| j | jump | ( -- ) | Unconditional branch |
| J | 0jump | ( n -- ) | Jump if a == 0 |
| f | find | ( c -- xt ) | Get execution token of c |
| x | execute | ( xt -- ... ) | Run the execution token |
| @ | fetch | ( a-addr -- w ) | Load value from addr |
| ! | store | ( w a-addr -- ) | Store value to addr |
| ? | cfetch | ( c-addr -- c ) | Load byte from addr |
| $ | cstore | ( c c-addr -- ) | Store byte to addr |
| d | dfetch | ( -- a-addr ) | Get data stack pointer |
| D | dstore | ( a-addr -- ) | Set data stack pointer |
| r | rfetch | ( -- a-addr ) | Get return stack pointer |
| R | rstore | ( a-addr -- ) | Set return stack pointer |
| i | docol | ( -- a-addr ) | Get the interpreter function |
| e | exit | ( -- ) | Exit current function |
| L | lit | ( -- n ) | Load immediate |
| S | string | ( -- c-addr u ) | Load string literal |
| + | add | ( a b -- c ) | c = (a + b) |
| - | sub | ( a b -- c ) | c = (a - b) |
| * | mul | ( a b -- c ) | c = (a * b) |
| / | div | ( a b -- c ) | c = (a / b) |
| % | mod | ( a b -- c ) | c = (a % b) |
| & | and | ( a b -- c ) | c = (a & b) |
| \| | or | ( a b -- c ) | c = (a \| b) |
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
| < | less | ( a b -- c ) | c = (a < b) |
| = | equal | ( a b -- c ) | c = (a == b) |
| code | name | stack effect | semantics |
|:----:|:----------|:----------------|:-----------------------------|
| Q | quit | ( -- ) | Exit the process |
| C | cell | ( -- n ) | The size of Cells |
| h | &here | ( -- a-addr ) | The address of 'here' cell |
| l | &latest | ( -- a-addr ) | The address of 'latest' cell |
| k | key | ( -- c ) | Read character |
| t | type | ( c -- ) | Print character |
| j | jump | ( -- ) | Unconditional branch |
| J | 0jump | ( n -- ) | Jump if a == 0 |
| f | find | ( c -- xt ) | Get execution token of c |
| x | execute | ( xt -- ... ) | Run the execution token |
| @ | fetch | ( a-addr -- w ) | Load value from addr |
| ! | store | ( w a-addr -- ) | Store value to addr |
| ? | cfetch | ( c-addr -- c ) | Load byte from addr |
| $ | cstore | ( c c-addr -- ) | Store byte to addr |
| d | dfetch | ( -- a-addr ) | Get data stack pointer |
| D | dstore | ( a-addr -- ) | Set data stack pointer |
| r | rfetch | ( -- a-addr ) | Get return stack pointer |
| R | rstore | ( a-addr -- ) | Set return stack pointer |
| i | docol | ( -- a-addr ) | Get the interpreter function |
| e | exit | ( -- ) | Exit current function |
| L | lit | ( -- n ) | Load immediate |
| S | litstring | ( -- c-addr u ) | Load string literal |
| + | add | ( a b -- c ) | c = (a + b) |
| - | sub | ( a b -- c ) | c = (a - b) |
| * | mul | ( a b -- c ) | c = (a * b) |
| / | div | ( a b -- c ) | c = (a / b) |
| % | mod | ( a b -- c ) | c = (a % b) |
| & | and | ( a b -- c ) | c = (a & b) |
| \| | or | ( a b -- c ) | c = (a \| b) |
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
| < | less | ( a b -- c ) | c = (a < b) |
| = | equal | ( a b -- c ) | c = (a == b) |

View file

@ -442,7 +442,7 @@ alias-builtin rp! R
alias-builtin docol i
alias-builtin exit e
alias-builtin lit L
alias-builtin string S
alias-builtin litstring S
alias-builtin div /
alias-builtin mod %
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.
: s"
state @ if
compile string
compile litstring
here 0 , \ save location of length and fill dummy
0 \ length of the string
begin key dup '"' <> while

View file

@ -105,7 +105,7 @@
00000298: 9c82 0408 ad50 adff lodsl; pushl %eax; next;
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
000002b8: c683 c603 83e6 fcad addl %eax,%esi; addl $3,%esi; andl $~3,%esi;next;
000002c0: ff20 0000 0000 0000