how are the io ports (external devices) defined and accessed using C166 compiler?
It depends on what you mean by IO ports. If it's microcontroller IO lines (PORT0, PORT1, PORT2, ...), then use DPx and Px registers. If you mean peripherals on external bus, then it's memory mapped peripherals. You access them exactly the way you would write to and read from memory. Header file absacc.h provides predefined macros for accessing absolute memory locations. - mike