summary refs log tree commit diff stats
path: root/HACKING
stat options
Period:
Authors:

Commits per author per week (path 'HACKING')

AuthorW33 2024W34 2024W35 2024W36 2024Total
Total00000
'blob content' class='blob'>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# compute the factorial of 5, and return the result in the exit code

fn factorial n : int -> result/EAX : int [
  result/EAX <- copy 1
  {
    compare n, 1
    break-if <=
    var tmp/EBX : int
    tmp/EBX <- copy n
    tmp/EBX <- subtract 1
    var tmp2/EAX : int
    tmp2/EAX <- call factorial, tmp/EBX
    result/EAX <- multiply tmp2/EAX, n
  }
  return result/EAX
]