about summary refs log tree commit diff stats
path: root/picat
Commit message (Expand)AuthorAgeFilesLines
* *elioat2024-07-163-0/+1354
* *elioat2024-07-163-0/+649
* *elioat2024-03-141-0/+18
t&id=7d4e351a0d1e3c4e71b58d3218b4e6b833f542f2'>^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22





















                                                                  
# add the first 10 numbers, and return the result in the exit code

fn main [
  var result/EBX : int
  result/EBX <- copy 0
  var counter/ECX : int
  counter/ECX <- copy 1
  {
    compare counter/ECX, 10
    break-if >
    result/EBX <- add counter/ECX
    counter/ECX <- add 1
    loop
  }
  call exit, 1
]

fn exit x : int [
  code/EBX <- copy x
  code/EAX <- copy 1/exit
  syscall
]