aboutsummaryrefslogtreecommitdiffstats
path: root/docs/assembly.rst
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-15 23:45:44 +0800
committerGitHub <noreply@github.com>2017-08-15 23:45:44 +0800
commit2fa59489b68c55e62c4b909dd8503863fb0afc03 (patch)
treec4f5dae829185bc0ceae18d98feea81862e5ea22 /docs/assembly.rst
parent8ee973f316932ffe39628cb22a9c330dfa0e0d2f (diff)
parenta73fb4d52957317cd341ad1a126ce3a499889d7b (diff)
downloaddexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.tar.gz
dexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.tar.zst
dexon-solidity-2fa59489b68c55e62c4b909dd8503863fb0afc03.zip
Merge pull request #2664 from joshuahannan/develop
added while loop description
Diffstat (limited to 'docs/assembly.rst')
-rw-r--r--docs/assembly.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst
index bdb708a9..6495699f 100644
--- a/docs/assembly.rst
+++ b/docs/assembly.rst
@@ -570,6 +570,20 @@ The following example computes the sum of an area in memory.
}
}
+For loops can also be written so that they behave like while loops:
+Simply leave the initialization and post-iteration parts empty.
+
+.. code::
+
+ {
+ let x := 0
+ let i := 0
+ for { } lt(i, 0x100) { } { // while(i < 0x100)
+ x := add(x, mload(i))
+ i := add(i, 0x20)
+ }
+ }
+
Functions
---------