2
$\begingroup$

I am doing a study on I found on youtube called OpenSecurityTraining: Introductory Intel x86. From what I understand there are registers like EAX, ECD, EDX, ect... and each have a purpose and hold/move information in memory.

Are these registers per stack/application? Meaning, each application will have it's own EAX, EDX, ect... that it uses to hold or move data in and out of memory?

$\endgroup$
1

2 Answers 2

3
$\begingroup$

Each processor has it's own registers. each process has it's own values to the registers which getting stored/reload during context-switch.

$\endgroup$
1
  • $\begingroup$ There are two problems: First, a processor can have multiple cores, and each core can have virtual cores, so a processor can have several register sets. Second, it's not processes that have their own register values, but threads. Processes can have multiple threads. $\endgroup$
    – gnasher729
    May 3, 2021 at 16:08
3
$\begingroup$

Each virtual core has its own registers. Let's say you have a quad core Intel processor with hyperthreading. Each core has two virtual cores, the processor has four cores, so you have a total of eight sets of registers in that processor.

Each thread has registers. The operating system lets you have huge number of threads, but you can have at most one thread running per virtual core. So on the processor mentioned above, there could be eight threads running, using eight registers. For all the other threads that are not running, the operating system will store the register values that the thread should have, and when a thread is paused it's registers are stored, and when another thread is unpaused the stored register values are restored in the actual registers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.