-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#430 Forth Standard words CELLS CELL+ TRUE FALSE RSHIFT
- Loading branch information
Showing
5 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
\ https://forth-standard.org/standard/core/FALSE | ||
\ Return a false flag. | ||
#require ALIAS | ||
' 0 ALIAS FALSE ( -- false ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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$: | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ) |