diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-08 16:24:22 +0100 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-17 12:10:37 +0100 |
commit | 46ac4818ad07f3c4f290319b3e04d3125b8197ac (patch) | |
tree | 0147f7ecb1a5592653834ebf13043a7429e7e11b /slof | |
parent | f332133c85b2fb8d347d0e4d318da1f11f3bdf65 (diff) | |
download | SLOF-46ac4818ad07f3c4f290319b3e04d3125b8197ac.zip SLOF-46ac4818ad07f3c4f290319b3e04d3125b8197ac.tar.gz SLOF-46ac4818ad07f3c4f290319b3e04d3125b8197ac.tar.bz2 |
Fixed PACK command.
According to IEEE 1275, the "pack" command converts a Forth string into a
packed counted string, i.e. it has to store the length of the string in the
destination memory buffer, too, so that the operation can be reverted with the
"count" command. Our current implementation did not save the length yet - this
has been fixed now.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/engine.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/slof/engine.in b/slof/engine.in index 2cc9d26..d723bc2 100644 --- a/slof/engine.in +++ b/slof/engine.in @@ -266,7 +266,7 @@ col(SPACES 0 DO?DO(3) SPACE DOLOOP(-3)) // Text manipulation. col(COUNT DUP CHAR+ SWAP C@) -col(PACK DUP >R SWAP MOVE R>) +col(PACK DUP >R 1+ SWAP DUP R@ C! MOVE R>) col(UPC DUP LIT('a') LIT('z') BETWEEN 0BRANCH(3) LIT(0x20) - ) col(LCC DUP LIT('A') LIT('Z') BETWEEN 0BRANCH(3) LIT(0x20) + ) |