Here is some code converted from the PIC collection and some more SX specific routines.
Please send any questions or comments to golovchenko@mail.ru, or the PICList (with the topic tag [SX]: in the subject).