fb:porticula NoPaste
Cast Type
Uploader: | Volta |
Datum/Zeit: | 20.06.2012 12:22:44 |
'es gibt immer eine einfache, schnelle asm Lösung :))
Type test
lo As UShort
hi As UShort
End Type
#Macro fcast(x, y) 'copy 32bit x -> y
Asm mov eax, [x]
Asm mov [y], eax
#EndMacro
Dim a As UInteger = &H34567890
Dim b As test
fcast(a, b)
Print Hex(b.lo), Hex(b.hi)
a = 0
fcast(b, a)
Print Hex(a)
'2.----------------------------
a = &H12345678
b.lo = 0
b.hi = 0
Dim bx As UInteger Ptr
bx = Cast(UInteger Ptr,@b)
*bx = a
Print Hex(b.lo), Hex(b.hi)
a = 0
a = *bx
Print Hex(a)
sleep