diff --git a/blk/058 b/blk/058 index 43f9284..e9718b2 100644 --- a/blk/058 +++ b/blk/058 @@ -4,10 +4,9 @@ LIT -- Write a LIT entry. You're expected to write actual string to HERE right afterwards. LIT< x -- Read following word and write to HERE as a string literal. -LITS a -- Write word at addr a as a atring literal. S= a1 a2 -- f Returns whether string a1 == a2. -SCPY a -- Copy string at addr a into HERE. - +SCPY a -- Copy string at addr a into HERE, without + NULL termination. diff --git a/blk/268 b/blk/268 index 57d20d5..e1e312b 100644 --- a/blk/268 +++ b/blk/268 @@ -8,7 +8,7 @@ DUP LIT< ( S= IF DROP [COMPILE] ( ELSE - SCPY 0x20 H@ 1- C! + SCPY 0x20 C, THEN 0 ( loop again ) ELSE 1 ( stop looping ) THEN UNTIL diff --git a/blk/407 b/blk/407 index f927ae3..fa8978a 100644 --- a/blk/407 +++ b/blk/407 @@ -1,8 +1,6 @@ : SCPY - BEGIN ( a ) - C@+ ( a+1 c ) - DUP C, ( a c ) - NOT IF DROP EXIT THEN + BEGIN ( a ) + C@+ ( a+1 c ) + DUP NOT IF 2DROP EXIT THEN + C, ( a c ) AGAIN ; - - diff --git a/blk/408 b/blk/408 index 1fce040..fb4a6c0 100644 --- a/blk/408 +++ b/blk/408 @@ -1,14 +1,10 @@ : [entry] - HERE @ ( w h ) - SWAP SCPY ( h ) - ( Adjust HERE -1 because SCPY copies the null ) - HERE @ 1- ( h h' ) - DUP HERE ! ( h h' ) - SWAP - ( sz ) + HERE @ ( w h ) + SWAP SCPY ( h ) + HERE @ SWAP - ( sz ) ( write prev value ) HERE @ CURRENT @ - , - ( write size ) - C, + C, ( write size ) HERE @ CURRENT ! ; diff --git a/blk/422 b/blk/422 index e2ca7c8..445bcf4 100644 --- a/blk/422 +++ b/blk/422 @@ -1,7 +1,6 @@ : [ INTERPRET ; IMMEDIATE : ] R> DROP ; -: LITS 34 , SCPY ; -: LIT< WORD LITS ; IMMEDIATE +: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE : LITA 36 , , ; : '? WORD (find) ; : ' diff --git a/blk/424 b/blk/424 index 4bcb673..7bd64ff 100644 --- a/blk/424 +++ b/blk/424 @@ -7,7 +7,7 @@ 40 is ASCII for '('. We do this to simplify XPACK's task of not mistakenly consider '(' definition as a comment. - LITS: 34 == litWord + LIT<: 34 == litWord LITA: 36 == addrWord COMPILE: Tough one. Get addr of caller word (example above (br)) and then call LITA on it. ) diff --git a/emul/forth.bin b/emul/forth.bin index 26c548f..c9db31e 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ