# Range utilities

This unit lives at [mem/range.fs] and provides a few range related words.

## API

bounds[] ( a u -- lo hi ) *B*
  Yields the low and high addresses of the bounds represented by range "a u".

cintersect[] ( a1 u1 a2 u2 -- ?a u )
  Compute the intersection between the two given ranges and return the part
  common to both. If there is no intersection, u=0 and a isn't present.

cmove- ( src dst u -- )
  Like "cmove", but operates backwards. You'll want to use this when copying
  overlapping memory area "forward" (dst > src).

rslide+ ( by a u -- )
  Move range "a u" forward in memory by "by" bytes.

rtrimleft ( n a u -- a u )
  Trim "n" characters at the left of range "a u" and return the resulting range.

rtrimright ( n a u -- a u )
  Trim "n" characters at the right of range "a u" and return the resulting
  range.

swap[] ( a u -- ) *B*
  Reverse the order of the elements in the range. For example, a range with
  3 elements "1 2 3" becomes a range with elements "3 2 1".
