Add depth and rdepth

This commit is contained in:
Koichi Nakamura 2021-01-10 10:46:35 +09:00
parent 99e8b72521
commit 7b57c7f864

View file

@ -610,6 +610,11 @@ allot-cell : &find! [ ' L , , ] ; \ ( c-addr -- nt ) Throw exception at error
: sp0 [ sp@ ] literal ;
: rp0 [ rp@ ] literal ;
\ ( -- n )
\ Number of elemtns in the stack
: depth sp0 sp@ - cell- cell / ;
: rdepth rp0 rp@ - cell / ;
\ === Integer Arithmetic ===
: 1+ 1 + ;