mirror of
https://github.com/piotr-wiszowaty/foco65.git
synced 2025-03-07 10:29:53 +00:00
Add words: fill nip
This commit is contained in:
parent
c19c3544dd
commit
259dc66d0e
53
foco65
53
foco65
@ -805,6 +805,17 @@ basewords_text = """
|
|||||||
jmp next
|
jmp next
|
||||||
[end-code] ;
|
[end-code] ;
|
||||||
|
|
||||||
|
: nip
|
||||||
|
[code]
|
||||||
|
lda pstack,x
|
||||||
|
sta pstack+2,x
|
||||||
|
inx
|
||||||
|
lda pstack,x
|
||||||
|
sta pstack+2,x
|
||||||
|
inx
|
||||||
|
jmp next
|
||||||
|
[end-code] ;
|
||||||
|
|
||||||
: while
|
: while
|
||||||
[code]
|
[code]
|
||||||
lda pstack,x
|
lda pstack,x
|
||||||
@ -1030,6 +1041,48 @@ cmove_done
|
|||||||
jmp next
|
jmp next
|
||||||
[end-code] ;
|
[end-code] ;
|
||||||
|
|
||||||
|
: fill ( c-addr u c -- )
|
||||||
|
[code]
|
||||||
|
lda pstack,x
|
||||||
|
inx
|
||||||
|
sta w
|
||||||
|
inx
|
||||||
|
lda pstack,x
|
||||||
|
inx
|
||||||
|
sta cntr
|
||||||
|
lda pstack,x
|
||||||
|
inx
|
||||||
|
sta cntr+1
|
||||||
|
lda pstack,x
|
||||||
|
inx
|
||||||
|
sta z
|
||||||
|
lda pstack,x
|
||||||
|
inx
|
||||||
|
sta z+1
|
||||||
|
ldy #0
|
||||||
|
lda cntr+1
|
||||||
|
beq fill_tail
|
||||||
|
lda w
|
||||||
|
fill_loop_1
|
||||||
|
sta (z),y
|
||||||
|
iny
|
||||||
|
bne fill_loop_1
|
||||||
|
inc z+1
|
||||||
|
dec cntr+1
|
||||||
|
bne fill_loop_1
|
||||||
|
fill_tail
|
||||||
|
lda cntr
|
||||||
|
beq fill_done
|
||||||
|
lda w
|
||||||
|
fill_loop_2
|
||||||
|
sta (z),y
|
||||||
|
iny
|
||||||
|
dec cntr
|
||||||
|
bne fill_loop_2
|
||||||
|
fill_done
|
||||||
|
jmp next
|
||||||
|
[end-code] ;
|
||||||
|
|
||||||
: dup ( x -- x x )
|
: dup ( x -- x x )
|
||||||
[code]
|
[code]
|
||||||
ldy pstack,x
|
ldy pstack,x
|
||||||
|
Loading…
x
Reference in New Issue
Block a user