aboutsummaryrefslogtreecommitdiff
path: root/tests/stack_machine_relop/instructions.s.tcl
blob: 5a83b53173c765866946367ac243e5f33129086a (about) (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
### store 2 values to memory, load them back, add them and store the result

set_sp 0

## compare 1234567890 to itself

const 1234567890
const 1234567890
# yields 1
eq
store h1EEE0

const 1234567890
const 1234567890
# yields 0
lt
store h1EEE4

const 1234567890
const 1234567890
# yields 0
ult
store h1EEE8

const 1234567890
const 1234567890
# yields 1
le
store h1EEEC

const 1234567890
const 1234567890
# yields 1
ule
store h1EEF0

const 1234567890
const 1234567890
# yields 0
gt
store h1EEF4

const 1234567890
const 1234567890
# yields 0
ugt
store h1EEF8

const 1234567890
const 1234567890
# yields 1
ge
store h1EEFC

const 1234567890
const 1234567890
# yields 1
uge
store h1EF00


## compare hFFFFFFFF to h7FFFFFFF
## hFFFFFFFF will be treated as negative for signed operations

const hFFFFFFFF
const h7FFFFFFF
# yields 0
eq
store h1F0E0

const hFFFFFFFF
const h7FFFFFFF
# yields 1
lt
store h1F0E4

const hFFFFFFFF
const h7FFFFFFF
# yields 0
ult
store h1F0E8

const hFFFFFFFF
const h7FFFFFFF
# yields 1
le
store h1F0EC

const hFFFFFFFF
const h7FFFFFFF
# yields 0
ule
store h1F0F0

const hFFFFFFFF
const h7FFFFFFF
# yields 0
gt
store h1F0F4

const hFFFFFFFF
const h7FFFFFFF
# yields 1
ugt
store h1F0F8

const hFFFFFFFF
const h7FFFFFFF
# yields 0
ge
store h1F0FC

const hFFFFFFFF
const h7FFFFFFF
# yields 1
uge
store h1F100


## compare 18532 to 234, no signedness magic here

const 18532
const 234
# yields 0
eq
store h1F2E0

const 18532
const 234
# yields 0
lt
store h1F2E4

const 18532
const 234
# yields 0
ult
store h1F2E8

const 18532
const 234
# yields 0
le
store h1F2EC

const 18532
const 234
# yields 0
ule
store h1F2F0

const 18532
const 234
# yields 1
gt
store h1F2F4

const 18532
const 234
# yields 1
ugt
store h1F2F8

const 18532
const 234
# yields 1
ge
store h1F2FC

const 18532
const 234
# yields 1
uge
store h1F300


## compare 123 to -1294081
## -1294081 will be interpreted as big positive number for unsigned operations

const 123
const -1294081
# yields 0
eq
store h1F4E0

const 123
const -1294081
# yields 0
lt
store h1F4E4

const 123
const -1294081
# yields 1
ult
store h1F4E8

const 123
const -1294081
# yields 0
le
store h1F4EC

const 123
const -1294081
# yields 1
ule
store h1F4F0

const 123
const -1294081
# yields 1
gt
store h1F4F4

const 123
const -1294081
# yields 0
ugt
store h1F4F8

const 123
const -1294081
# yields 1
ge
store h1F4FC

const 123
const -1294081
# yields 0
uge
store h1F500


halt