How many registers does an x86_64 CPU actually have?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question









New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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














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?










share|improve this question









New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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












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?










share|improve this question









New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









NirIzr

8,85712268




8,85712268






New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









rubberband876

112




112




New contributor




rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






rubberband876 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • 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










  • 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










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.



amd64 Registers



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.






share|improve this answer






















  • 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


















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):



commonly used registers



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:



system registers



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.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "489"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    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






























    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.



    amd64 Registers



    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.






    share|improve this answer






















    • 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















    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.



    amd64 Registers



    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.






    share|improve this answer






















    • 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













    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.



    amd64 Registers



    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.






    share|improve this answer














    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.



    amd64 Registers



    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    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

















    • 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











    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):



    commonly used registers



    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:



    system registers



    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.






    share|improve this answer


























      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):



      commonly used registers



      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:



      system registers



      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.






      share|improve this answer
























        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):



        commonly used registers



        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:



        system registers



        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.






        share|improve this answer














        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):



        commonly used registers



        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:



        system registers



        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 1 hour ago

























        answered 1 hour ago









        NirIzr

        8,85712268




        8,85712268




















            rubberband876 is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            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.













             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS