Cosmic UK Cosmic US Cosmic Germany Cosmic Italia Cosmic France


Cosmic Software Frequently Asked Questions


Why do I receive the linker error "function not defined" when the function is defined in my assembly routine?


To call a function defined in assembly from a C function the assembly function name must be prepended and with an underscore and made public via the xdef directive. e.g.
Assembly function:
xdef _foo 
_foo:
... 
end
C function:
extern void foo(void);
foo();  // Call assembly function _foo 
Conversely, to call a C function from an assembly function
C function:
void bar(void)
  { 

  }
Assembly Function:
xref _bar
jsr _bar   // Call C function bar