Important Registers

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Tux

Important Registers

Post by Tux »

I am writing a Task Manager, the MT code is 89% done. I just need to complete the TM. Anyway, I want to know what registers I have to backup when switching tasks.
I know asm, but I am a little confused on the registers.
Slasher

Re:Important Registers

Post by Slasher »

You need to back up all registers. imagine performing an addition where part of the numbers are lost ie not stored then the result wouldn't be accurate. SO save all register.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Important Registers

Post by Solar »

Basically depends on what CPU you're on, no? ;)

I assume it's IA-32. You might want to read about and understand something called TSS and how it works. You should also read about and understand FPU, MMX, and SSE registers and how you can detect if they have been used by the application...
Every good solution is obvious once you've found it.
jamesb.au

Re:Important Registers

Post by jamesb.au »

Tux wrote: I am writing a Task Manager, the MT code is 89% done. I just need to complete the TM. Anyway, I want to know what registers I have to backup when switching tasks.
I know asm, but I am a little confused on the registers.
I highly recommend the Intel architecture manuals. There are 4 of them, the one on optimisation of code is not strictly necessary, but the general architecture, instruction set reference and system programming guide are invaluable. Go to developer.intel.com and to the Pentium 4 pages, look for manuals, and place your order. They are free, even postage is free :) The P4 manuals are the most up to date, and point out differences between the original Pentium, Pentium Pro, P6 family (PII, Celeron, PIII) and P4 and Xeon processors.

Here is a link: http://developer.intel.com/design/pentium4/manuals/ - you can download them as PDFs, or place an order for hard copies.

Order hard copies of the manuals from:

http://developer.intel.com/design/penti ... index2.htm
Tux

Re:Important Registers

Post by Tux »

Thanks, I checked upon a TSS and I got a nice one. It has all I need. Thanks.
Post Reply