sub swap( byref a as sys, byref b as sys )
iEcx = a
iEax = b
a = iEax
b = iEcx
end sub
v1=10
v2=20
swap v1, v2
print v1 & " " & v2 'correct
sub swop( byref sys a, byref sys b )
mov Ecx, a
mov Eax, b
mov a, Eax
mov b, Ecx
end sub
v1=10
v2=20
swop v1, v2
print v1 & " " & v2 'odd
includepath "$/inc/"
$filename "And32count.dll"
$dll
include "RTL32.inc"
extern export
function And32(long a,b,*c)
mov eax, a
mov ecx, b 'avoid using ebx
and eax, ecx
addr edi ,c
mov [edi] , eax
'the compiler will produce similar assembly code:
'c=a and b
end function
and to declare the dllPrivate Declare Sub And32 Lib "D:\Programação\OxygenBasic\And32count.dll" Alias "And32" _
(ByVal n As Long, ByVal n2 As Long, ByRef out As Long)
'128 bit logic
'2017-12-24 T 12:02:25
indexbase 0
int a={1,2,3,4,5,6,7,8}
movups xmm0,a[0]
movups xmm1,a[4]
andps xmm0,xmm1 'and
'andnps xmm0,xmm1 'and not
'orps xmm0,xmm1 'or
'xorps xmm0,xmm1 'xor
movups a[0],xmm0
print a[0]