examples: conditionally compile an `asm amd64 {}` block on M1 in asm.v

pull/10394/head
Delyan Angelov 2021-06-07 18:22:01 +03:00
parent 9f6c4030f6
commit 4f213f4468
1 changed files with 9 additions and 7 deletions

View File

@ -2,13 +2,15 @@ fn main() {
a := 100 a := 100
b := 20 b := 20
mut c := 0 mut c := 0
asm amd64 { $if amd64 {
mov eax, a asm amd64 {
add eax, b mov eax, a
mov c, eax add eax, b
; =r (c) // output mov c, eax
; r (a) // input ; =r (c) // output
r (b) ; r (a) // input
r (b)
}
} }
println('a: $a') // 100 println('a: $a') // 100
println('b: $b') // 20 println('b: $b') // 20