Added example for signextend

Added sample assembly code for signextend
This commit is contained in:
Vignesh Karthikeyan 2019-06-05 02:02:40 +05:30 committed by GitHub
parent 3d40152102
commit 1978e1d3ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -402,7 +402,8 @@ Local Solidity variables are available for assignments, for example:
To be safe, always clear the data properly before you use it
in a context where this is important:
``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }``
To clean signed types, you can use the ``signextend`` opcode.
To clean signed types, you can use the ``signextend`` opcode:
``assembly { signextend(0, x) }``
.. code::