version 1.12, 1997/07/31 16:17:11
|
version 1.14, 1999/02/22 21:39:42
|
Line 18
|
Line 18
|
\ along with this program; if not, write to the Free Software |
\ along with this program; if not, write to the Free Software |
\ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
\ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
: nalign ( addr1 n -- addr2 ) \ gforth |
: naligned ( addr1 n -- addr2 ) \ gforth |
\g @code{addr2} is the aligned version of @code{addr1} wrt the |
\g @code{addr2} is the aligned version of @code{addr1} wrt the |
\g alignment @code{n}. |
\g alignment @code{n}. |
1- tuck + swap invert and ; |
1- tuck + swap invert and ; |
|
|
|
' naligned alias nalign \ old name, obsolete |
|
|
: dozerofield ( -- ) |
: dozerofield ( -- ) |
\ a field that makes no change |
\ a field that makes no change |
\ to enable accessing the offset with "['] <field> >body @" this |
\ to enable accessing the offset with "['] <field> >body @" this |
Line 35 does> ( name execution: -- )
|
Line 37 does> ( name execution: -- )
|
drop ; |
drop ; |
|
|
: field, ( align1 offset1 align size -- align2 offset2 ) |
: field, ( align1 offset1 align size -- align2 offset2 ) |
rot dup , ( align1 align size offset1 ) |
swap rot over nalign dup , ( align1 size align offset ) |
+ >r nalign r> ; |
rot + >r nalign r> ; |
|
|
: create-field ( align1 offset1 align size -- align2 offset2 ) |
: create-field ( align1 offset1 align size -- align2 offset2 ) |
create field, ; |
create field, ; |