File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed
Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -732,7 +732,6 @@ error if it cannot be cannot be cross compiled.
732732* ` MIN `
733733* ` MOD `
734734* ` MOVE `
735- * Does not handle cases where the data overlaps.
736735* ` NEGATE `
737736* ` OR `
738737* ` OVER `
Original file line number Diff line number Diff line change 495495;
496496
497497: MOVE ( addr1 addr2 u -- )
498- 0 ?DO
499- ( addr1 addr2 )
500- OVER @ ( addr1 addr2 val1 )
501- OVER ! ( addr1 addr2 ) \ store val1
502- 1+ SWAP 1+ SWAP ( addr1+1 addr2+1 )
498+ ?DUP 0= IF \ if u is 0
499+ 2DROP EXIT \ exit immediately
500+ THEN
501+ SWAP OVER ( addr1 u addr2 u )
502+ >R >R ( addr1 u ) ( R: u addr2 )
503+ SWAP OVER ( u addr1 u )
504+ \ put the contents in addr1 on the stack
505+ + 1- SWAP ( addr1+u-1 u )
506+ 0 DO
507+ ( objn ... addr1+u-1 )
508+ DUP @ ( objn ... addr1+u-1 obj0 )
509+ SWAP 1- ( objn ... obj0 addr1+u-2 )
503510 LOOP
504- 2DROP
511+ DROP R> R> ( objn ... addr2 u )
512+ \ put the contents of the stack in addr2
513+ 0 DO
514+ SWAP OVER !
515+ 1+
516+ LOOP
517+ DROP
505518;
506519
507520: FILL ( caddr u char -- )
Original file line number Diff line number Diff line change @@ -891,12 +891,11 @@ UNSIGNED: 0 FFFF
891891 T{ SBUF FBUF 3 MOVE -> }T
892892 T{ SEEBUF -> 12 34 56 }T
893893
894- // TODO fix the overlapping case
895- // T{ FBUF FBUF 1+ 2 MOVE -> }T
896- // T{ SEEBUF -> 12 12 34 }T
894+ T{ FBUF FBUF 1+ 2 MOVE -> }T
895+ T{ SEEBUF -> 12 12 34 }T
897896
898- // T{ FBUF CHAR + FBUF 2 CHARS MOVE -> }T
899- // T{ SEEBUF -> 12 34 34 }T
897+ T{ FBUF 1 + FBUF 2 MOVE -> }T
898+ T{ SEEBUF -> 12 34 34 }T
900899 ` ,
901900 },
902901 {
You can’t perform that action at this time.
0 commit comments