Add words: >r r>

This commit is contained in:
Piotr Wiszowaty 2018-09-22 23:42:41 +02:00
parent 1fa534c871
commit 731a94d211
2 changed files with 27 additions and 1 deletions

View File

@ -187,8 +187,8 @@ or:
Words
-----
`+loop` `lshift` `<=` `<` `>=` `>` `-` `+` `or` `over` `rshift` `rsp` `sp` `swap` `unloop` `u<` `u>` `while` `<>`
`:` `@` `0=` `1-` `1+` `2/` `2*` `2@` `2!` `and` `c!` `c@` `cmove` `count` `d-` `d+` `d=` `do` `drop` `dup` `fill` `i` `j` `loop`
`+loop` `lshift` `<=` `<` `>=` `>` `-` `+` `or` `over` `rshift` `rsp` `sp` `swap` `unloop` `u<` `u>` `while` `<>` `>r` `<r`
`=` `!` `[` `]` `[code]` `[end-code]` `cell` `cells` `not` `[text-section]` `[data-section]`
`variable` `2variable` `constant` `create` `,` `c,` `,'` `'` `,"` `"` `allot`
`lit` `\` `(` `recursive` `[label]` `*` `/` `m*`

26
foco65
View File

@ -1954,6 +1954,32 @@ m_star_done
sta pstack+1,x
jmp next
[end-code] ;
: >r ( x -- ) ( R: -- x )
[label] to_r
[code]
lda pstack+1,x
pha
lda pstack+0,x
pha
inx
inx
jmp next
[end-code] ;
: r> ( -- x ) ( R: x -- )
[label] r_from
[code]
pla
tay
pla
dex
sta pstack,x
dex
tya
sta pstack,x
jmp next
[end-code] ;
"""
parser = argparse.ArgumentParser()