aboutsummaryrefslogtreecommitdiff
path: root/forth/forth/avr/bit-test.fs
blob: cdfdcea12bd78196f81c690eb101711d713950b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
\ *********************************************************************
\                                                                     *
\    Filename:      bit-test.txt                                      *
\    Date:          06.01.2015                                        *
\    FF Version:    5.0                                               *
\    MCU:           Atmega                                            *
\    Copyright:     Mikael Nordman                                    *
\    Author:        Mikael Nordman                                    *
\ *********************************************************************
\    FlashForth is licensed acording to the GNU General Public License*
\ *********************************************************************
\ Test words for manipulating bits in ram and in IO registers
\ Needs bit.txt
-bittest
marker -bittest

\ BIT addressable IO register
\ $20 - $3f
$22 constant porta

\ IN OUT addressable IO register
$4a constant gpior1

\ LDS STS addressable IO register
$124 constant tcnt5l

porta 2 bit0: porta2off
porta 2 bit1: porta2on
porta 2 bit?: porta2?

gpior1 0 bit0: gpio0off
gpior1 0 bit1: gpio0on
gpior1 0 bit?: gpio0?

tcnt5l 7 bit0: tcnt5l7off
tcnt5l 7 bit1: tcnt5l7on
tcnt5l 7 bit?: tcnt5l7?
 
-1 porta c!
porta2off porta c@ . porta2? .
porta2on porta c@ . porta2? .
0 porta c!
porta2on porta c@ . porta2? . 
porta2off porta c@ . porta2? .

-1 gpior1 c!
gpio0off gpior1 c@ . gpio0? .
gpio0on gpior1 c@ . gpio0? .
0 gpior1 c!
gpio0off gpior1 c@ . gpio0? .
gpio0on gpior1 c@ . gpio0? .
0 gpior1 c!
-1 tcnt5l c!
tcnt5l7off tcnt5l c@ . tcnt5l7? .
tcnt5l7on tcnt5l c@ . tcnt5l7? .
0 tcnt5l c!
tcnt5l7on tcnt5l c@ . tcnt5l7? .
tcnt5l7off tcnt5l c@ . tcnt5l7? .