1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 04:28:05 +11:00
collapseos/blk/370
Virgil Dupras 2d9a07d215 blkunpack: don't include trailing empty lines
This was becoming heavy to manage.
2020-06-23 06:52:34 -04:00

15 lines
427 B
Plaintext

: MOVE ( a1 a2 u -- )
?DUP IF ( u ) 0 DO ( a1 a2 )
SWAP C@+ ( a2 a1+1 x )
ROT C!+ ( a1+1 a2+1 )
LOOP THEN 2DROP ;
: MOVE- ( a1 a2 u -- )
?DUP IF TUCK + 1- ( a1 u a2+u-1 )
ROT 2 PICK + 1- ( u a2+u-1 a1+u-1 )
ROT ( u ) 0 DO ( a2 a1 )
C@- ( a2 a1-1 x )
ROT C!- ( a1-1 a2-1 ) SWAP ( a2 a1 )
LOOP THEN 2DROP ;
: MOVE, ( a u -- ) H@ OVER ALLOT SWAP MOVE ;
: PREV 3 - DUP @ - ;