PDA

View Full Version : Any body good in assembly .. PLZ help


al3600b
05-17-2004, 03:21 AM
i need to do some math operations .. including division .. Such that..
Divide N, M, P N = P / M N and M are 512-bit. P is 1024-bit.
So ..
any body can help to do it ?
Regards ..
Thank u

GeoTrail
02-16-2005, 06:23 PM
Do you mean something simple like this? PUSH dword I_BSSEnd-I_BSSStart
PUSH dword 0
PUSH dword I_BSSStart
CALL _memset
ADD esp,12
MOV eax,[esp+4]
MOV [_PB_Instance],eax
PUSH dword 0
PUSH dword 4000
PUSH dword 0
CALL _HeapCreate@12
MOV [PB_MemoryBase],eax

PUSH dword 64000
PUSH dword 8
PUSH dword [PB_MemoryBase]
CALL _HeapAlloc@12
MOV [PB_StringBase],eax

CALL PB_OpenConsole

MOV dword [v_one],1125515264

MOV dword [v_two],1082130432

FLD dword [v_one]
FDIV dword [v_two]
FSTP dword [v_result]

PUSH dword [PB_StringBase]
PUSH dword [PB_StringBase]
FLD dword [v_result]
FISTP dword [esp-4]
MOV eax,dword [esp-4]
CALL PB_Str
POP eax
INC dword [PB_StringBase]
CALL PB_Print
POP dword [PB_StringBase]

PUSH dword [PB_StringBase]
CALL PB_Input
POP dword [PB_StringBase]

CALL PB_CloseConsole
_PB_EOP_NoValue:
PUSH dword 0
_PB_EOP:
CALL _PB_EndFunctions
PUSH dword [PB_MemoryBase]
CALL _HeapDestroy@4
CALL _ExitProcess@4
_PB_EndFunctions:
RET