Add align operations

This commit is contained in:
Koichi Nakamura 2021-01-02 15:48:47 +09:00
parent 1142fe1607
commit 7a67e8a57a

View file

@ -361,6 +361,7 @@ c ] i , ' L , k 1 k 0 - , ' M , ' ! , ' e , l !
\ Read name, create word with smudge=1, \ Read name, create word with smudge=1,
\ compile 'docol' and enter compile mode. \ compile 'docol' and enter compile mode.
c : i , c : i ,
' A , \ align here
' h , ' @ , ' h , ' @ ,
' l , ' @ , ' , , \ fill link ' l , ' @ , ' , , \ fill link
' l , ' ! , \ update latest ' l , ' ! , \ update latest
@ -377,6 +378,7 @@ c : i ,
\ ; ( -- ) SEMICOLON \ ; ( -- ) SEMICOLON
\ Compile 'exit', unsmudge latest, and enter immediate mode. \ Compile 'exit', unsmudge latest, and enter immediate mode.
c ; i , c ; i ,
' A , \ align here
' L , ' e , ' , , \ compile exit ' L , ' e , ' , , \ compile exit
' l , ' @ , ' l , ' @ ,
' C , ' + , ' # , ' ? , ' C , ' + , ' # , ' ? ,
@ -410,7 +412,7 @@ set-immediate \
\ Copy code pointer of builtin word "name-old" to \ Copy code pointer of builtin word "name-old" to
\ the new word "name-new". \ the new word "name-new".
\ "name-old" must not be a FORTH word. \ "name-old" must not be a FORTH word.
h @ l @ , l ! \ fill link, update latest A h @ l @ , l ! \ fill link, update latest
W # B m A \ fill length and chars of "name-new" W # B m A \ fill length and chars of "name-new"
W F G @ , \ fill code-pointer of "name-old" W F G @ , \ fill code-pointer of "name-old"
; ;
@ -793,6 +795,7 @@ alias-builtin xor ^
\ When the word is executed, it pushs value of here \ When the word is executed, it pushs value of here
\ at the end of the entry. \ at the end of the entry.
: create : create
align
latest , \ fill link latest , \ fill link
here cell- &latest ! \ update latest here cell- &latest ! \ update latest
word word
@ -810,6 +813,7 @@ alias-builtin xor ^
; ;
: does> : does>
align
0 [compile] literal \ literal for xt 0 [compile] literal \ literal for xt
here cell- \ save addr of xt here cell- \ save addr of xt