Assembly registers | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

Assembly registers

I want to know where are located the registers we manipulate through assembly langage. I read it is a special part of the processor, but then another question comes to my mind : multiple programs can run on the same processor thanks to a scheduler, but why register's values doesn't change due to the multiple programs running at the same time? Thanks by advance!

19th Jun 2019, 9:29 PM
Théophile - avatar
2 ответов
+ 2
OS’s use context switching. Before it switches to another process on the same thread, it saves the registers to memory and then restores them when switching back to that process. For hardware threads each one has its own set of registers, and thus multiple threads can run in parallel.
19th Jun 2019, 10:40 PM
aklex - avatar
+ 1
Thanks a lot aklex!
20th Jun 2019, 5:56 AM
Théophile - avatar