SlideShare a Scribd company logo
Lesson 1. What 64-bit systems are
By the moment of writing the course, there are two most popular 64-bit architectures of
microprocessors: IA64 and Intel 64.

    1. IA-64 is a 64-bit microprocessor architecture developed by Intel and Hewlett Packard companies
       together. It is implemented in Itanium and Itanium 2 microprocessors. To learn more about the
       architecture IA-64 see the following Wikipedia article "Itanium".
    2. Intel 64 (EM64T / AMD64 / x86-64 / x64) is an extension of x86 architecture with full backward
       compatibility. There are many variants of its name and it causes some confusion, but all these
       names mean the same thing: x86-64, AA-64, Hammer Architecture, AMD64, Yamhill Technology,
       EM64T, IA-32e, Intel 64, x64. To learn how so many names appeared see the article in
       Wikipedia: "X86-64".

You should understand that IA-64 and Intel 64 are absolutely different, incompatible with each other,
microprocessor architectures. Within the scope of this course we will consider only Intel 64 (x64 /
AMD64) architecture as the most popular among applied Windows software developers. Accordingly,
when we mention Windows operating system, we will mean its 64-bit versions for Intel 64 architecture.
For example: Windows XP Professional x64 Edition, Windows Vista x64, Windows 7 x64. The program
model Intel 64 available to a programmer in a 64-bit Windows is called Win64, for short.


Intel 64 architecture
The information given here is based on the first volume of the documentation "AMD64 Architecture
Programmer's Manual. Volume 1. Application Programming".

The architecture Intel 64 we are considering here, is a simple yet powerful extension of the obsolete
commercial architecture x86 with backward compatibility. It adds the 64-bit address space and extends
resources to support higher performance of recompiled 64-bit programs. The architecture supports
obsolete 16-bit and 32-bit code of applications and operating systems without modifying or recompiling
them.

The need of a 64-bit architecture is determined by the applications that require a larger address space.
First of all, these are high-performance servers, data managers, CAD and, of course, games. These
applications will get great benefits from the 64-bit address space and larger number of registers. Few
registers available in the obsolete x86 architecture limit performance of computing tasks. The increased
number of registers provides the necessary performance for many applications.

Let us point out the main advantages of the architecture x86-64:

    •   the 64-bit address space;
    •   an extended register set;
    •   a command set familiar to developers;
    •   the capability to launch obsolete 32-bit applications in a 64-bit operating system;
    •   the capability to use 32-bit operating systems.
64-bit operating systems
Nearly all modern operating systems have versions for Intel 64 architecture. For example, Microsoft
ships Windows XP x64. Large UNIX developers also ship 64-bit versions, for example, Linux Debian 3.5
x86-64. But it does not mean that the whole code of such a system is 64-bit. Some parts of the operating
system and many applications may well remain 32-bit because Intel 64 provides backward compatibility.
Thus, the 64-bit version of Windows uses a special mode WoW64 (Windows-on-Windows 64) that
translates the calls of 32-bit applications to the resources of the 64-bit operating system.


Address space
Although a 64-bit processor can theoretically address 16 Ebytes of memory (2^64), Win64 now supports
only 16 Tbytes (2^44). There are some reasons for that. Contemporary processors can provide access
only to one Tbyte (2^40) of physical memory. The architecture (but not the hardware part) can extend
this space up to 4 Pbytes (2^52). But in this case you need an immense amount of memory for the page
tables representing it.

Besides the limitations described above, the size of memory available in every particular version of the
64-bit Windows depends upon the commercial reasons of Microsoft. Different Windows versions have
different limitations which are illustrated in the table.
Table 1 - The amounts of memory supported in different Windows versions


Win64 program model
Like in Win32, the size of a page in Win64 is 4 Kbytes. The first 64 Kbytes of the address space are never
displayed, so the lowest correct address is 0x10000. Unlike Win32, system DLL's take more than 4
Gbytes.

Compilers for Intel 64 have one peculiarity: they can use registers with great efficiency to pass
parameters into functions instead of using the stack. This allowed the Win64 architecture developers to
get rid of such a notion as a calling convention. In Win32, you may use various conventions: __stdcall,
__cdecl, __fastcall, etc. In Win64, there is only one calling convention. Here is an example of how four
arguments of integer type are passed through registers:

    •   RCX: the first argument
    •   RDX: the second argument
    •   R8: the third argument
•   R9: the fourth argument

The arguments following the first four integer ones are passed through the stack. To pass float
arguments XMM0-XMM3 registers are used as well as the stack.

The difference in the calling conventions makes it impossible to use both 64-bit and 32-bit code in one
program. In other words, if an application has been compiled for the 64-bit mode, all the libraries (DLL)
being used must also be 64-bit.

Passing parameters through registers is one of the innovations that make 64-bit programs faster than
32-bit ones. You may achieve an additional performance gain using 64-bit data types. We will tell you
about it in the next lesson.

The course authors: Andrey Karpov (karpov@viva64.com), Evgeniy Ryzhkov (evg@viva64.com).

The rightholder of the course "Lessons on development of 64-bit C/C++ applications" is OOO "Program
Verification Systems". The company develops software in the sphere of source program code analysis.
The company's site: http://www.viva64.com.

Contacts: e-mail: support@viva64.com, Tula, 300027, PO box 1800.

More Related Content

Similar to Lesson 1. What 64-bit systems are (20)

PDF
64 bits
PVS-Studio
 
PDF
Seven Steps of Migrating a Program to a 64-bit System
PVS-Studio
 
PDF
64-bit
PVS-Studio
 
PDF
Seven Steps of Migrating a Program to a 64-bit System
Andrey Karpov
 
PPT
64 bit computing
Ankita Nema
 
PDF
Optimization of 64-bit programs
PVS-Studio
 
PDF
64 bit arch
James Bayer
 
PDF
Introduction into 64 bits for the beginners or where's again the 64-bit world?
PVS-Studio
 
PPTX
Go Native : Squeeze the juice out of your 64-bit processor using C++
Fernando Moreira
 
PDF
How to determine if cpu is 32bitor64bit
Ashwin Pawar
 
PDF
Driver Development for Windows 64-bit
PVS-Studio
 
PPTX
Terraria Guide, Terraria Crafting Recipes
JohndaleRamirez2
 
DOCX
Operating system
Muhammad Baqar Kazmi
 
PPT
testing now
S Arunima
 
PDF
64bit_Linux-Myths_and_Facts_for AMD_Processors.pdf
rangerdan275
 
PPT
IMD 203 - Ch02
ALBAKRI MOHAMMAD
 
PPTX
CO&AL-lecture-04 about the procedures in c language (1).pptx
gagarwazir7
 
PDF
20 issues of porting C++ code on the 64-bit platform
Andrey Karpov
 
PDF
20 issues of porting C++ code on the 64-bit platform
PVS-Studio
 
PDF
Program errors occurring while porting C++ code from 32-bit platforms on 64-b...
Andrey Karpov
 
64 bits
PVS-Studio
 
Seven Steps of Migrating a Program to a 64-bit System
PVS-Studio
 
64-bit
PVS-Studio
 
Seven Steps of Migrating a Program to a 64-bit System
Andrey Karpov
 
64 bit computing
Ankita Nema
 
Optimization of 64-bit programs
PVS-Studio
 
64 bit arch
James Bayer
 
Introduction into 64 bits for the beginners or where's again the 64-bit world?
PVS-Studio
 
Go Native : Squeeze the juice out of your 64-bit processor using C++
Fernando Moreira
 
How to determine if cpu is 32bitor64bit
Ashwin Pawar
 
Driver Development for Windows 64-bit
PVS-Studio
 
Terraria Guide, Terraria Crafting Recipes
JohndaleRamirez2
 
Operating system
Muhammad Baqar Kazmi
 
testing now
S Arunima
 
64bit_Linux-Myths_and_Facts_for AMD_Processors.pdf
rangerdan275
 
IMD 203 - Ch02
ALBAKRI MOHAMMAD
 
CO&AL-lecture-04 about the procedures in c language (1).pptx
gagarwazir7
 
20 issues of porting C++ code on the 64-bit platform
Andrey Karpov
 
20 issues of porting C++ code on the 64-bit platform
PVS-Studio
 
Program errors occurring while porting C++ code from 32-bit platforms on 64-b...
Andrey Karpov
 

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Ad

Lesson 1. What 64-bit systems are

  • 1. Lesson 1. What 64-bit systems are By the moment of writing the course, there are two most popular 64-bit architectures of microprocessors: IA64 and Intel 64. 1. IA-64 is a 64-bit microprocessor architecture developed by Intel and Hewlett Packard companies together. It is implemented in Itanium and Itanium 2 microprocessors. To learn more about the architecture IA-64 see the following Wikipedia article "Itanium". 2. Intel 64 (EM64T / AMD64 / x86-64 / x64) is an extension of x86 architecture with full backward compatibility. There are many variants of its name and it causes some confusion, but all these names mean the same thing: x86-64, AA-64, Hammer Architecture, AMD64, Yamhill Technology, EM64T, IA-32e, Intel 64, x64. To learn how so many names appeared see the article in Wikipedia: "X86-64". You should understand that IA-64 and Intel 64 are absolutely different, incompatible with each other, microprocessor architectures. Within the scope of this course we will consider only Intel 64 (x64 / AMD64) architecture as the most popular among applied Windows software developers. Accordingly, when we mention Windows operating system, we will mean its 64-bit versions for Intel 64 architecture. For example: Windows XP Professional x64 Edition, Windows Vista x64, Windows 7 x64. The program model Intel 64 available to a programmer in a 64-bit Windows is called Win64, for short. Intel 64 architecture The information given here is based on the first volume of the documentation "AMD64 Architecture Programmer's Manual. Volume 1. Application Programming". The architecture Intel 64 we are considering here, is a simple yet powerful extension of the obsolete commercial architecture x86 with backward compatibility. It adds the 64-bit address space and extends resources to support higher performance of recompiled 64-bit programs. The architecture supports obsolete 16-bit and 32-bit code of applications and operating systems without modifying or recompiling them. The need of a 64-bit architecture is determined by the applications that require a larger address space. First of all, these are high-performance servers, data managers, CAD and, of course, games. These applications will get great benefits from the 64-bit address space and larger number of registers. Few registers available in the obsolete x86 architecture limit performance of computing tasks. The increased number of registers provides the necessary performance for many applications. Let us point out the main advantages of the architecture x86-64: • the 64-bit address space; • an extended register set; • a command set familiar to developers; • the capability to launch obsolete 32-bit applications in a 64-bit operating system; • the capability to use 32-bit operating systems.
  • 2. 64-bit operating systems Nearly all modern operating systems have versions for Intel 64 architecture. For example, Microsoft ships Windows XP x64. Large UNIX developers also ship 64-bit versions, for example, Linux Debian 3.5 x86-64. But it does not mean that the whole code of such a system is 64-bit. Some parts of the operating system and many applications may well remain 32-bit because Intel 64 provides backward compatibility. Thus, the 64-bit version of Windows uses a special mode WoW64 (Windows-on-Windows 64) that translates the calls of 32-bit applications to the resources of the 64-bit operating system. Address space Although a 64-bit processor can theoretically address 16 Ebytes of memory (2^64), Win64 now supports only 16 Tbytes (2^44). There are some reasons for that. Contemporary processors can provide access only to one Tbyte (2^40) of physical memory. The architecture (but not the hardware part) can extend this space up to 4 Pbytes (2^52). But in this case you need an immense amount of memory for the page tables representing it. Besides the limitations described above, the size of memory available in every particular version of the 64-bit Windows depends upon the commercial reasons of Microsoft. Different Windows versions have different limitations which are illustrated in the table.
  • 3. Table 1 - The amounts of memory supported in different Windows versions Win64 program model Like in Win32, the size of a page in Win64 is 4 Kbytes. The first 64 Kbytes of the address space are never displayed, so the lowest correct address is 0x10000. Unlike Win32, system DLL's take more than 4 Gbytes. Compilers for Intel 64 have one peculiarity: they can use registers with great efficiency to pass parameters into functions instead of using the stack. This allowed the Win64 architecture developers to get rid of such a notion as a calling convention. In Win32, you may use various conventions: __stdcall, __cdecl, __fastcall, etc. In Win64, there is only one calling convention. Here is an example of how four arguments of integer type are passed through registers: • RCX: the first argument • RDX: the second argument • R8: the third argument
  • 4. R9: the fourth argument The arguments following the first four integer ones are passed through the stack. To pass float arguments XMM0-XMM3 registers are used as well as the stack. The difference in the calling conventions makes it impossible to use both 64-bit and 32-bit code in one program. In other words, if an application has been compiled for the 64-bit mode, all the libraries (DLL) being used must also be 64-bit. Passing parameters through registers is one of the innovations that make 64-bit programs faster than 32-bit ones. You may achieve an additional performance gain using 64-bit data types. We will tell you about it in the next lesson. The course authors: Andrey Karpov ([email protected]), Evgeniy Ryzhkov ([email protected]). The rightholder of the course "Lessons on development of 64-bit C/C++ applications" is OOO "Program Verification Systems". The company develops software in the sphere of source program code analysis. The company's site: http://www.viva64.com. Contacts: e-mail: [email protected], Tula, 300027, PO box 1800.