functions for those who don't like mixing assembler with their normal
code.
Code:
' ------------------------------------------- ' This is the code to load the LONG integer. ' ------------------------------------------- LOCAL yy as LONG ! mov ax, -100 ; high integer ! rol eax, 16 ! mov ax, -50 ; low integer ! mov yy, eax ' ------------------------------------------- ' The message Box to test the return values. ' ------------------------------------------- MessageBox hWin,ByCopy str$(LoInt(yy))+str$(HiInt(yy)), _ "Hi & Lo Integer from LONG", _ %MB_OK or %MB_ICONINFORMATION ' ------------------- ' The two functions. ' ------------------- '########################################################################## FUNCTION HiInt(ByVal lVal as LONG) as Integer #REGISTER NONE ! mov eax, lVal ! rol eax, 16 ! mov FUNCTION, ax END FUNCTION '########################################################################## FUNCTION LoInt(ByVal lVal as LONG) as Integer #REGISTER NONE ! mov eax, lVal ! mov FUNCTION, ax END FUNCTION '##########################################################################
Regards,
[email protected]
------------------
Leave a comment: