Re: Data Types in Visual Basic
From: Jim Carlock (anonymous_at_127.0.0.1)
Date: 07/07/04
- Next message: Andrea Anastasescu: "Re: basic question"
- Previous message: NickHK: "Re: Data types in immediate window"
- In reply to: rami mizrahi: "Data Types in Visual Basic"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 02:05:36 -0400
I think it's because of historical compatibility issues.
At some point maybe a decade ago, Microsoft decided that
the 32-bit platform was the way to go, and it stuck. The fact
that a boolean value is 16-bit, is because MS decided that
there are more uses for a 16-bit value than there are for an
8-bit value. In fact, if you look into the API, you'll see a lot
of function calls that return a 32-bit value instead of a 16-bit
value.
The general purpose registers are EAX, EBX, ECX, EDX
and a few others. These are 32-bit registers. However, there
still exist some 16-bit memory addressing registers, which
have remained in effect since the 286 microprocessor came
into play (or maybe even earlier with 8086 processor).
The general purpose registers above can be represented as
16-bit or 8-bit registers as well. The lower 16 bits of the EAX
registers makes up the AX register. The two bytes of the AX
register then can be broken down into byte representations,
AL and AH.
However, ever since the 386 came into play, 32-bit processing
was optimized to provide a little more speed than using 8-bit
processing.
But for the most part, I think it's for compatibility issues and
maintaining compatibility with older operating systems.
-- Jim Carlock http://www.microcosmotalk.com/ Post replies to the newsgroup. "rami mizrahi" <ramilb80@hotmail.com> wrote in message news:e4K3Dx6YEHA.992@TK2MSFTNGP10.phx.gbl... Why does Visual Basic .NET reserve two bytes for the boolean data type while one byte is enough to store a "0" or a "1"? I was told that this is due to the architecture of 32 bit processors and that they would have to expand 8 bit instructions to at least 16 bit to be able to process them (which is not efficient). I would like to get detailed information about this. Is this related to the fact that most x86 processors are little Endian? Thank you! *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it!
- Next message: Andrea Anastasescu: "Re: basic question"
- Previous message: NickHK: "Re: Data types in immediate window"
- In reply to: rami mizrahi: "Data Types in Visual Basic"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|