Hi,
Generally, using nested IF/THENs produces less code than using AND. For exampleCompiled for a 16F628 is 30 words and 76 bytes for 18F4520 (all variables are bytes) while using AND, like thisCode:IF A = 1 THEN IF B = 2 THEN IF C = 3 THEN IF D = 4 THEN IF E = 5 THEN HIGH PortB.0 ENDIF ENDIF ENDIF ENDIF ENDIFtakes 79 words for the 16F628 and 162 bytes for the 18F4520.Code:IF (A = 1) AND (B = 2) AND (C = 3) AND (D = 4) AND (E = 5) THEN HIGH PortB.0 ENDIF
/Henrik.
Bookmarks