John W. Colby
jwcolby at colbyconsulting.com
Wed May 18 20:30:16 CDT 2005
The second may be true (though I doubt it since there are native instructions for math operations on 16 bit registers) but the first is almost certainly not true. It is almost certainly the case that an instruction to load an 8 or 16 bit value takes no longer than one that loads a 32 bit value, and all three are just a single instruction. http://www.cs.tut.fi/~siponen/upros/intel/ Will allow you to see the register names, sizes and uses, how many clock cycles it takes to perform various memory and register operations, the sizes of the instructions, and tons of more arcane information if you have any interest in that stuff. This is for the 486 and previous but the concepts extend into modern processors as well. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, May 18, 2005 7:03 PM To: Access Developers discussion and problem solving Subject: Re: Integers was:RE: [AccessD] Global Variable On 18 May 2005 at 10:48, Francisco Tapia wrote: > I was always under the impression that a 16bit integer was processed > in a > single clock cycle just like the 32bit long integer. Additionally a 16bit > integer always took up less memory. Have I been led astray from all the > various tech magazines and discussion lists around the net? > The arithmetic is processed in the same number of cycles. It's accessing the data in memory and returning the result that takes up takes the additional steps and adds extra cycles if the variable is not "native" in size (ie 32 bit on a 32 bit processor). Secondly, generally a compiler can't optimize loops, array indices etc by storing the variable as a "register variable" unless it is a "native int". -- Stuart -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com