LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   general propose registers(r9 - r15) (https://www.linuxquestions.org/questions/programming-9/general-propose-registers-r9-r15-766280/)

hamedn 11-02-2009 12:16 PM

general propose registers(r9 - r15)
 
Hello my friends
I have a question about general propose registers; Please help me. How I can write into r9,r10,r11, r12,13,r14,15 registers using embedded assembly in C. I wrote some code but when I want to compile the code I get “bad register name “ error .
Please help me . thank you.

johnsfine 11-02-2009 01:20 PM

Are you compiling 32 bit code that doesn't have those registers (even when run on a 64 bit CPU) or are you compiling 64 bit code?

If you are compiling 64 bit, post the code that didn't work as well as the version of compiler you are using. Then we might have a chance to help you.

But in embedded assembly, it generally is not a good idea to force the choice of register. It is usually better to use registers generically and let the compiler select the specific registers.

Why do you want to force the register choice?

hamedn 11-03-2009 12:03 PM

HI , thank u my friend
i tried to compile code in 32bit mode. how i can use these registers. is there any solution to this problem.
i want to save six four bytes operands in a place that don't change any program this place and after some time i wnat to restore these operands.
what's your idea about this.
if it's posible for u please give me some assembly code to write in Specified virtual address.

johnsfine 11-03-2009 12:16 PM

Quote:

Originally Posted by hamedn (Post 3742871)
i tried to compile code in 32bit mode. how i can use these registers.

You can't.

Quote:

is there any solution to this problem.
No.

Quote:

i want to save six four bytes operands in a place that don't change any program this place and after some time i wnat to restore these operands.
what's your idea about this.
I'm not clear enough about what you need to have any idea for you.

Those registers are not usable. You will need somewhere else. I don't know enough about the constraints on what you are trying (the meaning of "don't change any program this place") to even think about what might fit your needs.

hamedn 11-05-2009 02:07 AM

Tanx my friend
I’m using a software like hypervisor ; but this environment is not a fully featured hypervisor. An OS is running on this software; Same time I’m running a program in guest kernel . I want this program save six (four bytes ) operands in somewhere that cant any other programs change these operands. After this I want to context switch to underline running software and read these operands.
I allocated some pages in guest kernel , how I can save these operands in this page using assembly code.


All times are GMT -5. The time now is 06:30 AM.