This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using C and reading CPU Register (Carry-Flag) via assembler

Hi smart guys out there,

I am using µVision with TIs eval-kit LM3S9B92. I use µVisions C-Compiler.

I learned that it is not possible to read the CPU-Registers with C and I have to use asembler for that.

I have no idea of asembler and actually I don't work with it in future and I hope I never have to again :-) ...but right now I need to know the status of the carrybit.

So all I am asking is for a piece of code that gets me the status of bit 29 in the register 17 :) and how to implement that in my project.

I hope this doesn't sound sassy ;-) - at least it isn't meant that way.

Thank you so much.

Parents
  • Point taken - didn't know that C works that way (owning the carry bit).
    Would it work, if the prior calculation was in assembler, too? 'Cause I thought that the codepart written in assembler will be transcoded to machinecode in a coherent way...won't it?

    I wanted to avoid the method Per suggested, because I was just curious if it is possible to avoid it. That was my single goal: Curiosity :-) . Stupid, I guess.

    Now I will just do it the standard way without using assembler.

    Thanks a lot for your help!

Reply
  • Point taken - didn't know that C works that way (owning the carry bit).
    Would it work, if the prior calculation was in assembler, too? 'Cause I thought that the codepart written in assembler will be transcoded to machinecode in a coherent way...won't it?

    I wanted to avoid the method Per suggested, because I was just curious if it is possible to avoid it. That was my single goal: Curiosity :-) . Stupid, I guess.

    Now I will just do it the standard way without using assembler.

    Thanks a lot for your help!

Children