AnsweredAssumed Answered

get CW for HCS12X to use Hardware division

Question asked by Mario Rauscher on Feb 22, 2008
Latest reply on Feb 26, 2008 by Mario Rauscher
Hello.
 
Im trying to divide a signed 32bit integer by a singned 16bit integer and want to have a signed 16bit bit result.
 
like this:
Code:

sint32 multiplic;
sint16 divisor;
sint16result;

result = multiplic / divisor;
the compiler always generates code with a call of the subroutine _LDIVS instead of using the EDIVS instruction.

Code:
74: result = multiplic / divisor;00d8 fc0000 [3] LDD divisor00db b74d [1] SEX D,X00dd 3b [2] PSHD 00de 34 [2] PSHX 00df fc0000 [3] LDD multiplic:200e2 b765 [1] TFR Y,X00e4 160000 [4] JSR _LDIVS00e7 7c0000 [3] STD result


 
Is there any way to get the compiler to use the Hardware division instead of this Software version?

Thanks in advance.

Outcomes