3 void _xdata * memcpyx (
9 /* Shut compiler up about unused parameters. */
12 /* AUTO_TOGGLE uses the '390 DPTS toggle bit. */
15 ; Destination is in DPTR. Save it on stack so we can return it at end.
21 mov dps, #1 ; Alternate DPTR.
23 ; count is in _memcpyx_PARM_3
24 mov dptr, #_memcpyx_PARM_3
31 ; src is in _memcpyx_PARM_2
32 mov dptr, #_memcpyx_PARM_2
45 mov dps, #21 ; Current DPTR is alt DPTR, toggle after each op.
47 mov dps, #0 ; Current DPTR is normal DPTR, no toggle.
50 ; src is in alt DPTR, dst is in normal DPTR, count is in r2/r3.
52 ; If we have zero bytes to copy, quick out.
57 ; increment r3 if r2 != 0 (makes djnz end-of-loop sequence possible).
59 cjne r2, #0, _memcpyx_loopTop
78 djnz r2, _memcpyx_loopTop
79 djnz r3, _memcpyx_loopTop