aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/assembly.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst
index 4e665b7e..a56e9cc1 100644
--- a/docs/assembly.rst
+++ b/docs/assembly.rst
@@ -545,6 +545,21 @@ The following example computes the sum of an area in memory.
}
}
+With the for loop header, it is also possible to declare it so it behaves
+like a while loop. 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
---------