-
Notifications
You must be signed in to change notification settings - Fork 1
/
InstructionCode.hpp
1874 lines (1703 loc) · 121 KB
/
InstructionCode.hpp
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* $Source: /backup/cvsroot/project/pnids/zdk/zls/zvm/InstructionCode.hpp,v $
*
* $Date: 2001/08/11 18:54:42 $
*
* $Revision: 1.3 $
*
* $Name: $
*
* $Author: zls $
*
* Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved.
*
* lisong.zheng@gmail.com
*
* $State: Exp $
*/
#ifndef _ZLS_zvm_InstructionCode_hpp_
#define _ZLS_zvm_InstructionCode_hpp_
#include <zls/zvm/Manifest.hpp>
ZLS_BEGIN_NAMESPACE(zvm)
/**
* @file
* @brief ZVM Version 2.0 指令设计.
<pre>
一、ZVM的指令码大小
ZVM的指令码大小为一个UWORD型,由于ZVM的指令基本上都是直接在指令中将数据类型
区别出来,所以通常指令码的高字节是指令基码,而低字节是ZVM的数据类型的signature(
注意:总是大写字母的).
二、ZVM的变量种类
有两种变量:global variable、stack variable(local variable、local reference
variable、value argument和reference argument).
三、ZVM的各种操作的操作数的表现形式
操作数的表现形式有两种:value和address.
(1)bool等简单类型
(a)在进行+、-等二元和一元操作时,都采用value形式.
(b)在向function传递reference argument时,才采用address形式.
(2)string等Object类型
(a)在进行+、-等二元和一元操作时,都采用address形式.
(b)在向function传递reference argument时,也采用address形式.
(c)在向function传递value argument时,才采用value形式.
四、取值指令
基本上所有的load value指令都有一个操作数来指明"源",只有当"源"是table element
时,才使用没有操作数的load value指令,此时"源table"的地址在stack上被指明了.
注:如果将以下形式的load value指令想象为"数据类型LoadGlobalVariableValue",例如:
"boolLoadGlobalVariableVale",则就比较好理解了.
(1)global variable
--------------------------------------------------------------------------------
loadGlobalVariableValue 'signature-of-bool' variable_index(大小为sizeof(UDWORD))
loadGlobalVariableValue 'signature-of-byte' variable_index
loadGlobalVariableValue 'signature-of-sdword' variable_index
loadGlobalVariableValue 'signature-of-udword' variable_index
loadGlobalVariableValue 'signature-of-sqword' variable_index
loadGlobalVariableValue 'signature-of-uqword' variable_index
loadGlobalVariableValue 'signature-of-double' variable_index
loadGlobalVariableValue 'signature-of-string' variable_index
注:string是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadGlobalVariableValue 'signature-of-rope' variable_index
注:rope是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadGlobalVariableValue 'signature-of-ipv4address' variable_index
注:ipv4address是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadGlobalVariableValue 'signature-of-pport' variable_index
注:pport是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadGlobalVariableValue 'signature-of-table-prefix' variable_index
注:table是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
--------------------------------------------------------------------------------
(2)local variable和value argument
--------------------------------------------------------------------------------
loadStackVariableValue 'signature-of-bool' bp_offset(大小为SWORD)
loadStackVariableValue 'signature-of-byte' bp_offset
loadStackVariableValue 'signature-of-sdword' bp_offset
loadStackVariableValue 'signature-of-udword' bp_offset
loadStackVariableValue 'signature-of-sqword' bp_offset
loadStackVariableValue 'signature-of-uqword' bp_offset
loadStackVariableValue 'signature-of-double' bp_offset
loadStackVariableValue 'signature-of-string' bp_offset
注:string是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadStackVariableValue 'signature-of-rope' bp_offset
注:rope是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadStackVariableValue 'signature-of-ipv4address' bp_offset
注:ipv4address是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadStackVariableValue 'signature-of-pport' bp_offset
注:pport是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadStackVariableValue 'signature-of-table-prefix' bp_offset
注:table是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
--------------------------------------------------------------------------------
(3)local reference variable和reference arugment
--------------------------------------------------------------------------------
indirectLoadStackVariableValue 'signature-of-bool' bp_offset
indirectLoadStackVariableValue 'signature-of-byte' bp_offset
indirectLoadStackVariableValue 'signature-of-sdword' bp_offset
indirectLoadStackVariableValue 'signature-of-udword' bp_offset
indirectLoadStackVariableValue 'signature-of-sqword' bp_offset
indirectLoadStackVariableValue 'signature-of-uqword' bp_offset
indirectLoadStackVariableValue 'signature-of-double' bp_offset
indirectLoadStackVariableValue 'signature-of-string' bp_offset
注:string是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
indirectLoadStackVariableValue 'signature-of-rope' bp_offset
注:rope是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
indirectLoadStackVariableValue 'signature-of-ipv4address' bp_offset
注:ipv4address是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
indirectLoadStackVariableValue 'signature-of-pport' bp_offset
注:pport是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
indirectLoadStackVariableValue 'signature-of-table-prefix' bp_offset
注:table是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
--------------------------------------------------------------------------------
(4)table element
--------------------------------------------------------------------------------
注:如果将以下形式的load element value指令想象为"load表数据类型TableElementValueBy键数据类型",
例如:"loadBoolTableElementValeBySDWORD",则就比较好理解了.
注:在load element value指令的前面一定有两条类似如下的指令:
"load address of table"
"load value or address of table key"
loadBoolTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadByteTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadSDWORDTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadUDWORDTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadSQWORDTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadUQWORDTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadDoubleTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
loadStringTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
注:string是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadRopeTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
注:rope是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadIPv4AddressTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
注:ipv4address是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
loadPPortTableElementValue '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element value]
注:ipv4address是object,因此load value要进行deep copy
注:该指令只被用在向function传递value argument时
--------------------------------------------------------------------------------
(5)Object的中间计算结果
--------------------------------------------------------------------------------
注:这些间接取值的指令用来将Object型变量进行计算后的结果(一个在ZVM stack顶的
object-address)转换为向function传递value argument所需要的object-value形式.
indirectLoadValueFromAddress 'signature-of-string'
indirectLoadValueFromAddress 'signature-of-rope'
indirectLoadValueFromAddress 'signature-of-ipv4address'
indirectLoadValueFromAddress 'signature-of-pport'
indirectLoadValueFromAddress 'signature-of-table'
--------------------------------------------------------------------------------
五、取地址指令
基本上所有的load address指令都有一个TZVMIndex型的操作数来指明"源",只有当"源"
是table element时,才使用没有操作数的load address指令,此时"源table"的地址在stack
上被指明了.
注:如果将以下形式的load address指令想象为"数据类型LoadGlobalVariableAddress",例如:
"boolLoadGlobalVariableAddress",则就比较好理解了.
(1)global variable
--------------------------------------------------------------------------------
loadGlobalVariableAddress 'signature-of-bool' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.b)
loadGlobalVariableAddress 'signature-of-byte' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.uch)
loadGlobalVariableAddress 'signature-of-sdword' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.sdw)
loadGlobalVariableAddress 'signature-of-udword' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.udw)
loadGlobalVariableAddress 'signature-of-sqword' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.sqw)
loadGlobalVariableAddress 'signature-of-uqword' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.uqw)
loadGlobalVariableAddress 'signature-of-double' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.df)
loadGlobalVariableAddress 'signature-of-string' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.pciString)
注:虽然string是object,内部实现已经是采用pointer了,但是为了语义上的统一,
我还是决定采用pointer of pointer的方式,这也可以避免以后有意想不到的边界
效应:当那个CSlot.pciString已经指向了另一个地址了,而以前的pointer-copy者
却还在继续指向已经被free的地址!
loadGlobalVariableAddress 'signature-of-rope' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.pciRope)
注:虽然rope是object,内部实现已经是采用pointer了,但是为了语义上的统一,
我还是决定采用pointer of pointer的方式,这也可以避免以后有意想不到的边界
效应:当那个CSlot.pciRope已经指向了另一个地址了,而以前的pointer-copy者
却还在继续指向已经被free的地址!
loadGlobalVariableAddress 'signature-of-ipv4address' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.pciIPv4Address)
注:同string
loadGlobalVariableAddress 'signature-of-pport' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.pciPPort)
注:同string
loadGlobalVariableAddress 'signature-of-table-prefix' variable_index
注:CSlot.pvAddress = &(这个global variable的CSlot.pciTable)
注:同string
--------------------------------------------------------------------------------
(2)local variable和value argument
--------------------------------------------------------------------------------
loadStackVariableAddress 'signature-of-bool' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.b)
loadStackVariableAddress 'signature-of-byte' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.uch)
loadStackVariableAddress 'signature-of-sdword' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.sdw)
loadStackVariableAddress 'signature-of-udword' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.udw)
loadStackVariableAddress 'signature-of-sqword' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.sqw)
loadStackVariableAddress 'signature-of-uqword' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.uqw)
loadStackVariableAddress 'signature-of-double' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.df)
loadStackVariableAddress 'signature-of-string' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.pciString)
注:虽然string是object,内部实现已经是采用pointer了,但是为了语义上的统一,
我还是决定采用pointer of pointer的方式.
loadStackVariableAddress 'signature-of-rope' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.pciRope)
注:虽然rope是object,内部实现已经是采用pointer了,但是为了语义上的统一,
我还是决定采用pointer of pointer的方式.
loadStackVariableAddress 'signature-of-ipv4address' bp_offset
注:CSlot.pvAddress = &(这个stack variable的CSlot.pciIPv4Address)
注:同string
loadStackVariableAddress 'signature-of-pport' bp_offset
注:CSlot.pvAddress = &(这个Stack variable的CSlot.pciPPort)
注:同string
loadStackVariableAddress 'signature-of-table-prefix' bp_offset
注:CSlot.pvAddress = &(这个Stack variable的CSlot.pciTable)
注:同string
--------------------------------------------------------------------------------
(3)local reference variable和reference argument
--------------------------------------------------------------------------------
loadReferenceStackVariableReferenceToAddress bp_offset
注:取得local reference variable或reference argument中的reference to address
注:由于local reference variable或reference argument这个slot内的东西已经是
address了,所以这个指令其实只是再将这个slot按位copy到一个新slot而已.
--------------------------------------------------------------------------------
(4)table element
--------------------------------------------------------------------------------
loadBoolTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
stack细节:
指令执行之前
CSlot {
void * pvAddress = &(CSlot-of-variable.pciTable);
};
CSlot {
bool b = CSlot-of-variable.b;
或
UCHAR uch = CSlot-of-variable.uch;
或
...
或
void * pvAddress = &(CSlot-of-key-variable.对象型member);
};
指令执行之后
CSlot {
void * pvAddress = &(CSlot-of-element.b);
};
loadByteTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadSDWORDTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadUDWORDTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadSQWORDTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadUQWORDTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadDoubleTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadStringTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
stack细节:
指令执行之前
CSlot {
void * pvAddress = &(CSlot-of-variable.pciTable);
};
CSlot {
bool b = CSlot-of-variable.b;
或
UCHAR uch = CSlot-of-variable.uch;
或
...
或
void * pvAddress = &(CSlot-of-key-variable.对象型member);
};
指令执行之后
CSlot {
void * pvAddress = &(CSlot-of-element.pciString);
};
loadRopeTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadIPv4AddressTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
loadPPortTableElementAddress '?'(Key signature)
stack:[table_address, table_key(value or address)] ==> [element address]
--------------------------------------------------------------------------------
(5)object型的function result
注:2001/7/17这些指令被Discarded了!
--------------------------------------------------------------------------------
convertValueToAddress 'signature-of-string'
注:如果某个function的返回是string等object型,则在function后必须将result argument
转化为一个temp address,这样才符合ZVM中object型的运算规定。
可能在ZVM中有这样一个特殊寄存器:
struct TZVMStringRegister {
CZVMString * pciString;
TZVMStringRegister()
: pciString(0)
{ }
~TZVMStringRegister()
{ delete pciString; }
void Replace(CZVMString * pciNeedStoredString)
{
delete pciString;
pciString = pciNeedStoredString;
}
};
然后转换时先pop出那个CSlot,然后再
TZVMStringRegister.Replace(CSlot.pciString)
最后再
push(CSlot(&(TZVMStringRegister.pciString))
并标识为SLOT_TAG_ADDRESS_OF_STRING_OBJECT即可.
convertValueToAddress 'signature-of-rope'
convertValueToAddress 'signature-of-ipv4address'
convertValueToAddress 'signature-of-pport'
convertValueToAddress 'signature-of-table'
--------------------------------------------------------------------------------
六、取Constant值和地址指令
何时采用value、何时采用address呢?
(1)当ZVM的操作符需要的是value时,就采用value形式;当ZVM的操作符需要的是
address时,就采用address形式.
(2)当向function传递value argument时,就采用value形式.
(3)当向function传递reference argument时,现在还不支持constant element被作为
reference argument.
(1)load constant value
--------------------------------------------------------------------------------
loadConstantValue 'signature-of-bool' 0或1(1 byte)
loadConstantValue 'signature-of-byte' UCHAR(1 byte)
loadConstantValue 'signature-of-sdword' sdword(4 byte)
注:对于sdword型,由于其占用的字节数与TZVMIndex一样,因此可直接将sdword-literal
作为指令操作数,而不再使用index到constant pool去查询了.
loadConstantValue 'signature-of-udword' udword(4 byte)
注:对于udword型,由于其占用的字节数与TZVMIndex一样,因此可直接将udword-literal
作为指令操作数,而不再使用index到constant pool去查询了.
loadConstantValue 'signature-of-sqword' index(TZVMIndex)
loadConstantValue 'signature-of-uqword' index(TZVMIndex)
loadConstantValue 'signature-of-double' index(TZVMIndex)
loadConstantValue 'signature-of-string' index(TZVMIndex)
loadConstantValue 'signature-of-rope' index(TZVMIndex)
loadConstantValue 'signature-of-ipv4address' index(TZVMIndex)
loadConstantValue 'signature-of-pport' index(TZVMIndex)
--------------------------------------------------------------------------------
(2)load constant address
--------------------------------------------------------------------------------
loadConstantAddress 'signature-of-bool' 0或1
loadConstantAddress 'signature-of-byte' UCHAR(1 byte)
loadConstantAddress 'signature-of-sdword' sdword
loadConstantAddress 'signature-of-udword' udword
loadConstantAddress 'signature-of-sqword' sdword
loadConstantAddress 'signature-of-uqword' udword
loadConstantAddress 'signature-of-double' index
注:上面的七条指令只是先保留着,现在还不打算支持.
loadConstantAddress 'signature-of-string' index
loadConstantAddress 'signature-of-rope' index
loadConstantAddress 'signature-of-ipv4address' index
loadConstantAddress 'signature-of-pport' index
注:上面的三条指令目前还不允许用于reference argument.
--------------------------------------------------------------------------------
七、assign操作符
assign操作符将产生store指令。基本上所有的store指令都有一个操作数来指明"目的",
只有当存贮到table element时,才使用没有操作数的store指令,此时"目的element"的地址
在stack上被指明了.
注:store指令都采用deep copy方式,因此如果操作数是object型,则也是deep copy content.
(1)store value to global variable
--------------------------------------------------------------------------------
storeToGlobalVariable 'signature-of-bool' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-byte' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-sdword' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-udword' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-sqword' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-uqword' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-double' variable_index
stack: [value] ==> []
storeToGlobalVariable 'signature-of-string' variable_index
stack: [address] ==> []
注:string是object,所以在stack顶上的右值是一个address
storeToGlobalVariable 'signature-of-rope' variable_index
stack: [address] ==> []
注:rope是object,所以在stack顶上的右值是一个address
storeToGlobalVariable 'signature-of-ipv4address' variable_index
stack: [address] ==> []
注:ipv4address是object,所以在stack顶上的右值是一个address
storeToGlobalVariable 'signature-of-pport' variable_index
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
storeToGlobalVariable 'signature-of-pport' variable_index
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
storeToGlobalVariable 'signature-of-table-prefix' variable_index
stack: [address] ==> []
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(2)store value to local variable和value argument
--------------------------------------------------------------------------------
storeToStackVariable 'signature-of-bool' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-byte' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-sdword' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-udword' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-sqword' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-uqword' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-double' bp_offset
stack: [value] ==> []
storeToStackVariable 'signature-of-string' bp_offset
stack: [address] ==> []
注:string是object,所以在stack顶上的右值是一个address
storeToStackVariable 'signature-of-rope' bp_offset
stack: [address] ==> []
注:rope是object,所以在stack顶上的右值是一个address
storeToStackVariable 'signature-of-ipv4address' bp_offset
stack: [address] ==> []
注:ipv4address是object,所以在stack顶上的右值是一个address
storeToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
storeToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
storeToStackVariable 'signature-of-table-prefix' bp_offset
stack: [address] ==> []
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(3)store value to local reference variable和reference argument
--------------------------------------------------------------------------------
indirectStoreToStackVariable 'signature-of-bool' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-byte' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-sdword' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-udword' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-sqword' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-uqword' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-double' bp_offset
stack: [value] ==> []
indirectStoreToStackVariable 'signature-of-string' bp_offset
stack: [address] ==> []
注:string是object,所以在stack顶上的右值是一个address
indirectStoreToStackVariable 'signature-of-rope' bp_offset
stack: [address] ==> []
注:rope是object,所以在stack顶上的右值是一个address
indirectStoreToStackVariable 'signature-of-ipv4address' bp_offset
stack: [address] ==> []
注:ipv4address是object,所以在stack顶上的右值是一个address
indirectStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
indirectStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
indirectStoreToStackVariable 'signature-of-table-prefix' bp_offset
stack: [address] ==> []
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(4)store value to table element
注:在store to table element指令的前面一定有几条类似如下的指令:
"load address of table"
"load value or address of table key"
"load ? table element address by ? key"
"load value or address of source variable"
--------------------------------------------------------------------------------
storeToAddress 'signature-of-bool'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-byte'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-sdword'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-udword'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-sqword'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-uqword'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-double'
stack: [table-element-address, value] ==> []
storeToAddress 'signature-of-string'
stack: [table-element-address, address] ==> []
注:string是object,所以在stack顶上的右值是一个address
storeToAddress 'signature-of-rope'
stack: [table-element-address, address] ==> []
注:rope是object,所以在stack顶上的右值是一个address
storeToAddress 'signature-of-ipv4address'
stack: [table-element-address, address] ==> []
注:ipv4address是object,所以在stack顶上的右值是一个address
storeToAddress 'signature-of-pport'
stack: [table-element-address, address] ==> []
注:pport是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(5)assign reference-to-address to local reference variable(reference argument不算)
--------------------------------------------------------------------------------
assignReferenceAddressToReferenceStackVariable 'signature-of-type'
stack: [a-address] ==> []
注:这些指令用于初始化reference stack variable引用到的Address.
--------------------------------------------------------------------------------
八、nested assign操作符
(1)store value to global variable
--------------------------------------------------------------------------------
nestedStoreToGlobalVariable 'signature-of-bool' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-byte' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-sdword' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-udword' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-sqword' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-uqword' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-double' variable_index
stack: [value] ==> [value]
nestedStoreToGlobalVariable 'signature-of-string' variable_index
stack: [address] ==> [address]
注:string是object,所以在stack顶上的右值是一个address
nestedStoreToGlobalVariable 'signature-of-rope' variable_index
stack: [address] ==> [address]
注:rope是object,所以在stack顶上的右值是一个address
nestedStoreToGlobalVariable 'signature-of-ipv4address' variable_index
stack: [address] ==> [address]
注:ipv4address是object,所以在stack顶上的右值是一个address
nestedStoreToGlobalVariable 'signature-of-pport' variable_index
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
nestedStoreToGlobalVariable 'signature-of-pport' variable_index
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
nestedStoreToGlobalVariable 'signature-of-table-prefix' variable_index
stack: [address] ==> [address]
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(2)store value to local variable和value argument
--------------------------------------------------------------------------------
nestedStoreToStackVariable 'signature-of-bool' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-byte' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-sdword' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-udword' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-sqword' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-uqword' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-double' bp_offset
stack: [value] ==> [value]
nestedStoreToStackVariable 'signature-of-string' bp_offset
stack: [address] ==> [address]
注:string是object,所以在stack顶上的右值是一个address
nestedStoreToStackVariable 'signature-of-rope' bp_offset
stack: [address] ==> [address]
注:rope是object,所以在stack顶上的右值是一个address
nestedStoreToStackVariable 'signature-of-ipv4address' bp_offset
stack: [address] ==> [address]
注:ipv4address是object,所以在stack顶上的右值是一个address
nestedStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
nestedStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
nestedStoreToStackVariable 'signature-of-table-prefix' bp_offset
stack: [address] ==> [address]
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(3)store value to local reference variable和reference argument
--------------------------------------------------------------------------------
indirectNestedStoreToStackVariable 'signature-of-bool' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-byte' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-sdword' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-udword' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-sqword' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-uqword' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-double' bp_offset
stack: [value] ==> [value]
indirectNestedStoreToStackVariable 'signature-of-string' bp_offset
stack: [address] ==> [address]
注:string是object,所以在stack顶上的右值是一个address
indirectNestedStoreToStackVariable 'signature-of-rope' bp_offset
stack: [address] ==> [address]
注:rope是object,所以在stack顶上的右值是一个address
indirectNestedStoreToStackVariable 'signature-of-ipv4address' bp_offset
stack: [address] ==> [address]
注:ipv4address是object,所以在stack顶上的右值是一个address
indirectNestedStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
indirectNestedStoreToStackVariable 'signature-of-pport' bp_offset
stack: [address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
indirectNestedStoreToStackVariable 'signature-of-table-prefix' bp_offset
stack: [address] ==> [address]
注:table是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
(4)store value to table element
--------------------------------------------------------------------------------
nestedStoreToAddress 'signature-of-bool'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-byte'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-sdword'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-udword'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-sqword'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-uqword'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-double'
stack: [table-element-address, value] ==> [value]
nestedStoreToAddress 'signature-of-string'
stack: [table-element-address, address] ==> [address]
注:string是object,所以在stack顶上的右值是一个address
nestedStoreToAddress 'signature-of-rope'
stack: [table-element-address, address] ==> [address]
注:rope是object,所以在stack顶上的右值是一个address
nestedStoreToAddress 'signature-of-ipv4address'
stack: [table-element-address, address] ==> [address]
注:ipv4address是object,所以在stack顶上的右值是一个address
nestedStoreToAddress 'signature-of-pport'
stack: [table-element-address, address] ==> [address]
注:pport是object,所以在stack顶上的右值是一个address
--------------------------------------------------------------------------------
九)算术、比较、cast指令
(1)二元指令
logicOr 'signature-char'
弹出2个value或address,将它们进行逻辑or,再将结果一个新value或新address压入到stack顶.
logicAnd 'signature-char'
bitOr 'signature-char'
bitXor 'signature-char'
bitAnd 'signature-char'
notEqual 'signature-char'
equal 'signature-char'
less 'signature-char'
great 'signature-char'
lessEqual 'signature-char'
greatEqual 'signature-char'
shiftLeft 'signature-char'
弹出一个'signature-char'型的value1和一个udword型value2,然后tmp=value1<<value2,
再将tmp压入stack中.
shiftRight 'signature-char'
弹出一个'signature-char'型的value1和一个udword型value2,然后tmp=value1>>value2,
再将tmp压入stack中.
plus 'signature-char'
注:2001/7/17: 对于string plus,则还需要一个指令操作数来指定plus的结果存贮到哪个临时变量中.
注:2001/8/10: 对于rope plus,则还需要一个指令操作数来指定plus的结果存贮到哪个临时变量中.
minus 'signature-char'
multi 'signature-char'
div 'signature-char'
mod 'signature-char'
(2)一元指令
inc 'signature-char'
弹出一个address,进行++prefix,然后再将结果一个新value压入到stack顶.
注:操作数必须是简单类型数值变量.
dec 'signature-char'
弹出一个address,进行--prefix,然后再将结果一个新value压入到stack顶.
注:操作数必须是简单类型数值变量.
postInc 'signature-char'
弹出一个address,进行postfix++,然后再将结果一个新value压入到stack顶.
注:操作数必须是简单类型数值变量.
postDec 'signature-char'
弹出一个address,进行postfix--,然后再将结果一个新value压入到stack顶.
注:操作数必须是简单类型数值变量.
unaryPlus 'signature-char'
弹出一个value,进行unaryPlus,然后再将结果一个新value压入到stack顶.
unaryMinus 'signature-char'
弹出一个value,进行unaryMinus,然后再将结果一个新value压入到stack顶.
bitNot 'signature-char'
弹出一个value,进行bNot,然后再将结果一个新value压入到stack顶.
logicNot 'signature-char'
弹出一个value,进行lNot,然后再将结果一个新value压入到stack顶.
(3)cast指令
boolToByte
弹出一个value,将其cast为byte,然后再将结果压入到stack顶.
boolToSDWORD
boolToUDWORD
boolToSQWORD
boolToUQWORD
byteToBool
byteToSDWORD
byteToUDWORD
byteToSQWORD
byteToUQWORD
byteToDouble
sdwordToBool
sdwordToByte
sdwordToUDWORD
sdwordToSQWORD
sdwordToUQWORD
sdwordToDouble
udwordToBool
udwordToByte
udwordToSDWORD
udwordToSQWORD
udwordToUQWORD
udwordToDouble
sqwordToBool
sqwordToByte
sqwordToSDWORD
sqwordToUDWORD
sqwordToUQWORD
sqwordToDouble
uqwordToBool
uqwordToByte
uqwordToSDWORD
uqwordToUDWORD
uqwordToSQWORD
uqwordToDouble
doubleToByte
doubleToSDWORD
doubleToUDWORD
doubleToSQWORD
doubleToUQWORD
十、Stack操作指令
(1)pop
pop 'signature-of-simple-type'
弹出一个简单类型
pop 'signature-of-string'
弹出一个string型,并做内存析构
pop 'signature-of-rope'
弹出一个rope型,并做内存析构
pop 'signature-of-ipv4address'
弹出一个ipv4address型,并做内存析构
pop 'signature-of-pport'
弹出一个pport型,并做内存析构
pop 'signature-of-table'
弹出一个table型,并做内存析构
(2)ret
从stack顶不断地弹出一个个element,可能需同时对该element做一些内存析构工作。
如果弹出的element是saved-BP则恢复BP的值;直至弹出saved-PC为止,则停止pop,恢复
PC并跳转到PC指示指令处.
(3)pushBP
将BP寄存器的值压入stack顶,同时还将push完成后当前的SP寄存器值存储到BP寄存器中.
(4)construct 'signature-char'
在stack顶上construct一个相应类型的stack variable.
(5)constructTable 'signature-char'
在stack顶上construct一个相应类型的table型stack variable.
(6)constructReference 'signature-char'
在stack顶上construct一个相应类型的reference型stack variable.
(7)quickConstructObject 'object-type-signature-char' temp_variable_bp_offset
在stack顶上construct一个相应(Object)类型的stack variable,但是这个
object variable的内存却是直接从某个temp object stack variable借来的,即
它可以被看作是那个temp object stack variable的shadow.
十一、PC转移操作
(1)falseJump 'signature-char' code_label_offset(SDWORD)
从stack顶弹出一个'signature-char'型element,然后判断其为false否再跳转,此时
的跳转是将falseJump跟随的操作数code_label_offset加到PC上,然后这样PC就自然实现了
转移.
注:code_label_offset的数据类型是TZVMIndex,即必须将code_label_offset作为有符号
数来处理,这样才能实现PC的向前跳转.
注:采用offset而不是直接的code_label的原因是:因为在我的ZVM的实现中,PC寄存器被
设计为一个代码流指针,因此直接的code_label是没法使用的.
(2)unlimitJump code_label_offset(SDWORD)
无条件地跳转到指定的code_label处,此时的跳转是将unlimitJump跟随的操作数
code_label_offset加到PC上,然后这样PC就自然实现了转移.
(3)call function_index
将PC转到function_index所指的function的开始代码处.
(4)falseCircuitJump 'signature-char' code_label_offset(SDWORD)
检测stack顶上的那个'signature-char'型element,判断其为false否再决定是否
进行Logic AND短路跳转,短路跳转前要先将原来ZVM stack顶的那个element偷改为bool
型false值,然后再调整PC寄存器.
(5)trueCircuitJump 'signature-char' code_label_offset(SDWORD)
检测stack顶上的那个'signature-char'型element,判断其为true否再决定是否
进行Logic OR短路跳转,短路跳转前要先将原来ZVM stack顶的那个element偷改为bool
型true值,然后再调整PC寄存器.
</pre>
*/
/**
* @name 取值指令
*/
//@{
const TZVMICode ZVM_loadGlobalVariableValue = 0x0100;
const TZVMICode ZVM_loadBoolGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadByteGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadSQWORDGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadUQWORDGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadDoubleGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadStringGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadRopeGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadIPv4AddressGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadPPortGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadTableGlobalVariableValue = (ZVM_loadGlobalVariableValue | CchZVM_TABLE_TYPE_TAG);
const TZVMICode ZVM_loadStackVariableValue = 0x0200;
const TZVMICode ZVM_loadBoolStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadByteStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadSQWORDStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadUQWORDStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadDoubleStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadStringStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadRopeStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadIPv4AddressStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadPPortStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadTableStackVariableValue = (ZVM_loadStackVariableValue | CchZVM_TABLE_TYPE_TAG);
const TZVMICode ZVM_indirectLoadStackVariableValue = 0x0300;
const TZVMICode ZVM_indirectLoadBoolStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_indirectLoadByteStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_indirectLoadSDWORDStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_indirectLoadUDWORDStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_indirectLoadSQWORDStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_indirectLoadUQWORDStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_indirectLoadDoubleStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_indirectLoadStringStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_indirectLoadRopeStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_indirectLoadIPv4AddressStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_indirectLoadPPortStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_indirectLoadTableStackVariableValue = (ZVM_indirectLoadStackVariableValue | CchZVM_TABLE_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValue = 0x0400;
const TZVMICode ZVM_loadBoolTableElementValueByBoolKey = (ZVM_loadBoolTableElementValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByByteKey = (ZVM_loadBoolTableElementValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueBySDWORDKey = (ZVM_loadBoolTableElementValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByUDWORDKey = (ZVM_loadBoolTableElementValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueBySQWORDKey = (ZVM_loadBoolTableElementValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByUQWORDKey = (ZVM_loadBoolTableElementValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByDoubleKey = (ZVM_loadBoolTableElementValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByStringKey = (ZVM_loadBoolTableElementValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByRopeKey = (ZVM_loadBoolTableElementValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByIPv4AddressKey = (ZVM_loadBoolTableElementValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadBoolTableElementValueByPPortKey = (ZVM_loadBoolTableElementValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValue = 0x0500;
const TZVMICode ZVM_loadByteTableElementValueByBoolKey = (ZVM_loadByteTableElementValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByByteKey = (ZVM_loadByteTableElementValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueBySDWORDKey = (ZVM_loadByteTableElementValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByUDWORDKey = (ZVM_loadByteTableElementValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueBySQWORDKey = (ZVM_loadByteTableElementValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByUQWORDKey = (ZVM_loadByteTableElementValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByDoubleKey = (ZVM_loadByteTableElementValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByStringKey = (ZVM_loadByteTableElementValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByRopeKey = (ZVM_loadByteTableElementValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByIPv4AddressKey = (ZVM_loadByteTableElementValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadByteTableElementValueByPPortKey = (ZVM_loadByteTableElementValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValue = 0x0600;
const TZVMICode ZVM_loadSDWORDTableElementValueByBoolKey = (ZVM_loadSDWORDTableElementValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByByteKey = (ZVM_loadSDWORDTableElementValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueBySDWORDKey = (ZVM_loadSDWORDTableElementValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByUDWORDKey = (ZVM_loadSDWORDTableElementValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueBySQWORDKey = (ZVM_loadSDWORDTableElementValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByUQWORDKey = (ZVM_loadSDWORDTableElementValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByDoubleKey = (ZVM_loadSDWORDTableElementValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByStringKey = (ZVM_loadSDWORDTableElementValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByRopeKey = (ZVM_loadSDWORDTableElementValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByIPv4AddressKey = (ZVM_loadSDWORDTableElementValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadSDWORDTableElementValueByPPortKey = (ZVM_loadSDWORDTableElementValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValue = 0x0700;
const TZVMICode ZVM_loadUDWORDTableElementValueByBoolKey = (ZVM_loadUDWORDTableElementValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByByteKey = (ZVM_loadUDWORDTableElementValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueBySDWORDKey = (ZVM_loadUDWORDTableElementValue | CchZVM_SDWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByUDWORDKey = (ZVM_loadUDWORDTableElementValue | CchZVM_UDWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueBySQWORDKey = (ZVM_loadUDWORDTableElementValue | CchZVM_SQWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByUQWORDKey = (ZVM_loadUDWORDTableElementValue | CchZVM_UQWORD_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByDoubleKey = (ZVM_loadUDWORDTableElementValue | CchZVM_DOUBLE_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByStringKey = (ZVM_loadUDWORDTableElementValue | CchZVM_STRING_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByRopeKey = (ZVM_loadUDWORDTableElementValue | CchZVM_ROPE_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByIPv4AddressKey = (ZVM_loadUDWORDTableElementValue | CchZVM_IPv4ADDR_TYPE_TAG);
const TZVMICode ZVM_loadUDWORDTableElementValueByPPortKey = (ZVM_loadUDWORDTableElementValue | CchZVM_PPORT_TYPE_TAG);
const TZVMICode ZVM_loadSQWORDTableElementValue = 0x0800;
const TZVMICode ZVM_loadSQWORDTableElementValueByBoolKey = (ZVM_loadSQWORDTableElementValue | CchZVM_BOOL_TYPE_TAG);
const TZVMICode ZVM_loadSQWORDTableElementValueByByteKey = (ZVM_loadSQWORDTableElementValue | CchZVM_BYTE_TYPE_TAG);
const TZVMICode ZVM_loadSQWORDTableElementValueBySDWORDKey = (ZVM_loadSQWORDTableElementValue | CchZVM_SDWORD_TYPE_TAG);