Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Alternative ways to divide and multiply with assembly.

Options
  • 05-08-2004 7:27pm
    #1
    Closed Accounts Posts: 1,567 ✭✭✭


    I use these instructions instead of using IMUL or MUL sometimes
    to speed up code when i know number.

    Multiplying EAX by 3.

    [PHP]lea eax, [eax + 2 * eax][/PHP]

    By 24

    [PHP]lea eax, [eax + 2 * eax]
    shl eax, 3[/PHP]

    And so on..are there alternative ways to divide also, without using DIV & IDIV
    instructions???


Advertisement