diff --git a/README.md b/README.md index 6440ad7..66f52fa 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/foco65 b/foco65 index fe1390f..877c89c 100755 --- a/foco65 +++ b/foco65 @@ -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