blob: cecb9a881e3733b775e549ebe4077b0c0db16de3 (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
!
!; test all ops
; test all ops
!
!a1 .EQU 4+10
!a2 .EQU 4-10
!a3 .EQU 4&10
!a4 .EQU 4|2
!a5 .EQU 4~2
!a6 .EQU 4*10
!a7 .EQU 40/10
!a8 .EQU +7
!a9 .EQU -7
!a10 .EQU ~7
!
!
! a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
14 -6 0 6 6 40 4 7 -7 -8
!
!; test the priorities
; test the priorities
!
!b1 .EQU 1|2~3&4+5-8*7/2
!b2 .EQU (1|2~(3&(4+5-(8*(7/2)))))
!b3 .EQU 10*2/3*4
!b4 .EQU (((10*2)/3)*4)
!b5 .EQU 10+2-3+4
!b6 .EQU (((10+2)-3)+4)
!
! b1 b2 b3 b4
2 2 24 24
!
!; test association
; test association
!
!c1 .EQU -~3
!c2 .EQU ~-3
!c3 .EQU -(~3)
!c4 .EQU ~(-3)
!
! c1 c2 c3 c4
4 2 4 2
!
!; test rules for symbols
; test rules for symbols
!
!ok1 .EQU FOO
!ok2 .EQU FOO+10
!ok3 .EQU 10+FOO
!ok4 .EQU FOO-10
!
! ok1
FOO
! ok2
FOO+10
! ok3
FOO+10
! ok4
FOO+-10
!
!ok5 .EQU FOO+3+4+5+6
!ok6 .EQU FOO-BAR
!
! ok5
FOO+18
! ok6
FOO-FOO
!
!bad1 .EQU FOO+FOO
!bad2 .EQU FOO*2
!bad3 .EQU FOO/2
!bad4 .EQU FOO|2
!bad5 .EQU FOO&2
!bad6 .EQU FOO~2
!bad7 .EQU FOO*2
!
!; test spacing
; test spacing
!
!space1 .EQU 1 + 2 +3+FOO + 3
!space2
space2:
!
!; from the SH manual
; from the SH manual
!
! .DATA.L 1+(2-(3+(4-5))),1
.long 1,1
!
! .DATA.L -H'fffffff1+H'000000f0*H'00000010|H'000000f0&H'0000ffff,H'00000fff
.long 4095,4095
!
! .DATA.L -~-~H'0000000f,H'00
.long 17,0
!
!
!
!
! .END
|