examples: conditionally compile an `asm amd64 {}` block on M1 in asm.v
parent
9f6c4030f6
commit
4f213f4468
|
@ -2,6 +2,7 @@ fn main() {
|
||||||
a := 100
|
a := 100
|
||||||
b := 20
|
b := 20
|
||||||
mut c := 0
|
mut c := 0
|
||||||
|
$if amd64 {
|
||||||
asm amd64 {
|
asm amd64 {
|
||||||
mov eax, a
|
mov eax, a
|
||||||
add eax, b
|
add eax, b
|
||||||
|
@ -10,6 +11,7 @@ fn main() {
|
||||||
; r (a) // input
|
; r (a) // input
|
||||||
r (b)
|
r (b)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
println('a: $a') // 100
|
println('a: $a') // 100
|
||||||
println('b: $b') // 20
|
println('b: $b') // 20
|
||||||
println('c: $c') // 120
|
println('c: $c') // 120
|
||||||
|
|
Loading…
Reference in New Issue