diff options
author | Denton Liu <liu.denton+github@gmail.com> | 2016-05-12 04:07:12 +0800 |
---|---|---|
committer | Denton Liu <liu.denton+github@gmail.com> | 2016-05-18 23:23:48 +0800 |
commit | d70ae38e9241bc9982e04d2cc16d6df18f2ae015 (patch) | |
tree | 9e8b7b9dcaf3d926f97ac4cf88ec853877bf6839 /docs | |
parent | 51fe1bd9c2fb60106ecf259c7d1749f28a584e0c (diff) | |
download | dexon-solidity-d70ae38e9241bc9982e04d2cc16d6df18f2ae015.tar.gz dexon-solidity-d70ae38e9241bc9982e04d2cc16d6df18f2ae015.tar.zst dexon-solidity-d70ae38e9241bc9982e04d2cc16d6df18f2ae015.zip |
Fixed table formatting
Diffstat (limited to 'docs')
-rw-r--r-- | docs/control-structures.rst | 282 |
1 files changed, 141 insertions, 141 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 49d12087..0a233763 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -335,147 +335,147 @@ In the following, `mem[a...b)` signifies the bytes of memory starting at positio The opcodes `pushi` and `jumpdest` cannot be used directly. -+-----------------------+------+---------------------------------------------------------------+ -| stop + `-` | stop execution, identical to return(0,0) | -+-----------------------+------+---------------------------------------------------------------+ -| add(x, y) | | x + y | -+-----------------------+------+---------------------------------------------------------------+ -| sub(x, y) | | x - y | -+-----------------------+------+---------------------------------------------------------------+ -| mul(x, y) | | x * y | -+-----------------------+------+---------------------------------------------------------------+ -| div(x, y) | | x / y | -+-----------------------+------+---------------------------------------------------------------+ -| sdiv(x, y) | | x / y, for signed numbers in two's complement | -+-----------------------+------+---------------------------------------------------------------+ -| mod(x, y) | | x % y | -+-----------------------+------+---------------------------------------------------------------+ -| smod(x, y) | | x % y, for signed numbers in two's complement | -+-----------------------+------+---------------------------------------------------------------+ -| exp(x, y) | | x to the power of y | -+-----------------------+------+---------------------------------------------------------------+ -| not(x) | | ~x, every bit of x is negated | -+-----------------------+------+---------------------------------------------------------------+ -| lt(x, y) | | 1 if x < y, 0 otherwise | -+-----------------------+------+---------------------------------------------------------------+ -| gt(x, y) | | 1 if x > y, 0 otherwise | -+-----------------------+------+---------------------------------------------------------------+ -| slt(x, y) | |1 if x < y, 0 otherwise, for signed numbers in two's complement| -+-----------------------+------+---------------------------------------------------------------+ -| sgt(x, y) | |1 if x > y, 0 otherwise, for signed numbers in two's complement| -+-----------------------+------+---------------------------------------------------------------+ -| eq(x, y) | | 1 if x == y, 0 otherwise | -+-----------------------+------+---------------------------------------------------------------+ -| iszero(x) | | 1 if x == 0, 0 otherwise | -+-----------------------+------+---------------------------------------------------------------+ -| and(x, y) | | bitwise and of x and y | -+-----------------------+------+---------------------------------------------------------------+ -| or(x, y) | | bitwise or of x and y | -+-----------------------+------+---------------------------------------------------------------+ -| xor(x, y) | | bitwise xor of x and y | -+-----------------------+------+---------------------------------------------------------------+ -| byte(n, x) | | nth byte of x, where the most significant byte is the 0th byte| -+-----------------------+------+---------------------------------------------------------------+ -| addmod(x, y, m) | | (x + y) % m with arbitrary precision arithmetics | -+-----------------------+------+---------------------------------------------------------------+ -| mulmod(x, y, m) | | (x * y) % m with arbitrary precision arithmetics | -+-----------------------+------+---------------------------------------------------------------+ -| signextend(i, x) | | sign extend from (i*8+7)th bit counting from least significant| -+-----------------------+------+---------------------------------------------------------------+ -| sha3(p, n) | | keccak(mem[p...(p+n))) | -+-----------------------+------+---------------------------------------------------------------+ -| jump(label) | `-` | jump to label / code position | -+-----------------------+------+---------------------------------------------------------------+ -| jumpi(label, cond) | `-` | jump to label if cond is nonzero | -+-----------------------+------+---------------------------------------------------------------+ -| pc | | current position in code | -+-----------------------+------+---------------------------------------------------------------+ -| pop | `*` | remove topmost stack slot | -+-----------------------+------+---------------------------------------------------------------+ -| dup1 ... dup16 | | copy ith stack slot to the top (counting from top) | -+-----------------------+------+---------------------------------------------------------------+ -| swap1 ... swap1 | `*` | swap topmost and ith stack slot below it | -+-----------------------+------+---------------------------------------------------------------+ -| mload(p) | | mem[p..(p+32)) | -+-----------------------+------+---------------------------------------------------------------+ -| mstore(p, v) | `-` | mem[p..(p+32)) := v | -+-----------------------+------+---------------------------------------------------------------+ -| mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte | -+-----------------------+------+---------------------------------------------------------------+ -| sload(p) | | storage[p] | -+-----------------------+------+---------------------------------------------------------------+ -| sstore(p, v) | `-` | storage[p] := v | -+-----------------------+------+---------------------------------------------------------------+ -| msize | | size of memory, i.e. largest accessed memory index | -+-----------------------+------+---------------------------------------------------------------+ -| gas | | gas still available to execution | -+-----------------------+------+---------------------------------------------------------------+ -| address | | address of the current contract / execution context | -+-----------------------+------+---------------------------------------------------------------+ -| balance(a) | | wei balance at address a | -+-----------------------+------+---------------------------------------------------------------+ -| caller | | call sender (excluding delegatecall) | -+-----------------------+------+---------------------------------------------------------------+ -| callvalue | | wei sent together with the current call | -+-----------------------+------+---------------------------------------------------------------+ -| calldataload(p) | | call data starting from position p (32 bytes) | -+-----------------------+------+---------------------------------------------------------------+ -| calldatasize | | size of call data in bytes | -+-----------------------+------+---------------------------------------------------------------+ -| calldatacopy(t, f, s) | `-` | copy s bytes from calldata at position f to mem at position t | -+-----------------------+------+---------------------------------------------------------------+ -| codesize | | size of the code of the current contract / execution context | -+-----------------------+------+---------------------------------------------------------------+ -| codecopy(t, f, s) | `-` | copy s bytes from code at position f to mem at position t | -+-----------------------+------+---------------------------------------------------------------+ -| extcodesize(a) | | size of the code at address a | -+-----------------------+------+---------------------------------------------------------------+ -|extcodecopy(a, t, f, s)| `-` | like codecopy(t, f, s) but take code at address a | -+-----------------------+------+---------------------------------------------------------------+ -| create(v, p, s) | | create new contract with code mem[p..(p+s)) and send v wei | -| | | and return the new address | -+-----------------------+------+---------------------------------------------------------------+ -| call(g, a, v, in, | | call contract at address a with input mem[in..(in+insize)] | -| insize, out, outsize) | | providing g gas and v wei and output area | -| | | mem[out..(out+outsize)] returting 1 on error (out of gas) | -+-----------------------+------+---------------------------------------------------------------+ -| callcode(g, a, v, in, | | identical to call but only use the code from a and stay | -| insize, out, outsize) | | in the context of the current contract otherwise | -+-----------------------+------+---------------------------------------------------------------+ -| delegatecall(g, a, in,| | identical to callcode but also keep `caller` and `callvalue` | -| insize, out, outsize) | | | -+-----------------------+------+---------------------------------------------------------------+ -| return(p, s) | `*` | end execution, return data mem[p..(p+s)) | -+-----------------------+------+---------------------------------------------------------------+ -| selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a | -+-----------------------+------+---------------------------------------------------------------+ -| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) | -+-----------------------+------+---------------------------------------------------------------+ -| log1(p, s, t1) | `-` | log with topic t1 and data mem[p..(p+s)) | -+-----------------------+------+---------------------------------------------------------------+ -| log2(p, s, t1, t2) | `-` | log with topics t1, t2 and data mem[p..(p+s)) | -+-----------------------+------+---------------------------------------------------------------+ -| log3(p, s, t1, t2, t3)| `-` | log with topics t1, t2, t3 and data mem[p..(p+s)) | -+-----------------------+------+---------------------------------------------------------------+ -| log4(p, s, t1, t2, t3,| `-` | log with topics t1, t2, t3, t4 and data mem[p..(p+s)) | -| t4) | | | -+-----------------------+------+---------------------------------------------------------------+ -| origin | | transaction sender | -+-----------------------+------+---------------------------------------------------------------+ -| gasprice | | gas price of the transaction | -+-----------------------+------+---------------------------------------------------------------+ -| blockhash(b) | |hash of block nr b - only for last 256 blocks excluding current| -+-----------------------+------+---------------------------------------------------------------+ -| coinbase | | current mining beneficiary | -+-----------------------+------+---------------------------------------------------------------+ -| timestamp | | timestamp of the current block in seconds since the epoch | -+-----------------------+------+---------------------------------------------------------------+ -| number | | current block number | -+-----------------------+------+---------------------------------------------------------------+ -| difficulty | | difficulty of the current block | -+-----------------------+------+---------------------------------------------------------------+ -| gaslimit | | block gas limit of the current block | -+-----------------------+------+---------------------------------------------------------------+ ++-------------------------+------+-----------------------------------------------------------------+ +| stop + `-` | stop execution, identical to return(0,0) | ++-------------------------+------+-----------------------------------------------------------------+ +| add(x, y) | | x + y | ++-------------------------+------+-----------------------------------------------------------------+ +| sub(x, y) | | x - y | ++-------------------------+------+-----------------------------------------------------------------+ +| mul(x, y) | | x * y | ++-------------------------+------+-----------------------------------------------------------------+ +| div(x, y) | | x / y | ++-------------------------+------+-----------------------------------------------------------------+ +| sdiv(x, y) | | x / y, for signed numbers in two's complement | ++-------------------------+------+-----------------------------------------------------------------+ +| mod(x, y) | | x % y | ++-------------------------+------+-----------------------------------------------------------------+ +| smod(x, y) | | x % y, for signed numbers in two's complement | ++-------------------------+------+-----------------------------------------------------------------+ +| exp(x, y) | | x to the power of y | ++-------------------------+------+-----------------------------------------------------------------+ +| bnot(x) | | ~x, every bit of x is negated | ++-------------------------+------+-----------------------------------------------------------------+ +| lt(x, y) | | 1 if x < y, 0 otherwise | ++-------------------------+------+-----------------------------------------------------------------+ +| gt(x, y) | | 1 if x > y, 0 otherwise | ++-------------------------+------+-----------------------------------------------------------------+ +| slt(x, y) | | 1 if x < y, 0 otherwise, for signed numbers in two's complement | ++-------------------------+------+-----------------------------------------------------------------+ +| sgt(x, y) | | 1 if x > y, 0 otherwise, for signed numbers in two's complement | ++-------------------------+------+-----------------------------------------------------------------+ +| eq(x, y) | | 1 if x == y, 0 otherwise | ++-------------------------+------+-----------------------------------------------------------------+ +| not(x) | | 1 if x == 0, 0 otherwise | ++-------------------------+------+-----------------------------------------------------------------+ +| and(x, y) | | bitwise and of x and y | ++-------------------------+------+-----------------------------------------------------------------+ +| or(x, y) | | bitwise or of x and y | ++-------------------------+------+-----------------------------------------------------------------+ +| xor(x, y) | | bitwise xor of x and y | ++-------------------------+------+-----------------------------------------------------------------+ +| byte(n, x) | | nth byte of x, where the most significant byte is the 0th byte | ++-------------------------+------+-----------------------------------------------------------------+ +| addmod(x, y, m) | | (x + y) % m with arbitrary precision arithmetics | ++-------------------------+------+-----------------------------------------------------------------+ +| mulmod(x, y, m) | | (x * y) % m with arbitrary precision arithmetics | ++-------------------------+------+-----------------------------------------------------------------+ +| signextend(i, x) | | sign extend from (i*8+7)th bit counting from least significant | ++-------------------------+------+-----------------------------------------------------------------+ +| sha3(p, n) | | keccak(mem[p...(p+n))) | ++-------------------------+------+-----------------------------------------------------------------+ +| jump(label) | `-` | jump to label / code position | ++-------------------------+------+-----------------------------------------------------------------+ +| jumpi(label, cond) | `-` | jump to label if cond is nonzero | ++-------------------------+------+-----------------------------------------------------------------+ +| pc | | current position in code | ++-------------------------+------+-----------------------------------------------------------------+ +| pop | `*` | remove topmost stack slot | ++-------------------------+------+-----------------------------------------------------------------+ +| dup1 ... dup16 | | copy ith stack slot to the top (counting from top) | ++-------------------------+------+-----------------------------------------------------------------+ +| swap1 ... swap1 | `*` | swap topmost and ith stack slot below it | ++-------------------------+------+-----------------------------------------------------------------+ +| mload(p) | | mem[p..(p+32)) | ++-------------------------+------+-----------------------------------------------------------------+ +| mstore(p, v) | `-` | mem[p..(p+32)) := v | ++-------------------------+------+-----------------------------------------------------------------+ +| mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte | ++-------------------------+------+-----------------------------------------------------------------+ +| sload(p) | | storage[p] | ++-------------------------+------+-----------------------------------------------------------------+ +| sstore(p, v) | `-` | storage[p] := v | ++-------------------------+------+-----------------------------------------------------------------+ +| msize | | size of memory, i.e. largest accessed memory index | ++-------------------------+------+-----------------------------------------------------------------+ +| gas | | gas still available to execution | ++-------------------------+------+-----------------------------------------------------------------+ +| address | | address of the current contract / execution context | ++-------------------------+------+-----------------------------------------------------------------+ +| balance(a) | | wei balance at address a | ++-------------------------+------+-----------------------------------------------------------------+ +| caller | | call sender (excluding delegatecall) | ++-------------------------+------+-----------------------------------------------------------------+ +| callvalue | | wei sent together with the current call | ++-------------------------+------+-----------------------------------------------------------------+ +| calldataload(p) | | call data starting from position p (32 bytes) | ++-------------------------+------+-----------------------------------------------------------------+ +| calldatasize | | size of call data in bytes | ++-------------------------+------+-----------------------------------------------------------------+ +| calldatacopy(t, f, s) | `-` | copy s bytes from calldata at position f to mem at position t | ++-------------------------+------+-----------------------------------------------------------------+ +| codesize | | size of the code of the current contract / execution context | ++-------------------------+------+-----------------------------------------------------------------+ +| codecopy(t, f, s) | `-` | copy s bytes from code at position f to mem at position t | ++-------------------------+------+-----------------------------------------------------------------+ +| extcodesize(a) | | size of the code at address a | ++-------------------------+------+-----------------------------------------------------------------+ +| extcodecopy(a, t, f, s) | `-` | like codecopy(t, f, s) but take code at address a | ++-------------------------+------+-----------------------------------------------------------------+ +| create(v, p, s) | | create new contract with code mem[p..(p+s)) and send v wei | +| | | and return the new address | ++-------------------------+------+-----------------------------------------------------------------+ +| call(g, a, v, in, | | call contract at address a with input mem[in..(in+insize)] | +| insize, out, outsize) | | providing g gas and v wei and output area | +| | | mem[out..(out+outsize)] returting 1 on error (out of gas) | ++-------------------------+------+-----------------------------------------------------------------+ +| callcode(g, a, v, in, | | identical to call but only use the code from a and stay | +| insize, out, outsize) | | in the context of the current contract otherwise | ++-------------------------+------+-----------------------------------------------------------------+ +| delegatecall(g, a, in, | | identical to callcode but also keep `caller` and `callvalue` | +| insize, out, outsize) | | | ++-------------------------+------+-----------------------------------------------------------------+ +| return(p, s) | `*` | end execution, return data mem[p..(p+s)) | ++-------------------------+------+-----------------------------------------------------------------+ +| selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a | ++-------------------------+------+-----------------------------------------------------------------+ +| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) | ++-------------------------+------+-----------------------------------------------------------------+ +| log1(p, s, t1) | `-` | log with topic t1 and data mem[p..(p+s)) | ++-------------------------+------+-----------------------------------------------------------------+ +| log2(p, s, t1, t2) | `-` | log with topics t1, t2 and data mem[p..(p+s)) | ++-------------------------+------+-----------------------------------------------------------------+ +| log3(p, s, t1, t2, t3) | `-` | log with topics t1, t2, t3 and data mem[p..(p+s)) | ++-------------------------+------+-----------------------------------------------------------------+ +| log4(p, s, t1, t2, t3, | `-` | log with topics t1, t2, t3, t4 and data mem[p..(p+s)) | +| t4) | | | ++-------------------------+------+-----------------------------------------------------------------+ +| origin | | transaction sender | ++-------------------------+------+-----------------------------------------------------------------+ +| gasprice | | gas price of the transaction | ++-------------------------+------+-----------------------------------------------------------------+ +| blockhash(b) | | hash of block nr b - only for last 256 blocks excluding current | ++-------------------------+------+-----------------------------------------------------------------+ +| coinbase | | current mining beneficiary | ++-------------------------+------+-----------------------------------------------------------------+ +| timestamp | | timestamp of the current block in seconds since the epoch | ++-------------------------+------+-----------------------------------------------------------------+ +| number | | current block number | ++-------------------------+------+-----------------------------------------------------------------+ +| difficulty | | difficulty of the current block | ++-------------------------+------+-----------------------------------------------------------------+ +| gaslimit | | block gas limit of the current block | ++-------------------------+------+-----------------------------------------------------------------+ Literals -------- |