1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 03:30:55 +11:00
collapseos/forth/dict.fs

19 lines
415 B
Forth
Raw Normal View History

2020-04-08 11:23:42 +10:00
( Get word header length from wordref. That is, name length
+ 3. a is a wordref )
( a -- n )
: WHLEN
1 - C@ ( name len field )
0x7f AND ( remove IMMEDIATE flag )
3 + ( fixed header len )
;
( Get word addr, starting at name's address )
: '< ' DUP WHLEN - ;
( Get word's prev offset )
( a -- a )
: PREV
3 - DUP @ ( a o )
- ( a-o )
;