From 5f9c02c6b6e78ec80a5b8c2e6a467bb89b9a9454 Mon Sep 17 00:00:00 2001 From: Joshua Hannan Date: Sat, 29 Jul 2017 18:15:54 -0500 Subject: added while loop description --- docs/assembly.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/assembly.rst') 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 --------- -- cgit