MitchBradley/cforth

xdrop

Jos-Ven opened this issue · 1 comments

Hi, I am a bit puzzled by the following:
Under Win32Forth and Gforth I can use xdrop as follows :
: xdrop ( nx..n1 #n - ) >r sp@ r> cells + sp! ;
1000 1 2 3 4 5 5 xdrop . \ 1000 ok

To see the 1000 under Cforth on a ESP32 I have to use the following:
: xdrop-V2 ( nx..n1 #n - ) >r sp@ r> 1- cells + sp! drop ;
1000 1 2 3 4 5 5 xdrop-V2 . \ 1000 ok

Any comment is welcome.

Cforth caches the top of stack in a register.