2021-03-17 01:43:17 +01:00
|
|
|
fn main() {
|
|
|
|
a := 100
|
|
|
|
b := 20
|
|
|
|
mut c := 0
|
|
|
|
asm amd64 {
|
|
|
|
mov eax, a
|
|
|
|
add eax, b
|
|
|
|
mov c, eax
|
2021-04-20 16:16:35 +02:00
|
|
|
; =r (c) // output
|
|
|
|
; r (a) // input
|
2021-03-17 01:43:17 +01:00
|
|
|
r (b)
|
|
|
|
}
|
|
|
|
println('a: $a') // 100
|
|
|
|
println('b: $b') // 20
|
|
|
|
println('c: $c') // 120
|
|
|
|
}
|