64 bit development

October 19, 2006

no comments

I recently gave a lecture about programming 64 bit Windows, in both the native and the manage worlds.

I have found that many developers don’t know much about the subject, so here are some explanations & links:

64-bit computing is here

Intel and AMD are both shipping X64 desktop chips

K8 , Athlon 64, Athlon 64 X2, Athlon 64 FX, AMD Opteron, Turion 64, Sempron (“Palermo” E6 stepping and all “Manila” models)

Intel EM64T
Xeon (some models since “Nocona”), Celeron D (some models since “Prescott”) , Pentium 4 (some models since “Prescott”), Pentium D, Pentium Extreme Edition, Core microarchitecture (EM64T), Xeon (“Woodcrest”), Intel Core 2

Why go 64-bit?

  • Large memories
  • 32-bit Windows applications can address 2 / 3 GB
  • 3 GB requires special boot and build option
  • 32-bit applications on 64-bit Windows can address up to 2 / 4 GB
  • 4 GB only requires the build option
  • 64-bit native applications can address up to 8 TB
  • In the future the address space maybe extend to full 64
  • 16 exbibytes, or about 18×1018 bytes

Go & read this article: Everything You Need To Know To Start Programming 64-Bit Windows Systems

Read more: x64 architecture

More tips & trials:

  1. Play with the CorFlags.exe command, it shows and enable to change the target machine architecture of a .Net assembly
  2. Go to C:\Windows\Assembly on 64 based OS with .Net framework 2 installed. You’ll find there three GACs, one for x64, one for x32 and one for MSIL only
  3. Download & install 64 bit debugging tools for windows
  4. Run WinDbg, see what “.effmach x86” & “.effmach amd64 ” does
  5. See what the extension dll “!wow64exts.sw” does (Hint: #4)
  6. What is the size of IntPtr?
  7. What is the default pack of the C# & C++ compilers?

Example of CorFlags:

C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\>corflags System.Drawing.dll
CLR Header: 2.5
PE        : PE32
CorFlags  : 9
ILONLY    : 1
32BIT     : 0

C:\WINDOWS\assembly\GAC_64\System.Web\>corflags System.Web.dll
CLR Header: 2.5
PE        : PE32+
CorFlags  : 9
ILONLY    : 1
32BIT     : 0

C:\WINDOWS\assembly\GAC_32\System.Web\>corflags System.Web.dll
CLR Header: 2.5
PE        : PE32
CorFlags  : 11
ILONLY    : 1
32BIT     : 1


Enjoy 64 bit development

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>