Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Hi team:
When of my customer want to use assembly language to achieve square root. Is there a routine in controlSUITE?
Or how to call IQsqrt function in assembly language?
He added the below code in .asm file:
MOVB AL, #0x0 MOV @AH, #0x6400 .ref __IQ24sqrt LCR __IQ24sqrt
And below code in .c file:
tmp = _IQ24sqrt(100L << 24);
The function of these two parts of code is to square 100L << 24.
After compilation, the .c file generate the following code:
259 tmp = _IQ24sqrt(100L << 24); 3e9e24: FF69 SPM #0 3e9e25: 9A00 MOVB AL, #0x0 3e9e26: 28A86400 MOV @AH, #0x6400 3e9e28: 767F617A LCR _IQ24sqrt 3e9e2a: 1E42 MOVL *-SP[2], ACC
Why the program will trigger the 'ILLEGAL_ISR' when use 'LCR __IQ24sqrt' in the .asm file?
Best regards