codecin 7.22.10__py3-none-win_amd64.whl
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.
- codecin/__init__.py +27 -0
- codecin/aot.py +1057 -0
- codecin/assembler.py +619 -0
- codecin/cbackend.py +3024 -0
- codecin/cin.py +4265 -0
- codecin/cli.py +670 -0
- codecin/codecin_native.dll +0 -0
- codecin/config.py +50 -0
- codecin/console.py +183 -0
- codecin/cpu.py +312 -0
- codecin/crom.py +449 -0
- codecin/cvm.py +708 -0
- codecin/disasm.py +149 -0
- codecin/environment.py +176 -0
- codecin/errors.py +54 -0
- codecin/isa.py +560 -0
- codecin/lib/array/pic.toml +10 -0
- codecin/lib/array/src/array.cin +103 -0
- codecin/lib/bigint/pic.toml +10 -0
- codecin/lib/bigint/src/bigint.cin +589 -0
- codecin/lib/bits/pic.toml +10 -0
- codecin/lib/bits/src/bits.cin +143 -0
- codecin/lib/bitset/pic.toml +10 -0
- codecin/lib/bitset/src/bitset.cin +374 -0
- codecin/lib/codec/pic.toml +10 -0
- codecin/lib/codec/src/codec.cin +563 -0
- codecin/lib/combin/pic.toml +10 -0
- codecin/lib/combin/src/combin.cin +414 -0
- codecin/lib/conv/pic.toml +10 -0
- codecin/lib/conv/src/conv.cin +151 -0
- codecin/lib/cppstd/pic.toml +10 -0
- codecin/lib/cppstd/src/cppstd.cin +418 -0
- codecin/lib/cstd/pic.toml +10 -0
- codecin/lib/cstd/src/cstd.cin +424 -0
- codecin/lib/csv/pic.toml +10 -0
- codecin/lib/csv/src/csv.cin +405 -0
- codecin/lib/dp/pic.toml +10 -0
- codecin/lib/dp/src/dp.cin +325 -0
- codecin/lib/ffi/pic.toml +10 -0
- codecin/lib/ffi/src/ffi.cin +163 -0
- codecin/lib/fmt/pic.toml +10 -0
- codecin/lib/fmt/src/fmt.cin +325 -0
- codecin/lib/frac/pic.toml +10 -0
- codecin/lib/frac/src/frac.cin +252 -0
- codecin/lib/gostd/pic.toml +10 -0
- codecin/lib/gostd/src/gostd.cin +415 -0
- codecin/lib/graph/pic.toml +10 -0
- codecin/lib/graph/src/graph.cin +367 -0
- codecin/lib/gui/pic.toml +10 -0
- codecin/lib/gui/src/gui.cin +218 -0
- codecin/lib/hash/pic.toml +10 -0
- codecin/lib/hash/src/hash.cin +67 -0
- codecin/lib/heap/pic.toml +10 -0
- codecin/lib/heap/src/heap.cin +199 -0
- codecin/lib/io/pic.toml +10 -0
- codecin/lib/io/src/io.cin +141 -0
- codecin/lib/json/pic.toml +10 -0
- codecin/lib/json/src/json.cin +84 -0
- codecin/lib/key/pic.toml +10 -0
- codecin/lib/key/src/key.cin +78 -0
- codecin/lib/math/pic.toml +10 -0
- codecin/lib/math/src/math.cin +50 -0
- codecin/lib/matrix/pic.toml +10 -0
- codecin/lib/matrix/src/matrix.cin +155 -0
- codecin/lib/net/pic.toml +10 -0
- codecin/lib/net/src/net.cin +171 -0
- codecin/lib/path/pic.toml +10 -0
- codecin/lib/path/src/path.cin +372 -0
- codecin/lib/queue/pic.toml +10 -0
- codecin/lib/queue/src/queue.cin +112 -0
- codecin/lib/rand/pic.toml +10 -0
- codecin/lib/rand/src/rand.cin +46 -0
- codecin/lib/set/pic.toml +10 -0
- codecin/lib/set/src/set.cin +269 -0
- codecin/lib/sort/pic.toml +10 -0
- codecin/lib/sort/src/sort.cin +93 -0
- codecin/lib/stat/pic.toml +10 -0
- codecin/lib/stat/src/stat.cin +138 -0
- codecin/lib/str/pic.toml +10 -0
- codecin/lib/str/src/str.cin +54 -0
- codecin/lib/termux/pic.toml +10 -0
- codecin/lib/termux/src/termux.cin +118 -0
- codecin/lib/test/pic.toml +10 -0
- codecin/lib/test/src/test.cin +74 -0
- codecin/lib/text/pic.toml +10 -0
- codecin/lib/text/src/text.cin +323 -0
- codecin/lib/time/pic.toml +10 -0
- codecin/lib/time/src/time.cin +54 -0
- codecin/lib/token/pic.toml +10 -0
- codecin/lib/token/src/token.cin +183 -0
- codecin/lib/tree/pic.toml +10 -0
- codecin/lib/tree/src/tree.cin +256 -0
- codecin/lib/unionfind/pic.toml +10 -0
- codecin/lib/unionfind/src/unionfind.cin +115 -0
- codecin/lib/validate/pic.toml +10 -0
- codecin/lib/validate/src/validate.cin +148 -0
- codecin/lib/vec/pic.toml +10 -0
- codecin/lib/vec/src/vec.cin +88 -0
- codecin/logger.py +145 -0
- codecin/memory.py +306 -0
- codecin/mkn.py +916 -0
- codecin/native/aot/aot.go +114 -0
- codecin/native/aot/stub_main.go.txt +23 -0
- codecin/native/build.ps1 +33 -0
- codecin/native/build.sh +48 -0
- codecin/native/cmd/cincc/main.go +66 -0
- codecin/native/compiler/codegen.go +2238 -0
- codecin/native/compiler/compile_test.go +1069 -0
- codecin/native/compiler/parser.go +1331 -0
- codecin/native/compiler/syscalls.go +166 -0
- codecin/native/compiler/tokenizer.go +394 -0
- codecin/native/compiler/types.go +217 -0
- codecin/native/engine/args.go +37 -0
- codecin/native/engine/audio.go +402 -0
- codecin/native/engine/audio_other.go +105 -0
- codecin/native/engine/audio_test.go +279 -0
- codecin/native/engine/audio_windows.go +190 -0
- codecin/native/engine/canvas.go +271 -0
- codecin/native/engine/console_other.go +9 -0
- codecin/native/engine/console_windows.go +43 -0
- codecin/native/engine/crom.go +86 -0
- codecin/native/engine/encode.go +93 -0
- codecin/native/engine/engine_test.go +198 -0
- codecin/native/engine/ffi_nocgo.go +20 -0
- codecin/native/engine/ffi_registry.go +69 -0
- codecin/native/engine/ffi_unix.go +109 -0
- codecin/native/engine/ffi_windows.go +117 -0
- codecin/native/engine/gui.go +209 -0
- codecin/native/engine/gui_stub.go +13 -0
- codecin/native/engine/gui_test.go +148 -0
- codecin/native/engine/gui_windows.go +604 -0
- codecin/native/engine/gui_x11.go +723 -0
- codecin/native/engine/host_test.go +139 -0
- codecin/native/engine/hostcrypto.go +30 -0
- codecin/native/engine/hostdesktop.go +173 -0
- codecin/native/engine/hostnet.go +127 -0
- codecin/native/engine/isa_gen.go +689 -0
- codecin/native/engine/keyboard.go +432 -0
- codecin/native/engine/keyboard_other.go +94 -0
- codecin/native/engine/keyboard_stub.go +17 -0
- codecin/native/engine/keyboard_termios_darwin.go +9 -0
- codecin/native/engine/keyboard_termios_linux.go +9 -0
- codecin/native/engine/keyboard_test.go +246 -0
- codecin/native/engine/keyboard_windows.go +208 -0
- codecin/native/engine/keyboard_windows_test.go +123 -0
- codecin/native/engine/lineedit.go +262 -0
- codecin/native/engine/lineedit_test.go +105 -0
- codecin/native/engine/lineint_unix.go +17 -0
- codecin/native/engine/lineint_windows.go +19 -0
- codecin/native/engine/mem_other.go +37 -0
- codecin/native/engine/mem_windows.go +33 -0
- codecin/native/engine/native.go +640 -0
- codecin/native/engine/netsock.go +321 -0
- codecin/native/engine/ops_ext.go +515 -0
- codecin/native/engine/stdin.go +72 -0
- codecin/native/engine/stdin_other.go +9 -0
- codecin/native/engine/stdin_windows.go +60 -0
- codecin/native/engine/system.go +313 -0
- codecin/native/engine/termux.go +180 -0
- codecin/native/engine/version_gen.go +7 -0
- codecin/native/engine/vkb_darwin.go +62 -0
- codecin/native/engine/vkb_linux.go +95 -0
- codecin/native/engine/vkb_stub.go +11 -0
- codecin/native/engine/vm.go +1677 -0
- codecin/native/go.mod +3 -0
- codecin/native/ir/ir.go +48 -0
- codecin/native/main.go +448 -0
- codecin/native/mc/aarch64.go +165 -0
- codecin/native/mc/aarch64_test.go +30 -0
- codecin/native/mc/elf.go +88 -0
- codecin/native/mc/print_test.go +52 -0
- codecin/native/mc/x86_64.go +1262 -0
- codecin/native/mc/x86_64_test.go +102 -0
- codecin/native.py +432 -0
- codecin/native_codegen.py +987 -0
- codecin/nativegen.py +786 -0
- codecin/object.py +539 -0
- codecin/optimizer.py +236 -0
- codecin/packaging/__init__.py +46 -0
- codecin/packaging/archive.py +177 -0
- codecin/packaging/model.py +519 -0
- codecin/packaging/spec.py +193 -0
- codecin/packaging/store.py +372 -0
- codecin/packaging/toml.py +541 -0
- codecin/packaging/vcs.py +215 -0
- codecin/pic.py +1917 -0
- codecin/pic_api.py +374 -0
- codecin/pic_login.py +519 -0
- codecin/pic_registry.py +515 -0
- codecin/registers.py +130 -0
- codecin/sdgcc.py +493 -0
- codecin/stats.py +230 -0
- codecin/stdlib.py +138 -0
- codecin/toolchain.py +396 -0
- codecin/toolkit.py +26 -0
- codecin/version.py +260 -0
- codecin-7.22.10.dist-info/METADATA +1077 -0
- codecin-7.22.10.dist-info/RECORD +202 -0
- codecin-7.22.10.dist-info/WHEEL +5 -0
- codecin-7.22.10.dist-info/entry_points.txt +5 -0
- codecin-7.22.10.dist-info/licenses/LICENSE +7 -0
- codecin-7.22.10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
// Code generated by script/gen_native_isa.py from codecin/isa.py; DO NOT EDIT.
|
|
2
|
+
// 单一事实来源: codecin/isa.py Opcode / Syscall / KIND_* 常量.
|
|
3
|
+
// 修改指令集后运行: python script/gen_native_isa.py
|
|
4
|
+
|
|
5
|
+
package engine
|
|
6
|
+
|
|
7
|
+
// 操作数种类 (与 isa.py KIND_* 一致)
|
|
8
|
+
const kindReg = 0
|
|
9
|
+
const kindImm = 1
|
|
10
|
+
const kindVec = 2
|
|
11
|
+
const kindVecLane = 3
|
|
12
|
+
const kindMem = 4
|
|
13
|
+
const kindCond = 5
|
|
14
|
+
const kindFloat = 6
|
|
15
|
+
const kindStr = 7
|
|
16
|
+
|
|
17
|
+
// 操作码 (与 isa.py Opcode 完整一致; 原生 VM 全量实现, 见 vm.go opcodeSupported)
|
|
18
|
+
const opMOV = 0
|
|
19
|
+
const opLOAD = 1
|
|
20
|
+
const opSTORE = 2
|
|
21
|
+
const opADD = 3
|
|
22
|
+
const opSUB = 4
|
|
23
|
+
const opMUL = 5
|
|
24
|
+
const opDIV = 6
|
|
25
|
+
const opAND = 7
|
|
26
|
+
const opOR = 8
|
|
27
|
+
const opXOR = 9
|
|
28
|
+
const opSHL = 10
|
|
29
|
+
const opSHR = 11
|
|
30
|
+
const opINC = 12
|
|
31
|
+
const opDEC = 13
|
|
32
|
+
const opCMP = 14
|
|
33
|
+
const opJMP = 15
|
|
34
|
+
const opJZ = 16
|
|
35
|
+
const opJNZ = 17
|
|
36
|
+
const opJE = 18
|
|
37
|
+
const opJL = 19
|
|
38
|
+
const opJG = 20
|
|
39
|
+
const opPUSH = 21
|
|
40
|
+
const opPOP = 22
|
|
41
|
+
const opCALL = 23
|
|
42
|
+
const opRET = 24
|
|
43
|
+
const opIN = 25
|
|
44
|
+
const opOUT = 26
|
|
45
|
+
const opHALT = 27
|
|
46
|
+
const opADDS = 28
|
|
47
|
+
const opSUBS = 29
|
|
48
|
+
const opADDC = 30
|
|
49
|
+
const opSUBC = 31
|
|
50
|
+
const opLSL = 32
|
|
51
|
+
const opLSR = 33
|
|
52
|
+
const opASR = 34
|
|
53
|
+
const opROR = 35
|
|
54
|
+
const opMVN = 36
|
|
55
|
+
const opEOR = 37
|
|
56
|
+
const opBIC = 38
|
|
57
|
+
const opORN = 39
|
|
58
|
+
const opLDR = 40
|
|
59
|
+
const opSTR = 41
|
|
60
|
+
const opLDP = 42
|
|
61
|
+
const opSTP = 43
|
|
62
|
+
const opCBZ = 44
|
|
63
|
+
const opCBNZ = 45
|
|
64
|
+
const opTBZ = 46
|
|
65
|
+
const opTBNZ = 47
|
|
66
|
+
const opB = 48
|
|
67
|
+
const opBL = 49
|
|
68
|
+
const opBR = 50
|
|
69
|
+
const opNOP = 51
|
|
70
|
+
const opWFE = 52
|
|
71
|
+
const opWFI = 53
|
|
72
|
+
const opSEV = 54
|
|
73
|
+
const opCSEL = 55
|
|
74
|
+
const opCSINC = 56
|
|
75
|
+
const opCSINV = 57
|
|
76
|
+
const opCSNEG = 58
|
|
77
|
+
const opSXTB = 59
|
|
78
|
+
const opSXTH = 60
|
|
79
|
+
const opSXTW = 61
|
|
80
|
+
const opUXTB = 62
|
|
81
|
+
const opUXTH = 63
|
|
82
|
+
const opCLZ = 64
|
|
83
|
+
const opCLS = 65
|
|
84
|
+
const opRBIT = 66
|
|
85
|
+
const opREV = 67
|
|
86
|
+
const opFADD = 68
|
|
87
|
+
const opFSUB = 69
|
|
88
|
+
const opFMUL = 70
|
|
89
|
+
const opFDIV = 71
|
|
90
|
+
const opFCMP = 72
|
|
91
|
+
const opFCVT = 73
|
|
92
|
+
const opFABS = 74
|
|
93
|
+
const opFNEG = 75
|
|
94
|
+
const opLDRS = 76
|
|
95
|
+
const opSTRS = 77
|
|
96
|
+
const opVADD = 78
|
|
97
|
+
const opVSUB = 79
|
|
98
|
+
const opVMUL = 80
|
|
99
|
+
const opVDIV = 81
|
|
100
|
+
const opVLD1 = 82
|
|
101
|
+
const opVST1 = 83
|
|
102
|
+
const opLB = 84
|
|
103
|
+
const opLH = 85
|
|
104
|
+
const opLW = 86
|
|
105
|
+
const opLD = 87
|
|
106
|
+
const opSB = 88
|
|
107
|
+
const opSH = 89
|
|
108
|
+
const opSW = 90
|
|
109
|
+
const opSD = 91
|
|
110
|
+
const opADDI = 92
|
|
111
|
+
const opSLTI = 93
|
|
112
|
+
const opSLTIU = 94
|
|
113
|
+
const opXORI = 95
|
|
114
|
+
const opORI = 96
|
|
115
|
+
const opANDI = 97
|
|
116
|
+
const opSLLI = 98
|
|
117
|
+
const opSRLI = 99
|
|
118
|
+
const opSRAI = 100
|
|
119
|
+
const opBEQ = 101
|
|
120
|
+
const opBNE = 102
|
|
121
|
+
const opBLT = 103
|
|
122
|
+
const opBGE = 104
|
|
123
|
+
const opBLTU = 105
|
|
124
|
+
const opBGEU = 106
|
|
125
|
+
const opJALR = 107
|
|
126
|
+
const opJAL = 108
|
|
127
|
+
const opLUI = 109
|
|
128
|
+
const opAUIPC = 110
|
|
129
|
+
const opSYS = 111
|
|
130
|
+
|
|
131
|
+
// 操作码名 -> 编码 (供 UCBC 编码器使用)
|
|
132
|
+
var opcodeByName = map[string]uint8{
|
|
133
|
+
"MOV": opMOV,
|
|
134
|
+
"LOAD": opLOAD,
|
|
135
|
+
"STORE": opSTORE,
|
|
136
|
+
"ADD": opADD,
|
|
137
|
+
"SUB": opSUB,
|
|
138
|
+
"MUL": opMUL,
|
|
139
|
+
"DIV": opDIV,
|
|
140
|
+
"AND": opAND,
|
|
141
|
+
"OR": opOR,
|
|
142
|
+
"XOR": opXOR,
|
|
143
|
+
"SHL": opSHL,
|
|
144
|
+
"SHR": opSHR,
|
|
145
|
+
"INC": opINC,
|
|
146
|
+
"DEC": opDEC,
|
|
147
|
+
"CMP": opCMP,
|
|
148
|
+
"JMP": opJMP,
|
|
149
|
+
"JZ": opJZ,
|
|
150
|
+
"JNZ": opJNZ,
|
|
151
|
+
"JE": opJE,
|
|
152
|
+
"JL": opJL,
|
|
153
|
+
"JG": opJG,
|
|
154
|
+
"PUSH": opPUSH,
|
|
155
|
+
"POP": opPOP,
|
|
156
|
+
"CALL": opCALL,
|
|
157
|
+
"RET": opRET,
|
|
158
|
+
"IN": opIN,
|
|
159
|
+
"OUT": opOUT,
|
|
160
|
+
"HALT": opHALT,
|
|
161
|
+
"ADDS": opADDS,
|
|
162
|
+
"SUBS": opSUBS,
|
|
163
|
+
"ADDC": opADDC,
|
|
164
|
+
"SUBC": opSUBC,
|
|
165
|
+
"LSL": opLSL,
|
|
166
|
+
"LSR": opLSR,
|
|
167
|
+
"ASR": opASR,
|
|
168
|
+
"ROR": opROR,
|
|
169
|
+
"MVN": opMVN,
|
|
170
|
+
"EOR": opEOR,
|
|
171
|
+
"BIC": opBIC,
|
|
172
|
+
"ORN": opORN,
|
|
173
|
+
"LDR": opLDR,
|
|
174
|
+
"STR": opSTR,
|
|
175
|
+
"LDP": opLDP,
|
|
176
|
+
"STP": opSTP,
|
|
177
|
+
"CBZ": opCBZ,
|
|
178
|
+
"CBNZ": opCBNZ,
|
|
179
|
+
"TBZ": opTBZ,
|
|
180
|
+
"TBNZ": opTBNZ,
|
|
181
|
+
"B": opB,
|
|
182
|
+
"BL": opBL,
|
|
183
|
+
"BR": opBR,
|
|
184
|
+
"NOP": opNOP,
|
|
185
|
+
"WFE": opWFE,
|
|
186
|
+
"WFI": opWFI,
|
|
187
|
+
"SEV": opSEV,
|
|
188
|
+
"CSEL": opCSEL,
|
|
189
|
+
"CSINC": opCSINC,
|
|
190
|
+
"CSINV": opCSINV,
|
|
191
|
+
"CSNEG": opCSNEG,
|
|
192
|
+
"SXTB": opSXTB,
|
|
193
|
+
"SXTH": opSXTH,
|
|
194
|
+
"SXTW": opSXTW,
|
|
195
|
+
"UXTB": opUXTB,
|
|
196
|
+
"UXTH": opUXTH,
|
|
197
|
+
"CLZ": opCLZ,
|
|
198
|
+
"CLS": opCLS,
|
|
199
|
+
"RBIT": opRBIT,
|
|
200
|
+
"REV": opREV,
|
|
201
|
+
"FADD": opFADD,
|
|
202
|
+
"FSUB": opFSUB,
|
|
203
|
+
"FMUL": opFMUL,
|
|
204
|
+
"FDIV": opFDIV,
|
|
205
|
+
"FCMP": opFCMP,
|
|
206
|
+
"FCVT": opFCVT,
|
|
207
|
+
"FABS": opFABS,
|
|
208
|
+
"FNEG": opFNEG,
|
|
209
|
+
"LDRS": opLDRS,
|
|
210
|
+
"STRS": opSTRS,
|
|
211
|
+
"VADD": opVADD,
|
|
212
|
+
"VSUB": opVSUB,
|
|
213
|
+
"VMUL": opVMUL,
|
|
214
|
+
"VDIV": opVDIV,
|
|
215
|
+
"VLD1": opVLD1,
|
|
216
|
+
"VST1": opVST1,
|
|
217
|
+
"LB": opLB,
|
|
218
|
+
"LH": opLH,
|
|
219
|
+
"LW": opLW,
|
|
220
|
+
"LD": opLD,
|
|
221
|
+
"SB": opSB,
|
|
222
|
+
"SH": opSH,
|
|
223
|
+
"SW": opSW,
|
|
224
|
+
"SD": opSD,
|
|
225
|
+
"ADDI": opADDI,
|
|
226
|
+
"SLTI": opSLTI,
|
|
227
|
+
"SLTIU": opSLTIU,
|
|
228
|
+
"XORI": opXORI,
|
|
229
|
+
"ORI": opORI,
|
|
230
|
+
"ANDI": opANDI,
|
|
231
|
+
"SLLI": opSLLI,
|
|
232
|
+
"SRLI": opSRLI,
|
|
233
|
+
"SRAI": opSRAI,
|
|
234
|
+
"BEQ": opBEQ,
|
|
235
|
+
"BNE": opBNE,
|
|
236
|
+
"BLT": opBLT,
|
|
237
|
+
"BGE": opBGE,
|
|
238
|
+
"BLTU": opBLTU,
|
|
239
|
+
"BGEU": opBGEU,
|
|
240
|
+
"JALR": opJALR,
|
|
241
|
+
"JAL": opJAL,
|
|
242
|
+
"LUI": opLUI,
|
|
243
|
+
"AUIPC": opAUIPC,
|
|
244
|
+
"SYS": opSYS,
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// 每个操作码的参数个数 (-1 表示变长, 不校验);
|
|
248
|
+
// 与 isa.py Constants.ARG_COUNTS 一致。原生 VM 用它校验不可信字节码,
|
|
249
|
+
// 避免 argc 与操作码不匹配时 execute 里 args[i] 越界 panic。
|
|
250
|
+
var argCounts = [112]int16{
|
|
251
|
+
opMOV: 2,
|
|
252
|
+
opLOAD: 2,
|
|
253
|
+
opSTORE: 2,
|
|
254
|
+
opADD: 2,
|
|
255
|
+
opSUB: 2,
|
|
256
|
+
opMUL: 2,
|
|
257
|
+
opDIV: 2,
|
|
258
|
+
opAND: 2,
|
|
259
|
+
opOR: 2,
|
|
260
|
+
opXOR: 2,
|
|
261
|
+
opSHL: 2,
|
|
262
|
+
opSHR: 2,
|
|
263
|
+
opINC: 1,
|
|
264
|
+
opDEC: 1,
|
|
265
|
+
opCMP: 2,
|
|
266
|
+
opJMP: 1,
|
|
267
|
+
opJZ: 1,
|
|
268
|
+
opJNZ: 1,
|
|
269
|
+
opJE: 1,
|
|
270
|
+
opJL: 1,
|
|
271
|
+
opJG: 1,
|
|
272
|
+
opPUSH: 1,
|
|
273
|
+
opPOP: 1,
|
|
274
|
+
opCALL: 1,
|
|
275
|
+
opRET: 0,
|
|
276
|
+
opIN: 1,
|
|
277
|
+
opOUT: 1,
|
|
278
|
+
opHALT: 0,
|
|
279
|
+
opADDS: 3,
|
|
280
|
+
opSUBS: 3,
|
|
281
|
+
opADDC: 3,
|
|
282
|
+
opSUBC: 3,
|
|
283
|
+
opLSL: 3,
|
|
284
|
+
opLSR: 3,
|
|
285
|
+
opASR: 3,
|
|
286
|
+
opROR: 3,
|
|
287
|
+
opMVN: 2,
|
|
288
|
+
opEOR: 3,
|
|
289
|
+
opBIC: 3,
|
|
290
|
+
opORN: 3,
|
|
291
|
+
opLDR: 2,
|
|
292
|
+
opSTR: 2,
|
|
293
|
+
opLDP: 3,
|
|
294
|
+
opSTP: 3,
|
|
295
|
+
opCBZ: 2,
|
|
296
|
+
opCBNZ: 2,
|
|
297
|
+
opTBZ: 3,
|
|
298
|
+
opTBNZ: 3,
|
|
299
|
+
opB: -1,
|
|
300
|
+
opBL: 1,
|
|
301
|
+
opBR: 1,
|
|
302
|
+
opNOP: 0,
|
|
303
|
+
opWFE: 0,
|
|
304
|
+
opWFI: 0,
|
|
305
|
+
opSEV: 0,
|
|
306
|
+
opCSEL: 4,
|
|
307
|
+
opCSINC: 4,
|
|
308
|
+
opCSINV: 4,
|
|
309
|
+
opCSNEG: 4,
|
|
310
|
+
opSXTB: 2,
|
|
311
|
+
opSXTH: 2,
|
|
312
|
+
opSXTW: 2,
|
|
313
|
+
opUXTB: 2,
|
|
314
|
+
opUXTH: 2,
|
|
315
|
+
opCLZ: 2,
|
|
316
|
+
opCLS: 2,
|
|
317
|
+
opRBIT: 2,
|
|
318
|
+
opREV: 2,
|
|
319
|
+
opFADD: 3,
|
|
320
|
+
opFSUB: 3,
|
|
321
|
+
opFMUL: 3,
|
|
322
|
+
opFDIV: 3,
|
|
323
|
+
opFCMP: 2,
|
|
324
|
+
opFCVT: 2,
|
|
325
|
+
opFABS: 2,
|
|
326
|
+
opFNEG: 2,
|
|
327
|
+
opLDRS: 2,
|
|
328
|
+
opSTRS: 2,
|
|
329
|
+
opVADD: 3,
|
|
330
|
+
opVSUB: 3,
|
|
331
|
+
opVMUL: 3,
|
|
332
|
+
opVDIV: 3,
|
|
333
|
+
opVLD1: 2,
|
|
334
|
+
opVST1: 2,
|
|
335
|
+
opLB: 2,
|
|
336
|
+
opLH: 2,
|
|
337
|
+
opLW: 2,
|
|
338
|
+
opLD: 2,
|
|
339
|
+
opSB: 2,
|
|
340
|
+
opSH: 2,
|
|
341
|
+
opSW: 2,
|
|
342
|
+
opSD: 2,
|
|
343
|
+
opADDI: 3,
|
|
344
|
+
opSLTI: 3,
|
|
345
|
+
opSLTIU: 3,
|
|
346
|
+
opXORI: 3,
|
|
347
|
+
opORI: 3,
|
|
348
|
+
opANDI: 3,
|
|
349
|
+
opSLLI: 3,
|
|
350
|
+
opSRLI: 3,
|
|
351
|
+
opSRAI: 3,
|
|
352
|
+
opBEQ: 3,
|
|
353
|
+
opBNE: 3,
|
|
354
|
+
opBLT: 3,
|
|
355
|
+
opBGE: 3,
|
|
356
|
+
opBLTU: 3,
|
|
357
|
+
opBGEU: 3,
|
|
358
|
+
opJALR: -1,
|
|
359
|
+
opJAL: 2,
|
|
360
|
+
opLUI: 2,
|
|
361
|
+
opAUIPC: 2,
|
|
362
|
+
opSYS: -1,
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// SYS 功能号 (与 isa.py Syscall 一致)
|
|
366
|
+
const sysSQRT = 0
|
|
367
|
+
const sysPOW = 1
|
|
368
|
+
const sysABS = 2
|
|
369
|
+
const sysSIN = 3
|
|
370
|
+
const sysCOS = 4
|
|
371
|
+
const sysTAN = 5
|
|
372
|
+
const sysFADD = 6
|
|
373
|
+
const sysFSUB = 7
|
|
374
|
+
const sysFMUL = 8
|
|
375
|
+
const sysFDIV = 9
|
|
376
|
+
const sysFCMP = 10
|
|
377
|
+
const sysFTOI = 11
|
|
378
|
+
const sysITOF = 12
|
|
379
|
+
const sysRAND = 13
|
|
380
|
+
const sysSRAND = 14
|
|
381
|
+
const sysTIME = 15
|
|
382
|
+
const sysSTRLEN = 16
|
|
383
|
+
const sysSTRCMP = 17
|
|
384
|
+
const sysSTRCPY = 18
|
|
385
|
+
const sysSTRCAT = 19
|
|
386
|
+
const sysMALLOC = 20
|
|
387
|
+
const sysPRINTFLO = 21
|
|
388
|
+
const sysITOA = 22
|
|
389
|
+
const sysFTOA = 23
|
|
390
|
+
const sysPRINTSTR = 24
|
|
391
|
+
const sysSTRCONCAT = 25
|
|
392
|
+
const sysBOOLSTR = 26
|
|
393
|
+
const sysABORT = 27
|
|
394
|
+
const sysSUBSTR = 28
|
|
395
|
+
const sysINDEXOF = 29
|
|
396
|
+
const sysTOUPPER = 30
|
|
397
|
+
const sysTOLOWER = 31
|
|
398
|
+
const sysFLOOR = 32
|
|
399
|
+
const sysCEIL = 33
|
|
400
|
+
const sysROUND = 34
|
|
401
|
+
const sysATOI = 35
|
|
402
|
+
const sysTRIM = 36
|
|
403
|
+
const sysLTRIM = 37
|
|
404
|
+
const sysRTRIM = 38
|
|
405
|
+
const sysAUDIOPLAY = 39
|
|
406
|
+
const sysAUDIOSTOP = 40
|
|
407
|
+
const sysAUDIOVOL = 41
|
|
408
|
+
const sysAUDIOWAIT = 42
|
|
409
|
+
const sysCANVASNEW = 43
|
|
410
|
+
const sysCANVASSET = 44
|
|
411
|
+
const sysCANVASRECT = 45
|
|
412
|
+
const sysCANVASCIRC = 46
|
|
413
|
+
const sysCANVASTEXT = 47
|
|
414
|
+
const sysCANVASLINE = 48
|
|
415
|
+
const sysCANVASSAVE = 49
|
|
416
|
+
const sysCANVASSHOW = 50
|
|
417
|
+
const sysFILEREAD = 51
|
|
418
|
+
const sysFILEWRITE = 52
|
|
419
|
+
const sysFILEAPPEND = 53
|
|
420
|
+
const sysFILEEXISTS = 54
|
|
421
|
+
const sysFILEDELETE = 55
|
|
422
|
+
const sysFILESIZE = 56
|
|
423
|
+
const sysMKDIR = 57
|
|
424
|
+
const sysDIRLIST = 58
|
|
425
|
+
const sysEXEC = 59
|
|
426
|
+
const sysEXECOUTPUT = 60
|
|
427
|
+
const sysGETENV = 61
|
|
428
|
+
const sysSETENV = 62
|
|
429
|
+
const sysOSNAME = 63
|
|
430
|
+
const sysHOSTNAME = 64
|
|
431
|
+
const sysUSERNAME = 65
|
|
432
|
+
const sysCWD = 66
|
|
433
|
+
const sysHOMEDIR = 67
|
|
434
|
+
const sysTERMUXAVAIL = 68
|
|
435
|
+
const sysTERMUXNOTIFY = 69
|
|
436
|
+
const sysTERMUXTOAST = 70
|
|
437
|
+
const sysTERMUXCLIPGET = 71
|
|
438
|
+
const sysTERMUXCLIPSET = 72
|
|
439
|
+
const sysTERMUXBATTERY = 73
|
|
440
|
+
const sysTERMUXVIBRATE = 74
|
|
441
|
+
const sysTERMUXTTS = 75
|
|
442
|
+
const sysTERMUXLOCATION = 76
|
|
443
|
+
const sysTERMUXWIFI = 77
|
|
444
|
+
const sysTERMUXDIALOG = 78
|
|
445
|
+
const sysTERMUXSMS = 79
|
|
446
|
+
const sysPATHJOIN = 80
|
|
447
|
+
const sysPATHBASENAME = 81
|
|
448
|
+
const sysPATHDIRNAME = 82
|
|
449
|
+
const sysPATHABS = 83
|
|
450
|
+
const sysFILECOPY = 84
|
|
451
|
+
const sysFILEMOVE = 85
|
|
452
|
+
const sysDIRREMOVE = 86
|
|
453
|
+
const sysISDIR = 87
|
|
454
|
+
const sysFILEMTIME = 88
|
|
455
|
+
const sysTEMPDIR = 89
|
|
456
|
+
const sysCHDIR = 90
|
|
457
|
+
const sysTIMEMS = 91
|
|
458
|
+
const sysSLEEPMS = 92
|
|
459
|
+
const sysCPUCOUNT = 93
|
|
460
|
+
const sysARCHNAME = 94
|
|
461
|
+
const sysMEMINFO = 95
|
|
462
|
+
const sysISANDROID = 96
|
|
463
|
+
const sysHTTPGET = 97
|
|
464
|
+
const sysHTTPPOST = 98
|
|
465
|
+
const sysDOWNLOAD = 99
|
|
466
|
+
const sysSHA256 = 100
|
|
467
|
+
const sysBASE64ENC = 101
|
|
468
|
+
const sysBASE64DEC = 102
|
|
469
|
+
const sysCLIPGET = 103
|
|
470
|
+
const sysCLIPSET = 104
|
|
471
|
+
const sysNOTIFY = 105
|
|
472
|
+
const sysOPENURL = 106
|
|
473
|
+
const sysANDROIDINTENT = 107
|
|
474
|
+
const sysTERMUXCALL = 108
|
|
475
|
+
const sysTERMUXSHARE = 109
|
|
476
|
+
const sysTERMUXTORCH = 110
|
|
477
|
+
const sysTERMUXVOLUME = 111
|
|
478
|
+
const sysTERMUXBRIGHT = 112
|
|
479
|
+
const sysTERMUXCAMERA = 113
|
|
480
|
+
const sysTERMUXFINGER = 114
|
|
481
|
+
const sysTERMUXSENSOR = 115
|
|
482
|
+
const sysKEYHIT = 116
|
|
483
|
+
const sysKEYGET = 117
|
|
484
|
+
const sysKEYFLUSH = 118
|
|
485
|
+
const sysGUINEW = 119
|
|
486
|
+
const sysGUIUPDATE = 120
|
|
487
|
+
const sysGUICLOSE = 121
|
|
488
|
+
const sysGUICLOSED = 122
|
|
489
|
+
const sysMOUSEX = 123
|
|
490
|
+
const sysMOUSEY = 124
|
|
491
|
+
const sysMOUSEBTN = 125
|
|
492
|
+
const sysAUDIOPOS = 126
|
|
493
|
+
const sysAUDIOBEEP = 127
|
|
494
|
+
const sysGUIACTIVE = 128
|
|
495
|
+
const sysARGC = 129
|
|
496
|
+
const sysARGV = 130
|
|
497
|
+
const sysREADLINE = 131
|
|
498
|
+
const sysAUDIODUR = 132
|
|
499
|
+
const sysAUDIOPLAYING = 133
|
|
500
|
+
const sysAUDIOPAUSE = 134
|
|
501
|
+
const sysAUDIORESUME = 135
|
|
502
|
+
const sysAUDIOLEVEL = 136
|
|
503
|
+
const sysALLOCFRAME = 137
|
|
504
|
+
const sysTIMEUS = 138
|
|
505
|
+
const sysTIMENS = 139
|
|
506
|
+
const sysDLOPEN = 140
|
|
507
|
+
const sysDLSYM = 141
|
|
508
|
+
const sysFFICALL = 142
|
|
509
|
+
const sysFFICALLF = 143
|
|
510
|
+
const sysLIBCLOSE = 144
|
|
511
|
+
const sysHTTPREQ = 145
|
|
512
|
+
const sysHTTPCODE = 146
|
|
513
|
+
const sysTCPDIAL = 147
|
|
514
|
+
const sysTCPSEND = 148
|
|
515
|
+
const sysTCPRECV = 149
|
|
516
|
+
const sysTCPCLOSE = 150
|
|
517
|
+
const sysTCPLISTEN = 151
|
|
518
|
+
const sysTCPACCEPT = 152
|
|
519
|
+
const sysUDPOPEN = 153
|
|
520
|
+
const sysUDPSENDTO = 154
|
|
521
|
+
const sysUDPRECVFROM = 155
|
|
522
|
+
const sysUDPCLOSE = 156
|
|
523
|
+
const sysDNSLOOKUP = 157
|
|
524
|
+
const sysVKBSHOW = 158
|
|
525
|
+
const sysVKBHIDE = 159
|
|
526
|
+
|
|
527
|
+
// SYS 功能号名 (按下标索引, 用于错误信息; 与 isa.py Syscall 名一致)
|
|
528
|
+
var syscallNames = [160]string{
|
|
529
|
+
sysSQRT: "SQRT",
|
|
530
|
+
sysPOW: "POW",
|
|
531
|
+
sysABS: "ABS",
|
|
532
|
+
sysSIN: "SIN",
|
|
533
|
+
sysCOS: "COS",
|
|
534
|
+
sysTAN: "TAN",
|
|
535
|
+
sysFADD: "FADD",
|
|
536
|
+
sysFSUB: "FSUB",
|
|
537
|
+
sysFMUL: "FMUL",
|
|
538
|
+
sysFDIV: "FDIV",
|
|
539
|
+
sysFCMP: "FCMP",
|
|
540
|
+
sysFTOI: "FTOI",
|
|
541
|
+
sysITOF: "ITOF",
|
|
542
|
+
sysRAND: "RAND",
|
|
543
|
+
sysSRAND: "SRAND",
|
|
544
|
+
sysTIME: "TIME",
|
|
545
|
+
sysSTRLEN: "STRLEN",
|
|
546
|
+
sysSTRCMP: "STRCMP",
|
|
547
|
+
sysSTRCPY: "STRCPY",
|
|
548
|
+
sysSTRCAT: "STRCAT",
|
|
549
|
+
sysMALLOC: "MALLOC",
|
|
550
|
+
sysPRINTFLO: "PRINT_FLOAT",
|
|
551
|
+
sysITOA: "ITOA",
|
|
552
|
+
sysFTOA: "FTOA",
|
|
553
|
+
sysPRINTSTR: "PRINT_STR",
|
|
554
|
+
sysSTRCONCAT: "STR_CONCAT",
|
|
555
|
+
sysBOOLSTR: "BOOL_STR",
|
|
556
|
+
sysABORT: "ABORT",
|
|
557
|
+
sysSUBSTR: "SUBSTR",
|
|
558
|
+
sysINDEXOF: "INDEXOF",
|
|
559
|
+
sysTOUPPER: "TOUPPER",
|
|
560
|
+
sysTOLOWER: "TOLOWER",
|
|
561
|
+
sysFLOOR: "FLOOR",
|
|
562
|
+
sysCEIL: "CEIL",
|
|
563
|
+
sysROUND: "ROUND",
|
|
564
|
+
sysATOI: "ATOI",
|
|
565
|
+
sysTRIM: "TRIM",
|
|
566
|
+
sysLTRIM: "LTRIM",
|
|
567
|
+
sysRTRIM: "RTRIM",
|
|
568
|
+
sysAUDIOPLAY: "AUDIOPLAY",
|
|
569
|
+
sysAUDIOSTOP: "AUDIOSTOP",
|
|
570
|
+
sysAUDIOVOL: "AUDIOVOL",
|
|
571
|
+
sysAUDIOWAIT: "AUDIOWAIT",
|
|
572
|
+
sysCANVASNEW: "CANVASNEW",
|
|
573
|
+
sysCANVASSET: "CANVASSET",
|
|
574
|
+
sysCANVASRECT: "CANVASRECT",
|
|
575
|
+
sysCANVASCIRC: "CANVASCIRC",
|
|
576
|
+
sysCANVASTEXT: "CANVASTEXT",
|
|
577
|
+
sysCANVASLINE: "CANVASLINE",
|
|
578
|
+
sysCANVASSAVE: "CANVASSAVE",
|
|
579
|
+
sysCANVASSHOW: "CANVASSHOW",
|
|
580
|
+
sysFILEREAD: "FILEREAD",
|
|
581
|
+
sysFILEWRITE: "FILEWRITE",
|
|
582
|
+
sysFILEAPPEND: "FILEAPPEND",
|
|
583
|
+
sysFILEEXISTS: "FILEEXISTS",
|
|
584
|
+
sysFILEDELETE: "FILEDELETE",
|
|
585
|
+
sysFILESIZE: "FILESIZE",
|
|
586
|
+
sysMKDIR: "MKDIR",
|
|
587
|
+
sysDIRLIST: "DIRLIST",
|
|
588
|
+
sysEXEC: "EXEC",
|
|
589
|
+
sysEXECOUTPUT: "EXECOUTPUT",
|
|
590
|
+
sysGETENV: "GETENV",
|
|
591
|
+
sysSETENV: "SETENV",
|
|
592
|
+
sysOSNAME: "OSNAME",
|
|
593
|
+
sysHOSTNAME: "HOSTNAME",
|
|
594
|
+
sysUSERNAME: "USERNAME",
|
|
595
|
+
sysCWD: "CWD",
|
|
596
|
+
sysHOMEDIR: "HOMEDIR",
|
|
597
|
+
sysTERMUXAVAIL: "TERMUXAVAIL",
|
|
598
|
+
sysTERMUXNOTIFY: "TERMUXNOTIFY",
|
|
599
|
+
sysTERMUXTOAST: "TERMUXTOAST",
|
|
600
|
+
sysTERMUXCLIPGET: "TERMUXCLIPGET",
|
|
601
|
+
sysTERMUXCLIPSET: "TERMUXCLIPSET",
|
|
602
|
+
sysTERMUXBATTERY: "TERMUXBATTERY",
|
|
603
|
+
sysTERMUXVIBRATE: "TERMUXVIBRATE",
|
|
604
|
+
sysTERMUXTTS: "TERMUXTTS",
|
|
605
|
+
sysTERMUXLOCATION: "TERMUXLOCATION",
|
|
606
|
+
sysTERMUXWIFI: "TERMUXWIFI",
|
|
607
|
+
sysTERMUXDIALOG: "TERMUXDIALOG",
|
|
608
|
+
sysTERMUXSMS: "TERMUXSMS",
|
|
609
|
+
sysPATHJOIN: "PATHJOIN",
|
|
610
|
+
sysPATHBASENAME: "PATHBASENAME",
|
|
611
|
+
sysPATHDIRNAME: "PATHDIRNAME",
|
|
612
|
+
sysPATHABS: "PATHABS",
|
|
613
|
+
sysFILECOPY: "FILECOPY",
|
|
614
|
+
sysFILEMOVE: "FILEMOVE",
|
|
615
|
+
sysDIRREMOVE: "DIRREMOVE",
|
|
616
|
+
sysISDIR: "ISDIR",
|
|
617
|
+
sysFILEMTIME: "FILEMTIME",
|
|
618
|
+
sysTEMPDIR: "TEMPDIR",
|
|
619
|
+
sysCHDIR: "CHDIR",
|
|
620
|
+
sysTIMEMS: "TIMEMS",
|
|
621
|
+
sysSLEEPMS: "SLEEPMS",
|
|
622
|
+
sysCPUCOUNT: "CPUCOUNT",
|
|
623
|
+
sysARCHNAME: "ARCHNAME",
|
|
624
|
+
sysMEMINFO: "MEMINFO",
|
|
625
|
+
sysISANDROID: "ISANDROID",
|
|
626
|
+
sysHTTPGET: "HTTPGET",
|
|
627
|
+
sysHTTPPOST: "HTTPPOST",
|
|
628
|
+
sysDOWNLOAD: "DOWNLOAD",
|
|
629
|
+
sysSHA256: "SHA256",
|
|
630
|
+
sysBASE64ENC: "BASE64ENC",
|
|
631
|
+
sysBASE64DEC: "BASE64DEC",
|
|
632
|
+
sysCLIPGET: "CLIPGET",
|
|
633
|
+
sysCLIPSET: "CLIPSET",
|
|
634
|
+
sysNOTIFY: "NOTIFY",
|
|
635
|
+
sysOPENURL: "OPENURL",
|
|
636
|
+
sysANDROIDINTENT: "ANDROIDINTENT",
|
|
637
|
+
sysTERMUXCALL: "TERMUXCALL",
|
|
638
|
+
sysTERMUXSHARE: "TERMUXSHARE",
|
|
639
|
+
sysTERMUXTORCH: "TERMUXTORCH",
|
|
640
|
+
sysTERMUXVOLUME: "TERMUXVOLUME",
|
|
641
|
+
sysTERMUXBRIGHT: "TERMUXBRIGHT",
|
|
642
|
+
sysTERMUXCAMERA: "TERMUXCAMERA",
|
|
643
|
+
sysTERMUXFINGER: "TERMUXFINGER",
|
|
644
|
+
sysTERMUXSENSOR: "TERMUXSENSOR",
|
|
645
|
+
sysKEYHIT: "KEYHIT",
|
|
646
|
+
sysKEYGET: "KEYGET",
|
|
647
|
+
sysKEYFLUSH: "KEYFLUSH",
|
|
648
|
+
sysGUINEW: "GUINEW",
|
|
649
|
+
sysGUIUPDATE: "GUIUPDATE",
|
|
650
|
+
sysGUICLOSE: "GUICLOSE",
|
|
651
|
+
sysGUICLOSED: "GUICLOSED",
|
|
652
|
+
sysMOUSEX: "MOUSEX",
|
|
653
|
+
sysMOUSEY: "MOUSEY",
|
|
654
|
+
sysMOUSEBTN: "MOUSEBTN",
|
|
655
|
+
sysAUDIOPOS: "AUDIOPOS",
|
|
656
|
+
sysAUDIOBEEP: "AUDIOBEEP",
|
|
657
|
+
sysGUIACTIVE: "GUIACTIVE",
|
|
658
|
+
sysARGC: "ARGC",
|
|
659
|
+
sysARGV: "ARGV",
|
|
660
|
+
sysREADLINE: "READLINE",
|
|
661
|
+
sysAUDIODUR: "AUDIODUR",
|
|
662
|
+
sysAUDIOPLAYING: "AUDIOPLAYING",
|
|
663
|
+
sysAUDIOPAUSE: "AUDIOPAUSE",
|
|
664
|
+
sysAUDIORESUME: "AUDIORESUME",
|
|
665
|
+
sysAUDIOLEVEL: "AUDIOLEVEL",
|
|
666
|
+
sysALLOCFRAME: "ALLOCFRAME",
|
|
667
|
+
sysTIMEUS: "TIMEUS",
|
|
668
|
+
sysTIMENS: "TIMENS",
|
|
669
|
+
sysDLOPEN: "DLOPEN",
|
|
670
|
+
sysDLSYM: "DLSYM",
|
|
671
|
+
sysFFICALL: "FFICALL",
|
|
672
|
+
sysFFICALLF: "FFICALLF",
|
|
673
|
+
sysLIBCLOSE: "LIBCLOSE",
|
|
674
|
+
sysHTTPREQ: "HTTPREQ",
|
|
675
|
+
sysHTTPCODE: "HTTPCODE",
|
|
676
|
+
sysTCPDIAL: "TCPDIAL",
|
|
677
|
+
sysTCPSEND: "TCPSEND",
|
|
678
|
+
sysTCPRECV: "TCPRECV",
|
|
679
|
+
sysTCPCLOSE: "TCPCLOSE",
|
|
680
|
+
sysTCPLISTEN: "TCPLISTEN",
|
|
681
|
+
sysTCPACCEPT: "TCPACCEPT",
|
|
682
|
+
sysUDPOPEN: "UDPOPEN",
|
|
683
|
+
sysUDPSENDTO: "UDPSENDTO",
|
|
684
|
+
sysUDPRECVFROM: "UDPRECVFROM",
|
|
685
|
+
sysUDPCLOSE: "UDPCLOSE",
|
|
686
|
+
sysDNSLOOKUP: "DNSLOOKUP",
|
|
687
|
+
sysVKBSHOW: "VKBSHOW",
|
|
688
|
+
sysVKBHIDE: "VKBHIDE",
|
|
689
|
+
}
|