about summary refs log blame commit diff stats
path: root/apps/ex3.mu
blob: efe6a3170c88853b9ff34f035cd44f0f3f09651a (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                   










                            
# Add the first 10 numbers, and return the result in the exit code.
#
# To run:
#   $ ./translate_mu apps/browse.mu
#   $ ./a.elf
# Expected result:
#   $ echo $?
#   55

fn main -> result/ebx: int {
  result <- copy 0
  var i/eax: int <- copy 1
  {
    compare i, 0xa
    break-if->
    result <- add i
    i <- increment
    loop
  }
}