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 have writen the next file,but it's wrong! In the source group 1,there are three flies:test.c, START900.A51 and C51S.LIB. why.....? //file name:test.c #ifdef ASM unsigned long shiftR1(register unsigned long); #else extern unsigned long shiftR1(register unsigned long); #endif #define ASM #include<asm.h> #include <Reg936.h> void delay02s(acd) { #pragma ASM abcd: mov r6,#40 abcc: mov r5,#255 djnz r5,$ djnz r6,abcc djnz r7,abcd #pragma ENDASM }
void main( void) { unsigned char ab,acd; P0M1=0xff; P0M2=0xff; ab=1; acd=128; while(1) { if(ab==128) { P0=~acd; ab=128; acd/=2; delay02s(acd); } if(acd==128) { P0=~ab; acd=128; ab*=2; delay02s(ab/2); } if((ab==128)&&(acd==1)) { ab=1; acd=128; } } } How can I program ASM in C,or include other .asm programme or files?
Nice to get your replying! Thanks your warm heart and your messages! I will corret it.