Altera_Forum
Honored Contributor
20 years agoHow to jump to labels which are defined in C code
Hi,
In order to speed up system, I write a routine in ASM instructions. Then in asm code, I intend to jump to a label named LOOP which is defined in C code, but I failed. The following error occur: void Fast_Copy_In_ASM(alt_u32* pSource, alt_u32* pDest, alt_u32 length) { LOOP: asm("ldwio r7,0(r4)"); asm("stwio r7,0(r5)"); asm("addi r5,r5,4");//increase read_data to point to next byte asm("addi r4,r4,4");//increase read_data to point to next byte asm("addi r6,r6,-4");//decrease read_length asm("bne r6,zero,LOOP ");//CWG2 } error:undefined reference to ‘LOOP’ (1)How to jump to labels which are defined in C code from asm instruction? (2)Also, pls kindly tell me does there exist any document related to C and ASM mixture coding? Thanks any help! David http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif