How many registers does an x86_64 CPU actually have?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I am currently learning reverse engineering and am studying the flags register.
I had in my mind that rflags
was just another name for one of the 16 general purpose registers, for example rax
or rbx
.
But it looks like rflags
is actually an additional register. So that makes 17 registers in total... how many more could there be?
I have spent at least an hour on this and found numerous different answers.
The best answer so far is this, which says that there are 40 registers in total.
- 16 General Purpose Registers
- 2 Status Registers
- 6 Code Segment Registers
- 16 SSE Registers
- 8 FPU/MMX Registers
But if I add that up, I get 48.
Could anybody provide an official answer on how many registers an x86_64
CPU has (e.g. an Intel i7).
Additionally, I have seen references to 'hardware' and 'architectural' registers. What are those registers and how many are there?
register x86-64
New contributor
add a comment |Â
up vote
2
down vote
favorite
I am currently learning reverse engineering and am studying the flags register.
I had in my mind that rflags
was just another name for one of the 16 general purpose registers, for example rax
or rbx
.
But it looks like rflags
is actually an additional register. So that makes 17 registers in total... how many more could there be?
I have spent at least an hour on this and found numerous different answers.
The best answer so far is this, which says that there are 40 registers in total.
- 16 General Purpose Registers
- 2 Status Registers
- 6 Code Segment Registers
- 16 SSE Registers
- 8 FPU/MMX Registers
But if I add that up, I get 48.
Could anybody provide an official answer on how many registers an x86_64
CPU has (e.g. an Intel i7).
Additionally, I have seen references to 'hardware' and 'architectural' registers. What are those registers and how many are there?
register x86-64
New contributor
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am currently learning reverse engineering and am studying the flags register.
I had in my mind that rflags
was just another name for one of the 16 general purpose registers, for example rax
or rbx
.
But it looks like rflags
is actually an additional register. So that makes 17 registers in total... how many more could there be?
I have spent at least an hour on this and found numerous different answers.
The best answer so far is this, which says that there are 40 registers in total.
- 16 General Purpose Registers
- 2 Status Registers
- 6 Code Segment Registers
- 16 SSE Registers
- 8 FPU/MMX Registers
But if I add that up, I get 48.
Could anybody provide an official answer on how many registers an x86_64
CPU has (e.g. an Intel i7).
Additionally, I have seen references to 'hardware' and 'architectural' registers. What are those registers and how many are there?
register x86-64
New contributor
I am currently learning reverse engineering and am studying the flags register.
I had in my mind that rflags
was just another name for one of the 16 general purpose registers, for example rax
or rbx
.
But it looks like rflags
is actually an additional register. So that makes 17 registers in total... how many more could there be?
I have spent at least an hour on this and found numerous different answers.
The best answer so far is this, which says that there are 40 registers in total.
- 16 General Purpose Registers
- 2 Status Registers
- 6 Code Segment Registers
- 16 SSE Registers
- 8 FPU/MMX Registers
But if I add that up, I get 48.
Could anybody provide an official answer on how many registers an x86_64
CPU has (e.g. an Intel i7).
Additionally, I have seen references to 'hardware' and 'architectural' registers. What are those registers and how many are there?
register x86-64
register x86-64
New contributor
New contributor
edited 1 hour ago
NirIzr
8,85712268
8,85712268
New contributor
asked 3 hours ago
rubberband876
112
112
New contributor
New contributor
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago
add a comment |Â
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
Wikipedia has a page about the x86 architecture and all its known registers. Here is a small picture gathering all what we know about it.
In fact, not all these registers are officially documented. But, all the registers we know (and we know how to use) are listed in the picture. And, it makes much more than 40.
And, I do not know what are these 'hardware' or 'architectural' registers, because for me they are all 'hardware' (not software simulated). And, what we call a CPU architecture is also including the list of available hardware registers. So, up to my knowledge, they are all both hardware and architectural registers.
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
add a comment |Â
up vote
1
down vote
I believe the discrepancy between 40 and actual sum of 48 is mostly an error, however there are many other registers used for handling hardware, memory management, and control of different features of the CPU.
The answer you linked to covers all the commonly used registers in the following image (taken from there):
There are, however plenty of less commonly known registers. Those registers are not likely used by user mode programs but used to control and initialize the processor and low-level constructs the CPU is aware of. They control CPU subsystems such as the MMU unit, task scheduling, etc. Documentation of those registers can be found in the AMD64 Architecture Manual.
You can see most of them in the following figure, taken from the AMD64 Architecture Manual:
Not in the above picture is the new Extended Control Registers family of registers, for which only XCR0
is currently defined.
The System Registers are part of the Model Specific Registers that, as the name implied, are model specific. The variety also changes between CPUs. A full list for the AMD64 architecture can be found in "Appendix A MSR Cross-Reference" of the AMD64 Architecture Manual.
There are additionally what's called "memory mapped registers" which basically means those registers are accessed through memory operations instead of designated instructions. They can be, depending on your definition, countered as registers. One such example is the "APIC Registers" described in section 16.3.2 of the AMD64
There are even internal registers that are not exposed through the instruction set but are used for performance reasons.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Wikipedia has a page about the x86 architecture and all its known registers. Here is a small picture gathering all what we know about it.
In fact, not all these registers are officially documented. But, all the registers we know (and we know how to use) are listed in the picture. And, it makes much more than 40.
And, I do not know what are these 'hardware' or 'architectural' registers, because for me they are all 'hardware' (not software simulated). And, what we call a CPU architecture is also including the list of available hardware registers. So, up to my knowledge, they are all both hardware and architectural registers.
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
add a comment |Â
up vote
1
down vote
Wikipedia has a page about the x86 architecture and all its known registers. Here is a small picture gathering all what we know about it.
In fact, not all these registers are officially documented. But, all the registers we know (and we know how to use) are listed in the picture. And, it makes much more than 40.
And, I do not know what are these 'hardware' or 'architectural' registers, because for me they are all 'hardware' (not software simulated). And, what we call a CPU architecture is also including the list of available hardware registers. So, up to my knowledge, they are all both hardware and architectural registers.
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Wikipedia has a page about the x86 architecture and all its known registers. Here is a small picture gathering all what we know about it.
In fact, not all these registers are officially documented. But, all the registers we know (and we know how to use) are listed in the picture. And, it makes much more than 40.
And, I do not know what are these 'hardware' or 'architectural' registers, because for me they are all 'hardware' (not software simulated). And, what we call a CPU architecture is also including the list of available hardware registers. So, up to my knowledge, they are all both hardware and architectural registers.
Wikipedia has a page about the x86 architecture and all its known registers. Here is a small picture gathering all what we know about it.
In fact, not all these registers are officially documented. But, all the registers we know (and we know how to use) are listed in the picture. And, it makes much more than 40.
And, I do not know what are these 'hardware' or 'architectural' registers, because for me they are all 'hardware' (not software simulated). And, what we call a CPU architecture is also including the list of available hardware registers. So, up to my knowledge, they are all both hardware and architectural registers.
edited 1 hour ago
answered 1 hour ago
perror
10.8k1765129
10.8k1765129
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
add a comment |Â
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
I like the fact you say "known" registers. So it looks like nobody really knows because it's not public information? Is it true that when most people say 'register', they really mean general purpose register?
â rubberband876
1 hour ago
add a comment |Â
up vote
1
down vote
I believe the discrepancy between 40 and actual sum of 48 is mostly an error, however there are many other registers used for handling hardware, memory management, and control of different features of the CPU.
The answer you linked to covers all the commonly used registers in the following image (taken from there):
There are, however plenty of less commonly known registers. Those registers are not likely used by user mode programs but used to control and initialize the processor and low-level constructs the CPU is aware of. They control CPU subsystems such as the MMU unit, task scheduling, etc. Documentation of those registers can be found in the AMD64 Architecture Manual.
You can see most of them in the following figure, taken from the AMD64 Architecture Manual:
Not in the above picture is the new Extended Control Registers family of registers, for which only XCR0
is currently defined.
The System Registers are part of the Model Specific Registers that, as the name implied, are model specific. The variety also changes between CPUs. A full list for the AMD64 architecture can be found in "Appendix A MSR Cross-Reference" of the AMD64 Architecture Manual.
There are additionally what's called "memory mapped registers" which basically means those registers are accessed through memory operations instead of designated instructions. They can be, depending on your definition, countered as registers. One such example is the "APIC Registers" described in section 16.3.2 of the AMD64
There are even internal registers that are not exposed through the instruction set but are used for performance reasons.
add a comment |Â
up vote
1
down vote
I believe the discrepancy between 40 and actual sum of 48 is mostly an error, however there are many other registers used for handling hardware, memory management, and control of different features of the CPU.
The answer you linked to covers all the commonly used registers in the following image (taken from there):
There are, however plenty of less commonly known registers. Those registers are not likely used by user mode programs but used to control and initialize the processor and low-level constructs the CPU is aware of. They control CPU subsystems such as the MMU unit, task scheduling, etc. Documentation of those registers can be found in the AMD64 Architecture Manual.
You can see most of them in the following figure, taken from the AMD64 Architecture Manual:
Not in the above picture is the new Extended Control Registers family of registers, for which only XCR0
is currently defined.
The System Registers are part of the Model Specific Registers that, as the name implied, are model specific. The variety also changes between CPUs. A full list for the AMD64 architecture can be found in "Appendix A MSR Cross-Reference" of the AMD64 Architecture Manual.
There are additionally what's called "memory mapped registers" which basically means those registers are accessed through memory operations instead of designated instructions. They can be, depending on your definition, countered as registers. One such example is the "APIC Registers" described in section 16.3.2 of the AMD64
There are even internal registers that are not exposed through the instruction set but are used for performance reasons.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I believe the discrepancy between 40 and actual sum of 48 is mostly an error, however there are many other registers used for handling hardware, memory management, and control of different features of the CPU.
The answer you linked to covers all the commonly used registers in the following image (taken from there):
There are, however plenty of less commonly known registers. Those registers are not likely used by user mode programs but used to control and initialize the processor and low-level constructs the CPU is aware of. They control CPU subsystems such as the MMU unit, task scheduling, etc. Documentation of those registers can be found in the AMD64 Architecture Manual.
You can see most of them in the following figure, taken from the AMD64 Architecture Manual:
Not in the above picture is the new Extended Control Registers family of registers, for which only XCR0
is currently defined.
The System Registers are part of the Model Specific Registers that, as the name implied, are model specific. The variety also changes between CPUs. A full list for the AMD64 architecture can be found in "Appendix A MSR Cross-Reference" of the AMD64 Architecture Manual.
There are additionally what's called "memory mapped registers" which basically means those registers are accessed through memory operations instead of designated instructions. They can be, depending on your definition, countered as registers. One such example is the "APIC Registers" described in section 16.3.2 of the AMD64
There are even internal registers that are not exposed through the instruction set but are used for performance reasons.
I believe the discrepancy between 40 and actual sum of 48 is mostly an error, however there are many other registers used for handling hardware, memory management, and control of different features of the CPU.
The answer you linked to covers all the commonly used registers in the following image (taken from there):
There are, however plenty of less commonly known registers. Those registers are not likely used by user mode programs but used to control and initialize the processor and low-level constructs the CPU is aware of. They control CPU subsystems such as the MMU unit, task scheduling, etc. Documentation of those registers can be found in the AMD64 Architecture Manual.
You can see most of them in the following figure, taken from the AMD64 Architecture Manual:
Not in the above picture is the new Extended Control Registers family of registers, for which only XCR0
is currently defined.
The System Registers are part of the Model Specific Registers that, as the name implied, are model specific. The variety also changes between CPUs. A full list for the AMD64 architecture can be found in "Appendix A MSR Cross-Reference" of the AMD64 Architecture Manual.
There are additionally what's called "memory mapped registers" which basically means those registers are accessed through memory operations instead of designated instructions. They can be, depending on your definition, countered as registers. One such example is the "APIC Registers" described in section 16.3.2 of the AMD64
There are even internal registers that are not exposed through the instruction set but are used for performance reasons.
edited 1 hour ago
answered 1 hour ago
NirIzr
8,85712268
8,85712268
add a comment |Â
add a comment |Â
rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.
rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.
rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.
rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2freverseengineering.stackexchange.com%2fquestions%2f19693%2fhow-many-registers-does-an-x86-64-cpu-actually-have%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
If you know that the CPU has 10000 registers, but can actually use only ~40 of them, how is that useful? ...
â user202729
33 mins ago
Although OP is learning reverse engineering, this question in particular has little specifically related to reverse engineering.
â user202729
32 mins ago