2014-03-31 07:57:30 +02:00
|
|
|
|
;-----------------------------------------------------------------------------+
|
|
|
|
|
; <EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> [ by ManHunter / PCL ] |
|
|
|
|
|
;-----------------------------------------------------------------------------|
|
|
|
|
|
; <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: |
|
|
|
|
|
; lpFloat - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> TBYTE |
|
|
|
|
|
; lpResult - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>-<EFBFBD>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |
|
|
|
|
|
;-----------------------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
proc FloatToString lpFloat:DWORD, lpResult:DWORD
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local digits_count:DWORD
|
|
|
|
|
local old_cw:WORD
|
|
|
|
|
local new_cw:WORD
|
|
|
|
|
local saved_float:TBYTE
|
|
|
|
|
local tmp1 rb 11h
|
|
|
|
|
local tmp2 rb 11h
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ॣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>-<EFBFBD>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov edi,[lpResult]
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
mov esi,[lpFloat]
|
|
|
|
|
cmp dword [esi],0
|
|
|
|
|
jne loc_not_zero
|
|
|
|
|
cmp dword [esi+4],0
|
|
|
|
|
jne loc_not_zero
|
|
|
|
|
cmp word [esi+8],0
|
|
|
|
|
jne loc_not_zero
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov al,'0'
|
|
|
|
|
stosb
|
|
|
|
|
jmp loc_ret
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_not_zero:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
push edi
|
|
|
|
|
mov esi,[lpFloat]
|
|
|
|
|
lea edi,[saved_float]
|
|
|
|
|
movsd
|
|
|
|
|
movsd
|
|
|
|
|
movsw
|
|
|
|
|
pop edi
|
|
|
|
|
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭮<EFBFBD>?
|
|
|
|
|
cmp dword [saved_float+6],0
|
|
|
|
|
jge loc_not_signed
|
|
|
|
|
; <EFBFBD>ਢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>᮫<EFBFBD>⭮<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD>
|
|
|
|
|
and byte [saved_float+9],7Fh
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov al,'-'
|
|
|
|
|
stosb
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_not_signed:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稥 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fclex
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD>饥 <EFBFBD><EFBFBD>
|
|
|
|
|
fstcw [old_cw]
|
|
|
|
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD>饥 <EFBFBD><EFBFBD>
|
|
|
|
|
mov [new_cw],0000001001111111b
|
|
|
|
|
fldcw [new_cw]
|
|
|
|
|
lea esi,[saved_float]
|
|
|
|
|
fld tbyte [esi]
|
|
|
|
|
fld st
|
|
|
|
|
; <EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>冷<EFBFBD>
|
|
|
|
|
fxtract
|
|
|
|
|
fstp st
|
|
|
|
|
fldlg2
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
fmulp st1,st
|
|
|
|
|
fistp [digits_count]
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 16, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>⮡ࠦ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮩ <EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD>⮩
|
|
|
|
|
cmp [digits_count],10h
|
|
|
|
|
jnb loc_not_integer
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
fld st
|
|
|
|
|
frndint
|
|
|
|
|
fcomp st1
|
|
|
|
|
fstsw ax
|
|
|
|
|
test ah,01000000b
|
|
|
|
|
; <EFBFBD><EFBFBD>, <EFBFBD>⮡ࠦ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jz loc_not_integer
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
lea eax,[tmp1]
|
|
|
|
|
fbstp [eax]
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD-<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
push edi
|
|
|
|
|
lea esi,[tmp1+8]
|
|
|
|
|
lea edi,[tmp2]
|
|
|
|
|
mov ecx, 9
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
std
|
|
|
|
|
xor eax,eax
|
|
|
|
|
lodsb
|
|
|
|
|
cld
|
|
|
|
|
rol ax,12
|
|
|
|
|
rol ah,4
|
|
|
|
|
add ax,'00'
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
pop edi
|
|
|
|
|
|
|
|
|
|
; <EFBFBD>ய<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov eax,11h
|
|
|
|
|
mov ecx,[digits_count]
|
|
|
|
|
sub eax,ecx
|
|
|
|
|
inc ecx
|
|
|
|
|
lea esi,[tmp2+eax]
|
|
|
|
|
cmp byte [esi],'0'
|
|
|
|
|
jne @f
|
|
|
|
|
inc esi
|
|
|
|
|
dec ecx
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD>७<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
rep movsb
|
|
|
|
|
jmp loc_clear_stack
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_not_integer:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
mov eax,10h
|
|
|
|
|
sub eax,[digits_count]
|
|
|
|
|
|
|
|
|
|
; <EFBFBD>८<EFBFBD>ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> 楫<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 16 ࠧ<EFBFBD>冷<EFBFBD>
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
cmp eax,0
|
|
|
|
|
jge @f
|
|
|
|
|
neg eax
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ᥫ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD><EFBFBD>४<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>㣫<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0
|
|
|
|
|
mov [new_cw],0000101001111111b
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
jge @f
|
|
|
|
|
mov [new_cw],0000011001111111b
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD>饥 <EFBFBD><EFBFBD>
|
|
|
|
|
fldcw [new_cw]
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 10 <EFBFBD> <EFBFBD>⥯<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢠ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fld [float2]
|
|
|
|
|
fld [float2]
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
fmul st,st1
|
|
|
|
|
dec eax
|
|
|
|
|
cmp eax,1
|
|
|
|
|
ja @b
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>⥪
|
|
|
|
|
fxch st1
|
|
|
|
|
fstp st
|
|
|
|
|
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0, <EFBFBD><EFBFBD> 㬭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
jge @f
|
|
|
|
|
fdivp st1,st
|
|
|
|
|
jmp loc_rounded
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
fmulp st1,st
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_rounded:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.0e16 ?
|
|
|
|
|
fcom [float1]
|
|
|
|
|
fstsw ax
|
|
|
|
|
test ah,1
|
|
|
|
|
jz @f
|
|
|
|
|
fmul [float2]
|
|
|
|
|
dec [digits_count]
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
lea eax,[tmp1]
|
|
|
|
|
fbstp [eax]
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD-<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
push edi
|
|
|
|
|
lea esi,[tmp1+8]
|
|
|
|
|
lea edi,[tmp2]
|
|
|
|
|
mov ecx, 9
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
std
|
|
|
|
|
xor eax,eax
|
|
|
|
|
lodsb
|
|
|
|
|
cld
|
|
|
|
|
rol ax,12
|
|
|
|
|
rol ah,4
|
|
|
|
|
add ax,'00'
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
pop edi
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ॡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
lea esi,[tmp2+1]
|
|
|
|
|
mov ecx,[digits_count]
|
|
|
|
|
cmp ecx,-0Fh
|
|
|
|
|
jl loc_mantiss_and_exponent
|
|
|
|
|
cmp ecx,10h
|
|
|
|
|
jg loc_mantiss_and_exponent
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
jg @f
|
|
|
|
|
mov ax,'0.'
|
|
|
|
|
stosw
|
|
|
|
|
neg ecx
|
|
|
|
|
mov al,'0'
|
|
|
|
|
rep stosb
|
|
|
|
|
mov ecx,10h
|
|
|
|
|
jmp loc_fraction_filled
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
rep movsb
|
|
|
|
|
mov al,'.'
|
|
|
|
|
stosb
|
|
|
|
|
mov ecx,10h
|
|
|
|
|
sub ecx,[digits_count]
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_fraction_filled:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
rep movsb
|
|
|
|
|
jmp @f
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_clear_fraction:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD>㫨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dec edi
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
cmp byte [edi-1],'0'
|
|
|
|
|
jz loc_clear_fraction
|
|
|
|
|
cmp byte [edi-1],'.'
|
|
|
|
|
jnz @f
|
|
|
|
|
dec edi
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
jmp loc_clear_stack
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_mantiss_and_exponent:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
movsb
|
|
|
|
|
mov al,'.'
|
|
|
|
|
stosb
|
|
|
|
|
movsd
|
|
|
|
|
movsd
|
|
|
|
|
movsw
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD>㫨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
cmp byte [edi-1],'0'
|
|
|
|
|
jne @f
|
|
|
|
|
cmp byte [edi-2],'.'
|
|
|
|
|
je @f
|
|
|
|
|
dec edi
|
|
|
|
|
jmp @b
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov al,'e'
|
|
|
|
|
stosb
|
|
|
|
|
mov al,'+'
|
|
|
|
|
mov ebx,[digits_count]
|
|
|
|
|
cmp ebx, 0
|
|
|
|
|
jge @f
|
|
|
|
|
mov al,'-'
|
|
|
|
|
neg ebx
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
stosb
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov eax,ebx
|
|
|
|
|
mov ecx,10
|
|
|
|
|
mov ebx,4
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
dec ebx
|
|
|
|
|
xor edx,edx
|
|
|
|
|
div ecx
|
|
|
|
|
add dl,'0'
|
|
|
|
|
mov [tmp1+ebx],dl
|
|
|
|
|
or ebx,ebx
|
|
|
|
|
jnz @b
|
|
|
|
|
|
|
|
|
|
; <EFBFBD>ய<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD>㫨 <EFBFBD><EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx,4
|
|
|
|
|
lea esi,[tmp1]
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al,'0'
|
|
|
|
|
jne @f
|
|
|
|
|
dec ecx
|
|
|
|
|
jmp @b
|
2014-03-31 07:57:30 +02:00
|
|
|
|
@@:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
dec esi
|
|
|
|
|
rep movsb
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_clear_stack:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD>饥 <EFBFBD><EFBFBD>
|
|
|
|
|
fldcw [old_cw]
|
2014-03-31 07:57:30 +02:00
|
|
|
|
loc_ret:
|
2014-04-24 05:27:40 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
mov al,0
|
|
|
|
|
stosb
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ॣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
float1 dq 1.0e16
|
|
|
|
|
float2 dq 10.0
|
2014-04-24 05:27:40 +02:00
|
|
|
|
|
2014-03-31 07:57:30 +02:00
|
|
|
|
endp
|