title: How to optimize DivMod for a constant divisor of 10
body: <p>In Delphi <strong>math.pas</strong> unit there is a procedure <strong>DivMod</strong> that i want to convert it into inline and optimize it for divisor to be always 10 . But I dont know details of Pentagon ASM . What is the conversion of bellow procedure</p>
  
  <pre><code> procedure DivMod(Dividend: Integer; Divisor: Word;
    var Result, Remainder: Word);
  asm
          PUSH    EBX
          MOV     EBX,EDX
          MOV     EDX,EAX
          SHR     EDX,16
          DIV     BX
          MOV     EBX,Remainder
          MOV     [ECX],AX
          MOV     [EBX],DX
          POP     EBX
  end;
  </code></pre>