Language Words

These are the standard words provided as builtins, pseudobuiltins, or in a Forth file with priority <10.

Stack Manipulation

DEPTH

Signature: ( -- u )

Pushes the depth of the stack to the stack.

Example:

1 2 3 DEPTH
.S \ 1 2 3 3

DROP

Signature: ( x -- )

Pops an item from the top of the stack and discards it.

Example:

1 2 3 DROP
.S \ 1 2

DUP

Signature: ( x -- x x )

Duplicates the top item of the stack.

Example:

1 2 3 DUP
.S \ 1 2 3 3

Arithmetic, Comparison, and Logic

Strings

ADJUST

Signature: ( addr len n -- addr+n len-n )

Advances n bytes in a string.

Examples:

$1000 16 4 ADJUST
.S \ $1004 12
S"Foo Bar" 4 ADJUST
TYPE \ Bar

Control Flow

Compilation

Dictionary

Memory Access

Return Stack Manipulation