create  ( comp: -- | exec: -- addr )

published: 28 January 2023 / updated 29 January 2023

Lire cette page en français

 

vocabulary: forth

Create a new word.

The word CREATE can be used alone.

Example:

CREATE DATAS  ( --- addr) 
    25 c, 32 c, 44 c, 17 c, 
 
\ other example: 
: defPIN: ( PORTx mask ---  |  --- mask port) 
    create 
        , ,             \ compile PORT and min mask 
    does> 
        dup @           \ push pin mask 
        swap 2+ @       \ push PORT 
    ; 
 
\ définition LED.xx 
flash 
PORTB $80 defPIN: LED.red 
PORTB $40 defPIN: LED.yellow 
PORTB $20 defPIN: LED.green 
ram