How to compile Arm assembler instruction 
Author Message
 How to compile Arm assembler instruction

I have optimized speech codec decoder with ARM assemblly
but when I tried to compile with EVC I have got the
following errors

"c:\c1035pf.c(99) : error C4235: nonstandard extension
used : '__asm' keyword not supported in this product
"

is there any solution what i have  to do.??
Thx in advance.

Rajeev



Sun, 25 Sep 2005 18:52:54 GMT  
 How to compile Arm assembler instruction

Here is how MFC does this sort of stuff. Perhaps this will give you a clue.

__declspec({*filter*}) void AFXAPI
_AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/)
{
#if defined(_WIN32_WCE_CEPC) || defined(_WIN32_WCE_EMULATION)
 _asm
 {
  pop     edx         // edx = return address
  pop     eax         // eax = pfn
  pop     ecx         // ecx = pArgs
  add     ecx,[esp]   // ecx += nSizeArgs (=scratch area)
  mov     [ecx],edx   // scratch[0] = return address
  sub     ecx,[esp]   // ecx = pArgs (again)
  mov     esp,ecx     // esp = pArgs (usually already correct)
  pop     ecx         // ecx = this pointer (the CCmdTarget*)
  call    eax         // call member function
  ret                 // esp[0] should = scratch[0] = return address
 }
#elif defined(_MIPS_) && defined(_MIPS16_)
 __emit(0x65bd);  // move   sp,a1
 __emit(0x6744);  // move   v0,a0
 __emit(0x9400);  // lw     a0,0(sp)
 __emit(0x9501);  // lw     a1,4(sp)
 __emit(0x9602);  // lw     a2,8(sp)
 __emit(0xea00);  // jr     v0
 __emit(0x9703);  // lw     a3,0xC(sp)
#elif defined(_MIPS_)
 _asm("addiu %sp,%a1,0x0");      // sp = pArgs
 _asm("addiu %t6,%a0,0x0");      // t6 = pfn (save it)
 _asm("lw    %a0,0x0(%sp)");     // a0 = param0
 _asm("lw    %a1,0x4(%sp)");     // a1 = param1
 _asm("lw    %a2,0x8(%sp)");     // a2 = param2
 _asm("lw    %a3,0xc(%sp)");     // a3 = param3
 _asm("j     %t6");              // ip = pfn (jump to target function)
#elif defined(_SH3_) || defined(_SH4_)
 __asm("mov   R5, sp");    // sp = pStack
 __asm("mov   R4, R1");          // R1 = pfn (save it)

 __asm("mov   #4, R0");          // R5 = arg2

 __asm("mov   #8, R0");          // R6 = arg3

 __asm("mov  #12, R0");          // R7 = arg4



#elif defined(_ARM_) && defined(_M_THUMB)
 // Set up the stack pointer. Note that the first four dwords of arguments
 // are saved on the callee's stack so 16 is added to the pointer to
 // the arguments.
 __emit(0x468d);     // mov  sp, r1
 __emit(0xb004);     // add  sp, #16
 // Save the function pointer in r12 (the only available scratch register)
 __emit(0x4684);     // mov  r12, r0
 // Copy four words of arguments into r0-r3
 __emit(0x6808);     // ldr  r0, [r1]
 __emit(0x688a);     // ldr  r2, [r1, #8]
 __emit(0x68cb);     // ldr  r3, [r1, #12]
 __emit(0x6849);     // ldr  r1, [r1, #4]
 // Jump to the function
 __emit(0x4760);     // mov  pc, r12
#elif defined(_ARM_) && defined(_M_ARMT)
 // Set up the stack pointer. Note that the first four dwords of arguments
 // are saved on the callee's stack so 16 is added to the pointer to
 // the arguments.
 __emit(0xe281d010);     // add  sp, r1, #16
 // Save the function pointer in r12 (the only available scratch register)
 __emit(0xe1a0c000);     // mov  r12, r0
 // Copy four words of arguments into r0-r3
 __emit(0xe5910000);     // ldr  r0, [r1]
 __emit(0xe5912008);     // ldr  r2, [r1, #8]
 __emit(0xe591300c);     // ldr  r3, [r1, #12]
 __emit(0xe5911004);     // ldr  r1, [r1, #4]
 // Jump to the function
 __emit(0xe12fff1c);     // bx   r12
#elif defined(_ARM_)
 // Set up the stack pointer. Note that the first four dwords of arguments
 // are saved on the callee's stack so 16 is added to the pointer to
 // the arguments.
 __emit(0xe281d010);     // add  sp, r1, #16
 // Save the function pointer in r12 (the only available scratch register)
 __emit(0xe1a0c000);     // mov  r12, r0
 // Copy four words of arguments into r0-r3
 __emit(0xe5910000);     // ldr  r0, [r1]
 __emit(0xe5912008);     // ldr  r2, [r1, #8]
 __emit(0xe591300c);     // ldr  r3, [r1, #12]
 __emit(0xe5911004);     // ldr  r1, [r1, #4]
 // Jump to the function
 __emit(0xe1a0f00c);     // mov  pc, r12
#elif defined(_PPC_)
 __emit(0x7C812378); // mr          r1,r4
 __emit(0x7C6903A6); // mtctr       r3
 __emit(0x80610000); // lwz         r3,0(r1)
 __emit(0x80810004); // lwz         r4,4(r1)
 __emit(0x80A10008); // lwz         r5,8(r1)
 __emit(0x80C1000C); // lwz         r6,0Ch(r1)
 __emit(0x80E10010); // lwz         r7,10h(r1)
 __emit(0x81010014); // lwz         r8,14h(r1)
 __emit(0x81210018); // lwz         r9,18h(r1)
 __emit(0x8141001C); // lwz         r10,1Ch(r1)
 __emit(0x3821FFF8); // addi        r1,r1,FFF8h
 __emit(0x4E800420); // bctr
#elif defined(_WIN32_WCE_CEF)
 // Use helper__AfxDispatchCall in CEFRTL.DLL (see dispimpl.h)
#else
 #error No _AfxDispatchCall implementation found for this CPU.
#endif

Quote:
}

--
Sincerely,
Alexander


http://www.*-*-*.com/ - Russian Software Developer Network


Quote:
> I have optimized speech codec decoder with ARM assemblly
> but when I tried to compile with EVC I have got the
> following errors

> "c:\c1035pf.c(99) : error C4235: nonstandard extension
> used : '__asm' keyword not supported in this product
> "

> is there any solution what i have  to do.??
> Thx in advance.

> Rajeev



Sun, 25 Sep 2005 20:23:59 GMT  
 How to compile Arm assembler instruction
The ARM compiler does not support inline assembly except through the
__emit() syntax. The best way to do this is to move the code into an
assembly source file and use armasm.exe to compile the code. If you search
MSDN for "ARM assembler" there is documentation on how to get started with
the ARM assembler.

--
Mike Markley


Quote:

> Here is how MFC does this sort of stuff. Perhaps this will give you a
clue.

> __declspec({*filter*}) void AFXAPI
> _AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/)
> {
> #if defined(_WIN32_WCE_CEPC) || defined(_WIN32_WCE_EMULATION)
>  _asm
>  {
>   pop     edx         // edx = return address
>   pop     eax         // eax = pfn
>   pop     ecx         // ecx = pArgs
>   add     ecx,[esp]   // ecx += nSizeArgs (=scratch area)
>   mov     [ecx],edx   // scratch[0] = return address
>   sub     ecx,[esp]   // ecx = pArgs (again)
>   mov     esp,ecx     // esp = pArgs (usually already correct)
>   pop     ecx         // ecx = this pointer (the CCmdTarget*)
>   call    eax         // call member function
>   ret                 // esp[0] should = scratch[0] = return address
>  }
> #elif defined(_MIPS_) && defined(_MIPS16_)
>  __emit(0x65bd);  // move   sp,a1
>  __emit(0x6744);  // move   v0,a0
>  __emit(0x9400);  // lw     a0,0(sp)
>  __emit(0x9501);  // lw     a1,4(sp)
>  __emit(0x9602);  // lw     a2,8(sp)
>  __emit(0xea00);  // jr     v0
>  __emit(0x9703);  // lw     a3,0xC(sp)
> #elif defined(_MIPS_)
>  _asm("addiu %sp,%a1,0x0");      // sp = pArgs
>  _asm("addiu %t6,%a0,0x0");      // t6 = pfn (save it)
>  _asm("lw    %a0,0x0(%sp)");     // a0 = param0
>  _asm("lw    %a1,0x4(%sp)");     // a1 = param1
>  _asm("lw    %a2,0x8(%sp)");     // a2 = param2
>  _asm("lw    %a3,0xc(%sp)");     // a3 = param3
>  _asm("j     %t6");              // ip = pfn (jump to target function)
> #elif defined(_SH3_) || defined(_SH4_)
>  __asm("mov   R5, sp");    // sp = pStack
>  __asm("mov   R4, R1");          // R1 = pfn (save it)

>  __asm("mov   #4, R0");          // R5 = arg2

>  __asm("mov   #8, R0");          // R6 = arg3

>  __asm("mov  #12, R0");          // R7 = arg4



> #elif defined(_ARM_) && defined(_M_THUMB)
>  // Set up the stack pointer. Note that the first four dwords of arguments
>  // are saved on the callee's stack so 16 is added to the pointer to
>  // the arguments.
>  __emit(0x468d);     // mov  sp, r1
>  __emit(0xb004);     // add  sp, #16
>  // Save the function pointer in r12 (the only available scratch register)
>  __emit(0x4684);     // mov  r12, r0
>  // Copy four words of arguments into r0-r3
>  __emit(0x6808);     // ldr  r0, [r1]
>  __emit(0x688a);     // ldr  r2, [r1, #8]
>  __emit(0x68cb);     // ldr  r3, [r1, #12]
>  __emit(0x6849);     // ldr  r1, [r1, #4]
>  // Jump to the function
>  __emit(0x4760);     // mov  pc, r12
> #elif defined(_ARM_) && defined(_M_ARMT)
>  // Set up the stack pointer. Note that the first four dwords of arguments
>  // are saved on the callee's stack so 16 is added to the pointer to
>  // the arguments.
>  __emit(0xe281d010);     // add  sp, r1, #16
>  // Save the function pointer in r12 (the only available scratch register)
>  __emit(0xe1a0c000);     // mov  r12, r0
>  // Copy four words of arguments into r0-r3
>  __emit(0xe5910000);     // ldr  r0, [r1]
>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
>  // Jump to the function
>  __emit(0xe12fff1c);     // bx   r12
> #elif defined(_ARM_)
>  // Set up the stack pointer. Note that the first four dwords of arguments
>  // are saved on the callee's stack so 16 is added to the pointer to
>  // the arguments.
>  __emit(0xe281d010);     // add  sp, r1, #16
>  // Save the function pointer in r12 (the only available scratch register)
>  __emit(0xe1a0c000);     // mov  r12, r0
>  // Copy four words of arguments into r0-r3
>  __emit(0xe5910000);     // ldr  r0, [r1]
>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
>  // Jump to the function
>  __emit(0xe1a0f00c);     // mov  pc, r12
> #elif defined(_PPC_)
>  __emit(0x7C812378); // mr          r1,r4
>  __emit(0x7C6903A6); // mtctr       r3
>  __emit(0x80610000); // lwz         r3,0(r1)
>  __emit(0x80810004); // lwz         r4,4(r1)
>  __emit(0x80A10008); // lwz         r5,8(r1)
>  __emit(0x80C1000C); // lwz         r6,0Ch(r1)
>  __emit(0x80E10010); // lwz         r7,10h(r1)
>  __emit(0x81010014); // lwz         r8,14h(r1)
>  __emit(0x81210018); // lwz         r9,18h(r1)
>  __emit(0x8141001C); // lwz         r10,1Ch(r1)
>  __emit(0x3821FFF8); // addi        r1,r1,FFF8h
>  __emit(0x4E800420); // bctr
> #elif defined(_WIN32_WCE_CEF)
>  // Use helper__AfxDispatchCall in CEFRTL.DLL (see dispimpl.h)
> #else
>  #error No _AfxDispatchCall implementation found for this CPU.
> #endif
> }

> --
> Sincerely,
> Alexander


> http://www.*-*-*.com/ - Russian Software Developer Network



> > I have optimized speech codec decoder with ARM assemblly
> > but when I tried to compile with EVC I have got the
> > following errors

> > "c:\c1035pf.c(99) : error C4235: nonstandard extension
> > used : '__asm' keyword not supported in this product
> > "

> > is there any solution what i have  to do.??
> > Thx in advance.

> > Rajeev



Mon, 26 Sep 2005 00:25:46 GMT  
 How to compile Arm assembler instruction
Hi Mike,

I agree on your point but my problem is my c code and
assembly are mixed. I have optimized my  "C" code with ARM
assembly. Do you have any solution to compile this mixed
file.

thanks
Rajeev

Quote:
>-----Original Message-----
>The ARM compiler does not support inline assembly except
through the
>__emit() syntax. The best way to do this is to move the
code into an
>assembly source file and use armasm.exe to compile the
code. If you search
>MSDN for "ARM assembler" there is documentation on how to
get started with
>the ARM assembler.

>--
>Mike Markley



>> Here is how MFC does this sort of stuff. Perhaps this
will give you a
>clue.

>> __declspec({*filter*}) void AFXAPI
>> _AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/,
UINT /*nSizeArgs*/)
>> {
>> #if defined(_WIN32_WCE_CEPC) || defined

(_WIN32_WCE_EMULATION)

- Show quoted text -

Quote:
>>  _asm
>>  {
>>   pop     edx         // edx = return address
>>   pop     eax         // eax = pfn
>>   pop     ecx         // ecx = pArgs
>>   add     ecx,[esp]   // ecx += nSizeArgs (=scratch
area)
>>   mov     [ecx],edx   // scratch[0] = return address
>>   sub     ecx,[esp]   // ecx = pArgs (again)
>>   mov     esp,ecx     // esp = pArgs (usually already
correct)
>>   pop     ecx         // ecx = this pointer (the
CCmdTarget*)
>>   call    eax         // call member function
>>   ret                 // esp[0] should = scratch[0] =
return address
>>  }
>> #elif defined(_MIPS_) && defined(_MIPS16_)
>>  __emit(0x65bd);  // move   sp,a1
>>  __emit(0x6744);  // move   v0,a0
>>  __emit(0x9400);  // lw     a0,0(sp)
>>  __emit(0x9501);  // lw     a1,4(sp)
>>  __emit(0x9602);  // lw     a2,8(sp)
>>  __emit(0xea00);  // jr     v0
>>  __emit(0x9703);  // lw     a3,0xC(sp)
>> #elif defined(_MIPS_)
>>  _asm("addiu %sp,%a1,0x0");      // sp = pArgs
>>  _asm("addiu %t6,%a0,0x0");      // t6 = pfn (save it)
>>  _asm("lw    %a0,0x0(%sp)");     // a0 = param0
>>  _asm("lw    %a1,0x4(%sp)");     // a1 = param1
>>  _asm("lw    %a2,0x8(%sp)");     // a2 = param2
>>  _asm("lw    %a3,0xc(%sp)");     // a3 = param3
>>  _asm("j     %t6");              // ip = pfn (jump to
target function)
>> #elif defined(_SH3_) || defined(_SH4_)
>>  __asm("mov   R5, sp");    // sp = pStack
>>  __asm("mov   R4, R1");          // R1 = pfn (save it)

pointer)
>>  __asm("mov   #4, R0");          // R5 = arg2

>>  __asm("mov   #8, R0");          // R6 = arg3

>>  __asm("mov  #12, R0");          // R7 = arg4


function

>> #elif defined(_ARM_) && defined(_M_THUMB)
>>  // Set up the stack pointer. Note that the first four
dwords of arguments
>>  // are saved on the callee's stack so 16 is added to
the pointer to
>>  // the arguments.
>>  __emit(0x468d);     // mov  sp, r1
>>  __emit(0xb004);     // add  sp, #16
>>  // Save the function pointer in r12 (the only

available scratch register)

- Show quoted text -

Quote:
>>  __emit(0x4684);     // mov  r12, r0
>>  // Copy four words of arguments into r0-r3
>>  __emit(0x6808);     // ldr  r0, [r1]
>>  __emit(0x688a);     // ldr  r2, [r1, #8]
>>  __emit(0x68cb);     // ldr  r3, [r1, #12]
>>  __emit(0x6849);     // ldr  r1, [r1, #4]
>>  // Jump to the function
>>  __emit(0x4760);     // mov  pc, r12
>> #elif defined(_ARM_) && defined(_M_ARMT)
>>  // Set up the stack pointer. Note that the first four
dwords of arguments
>>  // are saved on the callee's stack so 16 is added to
the pointer to
>>  // the arguments.
>>  __emit(0xe281d010);     // add  sp, r1, #16
>>  // Save the function pointer in r12 (the only

available scratch register)

- Show quoted text -

Quote:
>>  __emit(0xe1a0c000);     // mov  r12, r0
>>  // Copy four words of arguments into r0-r3
>>  __emit(0xe5910000);     // ldr  r0, [r1]
>>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
>>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
>>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
>>  // Jump to the function
>>  __emit(0xe12fff1c);     // bx   r12
>> #elif defined(_ARM_)
>>  // Set up the stack pointer. Note that the first four
dwords of arguments
>>  // are saved on the callee's stack so 16 is added to
the pointer to
>>  // the arguments.
>>  __emit(0xe281d010);     // add  sp, r1, #16
>>  // Save the function pointer in r12 (the only

available scratch register)

- Show quoted text -

Quote:
>>  __emit(0xe1a0c000);     // mov  r12, r0
>>  // Copy four words of arguments into r0-r3
>>  __emit(0xe5910000);     // ldr  r0, [r1]
>>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
>>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
>>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
>>  // Jump to the function
>>  __emit(0xe1a0f00c);     // mov  pc, r12
>> #elif defined(_PPC_)
>>  __emit(0x7C812378); // mr          r1,r4
>>  __emit(0x7C6903A6); // mtctr       r3
>>  __emit(0x80610000); // lwz         r3,0(r1)
>>  __emit(0x80810004); // lwz         r4,4(r1)
>>  __emit(0x80A10008); // lwz         r5,8(r1)
>>  __emit(0x80C1000C); // lwz         r6,0Ch(r1)
>>  __emit(0x80E10010); // lwz         r7,10h(r1)
>>  __emit(0x81010014); // lwz         r8,14h(r1)
>>  __emit(0x81210018); // lwz         r9,18h(r1)
>>  __emit(0x8141001C); // lwz         r10,1Ch(r1)
>>  __emit(0x3821FFF8); // addi        r1,r1,FFF8h
>>  __emit(0x4E800420); // bctr
>> #elif defined(_WIN32_WCE_CEF)
>>  // Use helper__AfxDispatchCall in CEFRTL.DLL (see
dispimpl.h)
>> #else
>>  #error No _AfxDispatchCall implementation found for
this CPU.
>> #endif
>> }

>> --
>> Sincerely,
>> Alexander


>> http://www.*-*-*.com/ - Russian Software Developer Network


message

>> > I have optimized speech codec decoder with ARM
assemblly
>> > but when I tried to compile with EVC I have got the
>> > following errors

>> > "c:\c1035pf.c(99) : error C4235: nonstandard extension
>> > used : '__asm' keyword not supported in this product
>> > "

>> > is there any solution what i have  to do.??
>> > Thx in advance.

>> > Rajeev

>.



Tue, 27 Sep 2005 20:55:50 GMT  
 How to compile Arm assembler instruction
If you can't break the assembly out into a separate function then the only
solution would be to figure out what the hexadecimal encoding would be for
each instruction and replace all of your inline assembly with __emit(x)
calls. The other choice would be to generate an assembly listing of the
function and have the whole function be in assembler.

--
Mike Markley


Quote:
> Hi Mike,

> I agree on your point but my problem is my c code and
> assembly are mixed. I have optimized my  "C" code with ARM
> assembly. Do you have any solution to compile this mixed
> file.

> thanks
> Rajeev

> >-----Original Message-----
> >The ARM compiler does not support inline assembly except
> through the
> >__emit() syntax. The best way to do this is to move the
> code into an
> >assembly source file and use armasm.exe to compile the
> code. If you search
> >MSDN for "ARM assembler" there is documentation on how to
> get started with
> >the ARM assembler.

> >--
> >Mike Markley



> >> Here is how MFC does this sort of stuff. Perhaps this
> will give you a
> >clue.

> >> __declspec({*filter*}) void AFXAPI
> >> _AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/,
> UINT /*nSizeArgs*/)
> >> {
> >> #if defined(_WIN32_WCE_CEPC) || defined
> (_WIN32_WCE_EMULATION)
> >>  _asm
> >>  {
> >>   pop     edx         // edx = return address
> >>   pop     eax         // eax = pfn
> >>   pop     ecx         // ecx = pArgs
> >>   add     ecx,[esp]   // ecx += nSizeArgs (=scratch
> area)
> >>   mov     [ecx],edx   // scratch[0] = return address
> >>   sub     ecx,[esp]   // ecx = pArgs (again)
> >>   mov     esp,ecx     // esp = pArgs (usually already
> correct)
> >>   pop     ecx         // ecx = this pointer (the
> CCmdTarget*)
> >>   call    eax         // call member function
> >>   ret                 // esp[0] should = scratch[0] =
> return address
> >>  }
> >> #elif defined(_MIPS_) && defined(_MIPS16_)
> >>  __emit(0x65bd);  // move   sp,a1
> >>  __emit(0x6744);  // move   v0,a0
> >>  __emit(0x9400);  // lw     a0,0(sp)
> >>  __emit(0x9501);  // lw     a1,4(sp)
> >>  __emit(0x9602);  // lw     a2,8(sp)
> >>  __emit(0xea00);  // jr     v0
> >>  __emit(0x9703);  // lw     a3,0xC(sp)
> >> #elif defined(_MIPS_)
> >>  _asm("addiu %sp,%a1,0x0");      // sp = pArgs
> >>  _asm("addiu %t6,%a0,0x0");      // t6 = pfn (save it)
> >>  _asm("lw    %a0,0x0(%sp)");     // a0 = param0
> >>  _asm("lw    %a1,0x4(%sp)");     // a1 = param1
> >>  _asm("lw    %a2,0x8(%sp)");     // a2 = param2
> >>  _asm("lw    %a3,0xc(%sp)");     // a3 = param3
> >>  _asm("j     %t6");              // ip = pfn (jump to
> target function)
> >> #elif defined(_SH3_) || defined(_SH4_)
> >>  __asm("mov   R5, sp");    // sp = pStack
> >>  __asm("mov   R4, R1");          // R1 = pfn (save it)

> pointer)
> >>  __asm("mov   #4, R0");          // R5 = arg2

> >>  __asm("mov   #8, R0");          // R6 = arg3

> >>  __asm("mov  #12, R0");          // R7 = arg4


> function

> >> #elif defined(_ARM_) && defined(_M_THUMB)
> >>  // Set up the stack pointer. Note that the first four
> dwords of arguments
> >>  // are saved on the callee's stack so 16 is added to
> the pointer to
> >>  // the arguments.
> >>  __emit(0x468d);     // mov  sp, r1
> >>  __emit(0xb004);     // add  sp, #16
> >>  // Save the function pointer in r12 (the only
> available scratch register)
> >>  __emit(0x4684);     // mov  r12, r0
> >>  // Copy four words of arguments into r0-r3
> >>  __emit(0x6808);     // ldr  r0, [r1]
> >>  __emit(0x688a);     // ldr  r2, [r1, #8]
> >>  __emit(0x68cb);     // ldr  r3, [r1, #12]
> >>  __emit(0x6849);     // ldr  r1, [r1, #4]
> >>  // Jump to the function
> >>  __emit(0x4760);     // mov  pc, r12
> >> #elif defined(_ARM_) && defined(_M_ARMT)
> >>  // Set up the stack pointer. Note that the first four
> dwords of arguments
> >>  // are saved on the callee's stack so 16 is added to
> the pointer to
> >>  // the arguments.
> >>  __emit(0xe281d010);     // add  sp, r1, #16
> >>  // Save the function pointer in r12 (the only
> available scratch register)
> >>  __emit(0xe1a0c000);     // mov  r12, r0
> >>  // Copy four words of arguments into r0-r3
> >>  __emit(0xe5910000);     // ldr  r0, [r1]
> >>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
> >>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
> >>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
> >>  // Jump to the function
> >>  __emit(0xe12fff1c);     // bx   r12
> >> #elif defined(_ARM_)
> >>  // Set up the stack pointer. Note that the first four
> dwords of arguments
> >>  // are saved on the callee's stack so 16 is added to
> the pointer to
> >>  // the arguments.
> >>  __emit(0xe281d010);     // add  sp, r1, #16
> >>  // Save the function pointer in r12 (the only
> available scratch register)
> >>  __emit(0xe1a0c000);     // mov  r12, r0
> >>  // Copy four words of arguments into r0-r3
> >>  __emit(0xe5910000);     // ldr  r0, [r1]
> >>  __emit(0xe5912008);     // ldr  r2, [r1, #8]
> >>  __emit(0xe591300c);     // ldr  r3, [r1, #12]
> >>  __emit(0xe5911004);     // ldr  r1, [r1, #4]
> >>  // Jump to the function
> >>  __emit(0xe1a0f00c);     // mov  pc, r12
> >> #elif defined(_PPC_)
> >>  __emit(0x7C812378); // mr          r1,r4
> >>  __emit(0x7C6903A6); // mtctr       r3
> >>  __emit(0x80610000); // lwz         r3,0(r1)
> >>  __emit(0x80810004); // lwz         r4,4(r1)
> >>  __emit(0x80A10008); // lwz         r5,8(r1)
> >>  __emit(0x80C1000C); // lwz         r6,0Ch(r1)
> >>  __emit(0x80E10010); // lwz         r7,10h(r1)
> >>  __emit(0x81010014); // lwz         r8,14h(r1)
> >>  __emit(0x81210018); // lwz         r9,18h(r1)
> >>  __emit(0x8141001C); // lwz         r10,1Ch(r1)
> >>  __emit(0x3821FFF8); // addi        r1,r1,FFF8h
> >>  __emit(0x4E800420); // bctr
> >> #elif defined(_WIN32_WCE_CEF)
> >>  // Use helper__AfxDispatchCall in CEFRTL.DLL (see
> dispimpl.h)
> >> #else
> >>  #error No _AfxDispatchCall implementation found for
> this CPU.
> >> #endif
> >> }

> >> --
> >> Sincerely,
> >> Alexander


> >> http://www.*-*-*.com/ - Russian Software Developer Network


> message

> >> > I have optimized speech codec decoder with ARM
> assemblly
> >> > but when I tried to compile with EVC I have got the
> >> > following errors

> >> > "c:\c1035pf.c(99) : error C4235: nonstandard extension
> >> > used : '__asm' keyword not supported in this product
> >> > "

> >> > is there any solution what i have  to do.??
> >> > Thx in advance.

> >> > Rajeev

> >.



Wed, 28 Sep 2005 01:36:15 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. XScale / Cotulla / ARM V5 Thumb- / DSP-instructions supported ?

2. Counting the Assembler instructions in a block of C code

3. Arguments in included assembler instructions

4. 32-bit assembler instructions in c?

5. inline assembler and Pentium specific instruction(s)

6. Dose VC++ 5.0 inline assembler support CPUID instruction?

7. not able to Compile for the Ipaq 3955 ARM processor on eVC3

8. How to compile RDTSC instruction in MSDOS mode

9. detailed instructions to compile stlport with evc++ 3.0?

10. prefetchnta instruction not in 386 instruction set

11. What assembler code is generated by C instruction X?

12. qsort algoritm and ARM library

 

 
Powered by phpBB® Forum Software