Clarify wording about arg1/arg2

This commit is contained in:
Alex Beregszaszi 2017-09-22 16:07:34 +01:00
parent d01c9af47f
commit 74d9a171ff

View File

@ -27,7 +27,7 @@ The following instructions are introduced:
### `0x1b`: `SHL` (shift left) ### `0x1b`: `SHL` (shift left)
The `SHL` instruction (shift left) pops 2 values from the stack, `arg1` and `arg2`, and pushes on the stack the second popped value `arg2` shifted to the left by the number of bits in the first popped value `arg1`. The result is equal to The `SHL` instruction (shift left) pops 2 values from the stack, first `arg1` and then `arg2`, and pushes on the stack `arg2` shifted to the left by `arg1` number of bits. The result is equal to
``` ```
(arg2 * 2^arg1) mod 2^256 (arg2 * 2^arg1) mod 2^256
@ -41,7 +41,7 @@ Notes:
### `0x1c`: `SHR` (logical shift right) ### `0x1c`: `SHR` (logical shift right)
The `SHR` instruction (logical shift right) pops 2 values from the stack, `arg1` and `arg2`, and pushes on the stack the second popped value `arg2` shifted to the right by the number of bits in the first popped value `arg1` with zero fill. The result is equal to The `SHR` instruction (logical shift right) pops 2 values from the stack, first `arg1` and then `arg2`, and pushes on the stack `arg2` shifted to the right by `arg1` number of bits with zero fill. The result is equal to
``` ```
floor(arg2 / 2^arg1) floor(arg2 / 2^arg1)
@ -55,7 +55,7 @@ Notes:
### `0x1d`: `SAR` (arithmetic shift right) ### `0x1d`: `SAR` (arithmetic shift right)
The `SAR` instruction (arithmetic shift right) pops 2 values from the stack, `arg1` and `arg2`, and pushes on the stack the second popped value `arg2` shifted to the right by the number of bits in the first popped value `arg1` with sign extension. The result is equal to The `SAR` instruction (arithmetic shift right) pops 2 values from the stack, first `arg1` and then `arg2`, and pushes on the stack `arg2` shifted to the right by `arg1` number of bits with sign extension. The result is equal to
``` ```
floor(arg2 / 2^arg1) floor(arg2 / 2^arg1)