Hi,
I'm writing a new asm macro for use with the DPLib DPL_ISR one part of this performs some division with Q24 numbers, so instead of rolling my own division I though why not use the IQ lib _IQ24div() function.
Great, except when I try to call it from asm it causes an illegal ISR :(
If I run the same code without the LCR, there's no issue. I have IQmath.lib and the boot ROM symbols linked in the project and the IQmathLib.h file include path added to the compiler include search path.
The code I currently have is:
.cdecls C, LIST
%{
#include <IQmathLib.h>
%}
.ref __IQ24div
;...
ADDB SP, #2 ; Add frame space on stack
MOVL ACC, *XAR2 ; Copy denominator value to stack frame
MOVL *-SP[2], ACC
MOVL ACC, *XAR1 ; Copy numerator value to ACC
LCR __IQ24div ; Call IQ 24 division function ; THIS LINE CAUSES THE ILLEGAL ISR
MOVL *XAR3, ACC ; Copy result to quotient
SUBB SP, #2 ; Remove frame space from stack
Have I done something incorrectly here??
Thanks