From: Enoch <ix...@ho...> - 2013-04-12 02:27:47
|
Matthias Trute <mt...@we...> writes: >> Also, it seems to me that your implementation may cause ram buffer >> overflow. > > The code copies flash cells. That may overrun the > RAM if an odd number of bytes is transferred. Thats > bad indeed. Hello Matthias, I had it fixed for my own use, so here sharing: : 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 ; http://pastebin.com/ZqL4aWN7 Regards, Enoch. |