User Tools

Site Tools


en:pfw:kangoeroe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:pfw:kangoeroe [2023-09-04 18:16] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1en:pfw:kangoeroe [2023-09-04 18:16] (current) – ↷ Seite von pfw:kangoeroe nach en:pfw:kangoeroe verschoben uho
Line 1: Line 1:
 +===== Kangaroo method =====
 +
 +The "lone" DOES> is used for the creation of only one word rather than for the creation of a category of words.
 +simple example in noForth
 +<code>
 +create .DAY ( n -- )  s" SunMonTueWedThuFriSat ? " m, align
 +    does> swap 7 umin 3 * + 3 type ;
 +</code>
 +
 +example in noForth
 +<code>
 +create :
 +    assembler   ip push   w ip mov   next   forth   \ DOCOL
 +    does> create here cell- doer! ] ;               \ Action
 +</code>
 +
 +or
 +<code>
 +:noname     does> create here cell- doer! ] ;
 +create :
 +    assembler   ip push   w ip mov   next   forth
 +execute
 +</code>
 +
 +"faraway" DOES> for forward references in metacompiler
 +<code>
 +create :
 +    assembler   ip push   w ip mov   next   forth
 +    ... \ many other definitions
 +TELL : TO-DO: create here cell- doer! ] ;
 +</code>
 +
 +literal pool in assembler words with CODE>
 +<code>
 +code !RP0  ( -- )
 +    ramadr: RP0 ,       \ register w points to this literal
 +    code>   day  w ) ldr,
 +            day  day ) ldr,
 +            rp day mov,
 +    next, end-code
 +</code>
 +
 +(an)
 +
 +=== Please add your comments below. ===
 +~~DISCUSSION~~
 +