From 1978e1d3ff3c64ede94e0322ef7959e59c398f5f Mon Sep 17 00:00:00 2001 From: Vignesh Karthikeyan Date: Wed, 5 Jun 2019 02:02:40 +0530 Subject: [PATCH] Added example for signextend Added sample assembly code for signextend --- docs/assembly.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/assembly.rst b/docs/assembly.rst index 5b475a9b1..881d77650 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -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::