mirror of
https://github.com/nineties/planckforth
synced 2025-01-13 08:01:10 +01:00
Change semantics of 'm'
This commit is contained in:
parent
1da940ba1b
commit
bc96fe9863
1 changed files with 8 additions and 10 deletions
18
core.fs
18
core.fs
|
@ -189,21 +189,19 @@ c~ i,
|
||||||
\ Store byte 'c' to here and increment it
|
\ Store byte 'c' to here and increment it
|
||||||
cB i, 'h, '@, '$, 'h, '@, 'L, k1k0-, '+, 'h, '!, 'e, l!
|
cB i, 'h, '@, '$, 'h, '@, 'L, k1k0-, '+, 'h, '!, 'e, l!
|
||||||
|
|
||||||
\ 'm' ( c-from c-to u -- ) CMOVE
|
\ 'm' ( c-addr u -- ) CMOVE,
|
||||||
\ Copy u bytes from c-from to c-to.
|
\ Copy u bytes from c-addr to here,
|
||||||
\ It is not safe when two region overlaps.
|
\ increment here u bytes.
|
||||||
cm i,
|
cm i,
|
||||||
\ <loop>
|
\ <loop>
|
||||||
'#, 'J, kDk0-C*, \ goto <exit> if u=0
|
'#, 'J, k>k0-C*, \ goto <exit> if u=0
|
||||||
'{, \ preserve u
|
'{, \ preserve u
|
||||||
'o, '?, \ read character ( c-from c-to c )
|
'#, '?, 'B, \ copy byte
|
||||||
'o, '$, \ store c to c-to ( c-from c-to )
|
'L, k1k0-, '+, \ increment c-addr
|
||||||
'{, 'L, k1k0-, '+, \ increment c-from
|
|
||||||
'}, 'L, k1k0-, '+, \ increment c-to
|
|
||||||
'}, 'L, k1k0-, '-, \ decrement u
|
'}, 'L, k1k0-, '-, \ decrement u
|
||||||
'j, k0kE-C*, \ goto <loop>
|
'j, k0k?-C*, \ goto <loop>
|
||||||
\ <exit>
|
\ <exit>
|
||||||
'_, '_, '_,
|
'_, '_,
|
||||||
'e, l!
|
'e, l!
|
||||||
|
|
||||||
\ 'a' ( c-addr -- a-addr ) ALIGNED
|
\ 'a' ( c-addr -- a-addr ) ALIGNED
|
||||||
|
|
Loading…
Reference in a new issue