Getting floating point exception while trying to use div in assembly

后端 未结 1 408
无人及你
无人及你 2020-12-11 16:59

I am trying to run the following code in assembly:

  mov        %si, %ax
  mov        $15, %si
  div        %si
  mov        %eax, %esi

Whe

相关标签:
1条回答
  • 2020-12-11 17:28

    The div instruction divides the two-word parameter dx/ax by the operand. If the quotient is too large to fit into a word, it will throw that exception.

    Reference: http://siyobik.info.gf/main/reference/instruction/DIV

    What do you have in the dx register? Most likely dx/ax divided by 15 does not fit in a 16-bit word.

    0 讨论(0)
提交回复
热议问题