On October 16, 2005 10:52 pm, scott larson wrote: > hi, > i'm not very experienced with assembler directives, so i don't know > if this is achievable. > i have an asm program that has many subroutines, each lights a > different letter on a 5x7 LED display. In my main program, i call > whatever subroutine I want, for example, to display "HELLO" : > start > call HHH ; light up H > call Pause; > call EEE; light up E > call Pause; > call LLL; light up L > call Pause; > call LLL; light up L > call Pause; > call OOO; light up O > call Pause; > goto start > i have programmed the whole alphabet and other characters, but they > do not all fit on the PIC. > what i want to do is program only the ones that get called, and have > the assembler ignore the rest. > i have been looking at #DEFINE, IFDEF, and IF statements, but i > can't seem to figure this out. > can somebody point me in the right direction? > i'm using MPLAB. create a small asm program with this in it: #define EXAMPLE 1 #ifdef EXAMPLE #define HI 1 #define LO 0 #else #define HI 0 #define LO 1 #endif #ifndef EXAMPLE #define X 1 #define Y 2 #else #define X 3 #define Y 4 #endif in the code section, insert this: retlw HI retlw LO retlw X retlw Y you can also insert this in the code section: #ifdef EXAMPLE movlw 5 movlw HI #else movlw 10 movlw HI+Y #endif try the above with and without "#define EXAMPLE" -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist