\ stacks 00.3.28 3:09 pm NAB
: stack ( size "name" -- )
create
cells dup here cell+ dup ,
+ , allot ;
: push ( item stack -- )
1 cells over +! @ ! ;
: pop ( stack -- item )
dup @ @ -1 cells rot +! ;
\ Example:
\ 10 stack mystack
\ 23 mystack push
\ 42 mystack push
\ mystack pop . -> 42
\ mystack pop . -> 23