Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/* example of RC51 file using ASM control */
main( )
{
printf("This program will indefinitely loop");
#pragma ASM
jmp $;
#pragma ENDASM
}
i am using RIDE ide..for programming 8052 i need to add some ASM codes to it.so some one pls help me in doing it.!
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 unsigned char __far __at(0x7f00) buf[0x100]; unsigned char head, tail; #define USE_ASSEMBLY (1) #if !USE_ASSEMBLY void to_buffer( unsigned char c ) { if( head != (unsigned char)(tail-1) ) buf[ head++ ] = c; } #else void to_buffer( unsigned char c ) { c; // to avoid warning: unreferenced function argument __asm ; save used registers here. ; If we were still using r2,r3 we would have to push them here. ; if( head != (unsigned char)(tail-1) ) mov a,_tail dec a xrl a,_head ; we could do an ANL a,#0x0f here to use a smaller buffer (see below) jz t_b_end$ ; ; buf[ head++ ] = c; mov a,dpl ; dpl holds lower byte of function argument mov dpl,_head ; buf is 0x100 byte aligned so head can be used directly mov dph,#(_buf>>8) movx @dptr,a inc _head ; we could do an ANL _head,#0x0f here to use a smaller buffer (see above) t_b_end$: ; restore used registers here __endasm; } #endif
is it possible in keil c51 compiler :?:If you are utilizing another compiler other than SDCC, please specify and include version.
BigDog