delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/22/19:49:04

Message-ID: <388A3F3A.80C5F016@ou.edu>
From: David Cleaver <davidis AT ou DOT edu>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Length of Chars...
References: <3888ED7B DOT DF52FEB2 AT ou DOT edu> <38896068 DOT 8C5927C0 AT is DOT elta DOT co DOT il> <388A0530 DOT DF2B2F31 AT ou DOT edu> <83snzpq114 DOT fsf AT mercury DOT st DOT hmc DOT edu>
Lines: 24
Date: Sat, 22 Jan 2000 17:37:30 -0600
NNTP-Posting-Host: 129.15.140.115
X-Complaints-To: usenet AT ou DOT edu
X-Trace: news.ou.edu 948584179 129.15.140.115 (Sat, 22 Jan 2000 17:36:19 CST)
NNTP-Posting-Date: Sat, 22 Jan 2000 17:36:19 CST
Organization: The University of Oklahoma
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Nate Eldredge wrote:
>
> Most machines have one data type that is fastest to operate on,
> normally the one that corresponds to the native wordsize.  On the 386,
> it's the 32-bit int.  The 16-bit short, on the other hand, requires a
> special instruction prefix to operate on, and each instruction
> requires one more cycle than the corresponding 32-bit instruction.
> Thus the code generated for `i++' will be both smaller and faster if
> `i' is an int rather than a short.
>

So, would it better for me to store all of my one's and zero's in the
'int' type to speed up operations, since all I'm doing is accessing the
arrays (I'm not changing anything in them), or should I just keep it in
the 'char' data type?  See, the reason for the hex question was...

If I store all the info in hex form in the 'char' type, like:
0xa4, 0x3c, 0xf2, 0x7d, then all I have to do to change it to 'int' is
combine them all into one hex unit (right?):
0xa43cf27d

-David C.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019