Fixed a bug in memcpy
git-svn-id: svn://svn.cc65.org/cc65/trunk@2562 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
966dbc53d8
commit
2c7218b5d9
1 changed files with 4 additions and 4 deletions
|
@ -23,16 +23,16 @@ memcpy_upwards:
|
||||||
; Copy loop
|
; Copy loop
|
||||||
|
|
||||||
@L1: inx ; Bump low counter byte
|
@L1: inx ; Bump low counter byte
|
||||||
beq @L2 ; Jump on overflow
|
beq @L3 ; Jump on overflow
|
||||||
lda (ptr1),y
|
@L2: lda (ptr1),y
|
||||||
sta (ptr2),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
inc ptr1+1 ; Bump pointers
|
inc ptr1+1 ; Bump pointers
|
||||||
inc ptr2+1
|
inc ptr2+1
|
||||||
bne @L1 ; Branch always
|
bne @L1 ; Branch always
|
||||||
@L2: inc ptr3+1 ; Bump high counter byte
|
@L3: inc ptr3+1 ; Bump high counter byte
|
||||||
bne @L1
|
bne @L2
|
||||||
|
|
||||||
; Done. The low byte of dest is still in ptr2
|
; Done. The low byte of dest is still in ptr2
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue