Skip to content

Commit

Permalink
New Value. Code and Idea Erich Waelde
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrute committed Oct 17, 2015
1 parent 8260afc commit 1ae8d45
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions avr8/lib/2evalue.frt
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
;

0 comments on commit 1ae8d45

Please sign in to comment.