Add word: 2over

This commit is contained in:
Piotr Wiszowaty committed 2025-05-10 10:34:00 +02:00
1 parent 9683bba03b
commit 67b3c14e5c
2 files changed
+20 -2

No files matched your search

+1 -1
View File
@@ -189,7 +189,7 @@ Words
`!` `"` `'` `[']` `(` `*` `+` `,"` `,'` `,` `-` `/` `:` `<=` `<` `<>` `<` `=`
`>=` `>` `@` `[` `\` `]` `0=` `1+` `1-` `2!` `2*` `2/` `2@` `2drop` `2dup`
`2swap` `2variable` `allot` `and` `c!` `c,` `c@` `cell` `cells` `cmove`
`2over` `2swap` `2variable` `allot` `and` `c!` `c,` `c@` `cell` `cells` `cmove`
`[code]` `constant` `count` `create` `d+` `d-` `d=` `[data-section]` `do`
`drop` `dup` `[end-code]` `execute` `fill` `i` `j` `[label]` `lit` `+loop`
`loop` `lshift` `m*` `nip` `not` `or` `over` `>r` `r>` `recursive` `rot` `-rot`
+19 -1
View File
@@ -1622,7 +1622,25 @@ d_equ_f
jmp next
[end-code] ;
: 2swap ( x1 x2 x3 x4 -- x3 x4 x1 x2 )
: 2over ( x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2 )
[label] two_over
[code]
lda pstack+7,x
dex
sta pstack,x
lda pstack+7,x
dex
sta pstack,x
lda pstack+7,x
dex
sta pstack,x
lda pstack+7,x
dex
sta pstack,x
jmp next
[end-code] ;
: 2swap ( x1 x2 x3 x4 -- x3 x4 x1 x2 )
[label] two_stap
[code]
ldy pstack+0,x