Tamas Rudnai wrote: > High level would be something like: > > def PORTB.0 as digital out; > def LED1 as PORTB.0; > > LED1.on; > wait(100); > LED1.off; > > ... > > Is there any language something like this for PIC, which still can > produce a fairly compact code? Yes, although actually a bit higher level since your two I/O pin declaration lines are accomplished in a single line: /outbit led1 portb 0 n ;low turns on LED 1 set_led1_on ;turn on LED 1 ... set_led1_off ;turn off LED 1 The /OUTBIT declaration gives the name LED1 to port B bit 0, and defines a bunch of MPASM macros and string substitutions accordingly. The "n" in the declaration indicates negative logic, meaning the "ON" case is logic low and "OFF" is logic high (LED connected with series resistor to Vdd for example). SET_LED1_ON and SET_LED1_OFF are MPASM macros defined in the expansion of /OUTBIT. These set the bank as appropriate (using my DBANKIF macro, of course) and then set the pin high or low according to the desired on or off state. On PICs with LAT registers, SET_LED1_ON and SET_LED1_OFF will write to LAT instead of PORT. For example, on a PIC 18 SET_LED1_ON will always expand to the single instruction BCF LATB,0 because port B is always in the access bank. /OUTBIT is just one of many cool things in my PIC assembler preprocessor, PREPIC, which is part of my PIC development environment described at http://www.embedinc.com/pic. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist