aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-05-08 21:22:54 +0800
committerchriseth <c@ethdev.com>2016-05-09 16:52:23 +0800
commita927efb1513e31cfa9130458b4ea40d89e283b17 (patch)
treecdf13fa91e02ebd9d0454b47f8f07fdf4eb877b0 /docs
parent9e36bdda8a9552f1885e0a63a85db588623b39b2 (diff)
downloaddexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar.gz
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar.bz2
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar.lz
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar.xz
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.tar.zst
dexon-solidity-a927efb1513e31cfa9130458b4ea40d89e283b17.zip
Correctly use not/bnot/iszero.
A long time ago, some opcodes were renamed. Now we should only have not (bitwise negation) and iszero (logical negation).
Diffstat (limited to 'docs')
-rw-r--r--docs/control-structures.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 2d959d1d..fbe7715c 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -208,7 +208,7 @@ idea is that assembly libraries will be used to enhance the language in such way
// by using o_code = new bytes(size)
o_code := mload(0x40)
// new "memory end" including padding
- mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), bnot(0x1f))))
+ mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f))))
// store length in memory
mstore(o_code, size)
// actually retrieve the code, this needs assembly
@@ -292,7 +292,7 @@ The opcodes `pushi` and `jumpdest` cannot be used directly.
+-----------------------+------+---------------------------------------------------------------+
| exp(x, y) | | x to the power of y |
+-----------------------+------+---------------------------------------------------------------+
-| bnot(x) | | ~x, every bit of x is negated |
+| not(x) | | ~x, every bit of x is negated |
+-----------------------+------+---------------------------------------------------------------+
| lt(x, y) | | 1 if x < y, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+
@@ -304,7 +304,7 @@ The opcodes `pushi` and `jumpdest` cannot be used directly.
+-----------------------+------+---------------------------------------------------------------+
| eq(x, y) | | 1 if x == y, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+
-| not(x) | | 1 if x == 0, 0 otherwise |
+| iszero(x) | | 1 if x == 0, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+
| and(x, y) | | bitwise and of x and y |
+-----------------------+------+---------------------------------------------------------------+