LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2009, 12:16 PM   #1
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Rep: Reputation: 0
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.

Last edited by hamedn; 11-02-2009 at 12:17 PM.
 
Old 11-02-2009, 01:20 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
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?

Last edited by johnsfine; 11-02-2009 at 01:22 PM.
 
Old 11-03-2009, 12:03 PM   #3
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Original Poster
Rep: Reputation: 0
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.
 
Old 11-03-2009, 12:16 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by hamedn View Post
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.
 
Old 11-05-2009, 02:07 AM   #5
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Original Poster
Rep: Reputation: 0
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.

Last edited by hamedn; 11-06-2009 at 12:28 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Propose A Compelling Linux Business Case J_K9 LQ Articles Discussion 12 10-11-2010 09:34 PM
Library issues with Flash 10.0 r15 on Debian lenny/sid TheOneKEA Debian 6 08-07-2009 03:15 PM
LXer: IT COMPANIES PROPOSE XML STANDARD LXer Syndicated Linux News 0 08-02-2006 02:21 AM
Generic error "cannot fetch general purpose registers for thread, no such process"? kranti Programming 0 10-22-2005 06:18 AM
propose the password alaios Programming 3 05-03-2003 03:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration