Revert "examples: split asm.v to asm.amd64.v and asm.i386.v"

This reverts commit 74e73edac1.
pull/10394/head
Delyan Angelov 2021-06-07 20:23:44 +03:00
parent 74e73edac1
commit 5b2046342b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 18 additions and 38 deletions

View File

@ -1,19 +0,0 @@
fn main() {
a := 100
b := 20
mut c := 0
asm amd64 {
mov rax, a
add rax, b
mov c, rax
; =r (c)
; r (a)
r (b)
}
assert a == 100
assert b == 20
assert c == 120
println('a: $a') // 100
println('b: $b') // 20
println('c: $c') // 120
}

View File

@ -1,19 +0,0 @@
fn main() {
a := 100
b := 20
mut c := 0
asm i386 {
mov eax, a
add eax, b
mov c, eax
; =r (c)
; r (a)
r (b)
}
assert a == 100
assert b == 20
assert c == 120
println('a: $a') // 100
println('b: $b') // 20
println('c: $c') // 120
}

18
examples/asm.v 100644
View File

@ -0,0 +1,18 @@
fn main() {
a := 100
b := 20
mut c := 0
$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
println('c: $c') // 120
}