diff --git a/forth.s b/forth.s index 50b856e..d160366 100644 --- a/forth.s +++ b/forth.s @@ -1985,6 +1985,8 @@ defword "ROT",, defword "SP",, ; Put Data Stack Pointer on the stack TXA + INA + INA STA 0,X STZ 1,X JMP DEX2_NEXT @@ -2786,9 +2788,9 @@ BOOT_PRG: ; some more stack words .BYTE " : NIP SWAP DROP ; " ; ( x1 x0 -- x0 ) removes second on stack - .BYTE " : PICK 2+ 2* SP + @ ; " ; ( xn ... x1 x0 n -- xn ... x1 x0 xn ) , removes n, push copy of xn on top. n>=0 + .BYTE " : PICK 1+ 2* SP + @ ; " ; ( xn ... x1 x0 n -- xn ... x1 x0 xn ) , removes n, push copy of xn on top. n>=0 .BYTE " : DEPTH " - .BYTE .sprintf("%X", DTOP-2) + .BYTE .sprintf("%X", DTOP) .BYTE " SP - 2/ ; " .BYTE " : .S DEPTH DUP IF 1+ DUP 1 DO DUP I - PICK . LOOP CR THEN DROP ; " ; print stack, leave cells on stack