Hello there,am using keil I need to be able to access assembly registers from my C code.
Is there a easy way to set the value of a register to the value of a variable and get the value of a register as a variable?? Hope this makes sense..
Not really. The compiler wants to use the machine registers. If you want to use them write in assembler, it is not that complicated. Learn how to use the ABI calling convention to your benefit. There are lots of manuals and technical data, review.
"I need to be able to access assembly registers from my C code."
That's not really the way to go about the problem.
You don't write why you _need_ to be able to access the registers, making it impossible for anyone to suggest alternative solutions.
A c compiler is normally used when you do _not_ need to access registers - while assembler is used when do you need it. So are you sure your assumptions are correct? Or your choice of tools?