You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Zune software/Iris/uix-assembly.md
+139-1Lines changed: 139 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Mneumonic | Name
60
60
`MUL` | [MathMultiply](#mathmultiply)
61
61
`DIV` | [MathDivide](#mathdivide)
62
62
`MOD` | [MathModulus](#mathmodulus)
63
-
`NEG` | [MathModulus](#mathmodulus)
63
+
`NEG` | [MathNegate](#mathnegate)
64
64
`AND` | [LogicalAnd](#logicaland)
65
65
`ORR` | [LogicalOr](#logicalor)
66
66
`NOT` | [LogicalNot](#logicalnot)
@@ -277,6 +277,144 @@ Pushes the schema of the specified type to the stack.
277
277
TYP <typeIndex>
278
278
```
279
279
280
+
### Arithmetic and Logical Operations
281
+
282
+
#### Operation
283
+
Performs the specified arithmetic or logical operation using the provided operation host type schema. Unary operations will pop a single value off the stack and execute the operation. Binary operations will first pop the right operand, followed by the left. The operation result is pushed to the stack.
284
+
285
+
The operation host, such as `Int32Schema`, must support the requested operation. Type schemas can declare support for operations using `SupportsOperationHandler` and `PerformOperationHandler`.
286
+
287
+
This is a real instruction. It is recommended to use the alternative virtual instructions described in [Arithmetic and Logical Operations](#arithmetic-and-logical-operations) for the sake of clarity.
288
+
```asm
289
+
OPR <operationHostTypeIndex>, <operationId>
290
+
```
291
+
292
+
#### MathAdd
293
+
Pops two values off the stack and pushes their sum. This is a virtual instruction for [Operation](#operation).
294
+
```asm
295
+
ADD <operationHostTypeIndex>
296
+
OPR <operationHostTypeIndex>, 1
297
+
```
298
+
299
+
#### MathSubtract
300
+
Pops two values, $a$ then $b$, off the stack and pushes their difference, $b - a$. This is a virtual instruction for [Operation](#operation).
301
+
```asm
302
+
SUB <operationHostTypeIndex>
303
+
OPR <operationHostTypeIndex>, 2
304
+
```
305
+
306
+
#### MathMultiply
307
+
Pops two values off the stack and pushes their product. This is a virtual instruction for [Operation](#operation).
308
+
```asm
309
+
MUL <operationHostTypeIndex>
310
+
OPR <operationHostTypeIndex>, 3
311
+
```
312
+
313
+
#### MathDivide
314
+
Pops two values, $a$ then $b$, off the stack and pushes their quotient, $b / a$. This is a virtual instruction for [Operation](#operation).
315
+
```asm
316
+
DIV <operationHostTypeIndex>
317
+
OPR <operationHostTypeIndex>, 4
318
+
```
319
+
320
+
#### MathModulus
321
+
Pops two values, $a$ then $b$, off the stack and pushes their remainder, $b \bmod a$. This is a virtual instruction for [Operation](#operation).
322
+
```asm
323
+
MOD <operationHostTypeIndex>
324
+
OPR <operationHostTypeIndex>, 5
325
+
```
326
+
327
+
#### MathNegate
328
+
Pops a value $a$ off the stack and pushes its negation, $-a$. This is a virtual instruction for [Operation](#operation).
329
+
```asm
330
+
NEG <operationHostTypeIndex>
331
+
OPR <operationHostTypeIndex>, 16
332
+
```
333
+
334
+
#### LogicalAnd
335
+
Pops two values, $a$ then $b$, off the stack and pushes their logical AND, $a \land b$. This is a virtual instruction for [Operation](#operation).
336
+
```asm
337
+
AND <operationHostTypeIndex>
338
+
OPR <operationHostTypeIndex>, 6
339
+
```
340
+
341
+
#### LogicalOr
342
+
Pops two values, $a$ then $b$, off the stack and pushes their logical OR, $b \lor a$. This is a virtual instruction for [Operation](#operation).
343
+
```asm
344
+
ORR <operationHostTypeIndex>
345
+
OPR <operationHostTypeIndex>, 7
346
+
```
347
+
348
+
#### LogicalNot
349
+
Pops a value $a$ off the stack and pushes its logical negation, $\lnot a$. This is a virtual instruction for [Operation](#operation).
350
+
```asm
351
+
NOT <operationHostTypeIndex>
352
+
OPR <operationHostTypeIndex>, 15
353
+
```
354
+
355
+
#### RelationalEquals
356
+
Pops two values, $a$ then $b$, off the stack and pushes whether they are equal, $b = a$. This is a virtual instruction for [Operation](#operation).
357
+
```asm
358
+
REQ <operationHostTypeIndex>
359
+
OPR <operationHostTypeIndex>, 8
360
+
```
361
+
362
+
#### RelationalNotEquals
363
+
Pops two values, $a$ then $b$, off the stack and pushes whether they are not equal, $b \neq a$. This is a virtual instruction for [Operation](#operation).
364
+
```asm
365
+
RNE <operationHostTypeIndex>
366
+
OPR <operationHostTypeIndex>, 9
367
+
```
368
+
369
+
#### RelationalLessThan
370
+
Pops two values, $a$ then $b$, off the stack and pushes whether the result of $b \lt a$. This is a virtual instruction for [Operation](#operation).
371
+
```asm
372
+
RLT <operationHostTypeIndex>
373
+
OPR <operationHostTypeIndex>, 10
374
+
```
375
+
376
+
#### RelationalGreaterThan
377
+
Pops two values, $a$ then $b$, off the stack and pushes whether they are not equal, $b \gt a$. This is a virtual instruction for [Operation](#operation).
378
+
```asm
379
+
RGT <operationHostTypeIndex>
380
+
OPR <operationHostTypeIndex>, 11
381
+
```
382
+
383
+
#### RelationalLessThanEquals
384
+
Pops two values, $a$ then $b$, off the stack and pushes whether they are less than or equal, $b \le a$. This is a virtual instruction for [Operation](#operation).
385
+
```asm
386
+
RLE <operationHostTypeIndex>
387
+
OPR <operationHostTypeIndex>, 12
388
+
```
389
+
390
+
#### RelationalGreaterThanEquals
391
+
Pops two values, $a$ then $b$, off the stack and pushes whether they are greater than or equal, $b \ge a$. This is a virtual instruction for [Operation](#operation).
392
+
```asm
393
+
RGE <operationHostTypeIndex>
394
+
OPR <operationHostTypeIndex>, 13
395
+
```
396
+
397
+
#### RelationalIs
398
+
Pops two values, `a` then `b`, off the stack and pushes whether `b is a`. This is a virtual instruction for [Operation](#operation), though it does not appear to be used anywhere.
399
+
```asm
400
+
RIS <operationHostTypeIndex>
401
+
OPR <operationHostTypeIndex>, 14
402
+
```
403
+
404
+
#### PostIncrement
405
+
Pops a value $a$ off the stack and pushes $a + 1$. This is a virtual instruction for [Operation](#operation).
406
+
```asm
407
+
INC <operationHostTypeIndex>
408
+
OPR <operationHostTypeIndex>, 17
409
+
```
410
+
411
+
#### PostDecrement
412
+
Pops a value $a$ off the stack and pushes $a - 1$. This is a virtual instruction for [Operation](#operation).
0 commit comments