aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/avr8/lib/imove.frt
blob: bf33697c3575b304e5cd8e43e1027ae4d8660a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
\ copy a string from flash to RAM
\
\ i->d on the msp430, and the same stack as cmove
\
: imove ( i-addr len ram -- )
  rot rot dup 1 and >r                  \ ( ram i-addr len ) ( r: odd )
  2/ over + dup >r                      \ ( ram i-addr i-addr' ) ( r: odd i-addr' )
  swap                                  \ ( ram i-addr' i-addr )
  ?do  i @i over ! cell+  loop          \ ( ram' )
  r> r>                                 \ ( ram' i-addr' odd )
  if  @i swap c!  else  2drop  then
;