> I tell new programmers, "ALWAYS use meaningful variable names and NEVER use > magic numbers". That does help, but it is not the end. Some magic numbers are more clear when used magically than when #defined somewhere. This 2 should *not* be #defined somewhere else: n = n << 2; // multiply by 4 to get the word offset In assembly, registers don't have meaningful names :( But this is a few parts of a graphics LCD driver: #define R_IOSET R5 #define R_IOCLR R6 #define R_SET_ALL R7 #define R_XCLR R8 #define R_MASK R9 #define R_TEMP R10 LDR R_IOCLR, =MKT_IO0CLR LDR R_IOSET, =MKT_IO0SET LDR R_SET_ALL, =SET_ALL LDR R_XCLR, =SET_XSCL LDR R_MASK, =SET_DATA // set XSCL and D0..D3 STR R_SET_ALL, [ R_IOSET ] // shift 4 data bits to the correct position // and mask all other bits off AND R_TEMP, R_MASK, \REG, lsl #GLCD_D0 // write D0..D3 STR R_TEMP, [ R_IOCLR ] -- Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist