-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Value. Code and Idea Erich Waelde
- Loading branch information
mtrute
committed
Oct 17, 2015
1 parent
8260afc
commit 1ae8d45
Showing
1 changed file
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,31 @@ | ||
\ use 2 cells of EEPROM | ||
\ Author: Erich Wälde | ||
\ Date: oct 2015 | ||
|
||
\ #require quotations.frt | ||
|
||
: 2@e ( eaddr -- n2 n1 ) | ||
dup \ -- addr addr | ||
cell+ \ -- addr addr+2 | ||
@e \ -- addr n2 | ||
swap \ -- n2 addr | ||
@e \ -- n2 n1 | ||
; | ||
: 2!e ( n1 n2 eaddr -- ) | ||
rot \ -- n2 eaddr n1 | ||
over \ -- n2 eaddr n1 eaddr | ||
cell+ \ -- n2 eaddr n1 eaddr+2 | ||
!e \ -- n2 eaddr | ||
!e \ -- | ||
; | ||
: eallot ( n -- ) | ||
ehere + to ehere | ||
; | ||
: 2Evalue ( d -- ) | ||
(value) | ||
ehere , | ||
[: @i 2@e ;] , | ||
[: @i 2!e ;] , | ||
ehere 2!e 2 cells eallot | ||
; | ||
|