flat assembler
Message board for the users of flat assembler.
Index
> Main > A question about Registers |
Author |
|
shoorick 02 Nov 2010, 13:19
registers are part of processor, physical cells to store bytes/words. they are not unique for program, but there is a stack mechanism where program may store values from registers before, say, call subroutine ("another program"), and then restore these values after subroutine returns.
|
|||
02 Nov 2010, 13:19 |
|
ManOfSteel 02 Nov 2010, 15:05
They (or rather their contents) are "unique" for every context in multitasking systems.
|
|||
02 Nov 2010, 15:05 |
|
revolution 02 Nov 2010, 15:17
majidkamali1370 wrote: I just started learning assembly and there's lots of thing that I must know. |
|||
02 Nov 2010, 15:17 |
|
majidkamali1370 03 Nov 2010, 00:04
What about other running programs, when we change their contents ?
Do they (other programs) use them (registers) in this time (when we are changing them) ? Thanks |
|||
03 Nov 2010, 00:04 |
|
revolution 03 Nov 2010, 00:08
Each individual CPU can only run one task at a time. Multi-tasking is merely an illusion created by the OS by switching between tasks quickly.
|
|||
03 Nov 2010, 00:08 |
|
Tyler 03 Nov 2010, 00:40
To elaborate on what revolution just said: In order to make it appear to each program as if it has all the registers all to itself, the OS stores the values in the registers to RAM when it switches to a different task, and puts in the values of the stored registers of the task it's switching to.
In other words, as an application programmer, you don't have to worry about the fact that the registers are shared between your program and others. The OS does some stuff behind the scenes to allow you to use all registers as if your program is the only one running. |
|||
03 Nov 2010, 00:40 |
|
majidkamali1370 04 Nov 2010, 00:42
Thanks
|
|||
04 Nov 2010, 00:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.