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.
as i am doing in assembly language
setb c clr c
it work's fine but when i tried it in c
c = sd; sd = c;
the sd may be the high or low it gives error related to declaration of c, i solved it by defining
sbit C = PSW^7;
i want to know the reasion why it need the seprate declaration.it not required in assembly so why in c please help me to solve this problem
i want to know the reasion why it need the seprate declaration.
The carry bit should be declared as CY in your <[processor type].h> include file.
it not required in assembly so why in c
Because C, all by itself, does not care about the hardware. As far C is concerned, it is entirely irrelevant if your processor even has a carry bit.
Assembler, on the other hand, is very machine-specific.
On a side note, it is generally considered to be a bad idea to mess around with the carry flag in C.
thank's for the help, i went to the c with the same idea as the assembly and did not refer the reg file.thank's again