From: cbramix AT libero DOT it (Carlo) Newsgroups: comp.os.msdos.djgpp Subject: Re: Optimizing 8 bit variables? Date: 30 Aug 2003 05:41:29 -0700 Organization: http://groups.google.com/ Lines: 194 Message-ID: References: NNTP-Posting-Host: 151.25.221.152 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1062247289 12342 127.0.0.1 (30 Aug 2003 12:41:29 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 30 Aug 2003 12:41:29 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, I have coded a very simple C program. It's very simple and it can be coded into a different way, but I just want to show the point. #include #define MAXBUF 16 unsigned char funct(unsigned char *ptr,int size) { unsigned char res = 0; unsigned char a,b,c,d,e,f; size >>= 3; do { a = ptr[0]; b = ptr[1]; c = ptr[2]; d = ptr[3]; e = ptr[4]; f = ptr[5]; if (a>64) a=64; if (b>64) b=64; if (c>64) c=64; if (d>64) d=64; if (e>64) c=64; if (f>64) d=64; res += ((a^b) & (c^d)) | (e^f); ptr += 4; } while (--size); return res; } void main() { unsigned char buffer[MAXBUF]; int x; for (x=0; x