aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/examples/asm.v
blob: 88c75ec31829ba007d9bcc2f3d5b770fdb8b8e7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
	a := 100
	b := 20
	mut c := 0
	$if amd64 {
		asm amd64 {
			mov eax, a
			add eax, b
			mov c, eax
			; =r (c) // output
			; r (a) // input
			  r (b)
		}
	}
	println('a: $a') // 100
	println('b: $b') // 20
	println('c: $c') // 120
}