From 4f213f4468c1d1d38d75c936ce5c1f31371ff4ab Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 7 Jun 2021 18:22:01 +0300 Subject: [PATCH] examples: conditionally compile an `asm amd64 {}` block on M1 in asm.v --- examples/asm.v | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/asm.v b/examples/asm.v index de861a4614..88c75ec318 100644 --- a/examples/asm.v +++ b/examples/asm.v @@ -2,13 +2,15 @@ fn main() { a := 100 b := 20 mut c := 0 - asm amd64 { - mov eax, a - add eax, b - mov c, eax - ; =r (c) // output - ; r (a) // input - r (b) + $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