Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registers - beginner

Status
Not open for further replies.

Leijonamieli

Programmer
Nov 28, 2005
6
FI
I've been reading online tutorials about Assembly but there's one thing that is still unclear to me. Is there only one piece of each register (AX, BX...)? If so, why aren't other programs affected if they're using the same registers I change in my own program? Like if they're using CX for a loop operation and I'm making my own loop too.
 
In general any register that needs to be preserved from one call/process to the next should be saved on the stack either by the calling routine or the receiving routine. The routine which pushes the registers should also be the one to pop them.

Hope this helps.



[vampire][bat]
 
Ok, so there is only one of them. I hope I will understand this more profoundly one day.
 
I think, that you think, that other programs run at the same moment, that your program does.
This is not really true, they just seem to do so.
Each program runs a limited time then switches to the next and so on.
Afther all "active" programs have had there ammount of time
it just starts all over again.
If one program is stopt, for a while, all the registers are
save on the stack and the values of the program that start
will be restored from its one stack.

So if you are running a program, its only yours that you
have the wurry about.

If, afther a long long time programming a lot of simple to
complex programs, you learn the finnesses of whats named
"multy tasking".

But I have told to much allready, so forget the other
programs, when yours running all the registers are under
your control, so you have to ceap track of what you are
doing with them.

Tessa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top