File: flatcode1.doc

package info (click to toggle)
tela 1.28-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,596 kB
  • ctags: 5,519
  • sloc: ansic: 14,013; cpp: 13,376; lex: 1,651; fortran: 1,048; yacc: 834; sh: 715; makefile: 464
file content (280 lines) | stat: -rw-r--r-- 4,604 bytes parent folder | download | duplicates (4)
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
TELA Flatcode documentation 						PJ 10.2.1994
Version 1.1											Last mod. 2.1.1995 PJ

This file lists the Tela flatcode ("assembly language") instructions,
together with a brief exaplanation,  in alphabetical order.

ABS											Absolute value

	ABS a,b			a = abs(b)
	ABS a			a = abs(a)


ADD											Addition

	ADD a,b,c		a = b + c
	ADD a,b			a = a + b


AND											Logical AND

	AND a,b,c		a = b && c
	AND a,b			a = a && b


APPEND										Array append

	APPEND r,a,b,..	Append arrays a,b,... to r


ARRAY										Array construction

	ARRAY r,a,b,..	Construct a higher rank array r = #(a,b,..)


BIF											Conditional branch

	BIF offset,a	Branch to PC+offset if a is nonzero


BIFN										Conditional branch

	BIFN offset,a	Branch to PC+offset if a is zero


BRA											Unconditional branch

	BRA offset		Branch to PC+offset (add offset to program counter)


CALL										Function call

	CALL fn,N, out1,out2,...outN, in1,in2,...,inM
					Call function fn with N output arguments and M input arguments.
					N must be an integer. M is determined from the number of
					operands and N implicitly.

CZEROS										Create zeroed complex array

	CZEROS a,d1,d2,...,dN
					a = czeros(d1,d2,...,dN)
					di:s must be constant, and N may not exceed MAXRANK


DEC											Decrementation (decreasing by one)

	DEC a			a = a - 1


DIV											Division

	DIV a,b,c		a = b / c
	DIV a,b			a = a / b


EQ											Comparison for equality

	EQ a,b,c		a = (b == c)


GATH										Gather component(s) from array

	GATH x,a,i1,...,iN
					x = a[i1,...,iN]

GE											Greater-or-equal comparison

	GE a,b,c		a = (b >= c)


GETIN

	GETIN x,i		x = i-th optional input arg

GETOUT

	GETOUT x,i		x = i-th optional output arg


GT											Greater-than comparison

	GT a,b,c		a = (b > c)


INC											Incrementation (increasing by one)

	INC a			a = a + 1


INCJMP										Increment and jump

	INCJMP addr,a	a = a + 1; Jump to addr


IZEROS										Create zeroed integer array

	IZEROS a,d1,d2,...,dN
					a = izeros(d1,d2,...,dN)
					di:s must be constant, and N may not exceed MAXRANK


JIF											Conditional jump

	JIF addr,a		Jump to addr if a is nonzero


JIFN										Conditional jump

	JIFN addr,a		Jump to addr if a is zero


JMP											Unconditional jump

	JMP addr		Jump to addr (set program counter to addr)


JNGT

	JNGT addr,a,b	Jump to addr if a is NOT greater than b


JNGE

	JNGE addr,a,b	Jump to addr if a is NOT greater or equal than b


JNLE

	JNLE addr,a,b	Jump to addr if a is NOT less or equal than b


JNLT

	JNLT addr,a,b	Jump to addr if a is NOT less than b


LE											Less-or-equal comparison

	LE a,b,c		a = (b <= c)


LT											Less-than comparison

	LT a,b,c		a = (b < c)


MAX											Find maximum (b,c must be int or real)

	MAX a,b			a = max(b)				result a is always scalar
	MAX a,b,c		a = max(b,c)			a is array if both b,c are arrays


MGATH										Mapped gather operation

	MGATH x,a,i1,...,iN
					x = a<[i1,...,iN]>


MIN											Find minimum (b,c must be int or real)

	MIN a,b			a = min(b)				result a is always scalar
	MIN a,b,c		a = min(b,c)			a is array if both b,c are arrays


MMPOS										Return min/max position
											of last MIN or MAX unary operation.
	MMPOS a			a = MinMaxPosition		Integer scalar is assigned to a.

MOVE										Assignment

	MOVE a,b		a = b


MSCAT										Mapped scatter operation

	MSCAT x,a,i1,...,iN
					a<[i1,...,iN]> = x


MUL											Pointwise multiplication

	MUL a,b,c		a = b * c
	MUL a,b			a = a * b


NEG											Negation (sign change)

	NEG a,b			a = -b
	NEG a			a = -a


NEQ											Not-equal comparison

	NEQ a,b,c		a = (b != c)


NOP											No operation

	NOP


NOT											Logical NOT

	NOT a,b			a = !b
	NOT a			a = !a


OR											Logical OR

	OR a,b,c		a = b || c
	OR a,b			a = a || b


OZEROS										Create array of void objects

	OZEROS a,d1,d2,...,dN
					a = voids(d1,d2,...,dN)
					di:s must be constant, and N may not exceed MAXRANK


POW											Raising to power

	POW a,b,c		a = b ^ c		(b to the power c)
	POW a,b			a = a ^ b


PRI											Print a value to stdout

	PRI a


RANGE										Generate range of values

	RANGE x,a,b,s	a = a:s:b 				**Note order of b and s!


RZEROS										Create zeroed real array

	RZEROS a,d1,d2,...,dN
					a = zeros(d1,d2,...,dN)
					di:s must be constant, and N may not exceed MAXRANK


SCAT										Scatter component(s) to array

	SCAT x,a,i1,...,iN
					a[i1,...,iN] = x


SETOUT

	SETOUT i,x		i-th optional output arg = x


SUB											Subtraction

	SUB a,b,c		a = b - c
	SUB a,b			a = a - b