fb:porticula NoPaste
Cast Type
Uploader: | St_W |
Datum/Zeit: | 17.06.2012 20:20:36 |
Type test1
low As UShort
high As UShort
End Type
Dim a As UInteger = &h12345678
Dim b As test1
''Funktioniert nicht (Type mismatch):
'b = Cast(test1, a)
'Lösung:
b = *Cast(test1 Ptr, @a)
''Inline Assembler Alternative:
'Asm
' mov eax, [a]
' mov [b], eax
'End Asm
'------ selbe Prozedur in die andere Richtung -------
Print Hex(b.high); " "; Hex(b.low)
b.low = 0
'a = Cast(UInteger, b)
Asm
mov eax, [b]
mov [a], eax
End Asm
Print Hex(a)
Sleep