<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


ALIGN Search:

In Compilation Words in TurboForth Kernal

Word Name: ALIGN
Type: Standard compiling word
Data Stack Signature: --
Return Stack Signature: --
Availability: V1.0  V1.1  V1.2
Description:

Aligns H to the next (highest) even compilation address. Takes no action if H is already even.

Example:

ALIGN
99 C,
H @ $.

(TurboForth displays an odd value)

ALIGN H @ $.

(TurboForth aligns H/HERE, displaying an even value)

Comment:

Dictionary entries and executable code must align on even addresses. HEADER automatically calls ALIGN before creating dictionary entries, but sometimes H or HERE can be left with an odd value. The most common cause of this is the word C, which compiles a single byte to memory. In such situations where an odd value in H/HERE is undesirable, ALIGN will align H to the next even value. Note that if H is already aligned to an even address then ALIGN shall take no action.

See Also: , (comma)  C,  HEADER  H  HERE 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>