aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
---------