Image Map Image Map
Results 1 to 3 of 3

Thread: multiplication timing on 68000

  1. Default multiplication timing on 68000

    I heard that the number of clock cycles for a multiply varies depending on the number of '1' bits in one of the operands (ie. multiplication is a microcoded shift-and-maybe-add loop). But does anyone know which operand it is?
    Code:
    MOVE #127,d0
    MULU #2,d0
    Code:
    MOVE #2,d0
    MULU #127,d0
    Which is faster on real hardware?

  2. #2
    Join Date
    Mar 2020
    Location
    Long Island, NY, U.S.A.
    Posts
    18

    Default

    Your first example would be 12 clocks faster than the second.

    The MC68000 MULU instruction requires 38 + 2n clocks where n = the number of one bits in the source operand, plus the additional clocks for the effective address calculation (in the case of immediate byte or word, 4 clocks).

    44 clocks for MULU #2,d0 (38 + 2*1 + 4)
    56 clocks for MULU #127,d0 (38 + 2*7 + 4)

  3. Default

    Thanks, that saves me from having to try running a special benchmark on the Sega or something

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •