Skip to content

Commit 3f105fd

Browse files
committed
Fix: some comments for OpCode
1 parent a1dbc01 commit 3f105fd

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/Neo.VM/OpCode.cs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ public enum OpCode : byte
14591459
XOR = 0x93,
14601460

14611461
/// <summary>
1462-
/// Returns 1 if the inputs are exactly equal, 0 otherwise.
1462+
/// Returns true if the inputs are exactly equal, false otherwise.
14631463
///
14641464
/// <example> a.Equals(b) </example>
14651465
///
@@ -1679,7 +1679,7 @@ public enum OpCode : byte
16791679
SHR = 0xA9,
16801680

16811681
/// <summary>
1682-
/// If the input is 0 or 1, it is flipped. Otherwise, the output will be 0.
1682+
/// If the input is false, null or zero, the output is true, false otherwise.
16831683
///
16841684
/// <example> !a </example>
16851685
///
@@ -1691,7 +1691,7 @@ public enum OpCode : byte
16911691
NOT = 0xAA,
16921692

16931693
/// <summary>
1694-
/// If both a and b are not 0, the output is 1. Otherwise, 0.
1694+
/// If both a and b are not zero(or null, false), the output is true, false otherwise.
16951695
///
16961696
/// <example> b &amp;&amp; a </example>
16971697
///
@@ -1703,7 +1703,7 @@ public enum OpCode : byte
17031703
BOOLAND = 0xAB,
17041704

17051705
/// <summary>
1706-
/// If a or b is not 0, the output is 1. Otherwise, 0.
1706+
/// If a or b is not zero(or null, false), the output is true, false otherwise.
17071707
///
17081708
/// <example> b || a </example>
17091709
///
@@ -1715,7 +1715,7 @@ public enum OpCode : byte
17151715
BOOLOR = 0xAC,
17161716

17171717
/// <summary>
1718-
/// Returns 0 if the input is 0. 1 otherwise.
1718+
/// Returns true if the input is 0, false otherwise.
17191719
///
17201720
/// <example> a != 0 </example>
17211721
///
@@ -1727,7 +1727,7 @@ public enum OpCode : byte
17271727
NZ = 0xB1,
17281728

17291729
/// <summary>
1730-
/// Returns 1 if the numbers are equal, 0 otherwise.
1730+
/// Returns true if the items are equal, false otherwise.
17311731
///
17321732
/// <example> b == a </example>
17331733
///
@@ -1739,7 +1739,7 @@ public enum OpCode : byte
17391739
NUMEQUAL = 0xB3,
17401740

17411741
/// <summary>
1742-
/// Returns 1 if the numbers are not equal, 0 otherwise.
1742+
/// Returns true if the items are not equal, false otherwise.
17431743
///
17441744
/// <example> b != a </example>
17451745
///
@@ -1751,7 +1751,7 @@ public enum OpCode : byte
17511751
NUMNOTEQUAL = 0xB4,
17521752

17531753
/// <summary>
1754-
/// Returns 1 if a is less than b, 0 otherwise.
1754+
/// Returns true if a is less than b, false otherwise.
17551755
///
17561756
/// <example> b>a </example>
17571757
///
@@ -1763,7 +1763,7 @@ public enum OpCode : byte
17631763
LT = 0xB5,
17641764

17651765
/// <summary>
1766-
/// Returns 1 if a is less than or equal to b, 0 otherwise.
1766+
/// Returns true if a is less than or equal to b, otherwise false.
17671767
///
17681768
/// <example> b>=a </example>
17691769
///
@@ -1775,7 +1775,7 @@ public enum OpCode : byte
17751775
LE = 0xB6,
17761776

17771777
/// <summary>
1778-
/// Returns 1 if a is greater than b, 0 otherwise.
1778+
/// Returns true if a is greater than b, otherwise false.
17791779
///
17801780
/// <remarks>
17811781
/// Push: 1 item(s)
@@ -1785,7 +1785,7 @@ public enum OpCode : byte
17851785
GT = 0xB7,
17861786

17871787
/// <summary>
1788-
/// Returns 1 if a is greater than or equal to b, 0 otherwise.
1788+
/// Returns true if a is greater than or equal to b, otherwise false.
17891789
///
17901790
/// <remarks>
17911791
/// Push: 1 item(s)
@@ -1815,7 +1815,7 @@ public enum OpCode : byte
18151815
MAX = 0xBA,
18161816

18171817
/// <summary>
1818-
/// Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.
1818+
/// Returns true if x is within the specified range (left-inclusive), otherwise false.
18191819
///
18201820
/// <remarks>
18211821
/// Push: 1 item(s)
@@ -1889,7 +1889,8 @@ public enum OpCode : byte
18891889
NEWARRAY = 0xC3,
18901890

18911891
/// <summary>
1892-
/// A value n is taken from top of main stack. An array of type T with size n is put on top of the main stack.
1892+
/// A value n is taken from top of main stack.
1893+
/// An default-value-filled(null, false, 0, or empty string) array of type T with size n is put on top of the main stack.
18931894
///
18941895
/// <remarks>
18951896
/// Push: 1 item(s)
@@ -1910,7 +1911,7 @@ public enum OpCode : byte
19101911
NEWSTRUCT0 = 0xC5,
19111912

19121913
/// <summary>
1913-
/// A value n is taken from top of main stack. A zero-filled struct with size n is put on top of the main stack.
1914+
/// A value n is taken from top of main stack. A null-filled struct with size n is put on top of the main stack.
19141915
///
19151916
/// <remarks>
19161917
/// Push: 1 item(s)
@@ -1940,7 +1941,8 @@ public enum OpCode : byte
19401941
SIZE = 0xCA,
19411942

19421943
/// <summary>
1943-
/// An input index n (or key) and an array (or map) are removed from the top of the main stack. Puts True on top of main stack if array[n] (or map[n]) exist, and False otherwise.
1944+
/// An input index n (or key) and an array (or buffer, string, map) are removed from the top of the main stack.
1945+
/// Puts true on top of main stack if array[n] (or buffer[n], string[n], map[n]) exists, and false otherwise.
19441946
///
19451947
/// <remarks>
19461948
/// Push: 1 item(s)
@@ -1960,7 +1962,7 @@ public enum OpCode : byte
19601962
KEYS = 0xCC,
19611963

19621964
/// <summary>
1963-
/// A map is taken from top of the main stack. The values of this map are put on top of the main stack.
1965+
/// An array or map is taken from top of the main stack. The values of this array or map are put on top of the main stack.
19641966
///
19651967
/// <remarks>
19661968
/// Push: 1 item(s)
@@ -1970,7 +1972,8 @@ public enum OpCode : byte
19701972
VALUES = 0xCD,
19711973

19721974
/// <summary>
1973-
/// An input index n (or key) and an array (or map) are taken from main stack. Element array[n] (or map[n]) is put on top of the main stack.
1975+
/// An input index n (or key) and an array (or primitive type, buffer, map) are taken from main stack.
1976+
/// Element array[n] (or the converted bytes[n] of primitive type, buffer[n], map[n]) is put on top of the main stack.
19741977
///
19751978
/// <remarks>
19761979
/// Push: 1 item(s)
@@ -1993,7 +1996,8 @@ public enum OpCode : byte
19931996
APPEND = 0xCF,
19941997

19951998
/// <summary>
1996-
/// A value v, index n (or key) and an array (or map) are taken from main stack. Attribution array[n]=v (or map[n]=v) is performed.
1999+
/// A value, index n (or key) and an array (or buffer, map) are taken from main stack.
2000+
/// Attribution array[n] = value (or buffer[n] = value, map[n] = value) is performed.
19972001
///
19982002
/// <remarks>
19992003
/// Push: 1 item(s)
@@ -2003,7 +2007,7 @@ public enum OpCode : byte
20032007
SETITEM = 0xD0,
20042008

20052009
/// <summary>
2006-
/// An array is removed from the top of the main stack and its elements are reversed.
2010+
/// An array or buffer is removed from the top of the main stack and its elements are reversed.
20072011
///
20082012
/// <remarks>
20092013
/// Push: 0 item(s)
@@ -2100,7 +2104,7 @@ public enum OpCode : byte
21002104
ABORTMSG = 0xE0,
21012105

21022106
/// <summary>
2103-
/// Pops the top two stack items. If the second-to-top stack value is false, exits the vm execution and sets the
2107+
/// Pops the top two stack items. If the second-to-top stack value is false(or null, zero), exits the vm execution and sets the
21042108
/// vm state to FAULT. In this case, the top stack value is used as reason for the exit. Otherwise, it is ignored.
21052109
///
21062110
/// <remarks>

0 commit comments

Comments
 (0)