Skip to content

Commit

Permalink
Merge pull request #444 from TG9541/recover
Browse files Browse the repository at this point in the history
#430 Forth Standard words CELLS CELL+ TRUE FALSE RSHIFT
  • Loading branch information
TG9541 committed Feb 22, 2022
2 parents 8ee3453 + 5d2b6af commit de23e35
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/CELL+
@@ -0,0 +1,4 @@
\ https://forth-standard.org/standard/core/CELLPlus
\ Add the size in address units of a cell to a-addr1, giving a-addr2
#require ALIAS
' 2+ ALIAS CELL+ ( a-addr1 -- a-addr2 )
4 changes: 4 additions & 0 deletions lib/CELLS
@@ -0,0 +1,4 @@
\ https://forth-standard.org/standard/core/CELLS
\ n2 is the size in address units of n1 cells.
#require ALIAS
' 2* ALIAS CELLS ( n1 -- n2 )
4 changes: 4 additions & 0 deletions lib/FALSE
@@ -0,0 +1,4 @@
\ https://forth-standard.org/standard/core/FALSE
\ Return a false flag.
#require ALIAS
' 0 ALIAS FALSE ( -- false )
15 changes: 15 additions & 0 deletions lib/RSHIFT
@@ -0,0 +1,15 @@
\ STM8eForth : RSHIFT TG9541-210417
\ refer to github.com/TG9541/stm8ef/blob/master/LICENSE.md

: RSHIFT ( n c - n ) \ shift n right c times
[ $5C C, \ INCW X
$F6 C, \ LD A,(X)
$5C C, \ INCW X
$4D C, \ TNZ A
$2705 , \ JREQ 1$
$77 C, \ 2$: SRA (X)
$6601 , \ RRC (1,X)
$4A C, \ DEC A
$26F8 , \ JRNE 2$
] \ 1$:
;
4 changes: 4 additions & 0 deletions lib/TRUE
@@ -0,0 +1,4 @@
\ https://forth-standard.org/standard/core/TRUE
\ Return a true flag, a single-cell value with all bits set.
#require ALIAS
' -1 ALIAS TRUE ( -- true )

0 comments on commit de23e35

Please sign in to comment.