mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Revert "examples: split asm.v to asm.amd64.v and asm.i386.v"
This reverts commit 74e73edac1
.
This commit is contained in:
parent
74e73edac1
commit
5b2046342b
@ -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
|
||||
}
|
@ -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
Normal file
18
examples/asm.v
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user