>Does anyone have an example or explanation of how to >encapsulate i/o in assembly and C? Have a look at the modular assembly routines Olin Lathrop's routines available on his website (he has already replied to this thread). These are a very good example of how to encapsulate assembly code. Because the code is formed of linkable modules it forces you to think about how you are going to transfer data between modules and make things like buffers used in one module visible to other modules. It enforces thinking about local and global variables as well, and in the process provides an ideal work around the data memory banking issues of the PIC chips. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.