1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
Delyan Angelov 2021-06-07 18:22:01 +03:00
parent 9f6c4030f6
commit 4f213f4468

View File

@ -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