rename cmove to memcpy

This commit is contained in:
Koichi Nakamura 2021-01-09 17:13:51 +09:00
parent 6b6a2ed057
commit 998f87530a

View file

@ -459,7 +459,7 @@ alias-builtin xor ^
: find F ; : find F ;
: >cfa G ; : >cfa G ;
: c, B ; : c, B ;
: cmove, m ; : memcpy, m ;
: strlen z ; : strlen z ;
: str= E ; : str= E ;
: state M ; : state M ;
@ -813,7 +813,7 @@ alias-builtin xor ^
latest , \ fill link latest , \ fill link
here cell- &latest ! \ update latest here cell- &latest ! \ update latest
word dup strlen word dup strlen
dup c, cmove, 0 c, align \ fill length, name and \0 dup c, memcpy, 0 c, align \ fill length, name and \0
docol , \ compile docol docol , \ compile docol
['] lit , ['] lit ,
here 3 cells + , \ compile the address here 3 cells + , \ compile the address
@ -1116,7 +1116,7 @@ decimal \ set default to decimal
\ ( c-from c-to u -- ) \ ( c-from c-to u -- )
\ Copy u bytes from c-from to c-to. \ Copy u bytes from c-from to c-to.
\ The memory regions must not be overlapped. \ The memory regions must not be overlapped.
: cmove : memcpy
begin dup 0> while begin dup 0> while
1- >r \ decrement u, save 1- >r \ decrement u, save
over c@ over c@
@ -1127,7 +1127,7 @@ decimal \ set default to decimal
repeat 3drop repeat 3drop
; ;
\ we already have cmove, \ we already have memcpy,
\ ( c-from c-to -- ) \ ( c-from c-to -- )
\ copy nul terminated string from c-from to c-to \ copy nul terminated string from c-from to c-to