aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/tests/test-rega.frt
blob: 58e06c1a4861dd5db952fc44289a279f3a4f5663 (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
\ #requires tester-amforth.frt

TESTING VM Register A
hex

\ ------------------------------------------------------------------------
TESTING basic assumtions

variable atest 10 allot
atest >a

0 constant false
-1 constant true

$55aa constant pattern


{ a> atest = -> true }
{ pattern a! -> }
\  address must not change
{ a> atest = -> true }
{ a@ pattern = -> true }
\  address must not change
{ a> atest = -> true }

TESTING address changes.
{ pattern a!+ -> }
\  address must increase by 1 cell
{ a> atest cell+ = -> true }

{ pattern a!- -> }
\  address must decrease by 1 cell
{ a> atest = -> true }

{ a@+ pattern = -> true }
\  address must increase by 1 cell
{ a> atest cell+ = -> true }

{ a@- pattern = -> true }
\  address must decrease by 1 cell
{ a> atest = -> true }