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
    one answver
    The only safe way, as Christoph says, is to use assembler and call it from 'C'.

    in C, the same is possible, but by other means:

    bit flag;

    flag = 0;
    if (var &0x80) flag = 1;
    var <<= 1;

    use 'flag' as you would CY

    Erik

Reply
  • i want to get the value of the carry flag (after shift to left) from c code
    one answver
    The only safe way, as Christoph says, is to use assembler and call it from 'C'.

    in C, the same is possible, but by other means:

    bit flag;

    flag = 0;
    if (var &0x80) flag = 1;
    var <<= 1;

    use 'flag' as you would CY

    Erik

Children