Fix cmove

This commit is contained in:
Piotr Wiszowaty 2014-07-20 21:25:05 +02:00
parent d454bad69e
commit ae8b9fd0f1
2 changed files with 19 additions and 10 deletions

View File

@ -7,7 +7,9 @@ cross-assembler (e.g. [xasm](http://xasm.atari.org/)) as a backend.
Usage Usage
----- -----
'''sh
foco65 [OPTIONS] INPUT-FILE foco65 [OPTIONS] INPUT-FILE
'''
OPTIONS: OPTIONS:

27
foco65
View File

@ -948,20 +948,27 @@ while_end
inx inx
sta z+1 sta z+1
ldy #0 ldy #0
cmove_loop lda cntr+1
beq cmove_tail
cmove_loop_1
lda (z),y
sta (w),y
iny
bne cmove_loop_1
inc z+1
inc w+1
dec cntr+1
bne cmove_loop_1
cmove_tail
lda cntr
beq cmove_done
cmove_loop_2
lda (z),y lda (z),y
sta (w),y sta (w),y
iny iny
cpy cntr cpy cntr
bne cmove_loop bne cmove_loop_2
lda #0 cmove_done
sta cntr
ldy cntr+1
beq cmove_end
dey
sty cntr+1
jmp cmove_loop
cmove_end
jmp next jmp next
[end-code] ; [end-code] ;