We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi i want to get the value of the carry flag (after shift to left) from c code how to do it?? thanks
As Christoph says, it is possible - but definitely not advisable.
Sure, you can access the CY flag in 'C' - but you can never be sure that it relates to the operation that you think and/or require...
The only safe way, as Christoph says, is to use assembler and call it from 'C'.
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
the trigger to use the carry is to remove the "if" ...
consult Jack Sprat, he will tell you to read the manual and see this is how it is, whether you like it or not. C is a magificent product, nobody is to quesation it.