![](sad.gif)
8 vs 16 vs 32 bit CODE
what''s the difference? Obviously, 32 bit code can handle larger numbers, but what is the hype over things like "dos is 16 bit" "windows 95 is 32 bit, but with a 16 bit core
" "Windows NT is finally fully 32bit" etc, etc, etc. Is 32bit more stable? And why?
-arsenius
''after three days without programming, life becomes meaningless'' -The Tao of Programming
![](sad.gif)
Well, two thoughts come to mind...
1. On a 32 bit CPU, 32 bit code is the fastest.
2. Mixing 16 and 32 bit code (e.g. Win9x) is BAD. That''s one of the reasons that Win9x is so unstable.
~~~~~~~~~~
Martee
http://www.csc.uvic.ca/~mdill
1. On a 32 bit CPU, 32 bit code is the fastest.
2. Mixing 16 and 32 bit code (e.g. Win9x) is BAD. That''s one of the reasons that Win9x is so unstable.
~~~~~~~~~~
Martee
http://www.csc.uvic.ca/~mdill
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
I understand about the speed, but why is mixing 16 & 32 bit bad in terms of stability? And are we talking 16bit variables or the code itself?
-arsenius
''after three days without programming, life becomes meaningless'' -The Tao of Programming
-arsenius
''after three days without programming, life becomes meaningless'' -The Tao of Programming
Here''s how I understand it (take with fist full of salt).
Win9X is actually a 32 bit OS piggyback riding on a 16 bit core. That''s because all the 32 bit function calls get mapped onto 16 bit functions. If it were a true 32 bit OS like WinNT, it wouldn''t need the USER.EXE, KERNEL.EXE and GDI.EXE files in its SYSTEM folder. These 3 files are leftover from Win 3.x. Delete them, and forget using Windows 9X. It just won''t run.
Now concerning the instability problem, I think it has to do with Win 9X not fully supporting Preemptive Multi Tasking. But I''m not sure if that is accurate at all.
Win9X is actually a 32 bit OS piggyback riding on a 16 bit core. That''s because all the 32 bit function calls get mapped onto 16 bit functions. If it were a true 32 bit OS like WinNT, it wouldn''t need the USER.EXE, KERNEL.EXE and GDI.EXE files in its SYSTEM folder. These 3 files are leftover from Win 3.x. Delete them, and forget using Windows 9X. It just won''t run.
Now concerning the instability problem, I think it has to do with Win 9X not fully supporting Preemptive Multi Tasking. But I''m not sure if that is accurate at all.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
it becomes unstable when the computger has to keep converting large 32bit numbers to 16bit and back and forth due to the fact taht 9x is not full 32bit. it hasnt changed to full 32bit since thers still alot of business out there that run software thatis primarily 16bit written
Win9x is a 32 bit patch, on a 16 bit OS, run on an emulated 8 bit processor, cost 4 bits to make, and is sold by a 2 bit company. Or least it goes something like that.
The bits of a processor generally refer to the size of the cpu registers. I guess there''s an 8 bit mode for those x86''s isn''t there? 808086/8 compatible? There are four suposed general purpose registers (a, b, c, & d). In reality each needs to be used for certain purposes; but the other registers only have one purpose.
If they''re running in 16bit mode (real), you have an ax, bx, cx, & dx to use, each of which is 16bits wide. If you want to do 32bit math, you have to use 2 registers for each number.
In 32bit mode (protected) the registers are 32bits wide, and are called eax, ebx, ecx, & edx (of all things)
I can;t remember what they''re calling the new 64bit regs on the Itanium (xeax?)
The amount of memory available and how you accessed it sucked on 16 bit processors. You had to copy memory around constantly in&out of pages in ems; and twiddle two registers to read/write anaything. In 32bit protected mode the memory space is flat, there''s only one register required to access (in theory) up to 4GB of RAM.
Win95/98 can run Win3.xx applications by a process called ''thunking''. Win95/98 tranlates the old 16bit based opcodes and API calls into the new 32bit format.
WinNT 4.0 can run many 16bit apps as well using a similar thunking processes (called WoW, Windows On Windows). Thunking''s not going away, ''cause there''s a WoW32 for thunking 32bit apps on the 64bit architecture. In thoery you could double thunk a 16bit app & run it on the upcoming windows (good luck in practice).
NT stands for New Technology and was redone from scratch with DOS compatibility lower in priority than Win9x. WinME has very little legacy DOS support. XP has as little support as NT (which is still decent, I can play MOO & Civilizations still, but not Comanche or Wing Commander).
I''d say the primary reason NT is more stable is because it was redesigned from the ground up with multi-threading and multi-processor architectures in mind. If something was dangerous, such as setting the NMI (non-maskable interruapt) bit, they made it so that it could only be done by the system process. In 9x DOS compatiblity mode they didn''t always have that luxury.
Magmai Kai Holmlor
- The disgruntled & disillusioned
The bits of a processor generally refer to the size of the cpu registers. I guess there''s an 8 bit mode for those x86''s isn''t there? 808086/8 compatible? There are four suposed general purpose registers (a, b, c, & d). In reality each needs to be used for certain purposes; but the other registers only have one purpose.
If they''re running in 16bit mode (real), you have an ax, bx, cx, & dx to use, each of which is 16bits wide. If you want to do 32bit math, you have to use 2 registers for each number.
In 32bit mode (protected) the registers are 32bits wide, and are called eax, ebx, ecx, & edx (of all things)
I can;t remember what they''re calling the new 64bit regs on the Itanium (xeax?)
The amount of memory available and how you accessed it sucked on 16 bit processors. You had to copy memory around constantly in&out of pages in ems; and twiddle two registers to read/write anaything. In 32bit protected mode the memory space is flat, there''s only one register required to access (in theory) up to 4GB of RAM.
Win95/98 can run Win3.xx applications by a process called ''thunking''. Win95/98 tranlates the old 16bit based opcodes and API calls into the new 32bit format.
WinNT 4.0 can run many 16bit apps as well using a similar thunking processes (called WoW, Windows On Windows). Thunking''s not going away, ''cause there''s a WoW32 for thunking 32bit apps on the 64bit architecture. In thoery you could double thunk a 16bit app & run it on the upcoming windows (good luck in practice).
NT stands for New Technology and was redone from scratch with DOS compatibility lower in priority than Win9x. WinME has very little legacy DOS support. XP has as little support as NT (which is still decent, I can play MOO & Civilizations still, but not Comanche or Wing Commander).
I''d say the primary reason NT is more stable is because it was redesigned from the ground up with multi-threading and multi-processor architectures in mind. If something was dangerous, such as setting the NMI (non-maskable interruapt) bit, they made it so that it could only be done by the system process. In 9x DOS compatiblity mode they didn''t always have that luxury.
Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
here are my $0.02 worth...
80286 and earlier were limited to 16 bit registers
80386 and higher have 32 bit registers.
as an example of why 32 bit is faster, say you want to fill the screen with a color (320x200), now 320 * 200 = 64000, which is faster a loop that writes 2 bytes (16 bits) each time it runs or a loop that writes 4 bytes each time it runs? The 32 bit version only has run 16000 times, while the 16 bit has to run 32000.
Just a really crude example...
/Mikael Jacobson
80286 and earlier were limited to 16 bit registers
80386 and higher have 32 bit registers.
as an example of why 32 bit is faster, say you want to fill the screen with a color (320x200), now 320 * 200 = 64000, which is faster a loop that writes 2 bytes (16 bits) each time it runs or a loop that writes 4 bytes each time it runs? The 32 bit version only has run 16000 times, while the 16 bit has to run 32000.
Just a really crude example...
/Mikael Jacobson
![AFA-GBG2001 [www.motkraft.net/gbg2001]](http://www.motkraft.net/gbg2001/banner/banner02.gif)
I was reading a doc the ''advantages'' for developers windows xp will bring, I don''t think anyone will be supprised to hear that is was on the Micro$oft site. Anyway the reason I''m telling you this is beacause it said that prople should now be preparing their code for... get this, 64bit code. Then last night I was flicking through the d3d spheremap example in the directX 8 sdk and there was something like: #ifdef 64_BIT_CODE.
And what''s wrong with preparing your code for 64bit processors? I don''t use Unicode, yet my programs all are prepared to support it. That''s just planning for the future. No harm in doing that....
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement