v / examples
Raw file | 18 loc (18 sloc) | 254 bytes | Latest commit hash 017ace6ea
1fn main() {
2 a := 100
3 b := 20
4 mut c := 0
5 $if amd64 {
6 asm amd64 {
7 mov eax, a
8 add eax, b
9 mov c, eax
10 ; =r (c) // output
11 ; r (a) // input
12 r (b)
13 }
14 }
15 println('a: ${a}') // 100
16 println('b: ${b}') // 20
17 println('c: ${c}') // 120
18}