diff --git a/blk/046 b/blk/046 index 9285ef2..e9b66cf 100644 --- a/blk/046 +++ b/blk/046 @@ -3,6 +3,7 @@ Parameter Stack DROP a -- DUP a -- a a ?DUP DUP if a is nonzero +NIP a b -- b OVER a b -- a b a ROT a b c -- b c a SWAP a b -- b a @@ -12,5 +13,4 @@ SWAP a b -- b a 2SWAP a b c d -- c d a b 'S Returns current stack pointer, not counting the push it's making right now. -S0 Returns address of PSP TOS. When PSP is empty, - 'S == S0 (cont.) + (cont.) diff --git a/blk/047 b/blk/047 index a3e7fa8..704b33e 100644 --- a/blk/047 +++ b/blk/047 @@ -1,4 +1,5 @@ -(cont.) +S0 Returns address of PSP TOS. When PSP is empty, + 'S == S0 PICK Pick nth item from stack. "0 PICK" = DUP, "1 PICK" = OVER. ROLL Rotate PSP over n items. "1 ROLL" = SWAP, diff --git a/blk/108 b/blk/108 index 32c3a85..d012920 100644 --- a/blk/108 +++ b/blk/108 @@ -7,7 +7,7 @@ SWAP OVER - ( ilen chars-to-move ) SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen ) 3 PICK MOVE- ( ctm ilen ) - SWAP DROP ( ilen ) + NIP ( ilen ) ELSE DROP ( ilen becomes rbuffsize ) THEN DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) diff --git a/blk/125 b/blk/125 index 7a2e7d2..04605b9 100644 --- a/blk/125 +++ b/blk/125 @@ -7,7 +7,7 @@ THEN ROT ( o a n ol ) < IF ( under limit, do nothing ) - SWAP DROP ( a ) + NIP ( a ) ELSE ( o a ) SWAP OVER @ ( a o n ) -^ ( a n-o ) diff --git a/blk/364 b/blk/364 index 865da53..a757bf8 100644 --- a/blk/364 +++ b/blk/364 @@ -12,3 +12,4 @@ IF OVER C@ OR ELSE 0xff XOR OVER C@ AND THEN ( addr flg ) SWAP C! ; +: NIP SWAP DROP ; diff --git a/blk/366 b/blk/366 index 39b5ee7..784528c 100644 --- a/blk/366 +++ b/blk/366 @@ -9,5 +9,5 @@ OVER ! 1+ C< ( a c ) OVER 0x2d ( 2e-1 for NULL ) RAM+ = OVER WS? OR UNTIL ( a c ) - SWAP DROP 0x0e RAM+ ( ws a ) + NIP 0x0e RAM+ ( ws a ) SWAP EOT? IF 4 OVER ! THEN ; diff --git a/blk/369 b/blk/369 index fa4735a..f6f6872 100644 --- a/blk/369 +++ b/blk/369 @@ -7,7 +7,7 @@ : IMMED? 1- C@ 0x80 AND ; : +! SWAP OVER @ + SWAP ! ; : -^ SWAP - ; -: / /MOD SWAP DROP ; +: / /MOD NIP ; : MOD /MOD DROP ; : ALLOT HERE +! ; : CREATE (entry) 11 ( 11 == cellWord ) C, ; diff --git a/blk/370 b/blk/370 index 9792015..2aad0d2 100644 --- a/blk/370 +++ b/blk/370 @@ -7,7 +7,6 @@ ?DUP NOT IF EXIT THEN 1+ DUP PICK ( n val ) SWAP 2 * (roll) ( val ) - SWAP DROP -; + NIP ; : 2OVER 3 PICK 3 PICK ; : 2SWAP 3 ROLL 3 ROLL ; diff --git a/blk/569 b/blk/569 index c629f23..dea7c07 100644 --- a/blk/569 +++ b/blk/569 @@ -8,5 +8,5 @@ ( gid dmask ) 0xff XOR ( dpos ) 0 ( dindex ) BEGIN 1+ 2DUP RSHIFT NOT UNTIL 1- - ( gid dpos dindex ) SWAP DROP + ( gid dpos dindex ) NIP ( gid dindex ) SWAP 8 * + ; diff --git a/blk/604 b/blk/604 index 5d7d0b8..95c82f8 100644 --- a/blk/604 +++ b/blk/604 @@ -8,7 +8,7 @@ 0 ( cnt ) BEGIN _idle - DUP 0xff = IF DROP ELSE SWAP DROP EXIT THEN + DUP 0xff = IF DROP ELSE NIP EXIT THEN 1+ DUP 20 = UNTIL DROP 0xff diff --git a/blk/634 b/blk/634 index a399ba9..1fc3e5d 100644 --- a/blk/634 +++ b/blk/634 @@ -4,5 +4,5 @@ CREATE _ '0' C, ':' C, 'A' C, '[' C, 'a' C, 0xff C, : _nxtcls _sel @ _ BEGIN ( c a ) C@+ 2 PICK > UNTIL ( c a ) - 1- C@ SWAP DROP _sel ! + 1- C@ NIP _sel ! ; diff --git a/emul/forth.bin b/emul/forth.bin index 44c1bea..5e93703 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ