On Wed, Oct 15, 1997 at 12:17:40AM +0200, Eric van Es wrote: > And while we are at it would some one explain how to go about creating and > reading a lookup table? Sure, but what kind of lookup table? When programming a PIC in assembler, a "lookup table" usually refers to a retlw table that is necessary to use ROM for storing any kind of data - when using a C compiler this will get done for you, e.g. the following array is used in a 7 segment display routine to translate digits into 7 segment patterns; you don't have to worry about how to implement it - the compiler does it. static const unsigned char digits[10] = { 0x5F, /* 0 */ 0x06, 0x3B, 0x2F, /* 3 */ 0x66, 0x6D, 0x7D, 0x07, /* 7 */ 0x7F, 0x6F, }; Using this later - segcnt is a segment mask: PORTB |= segcnt & digits[curval % 10]; -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- ANSI C for the PIC! Now shipping! See www.htsoft.com for more info.