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