Z80 Routines:Optimized:CpHLDE

From WikiTI
Revision as of 10:06, 28 July 2007 by Calc84maniac (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This is a faster/smaller replacement for the typical CpHLDE routine.

Typical routine:

CpHLDE:
  push hl
  or a
  sbc hl,de
  pop hl
  ret

Better routine:

CpHLDE:
  or a
  sbc hl,de
  add hl,de
  ret