Fixed table formatting

This commit is contained in:
Denton Liu 2016-05-11 16:07:12 -04:00
parent 51fe1bd9c2
commit d70ae38e92

View File

@ -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. The opcodes `pushi` and `jumpdest` cannot be used directly.
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| stop + `-` | stop execution, identical to return(0,0) | | stop + `-` | stop execution, identical to return(0,0) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| add(x, y) | | x + y | | add(x, y) | | x + y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| sub(x, y) | | x - y | | sub(x, y) | | x - y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mul(x, y) | | x * y | | mul(x, y) | | x * y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| div(x, y) | | x / y | | div(x, y) | | x / y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| sdiv(x, y) | | x / y, for signed numbers in two's complement | | sdiv(x, y) | | x / y, for signed numbers in two's complement |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mod(x, y) | | x % y | | mod(x, y) | | x % y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| smod(x, y) | | x % y, for signed numbers in two's complement | | smod(x, y) | | x % y, for signed numbers in two's complement |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| exp(x, y) | | x to the power of y | | exp(x, y) | | x to the power of y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| not(x) | | ~x, every bit of x is negated | | bnot(x) | | ~x, every bit of x is negated |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| lt(x, y) | | 1 if x < y, 0 otherwise | | lt(x, y) | | 1 if x < y, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| gt(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| | 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| | 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 | | eq(x, y) | | 1 if x == y, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| iszero(x) | | 1 if x == 0, 0 otherwise | | not(x) | | 1 if x == 0, 0 otherwise |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| and(x, y) | | bitwise and of x and y | | and(x, y) | | bitwise and of x and y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| or(x, y) | | bitwise or of x and y | | or(x, y) | | bitwise or of x and y |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| xor(x, y) | | bitwise xor 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| | 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 | | addmod(x, y, m) | | (x + y) % m with arbitrary precision arithmetics |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mulmod(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| | signextend(i, x) | | sign extend from (i*8+7)th bit counting from least significant |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| sha3(p, n) | | keccak(mem[p...(p+n))) | | sha3(p, n) | | keccak(mem[p...(p+n))) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| jump(label) | `-` | jump to label / code position | | jump(label) | `-` | jump to label / code position |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| jumpi(label, cond) | `-` | jump to label if cond is nonzero | | jumpi(label, cond) | `-` | jump to label if cond is nonzero |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| pc | | current position in code | | pc | | current position in code |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| pop | `*` | remove topmost stack slot | | pop | `*` | remove topmost stack slot |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| dup1 ... dup16 | | copy ith stack slot to the top (counting from top) | | dup1 ... dup16 | | copy ith stack slot to the top (counting from top) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| swap1 ... swap1 | `*` | swap topmost and ith stack slot below it | | swap1 ... swap1 | `*` | swap topmost and ith stack slot below it |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mload(p) | | mem[p..(p+32)) | | mload(p) | | mem[p..(p+32)) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mstore(p, v) | `-` | mem[p..(p+32)) := v | | mstore(p, v) | `-` | mem[p..(p+32)) := v |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte | | mstore8(p, v) | `-` | mem[p] := v & 0xff - only modifies a single byte |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| sload(p) | | storage[p] | | sload(p) | | storage[p] |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| sstore(p, v) | `-` | storage[p] := v | | sstore(p, v) | `-` | storage[p] := v |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| msize | | size of memory, i.e. largest accessed memory index | | msize | | size of memory, i.e. largest accessed memory index |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| gas | | gas still available to execution | | gas | | gas still available to execution |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| address | | address of the current contract / execution context | | address | | address of the current contract / execution context |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| balance(a) | | wei balance at address a | | balance(a) | | wei balance at address a |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| caller | | call sender (excluding delegatecall) | | caller | | call sender (excluding delegatecall) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| callvalue | | wei sent together with the current call | | callvalue | | wei sent together with the current call |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| calldataload(p) | | call data starting from position p (32 bytes) | | calldataload(p) | | call data starting from position p (32 bytes) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| calldatasize | | size of call data in 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 | | 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 | | 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 | | 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 | | 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 | | 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 | | create(v, p, s) | | create new contract with code mem[p..(p+s)) and send v wei |
| | | and return the new address | | | | and return the new address |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| call(g, a, v, in, | | call contract at address a with input mem[in..(in+insize)] | | 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 | | insize, out, outsize) | | providing g gas and v wei and output area |
| | | mem[out..(out+outsize)] returting 1 on error (out of gas) | | | | 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 | | 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 | | insize, out, outsize) | | in the context of the current contract otherwise |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| delegatecall(g, a, in,| | identical to callcode but also keep `caller` and `callvalue` | | delegatecall(g, a, in, | | identical to callcode but also keep `caller` and `callvalue` |
| insize, out, outsize) | | | | insize, out, outsize) | | |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| return(p, s) | `*` | end execution, return data mem[p..(p+s)) | | return(p, s) | `*` | end execution, return data mem[p..(p+s)) |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a | | selfdestruct(a) | `*` | end execution, destroy current contract and send funds to a |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| log0(p, s) | `-` | log without topics and data mem[p..(p+s)) | | 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)) | | 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)) | | 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)) | | 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)) | | log4(p, s, t1, t2, t3, | `-` | log with topics t1, t2, t3, t4 and data mem[p..(p+s)) |
| t4) | | | | t4) | | |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| origin | | transaction sender | | origin | | transaction sender |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| gasprice | | gas price of the transaction | | gasprice | | gas price of the transaction |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| blockhash(b) | |hash of block nr b - only for last 256 blocks excluding current| | blockhash(b) | | hash of block nr b - only for last 256 blocks excluding current |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| coinbase | | current mining beneficiary | | coinbase | | current mining beneficiary |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| timestamp | | timestamp of the current block in seconds since the epoch | | timestamp | | timestamp of the current block in seconds since the epoch |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| number | | current block number | | number | | current block number |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| difficulty | | difficulty of the current block | | difficulty | | difficulty of the current block |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
| gaslimit | | block gas limit of the current block | | gaslimit | | block gas limit of the current block |
+-----------------------+------+---------------------------------------------------------------+ +-------------------------+------+-----------------------------------------------------------------+
Literals Literals
-------- --------