xcode - Calling assembly routine in objective C -


I have written the function names in the assembly file math.nasm as follows

 % ifdef USE_x86_ASM Section Text sebblogs nbs; * ------------------------ *; * Int NABs (Int a) *; * Price of return in EX *; * ------------------------ * ALIGN 16 NABS: Push eBooks ...... ...... POP EBX RATE% ANDIF < I am calling this function from cf function func1 to myfunc.c file - I am using nasm assembler for assembly file. I am using X-Code 3.1 version and GCC 4.0 compiler USE_x86_ASM  

Project Settings / Build / NASM Build Options / other Flags in Xcode Settings AS -DUSE_X86_ASM
In addition, I have a preprocessor header file Myfunc.h is also defined - I have announced NAB in Myfunc.h

  #define USE_x86_ASM int nABS (int a); Myfunc.c includes myfunc.h and  
  Undefined symbols: "_nABS", referenced from: _func1 Myfunc.o  

Can anyone tell me why I am getting a link error?

I have removed the% ifdef condition in addition to the modified suggestion, the revised code is as follows

  .text .align2 .globl _nABS. Private_extern _nABS  

_nABS: push ebx ...... ...... pop ebx
still I'm getting the same linking error that the file is compiled , But I get the same linking error. I checked that the .o generated app is included. Link file list

Some compiler C symbols add preceding underscores. Simply add the underscore to your label in the assembly file (and globl instructions)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -