[A83] HL = A * 12 (fast)


[Prev][Next][Index][Thread]

[A83] HL = A * 12 (fast)





I wrote this little piece of code to calculate HL = A * 12. It seems to
be a bit faster than anything else I could find, so maybe some of you
could benefit from it, or prove me wrong! :)

It takes 46 T-states, and destroys A:

    add    a, a    ; A * 2
    ld    l, a
    add    a, a    ; A * 4
    add    a, l    ; A * 6
    ld    l, a
    sbc    a, a
    and    1
    ld    h, a
    add    hl, hl    ; A * 12







Follow-Ups: