From 3350c34a74844e21ea69077e01efff3bae64bdcd Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 23 Mar 2021 17:31:08 -0700 Subject: . --- html/linux/ex3.mu.html | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 html/linux/ex3.mu.html (limited to 'html/linux/ex3.mu.html') diff --git a/html/linux/ex3.mu.html b/html/linux/ex3.mu.html new file mode 100644 index 00000000..2652cbaf --- /dev/null +++ b/html/linux/ex3.mu.html @@ -0,0 +1,83 @@ + + + + +Mu - linux/ex3.mu + + + + + + + + + + +https://github.com/akkartik/mu/blob/main/linux/ex3.mu +
+ 1 # Add the first 10 numbers, and return the result in the exit code.
+ 2 #
+ 3 # To run:
+ 4 #   $ ./translate browse.mu
+ 5 #   $ ./a.elf
+ 6 # Expected result:
+ 7 #   $ echo $?
+ 8 #   55
+ 9 
+10 fn main -> _/ebx: int {
+11   var result/ebx: int <- copy 0
+12   var i/eax: int <- copy 1
+13   {
+14     compare i, 0xa
+15     break-if->
+16     result <- add i
+17     i <- increment
+18     loop
+19   }
+20   return result
+21 }
+
+ + + -- cgit 1.4.1-2-gfad0