ic10c-node 2.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ // Copyright (c) 2026. All rights reserved.
2
+ // This source code is licensed under the CC BY-NC-SA
3
+ // (Creative Commons Attribution-NonCommercial-NoDerivatives) License, By Xiao Songtao.
4
+ // This software is protected by copyright law. Reproduction, distribution, or use for commercial
5
+ // purposes is prohibited without the author's permission. If you have any questions or require
6
+ // permission, please contact the author: edocsitahw@qq.com
7
+
8
+ /**
9
+ * @file index.d.ts
10
+ * @author edocsitahw
11
+ * @version 1.1
12
+ * @date 2026/07/22 15:56
13
+ * @desc
14
+ * @copyright CC BY-NC-SA 2026. All rights reserved.
15
+ * */
16
+ export * from "./nullary";
17
+ export * from "./unary";
18
+ export * from "./binary";
19
+ export * from "./ternary";
20
+ export * from "./quaternary";
21
+ export * from "./quinary";
22
+ export * from "./senary";
@@ -0,0 +1,85 @@
1
+ // Copyright (c) 2026. All rights reserved.
2
+ // This source code is licensed under the CC BY-NC-SA
3
+ // (Creative Commons Attribution-NonCommercial-NoDerivatives) License, By Xiao Songtao.
4
+ // This software is protected by copyright law. Reproduction, distribution, or use for commercial
5
+ // purposes is prohibited without the author's permission. If you have any questions or require
6
+ // permission, please contact the author: edocsitahw@qq.com
7
+
8
+ /**
9
+ * @file nullary.d.ts
10
+ * @author edocsitahw
11
+ * @version 1.1
12
+ * @date 2026/07/22 15:40
13
+ * @desc
14
+ * @copyright CC BY-NC-SA 2026. All rights reserved.
15
+ * */
16
+ import {ErrorNode, InstructionNode} from "../ast";
17
+
18
+ // 零元指令(无操作数)
19
+
20
+ /**
21
+ * @summary 零元指令概述
22
+ *
23
+ * @desc 零元指令是不带任何操作数的指令。
24
+ * 这些指令通常用于控制程序流程或 CPU 状态。
25
+ */
26
+
27
+ /**
28
+ * @summary HCF(Hang Crisis Failure)指令节点
29
+ *
30
+ * @desc HCF 指令是 IC10 的最高优先级指令。
31
+ * 执行后,CPU 将进入无限循环状态,无法恢复。
32
+ * 通常用于严重错误处理或程序终止。
33
+ *
34
+ * @warning
35
+ * 此指令会导致 CPU 永久停止,应谨慎使用!
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * // HCF 指令
40
+ * {
41
+ * "type": "hcfInstruction",
42
+ * "position": { "line": 0, "column": 0 }
43
+ * }
44
+ * ```
45
+ *
46
+ * @public
47
+ */
48
+ export interface HcfInstructionNode extends InstructionNode {
49
+ type: "hcfInstruction";
50
+ }
51
+
52
+
53
+ /**
54
+ * @summary YIELD 指令节点
55
+ *
56
+ * @desc YIELD 指令让出 CPU 执行权,允许其他 IC 芯片执行。
57
+ * 用于协作式多任务,避免单个 IC 独占 CPU。
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * // YIELD 指令
62
+ * {
63
+ * "type": "yieldInstruction",
64
+ * "position": { "line": 0, "column": 0 }
65
+ * }
66
+ * ```
67
+ *
68
+ * @public
69
+ */
70
+ export interface YieldInstructionNode extends InstructionNode {
71
+ type: "yieldInstruction";
72
+ }
73
+
74
+
75
+ /**
76
+ * @summary 零元指令联合类型
77
+ *
78
+ * @desc 包含所有零元指令类型的联合,包括可能的错误节点。
79
+ *
80
+ * @public
81
+ */
82
+ export type NullaryInstructionNode =
83
+ | HcfInstructionNode
84
+ | YieldInstructionNode
85
+ | ErrorNode;
@@ -0,0 +1,603 @@
1
+ // Copyright (c) 2026. All rights reserved.
2
+ // This source code is licensed under the CC BY-NC-SA
3
+ // (Creative Commons Attribution-NonCommercial-NoDerivatives) License, By Xiao Songtao.
4
+ // This software is protected by copyright law. Reproduction, distribution, or use for commercial
5
+ // purposes is prohibited without the author's permission. If you have any questions or require
6
+ // permission, please contact the author: edocsitahw@qq.com
7
+
8
+ /**
9
+ * @file quaternary.d.ts
10
+ * @author edocsitahw
11
+ * @version 1.1
12
+ * @date 2026/07/22 15:48
13
+ * @desc
14
+ * @copyright CC BY-NC-SA 2026. All rights reserved.
15
+ * */
16
+ import {
17
+ ErrorNode,
18
+ RegisterOrIdentifierNode,
19
+ OperandNode,
20
+ DeviceReferenceNode,
21
+ SlotIndexNode,
22
+ LogicSlotTypeNode,
23
+ LogicTypeNode,
24
+ BatchModeNode,
25
+ OperandType
26
+ } from "../ast";
27
+ import { TernaryInstruction } from "./ternary";
28
+
29
+
30
+ // 四元指令(4 个操作数)
31
+
32
+ export interface QuaternaryInstruction extends TernaryInstruction {
33
+ type4: OperandType;
34
+ }
35
+
36
+ /**
37
+ * @summary 四元指令概述
38
+ *
39
+ * @desc 四元指令是包含四个操作数的指令。
40
+ * 根据操作数类型可分为以下几类:
41
+ * - **QuaternaryInstruction_RI_O_O_O**:寄存器/标识符 + 操作数 + 操作数 + 操作数
42
+ * - **QuaternaryInstruction_DR_SI_LS_RI**:设备引用 + 槽索引 + 逻辑槽类型 + 寄存器/标识符
43
+ * - **QuaternaryInstruction_RI_O_LT_BM**:寄存器/标识符 + 操作数 + 逻辑类型 + 批处理模式
44
+ * - **QuaternaryInstruction_O_O_LT_RI**:操作数 + 操作数 + 逻辑类型 + 寄存器/标识符
45
+ * - **QuaternaryInstruction_O_SI_LS_RI**:操作数 + 槽索引 + 逻辑槽类型 + 寄存器/标识符
46
+ * - **QuaternaryInstruction_O_O_O_O**:操作数 + 操作数 + 操作数 + 操作数
47
+ * - **QuaternaryInstruction_RI_DR_SI_LS**:寄存器/标识符 + 设备引用 + 槽索引 + 逻辑槽类型
48
+ *
49
+ * @elseif en
50
+ * @summary Quaternary Instructions Overview
51
+ *
52
+ * @desc Quaternary instructions contain four operands.
53
+ * They are categorized by operand types:
54
+ * - **QuaternaryInstruction_RI_O_O_O**: Register/identifier + operand + operand + operand
55
+ * - **QuaternaryInstruction_DR_SI_LS_RI**: Device reference + slot index + logic slot type + register/identifier
56
+ * - **QuaternaryInstruction_RI_O_LT_BM**: Register/identifier + operand + logic type + batch mode
57
+ * - **QuaternaryInstruction_O_O_LT_RI**: Operand + operand + logic type + register/identifier
58
+ * - **QuaternaryInstruction_O_SI_LS_RI**: Operand + slot index + logic slot type + register/identifier
59
+ * - **QuaternaryInstruction_O_O_O_O**: Operand + operand + operand + operand
60
+ * - **QuaternaryInstruction_RI_DR_SI_LS**: Register/identifier + device reference + slot index + logic slot type
61
+ */
62
+
63
+ /**
64
+ * @summary 含 RegisterOrIdentifier + Operand + Operand + Operand 操作数的四元指令基类
65
+ *
66
+ * @desc 第一个操作数为寄存器或标识符,后三个为通用操作数。
67
+ * @elseif en
68
+ * @summary Base interface for quaternary instructions with RegisterOrIdentifier + Operand + Operand + Operand operands
69
+ *
70
+ * @desc First operand is a register or identifier, last three are general operands.
71
+ *
72
+ * @public
73
+ */
74
+ interface QuaternaryInstruction_RI_O_O_O extends QuaternaryInstruction {
75
+ operand1: RegisterOrIdentifierNode;
76
+ operand2: OperandNode;
77
+ operand3: OperandNode;
78
+ operand4: OperandNode;
79
+ }
80
+
81
+
82
+ /**
83
+ * @summary LERP(线性插值)指令节点
84
+ *
85
+ * @desc 计算两个值之间的线性插值。
86
+ * 结果 = start + (end - start) * t
87
+ * @elseif en
88
+ * @summary LERP (Linear Interpolation) instruction node
89
+ *
90
+ * @desc Computes linear interpolation between two values.
91
+ * Result = start + (end - start) * t
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * // LERP r0 r1 r2 r3
96
+ * // 计算从 r1 到 r2 的线性插值,t = r3
97
+ * ```
98
+ *
99
+ * @public
100
+ */
101
+ export interface LerpInstructionNode extends QuaternaryInstruction_RI_O_O_O {
102
+ type: "lerpInstruction";
103
+ }
104
+
105
+
106
+ /**
107
+ * @summary EXT(提取位)指令节点
108
+ *
109
+ * @desc 从源操作数中提取指定的位范围。
110
+ * @elseif en
111
+ * @summary EXT (Extract Bits) instruction node
112
+ *
113
+ * @desc Extracts a specified range of bits from the source operand.
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * // EXT r0 r1 r2 r3
118
+ * // 从 r1 中提取位,结果存入 r0
119
+ * ```
120
+ *
121
+ * @public
122
+ */
123
+ export interface ExtInstructionNode extends QuaternaryInstruction_RI_O_O_O {
124
+ type: "extInstruction";
125
+ }
126
+
127
+
128
+ /**
129
+ * @summary INS(插入位)指令节点
130
+ *
131
+ * @desc 将位插入到目标操作数中的指定位置。
132
+ * @elseif en
133
+ * @summary INS (Insert Bits) instruction node
134
+ *
135
+ * @desc Inserts bits into a specified position in the target operand.
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * // INS r0 r1 r2 r3
140
+ * // 将 r1 的位插入到 r0 的指定位置
141
+ * ```
142
+ *
143
+ * @public
144
+ */
145
+ export interface InsInstructionNode extends QuaternaryInstruction_RI_O_O_O {
146
+ type: "insInstruction";
147
+ }
148
+
149
+
150
+ /**
151
+ * @summary SAP(设置所有属性)指令节点
152
+ *
153
+ * @desc 设置设备的所有属性值。
154
+ * @elseif en
155
+ * @summary SAP (Set All Properties) instruction node
156
+ *
157
+ * @desc Sets all property values of a device.
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * // SAP r0 r1 r2 r3
162
+ * // 设置设备的多个属性值
163
+ * ```
164
+ *
165
+ * @public
166
+ */
167
+ export interface SapInstructionNode extends QuaternaryInstruction_RI_O_O_O {
168
+ type: "sapInstruction";
169
+ }
170
+
171
+
172
+ /**
173
+ * @summary SNA(设置数值所有属性)指令节点
174
+ *
175
+ * @desc 设置设备的数值类型所有属性。
176
+ * @elseif en
177
+ * @summary SNA (Set Numerical All) instruction node
178
+ *
179
+ * @desc Sets all numerical properties of a device.
180
+ *
181
+ * @example
182
+ * ```typescript
183
+ * // SNA r0 r1 r2 r3
184
+ * // 设置设备的数值类型属性
185
+ * ```
186
+ *
187
+ * @public
188
+ */
189
+ export interface SnaInstructionNode extends QuaternaryInstruction_RI_O_O_O {
190
+ type: "snaInstruction";
191
+ }
192
+
193
+
194
+ /**
195
+ * @summary SELECT(选择)指令节点
196
+ *
197
+ * @desc 根据条件从两个值中选择一个。
198
+ * 如果第一个操作数非零,返回第二个操作数,否则返回第三个操作数。
199
+ * @elseif en
200
+ * @summary SELECT instruction node
201
+ *
202
+ * @desc Selects one of two values based on a condition.
203
+ * If the first operand is non-zero, returns the second operand, otherwise returns the third operand.
204
+ *
205
+ * @example
206
+ * ```typescript
207
+ * // SELECT r0 r1 r2 r3
208
+ * // 如果 r1 非零则 r0 = r2,否则 r0 = r3
209
+ * ```
210
+ *
211
+ * @public
212
+ */
213
+ export interface SelectInstructionNode extends QuaternaryInstruction_RI_O_O_O {
214
+ type: "selectInstruction";
215
+ }
216
+
217
+
218
+ /**
219
+ * @summary 含 DeviceReference + SlotIndex + LogicSlotType + RegisterOrIdentifier 操作数的四元指令基类
220
+ *
221
+ * @desc 第一个操作数为设备引用,第二个为槽索引,第三个为逻辑槽类型,第四个为寄存器或标识符。
222
+ * @elseif en
223
+ * @summary Base interface for quaternary instructions with DeviceReference + SlotIndex + LogicSlotType + RegisterOrIdentifier operands
224
+ *
225
+ * @desc First operand is a device reference, second is a slot index, third is a logic slot type, fourth is a register or identifier.
226
+ *
227
+ * @public
228
+ */
229
+ interface QuaternaryInstruction_DR_SI_LS_RI extends QuaternaryInstruction {
230
+ operand1: DeviceReferenceNode;
231
+ operand2: SlotIndexNode;
232
+ operand3: LogicSlotTypeNode;
233
+ operand4: RegisterOrIdentifierNode;
234
+ }
235
+
236
+
237
+ /**
238
+ * @summary SS(设置设备槽)指令节点
239
+ *
240
+ * @desc 将值设置到设备的指定槽中。
241
+ * @elseif en
242
+ * @summary SS (Set Slot) instruction node
243
+ *
244
+ * @desc Sets a value to a specified slot of a device.
245
+ *
246
+ * @example
247
+ * ```typescript
248
+ * // SS console1 0 Color r0
249
+ * // 将 r0 的值设置到 console1 的 0 号槽的 Color 属性
250
+ * ```
251
+ *
252
+ * @public
253
+ */
254
+ export interface SsInstructionNode extends QuaternaryInstruction_DR_SI_LS_RI {
255
+ type: "ssInstruction";
256
+ }
257
+
258
+
259
+ /**
260
+ * @summary 含 RegisterOrIdentifier + Operand + LogicType + BatchMode 操作数的四元指令基类
261
+ *
262
+ * @desc 第一个操作数为寄存器或标识符,第二个为操作数,第三个为逻辑类型,第四个为批处理模式。
263
+ * @elseif en
264
+ * @summary Base interface for quaternary instructions with RegisterOrIdentifier + Operand + LogicType + BatchMode operands
265
+ *
266
+ * @desc First operand is a register or identifier, second is an operand, third is a logic type, fourth is a batch mode.
267
+ *
268
+ * @public
269
+ */
270
+ interface QuaternaryInstruction_RI_O_LT_BM extends QuaternaryInstruction {
271
+ operand1: RegisterOrIdentifierNode;
272
+ operand2: OperandNode;
273
+ operand3: LogicTypeNode;
274
+ operand4: BatchModeNode;
275
+ }
276
+
277
+
278
+ /**
279
+ * @summary LB(读取设备库存批量)指令节点
280
+ *
281
+ * @desc 从设备的库存中批量读取多个物品的数据。
282
+ * @elseif en
283
+ * @summary LB (Load Batch) instruction node
284
+ *
285
+ * @desc Batch reads data of multiple items from a device's inventory.
286
+ *
287
+ * @example
288
+ * ```typescript
289
+ * // LB r0 tank1 Mode Exact
290
+ * // 从 tank1 批量读取数据
291
+ * ```
292
+ *
293
+ * @public
294
+ */
295
+ export interface LbInstructionNode extends QuaternaryInstruction_RI_O_LT_BM {
296
+ type: "lbInstruction";
297
+ }
298
+
299
+
300
+ /**
301
+ * @summary 含 Operand + Operand + LogicType + RegisterOrIdentifier 操作数的四元指令基类
302
+ *
303
+ * @desc 前两个操作数为通用操作数,第三个为逻辑类型,第四个为寄存器或标识符。
304
+ * @elseif en
305
+ * @summary Base interface for quaternary instructions with Operand + Operand + LogicType + RegisterOrIdentifier operands
306
+ *
307
+ * @desc First two operands are general operands, third is a logic type, fourth is a register or identifier.
308
+ *
309
+ * @public
310
+ */
311
+ interface QuaternaryInstruction_O_O_LT_RI extends QuaternaryInstruction {
312
+ operand1: OperandNode;
313
+ operand2: OperandNode;
314
+ operand3: LogicTypeNode;
315
+ operand4: RegisterOrIdentifierNode;
316
+ }
317
+
318
+
319
+ /**
320
+ * @summary SBN(设置设备库存批量数值)指令节点
321
+ *
322
+ * @desc 从设备库存批量读取数值数据。
323
+ * @elseif en
324
+ * @summary SBN (Set Batch Numerical) instruction node
325
+ *
326
+ * @desc Batch reads numerical data from a device's inventory.
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * // SBN r0 r1 Mode r2
331
+ * // 从设备库存批量读取数值数据到 r2
332
+ * ```
333
+ *
334
+ * @public
335
+ */
336
+ export interface SbnInstructionNode extends QuaternaryInstruction_O_O_LT_RI {
337
+ type: "sbnInstruction";
338
+ }
339
+
340
+
341
+ /**
342
+ * @summary 含 Operand + SlotIndex + LogicSlotType + RegisterOrIdentifier 操作数的四元指令基类
343
+ *
344
+ * @desc 第一个操作数为通用操作数,第二个为槽索引,第三个为逻辑槽类型,第四个为寄存器或标识符。
345
+ * @elseif en
346
+ * @summary Base interface for quaternary instructions with Operand + SlotIndex + LogicSlotType + RegisterOrIdentifier operands
347
+ *
348
+ * @desc First operand is a general operand, second is a slot index, third is a logic slot type, fourth is a register or identifier.
349
+ *
350
+ * @public
351
+ */
352
+ interface QuaternaryInstruction_O_SI_LS_RI extends QuaternaryInstruction {
353
+ operand1: OperandNode;
354
+ operand2: SlotIndexNode;
355
+ operand3: LogicSlotTypeNode;
356
+ operand4: RegisterOrIdentifierNode;
357
+ }
358
+
359
+
360
+ /**
361
+ * @summary SBS(设置设备槽批量)指令节点
362
+ *
363
+ * @desc 批量将值设置到设备的多个槽中。
364
+ * @elseif en
365
+ * @summary SBS (Set Batch Slot) instruction node
366
+ *
367
+ * @desc Batch sets values to multiple slots of a device.
368
+ *
369
+ * @example
370
+ * ```typescript
371
+ * // SBS tank1 0 Quantity r0
372
+ * // 批量设置设备的槽值
373
+ * ```
374
+ *
375
+ * @public
376
+ */
377
+ export interface SbsInstructionNode extends QuaternaryInstruction_O_SI_LS_RI {
378
+ type: "sbsInstruction";
379
+ }
380
+
381
+
382
+ /**
383
+ * @summary 含 Operand + Operand + Operand + Operand 操作数的四元指令基类
384
+ *
385
+ * @desc 四个操作数都为通用操作数类型。
386
+ * @elseif en
387
+ * @summary Base interface for quaternary instructions with Operand + Operand + Operand + Operand operands
388
+ *
389
+ * @desc All four operands are general operand types.
390
+ *
391
+ * @public
392
+ */
393
+ interface QuaternaryInstruction_O_O_O_O extends QuaternaryInstruction {
394
+ operand1: OperandNode;
395
+ operand2: OperandNode;
396
+ operand3: OperandNode;
397
+ operand4: OperandNode;
398
+ }
399
+
400
+
401
+ /**
402
+ * @summary BAP(Branches on All Predicate)指令节点
403
+ *
404
+ * @desc 如果所有谓词条件都满足,则跳转到目标地址。
405
+ * @elseif en
406
+ * @summary BAP (Branches on All Predicate) instruction node
407
+ *
408
+ * @desc Jumps to the target address if all predicate conditions are satisfied.
409
+ *
410
+ * @example
411
+ * ```typescript
412
+ * // BAP loop r0 r1 r2
413
+ * // 如果所有条件满足,跳转到 loop
414
+ * ```
415
+ *
416
+ * @public
417
+ */
418
+ export interface BapInstructionNode extends QuaternaryInstruction_O_O_O_O {
419
+ type: "bapInstruction";
420
+ }
421
+
422
+
423
+ /**
424
+ * @summary BAPAL(Branches on All Predicate And Link)指令节点
425
+ *
426
+ * @desc 如果所有谓词条件都满足,则跳转到目标地址并保存返回地址。
427
+ * @elseif en
428
+ * @summary BAPAL (Branches on All Predicate And Link) instruction node
429
+ *
430
+ * @desc Jumps to the target address if all predicate conditions are satisfied, and saves the return address.
431
+ *
432
+ * @example
433
+ * ```typescript
434
+ * // BAPAL loop r0 r1 r2
435
+ * // 如果所有条件满足,跳转到 loop 并保存返回地址
436
+ * ```
437
+ *
438
+ * @public
439
+ */
440
+ export interface BapalInstructionNode extends QuaternaryInstruction_O_O_O_O {
441
+ type: "bapalInstruction";
442
+ }
443
+
444
+
445
+ /**
446
+ * @summary BNA(Branches on No predicate true)指令节点
447
+ *
448
+ * @desc 如果所有谓词条件都不满足,则跳转到目标地址。
449
+ * @elseif en
450
+ * @summary BNA (Branches on No predicate true) instruction node
451
+ *
452
+ * @desc Jumps to the target address if no predicate condition is satisfied.
453
+ *
454
+ * @example
455
+ * ```typescript
456
+ * // BNA loop r0 r1 r2
457
+ * // 如果所有条件都不满足,跳转到 loop
458
+ * ```
459
+ *
460
+ * @public
461
+ */
462
+ export interface BnaInstructionNode extends QuaternaryInstruction_O_O_O_O {
463
+ type: "bnaInstruction";
464
+ }
465
+
466
+
467
+ /**
468
+ * @summary BNAAL(Branches on No predicate true And Link)指令节点
469
+ *
470
+ * @desc 如果所有谓词条件都不满足,则跳转到目标地址并保存返回地址。
471
+ * @elseif en
472
+ * @summary BNAAL (Branches on No predicate true And Link) instruction node
473
+ *
474
+ * @desc Jumps to the target address if no predicate condition is satisfied, and saves the return address.
475
+ *
476
+ * @example
477
+ * ```typescript
478
+ * // BNAAL loop r0 r1 r2
479
+ * // 如果所有条件都不满足,跳转到 loop 并保存返回地址
480
+ * ```
481
+ *
482
+ * @public
483
+ */
484
+ export interface BnaalInstructionNode extends QuaternaryInstruction_O_O_O_O {
485
+ type: "bnaalInstruction";
486
+ }
487
+
488
+
489
+ /**
490
+ * @summary BRAP(Branches Register on All Predicate)指令节点
491
+ *
492
+ * @desc 如果所有谓词条件都满足,则跳转到寄存器中存储的地址。
493
+ * @elseif en
494
+ * @summary BRAP (Branches Register on All Predicate) instruction node
495
+ *
496
+ * @desc Jumps to the address stored in the register if all predicate conditions are satisfied.
497
+ *
498
+ * @example
499
+ * ```typescript
500
+ * // BRAP r0 r1 r2 r3
501
+ * // 如果所有条件满足,跳转到 r0 存储的地址
502
+ * ```
503
+ *
504
+ * @public
505
+ */
506
+ export interface BrapInstructionNode extends QuaternaryInstruction_O_O_O_O {
507
+ type: "brapInstruction";
508
+ }
509
+
510
+
511
+ /**
512
+ * @summary BRNA(Branches Register on No predicate true)指令节点
513
+ *
514
+ * @desc 如果所有谓词条件都不满足,则跳转到寄存器中存储的地址。
515
+ * @elseif en
516
+ * @summary BRNA (Branches Register on No predicate true) instruction node
517
+ *
518
+ * @desc Jumps to the address stored in the register if no predicate condition is satisfied.
519
+ *
520
+ * @example
521
+ * ```typescript
522
+ * // BRNA r0 r1 r2 r3
523
+ * // 如果所有条件都不满足,跳转到 r0 存储的地址
524
+ * ```
525
+ *
526
+ * @public
527
+ */
528
+ export interface BrnaInstructionNode extends QuaternaryInstruction_O_O_O_O {
529
+ type: "brnaInstruction";
530
+ }
531
+
532
+
533
+ /**
534
+ * @summary 含 RegisterOrIdentifier + DeviceReference + SlotIndex + LogicSlotType 操作数的四元指令基类
535
+ *
536
+ * @desc 第一个操作数为寄存器或标识符,第二个为设备引用,第三个为槽索引,第四个为逻辑槽类型。
537
+ * @elseif en
538
+ * @summary Base interface for quaternary instructions with RegisterOrIdentifier + DeviceReference + SlotIndex + LogicSlotType operands
539
+ *
540
+ * @desc First operand is a register or identifier, second is a device reference, third is a slot index, fourth is a logic slot type.
541
+ *
542
+ * @public
543
+ */
544
+ interface QuaternaryInstruction_RI_DR_SI_LS extends QuaternaryInstruction {
545
+ operand1: RegisterOrIdentifierNode;
546
+ operand2: DeviceReferenceNode;
547
+ operand3: SlotIndexNode;
548
+ operand4: LogicSlotTypeNode;
549
+ }
550
+
551
+
552
+ /**
553
+ * @summary LS(读取设备槽)指令节点
554
+ *
555
+ * @desc 从设备的指定槽中读取数据到寄存器。
556
+ * @elseif en
557
+ * @summary LS (Load Slot) instruction node
558
+ *
559
+ * @desc Reads data from a specified slot of a device into the register.
560
+ *
561
+ * @example
562
+ * ```typescript
563
+ * // LS r0 console1 0 Color
564
+ * // 从 console1 的 0 号槽读取 Color 数据到 r0
565
+ * ```
566
+ *
567
+ * @public
568
+ */
569
+ export interface LsInstructionNode extends QuaternaryInstruction_RI_DR_SI_LS {
570
+ type: "lsInstruction";
571
+ }
572
+
573
+
574
+ /**
575
+ * @summary 四元指令联合类型
576
+ *
577
+ * @desc 包含所有四元指令类型的联合,包括可能的错误节点。
578
+ * @elseif en
579
+ * @summary Quaternary instruction union type
580
+ *
581
+ * @desc Union of all quaternary instruction types, including possible error nodes.
582
+ *
583
+ * @public
584
+ */
585
+ export type QuaternaryInstructionNode =
586
+ | LerpInstructionNode
587
+ | ExtInstructionNode
588
+ | InsInstructionNode
589
+ | SapInstructionNode
590
+ | SnaInstructionNode
591
+ | SelectInstructionNode
592
+ | SsInstructionNode
593
+ | LbInstructionNode
594
+ | SbnInstructionNode
595
+ | SbsInstructionNode
596
+ | BapInstructionNode
597
+ | BapalInstructionNode
598
+ | BnaInstructionNode
599
+ | BnaalInstructionNode
600
+ | BrapInstructionNode
601
+ | BrnaInstructionNode
602
+ | LsInstructionNode
603
+ | ErrorNode;