uday mehta
Advanced Member level 4
- Joined
- Dec 30, 2011
- Messages
- 104
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 1,298
- Activity points
- 1,979
in asm:
in c:
i think both code are same. there is no error in any code but on hardware only asm code works properly, means p3.0 port remain high when i burn hex file of "c" code and get low when i burn hex file of "asm" code. why code of "c" not work properly?? can any body explain? i am using at89c2051 micro-controller.
Code:
org 00h
loop:
clr p3.0
sjmp loop
end
in c:
Code:
#include<reg51.h>
sbit i = P3^0;
void main()
{
while(1)
{
i = 0;
}
}
i think both code are same. there is no error in any code but on hardware only asm code works properly, means p3.0 port remain high when i burn hex file of "c" code and get low when i burn hex file of "asm" code. why code of "c" not work properly?? can any body explain? i am using at89c2051 micro-controller.