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

Carry flag value from c code

Hi
i want to get the value of the carry flag (after shift to left) from c code
how to do it??
thanks

Parents
  • i want to get the value of the carry flag (after shift to left) from c code how to do it??

    The CY bit should be defined in your processor-specific .h file.

    However:

    Don't do it. Messing around with registers in C is a good way to create a maintenance and debugging nightmare. There is no specified way that these registers behave in C.

    Write a short assembly routine that does what you're trying to accomplish and call it from C. This is the clean way to do it.

Reply
  • i want to get the value of the carry flag (after shift to left) from c code how to do it??

    The CY bit should be defined in your processor-specific .h file.

    However:

    Don't do it. Messing around with registers in C is a good way to create a maintenance and debugging nightmare. There is no specified way that these registers behave in C.

    Write a short assembly routine that does what you're trying to accomplish and call it from C. This is the clean way to do it.

Children