-
Notifications
You must be signed in to change notification settings - Fork 0
/
instruc
361 lines (337 loc) · 3.61 KB
/
instruc
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
; File with list of instruction opcodes
; Also other words used in the .class files
; This file is part of Free Hero Mesh and is public domain.
; Directions
(0000)
#+E
#+NE
#+N
#+NW
#+W
#+SW
#+S
#+SE
#+F
#+LF
#+L
#+LB
#+B
#+RB
#+R
#+RF
; Bit constants
#bit0 (0001)
#bit1 (0002)
#bit2 (0004)
#bit3 (0008)
#bit4 (0010)
#bit5 (0020)
#bit6 (0040)
#bit7 (0080)
(87E8)
bitconstant "bit8"
#bit9
#bit10
#bit11
#bit12
#bit13
#bit14
#bit15
#bit16
#bit17
#bit18
#bit19
#bit20
#bit21
#bit22
#bit23
#bit24
#bit25
#bit26
#bit27
#bit28
#bit29
#bit30
bitconstant_last "bit31"
; Animation constants
STOP (0000)
ONCE (0001)
LOOP (0002)
OSC (0008)
OSCLOOP (000A)
(8000)
; Stack ops
.drop "."
dup
swap
nip
tuck
rot
rotback "-rot"
pick
over
; Flow controls
-,if
-else
-then
-begin
-again
-,until
-,while
-repeat
-for
-next
*goto
*CallSub
ret
retnz
retz
-case
-or
-and
-fork
-rtn
-link
,exec
; Arithmetic
add "+"
sub "-"
,mul "*"
,div "/"
,mod
,divmod "/mod"
neg
,min
,max
; Bitwise
lsh
,rsh
band
bor
bxor
bnot
-bit
; Logical
land
lor
lxor
lnot
; Comparison
eq
eq2
ne
,gt
,lt
,ge
,le
is
; Type checks
qn "n?"
qc "c?"
qcz "cz?"
qm "m?"
qs "s?"
qo "o?"
qoz "oz?"
qa "a?"
; Standard variables
,Class
,=!Temperature
,=Shape
,Xloc
,Yloc
,=Dir
,=Image
,=!Inertia
,=!Distance
,=!Density
,=!Volume
,=!Weight
,=!Height
,=!Climb
,=!Strength
,=Hard
,=Sharp
,=ShapeDir
,=Shovable
,=!Misc1
,=!Misc2
,=!Misc3
,=!Misc4
,=!Misc5
,=!Misc6
,=!Misc7
,=Arrived
,=Departed
,=Arrivals
,=Departures
,=Busy
,=Invisible
,=KeyCleared
,=UserSignal
,=UserState
,=VisualOnly
,=Stealthy
,=Moved
,=Moving
,=Done
,=Connection
,Destroyed
,Player
,Compatible
,CollisionLayers
,=Crush
Self
Msg
From
=Arg1
=Arg2
=Arg3
=MoveNumber
Level
,Key
=Finished
; Standard variables related to object replacements
,=ThisR
,=NextR
,LastR
; Top level definitions
-Background
-CodePage
-Order
Control
-LevelTable
-InputXY
; Class definitions
-Input
,Quiz
-InPlace
-DefaultImage
-Help
-EditorHelp
-Others
-SUBS
; Main operations / miscellaneous
=Animate
=AnimateDead
,Assassinate ; destroy without sending any messages
.Broadcast
BroadcastAnd ; Broadcast, but result is AND of return values
BroadcastAndEx
*BroadcastClass ; for (Broadcast [class])
.BroadcastEx ; broadcast with three arguments
BroadcastList ; Broadcast, pushing results to stack
BroadcastListEx
BroadcastSum ; Broadcast, but result is sum of return values
BroadcastSumEx
,CancelTriggers
chain
,Chebyshev
,Coloc
,Connect
.Create
Data
,DeferTriggers
DelInventory
Delta
.,Destroy
,FakeMove
,FindConnection
FlushClass
,FlushObj
GetInventory
HeightAt
HitMe
IgnoreKey
.,IntMove ; move without initializing Inertia
.,JumpTo
,Loc ; same as: Xloc Yloc
,LocateMe
LoseLevel
,Manhattan
MaxInventory ; error if more than that many slots in inventory
,Morton
.,Move
.,MovePlus "Move+" ; obj.Inertia+=Strength instead of obj.Inertia=Strength
.,MoveTo ; the internal MoveTo() function
.,PlusMove "+Move"
.,MinusMove "-Move"
NewX
NewXY
NewY
,ObjAbove
,ObjBelow
ObjBottomAt
ObjClassAt
,ObjDir
ObjLayerAt
ObjMovingTo
ObjTopAt
PopUp
*PopUpArgs ; for (PopUp [number])
,Rel
.Replace
,Seek
.,Send
.,SendEx ; send with three arguments
SetInventory
Sound
Sweep
SweepEx
Synchronize
,Target
Trace
,TraceStack
Trigger
TriggerAt
VolumeAt
,Walkable
,WinLevel
,XDir
,XStep
XYDir
,YDir
,YStep
; Operations with marks
mark "_"
tmark
in
nin
-mbegin
flip
count
clear
uniq
; Arrays
-Array
,GetArray
InitArray
,SetArray
,ArrayCell
ArraySlice
CopyArray
DotProduct
; Pattern matching
-,=Pattern "P"
-,=PatternS "P*"
-,=PatternC "Pc"
-Rook
-Bishop
-Queen
-cut
; Bizarro world
,=Bizarro
.BizarroSwap
SwapWorld
; Inheritance
-Abstract
,Super
; Specials
*Function
*Local
*Label
*String
*Int16
*Int32
*Dispatch
*UserFlag