2011-09-09 22:55:11 +02:00
|
|
|
|
;
|
|
|
|
|
; <EFBFBD>㭪樨 <EFBFBD><EFBFBD><EFBFBD> ࠡ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> float
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩ (1-17)
|
|
|
|
|
NumberSymbolsAD DW 5
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD> (10 <EFBFBD> <EFBFBD>⥯<EFBFBD><EFBFBD><EFBFBD> N)
|
2019-03-23 09:31:59 +01:00
|
|
|
|
MConst: DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
|
2011-09-09 22:55:11 +02:00
|
|
|
|
DQ 1.0E6,1.0E7,1.0E8,1.0E9,1.0E10
|
|
|
|
|
DQ 1.0E11,1.0E12,1.0E13,1.0E14,1.0E15
|
|
|
|
|
DQ 1.0E16,1.0E17,1.0E18,1.0E19,1.0E20
|
|
|
|
|
DQ 1.0E21,1.0E22,1.0E23,1.0E24,1.0E25
|
|
|
|
|
DQ 1.0E26,1.0E27,1.0E28,1.0E29,1.0E30
|
|
|
|
|
DQ 1.0E31,1.0E32,1.0E33,1.0E34,1.0E35
|
|
|
|
|
DQ 1.0E36,1.0E37,1.0E38,1.0E39,1.0E40
|
|
|
|
|
DQ 1.0E41,1.0E42,1.0E43,1.0E44,1.0E45
|
|
|
|
|
DQ 1.0E46,1.0E47,1.0E48,1.0E49,1.0E50
|
|
|
|
|
DQ 1.0E51,1.0E52,1.0E53,1.0E54,1.0E55
|
|
|
|
|
DQ 1.0E56,1.0E57,1.0E58,1.0E59,1.0E60
|
|
|
|
|
DQ 1.0E61,1.0E62,1.0E63,1.0E64,1.0E65
|
|
|
|
|
DQ 1.0E66,1.0E67,1.0E68,1.0E69,1.0E70
|
|
|
|
|
DQ 1.0E71,1.0E72,1.0E73,1.0E74,1.0E75
|
|
|
|
|
DQ 1.0E76,1.0E77,1.0E78,1.0E79,1.0E80
|
|
|
|
|
DQ 1.0E81,1.0E82,1.0E83,1.0E84,1.0E85
|
|
|
|
|
DQ 1.0E86,1.0E87,1.0E88,1.0E89,1.0E90
|
|
|
|
|
DQ 1.0E91,1.0E92,1.0E93,1.0E94,1.0E95
|
|
|
|
|
DQ 1.0E96,1.0E97,1.0E98,1.0E99,1.0E100
|
|
|
|
|
DQ 1.0E101,1.0E102,1.0E103,1.0E104,1.0E105
|
|
|
|
|
DQ 1.0E106,1.0E107,1.0E108,1.0E109,1.0E110
|
|
|
|
|
DQ 1.0E111,1.0E112,1.0E113,1.0E114,1.0E115
|
|
|
|
|
DQ 1.0E116,1.0E117,1.0E118,1.0E119,1.0E120
|
|
|
|
|
DQ 1.0E121,1.0E122,1.0E123,1.0E124,1.0E125
|
|
|
|
|
DQ 1.0E126,1.0E127,1.0E128
|
2019-03-23 09:31:59 +01:00
|
|
|
|
.end:
|
2011-09-09 22:55:11 +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>
|
|
|
|
|
Data_Double DQ ?
|
|
|
|
|
; <EFBFBD><EFBFBD> <EFBFBD> BCD-<EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD>
|
|
|
|
|
Data_BCD DT ?
|
|
|
|
|
; <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䫠<EFBFBD>
|
|
|
|
|
Data_Flag DB ?
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD> 0 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭮<EFBFBD> <EFBFBD><EFBFBD>)
|
|
|
|
|
Data_Sign DB ?
|
2019-03-21 21:08:47 +01:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 0 <EFBFBD><EFBFBD><EFBFBD> ..e+.. <EFBFBD> 1 <EFBFBD><EFBFBD><EFBFBD> ..e-..
|
|
|
|
|
Data_Sign_Exp DB ?
|
2011-09-09 22:55:11 +02:00
|
|
|
|
|
2019-03-21 21:08:47 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; <EFBFBD><EFBFBD>ப<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCII
|
|
|
|
|
Data_String DB 32 DUP (?)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;*******************************************************
|
|
|
|
|
;* <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><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> <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>: *
|
|
|
|
|
;* Data_Double - <EFBFBD>८<EFBFBD>ࠧ㥬<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>; *
|
|
|
|
|
;* NumberSymbolsAD - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩ (0-17). *
|
|
|
|
|
;* <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* Data_String - <EFBFBD><EFBFBD>ப<EFBFBD>-१<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*******************************************************
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
DoubleFloat_to_String:
|
|
|
|
|
pushad
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD> Data_String
|
|
|
|
|
mov EDI, Data_String
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> NumberSymbolsAD
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD>冷<EFBFBD>
|
|
|
|
|
fninit ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fld [Data_Double] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
mov BX,[NumberSymbolsAD]
|
|
|
|
|
cmp BX, 0
|
|
|
|
|
je .NoShifts ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩
|
|
|
|
|
jl .Error ;<EFBFBD>訡<EFBFBD><EFBFBD>
|
|
|
|
|
dec BX
|
2019-03-21 21:08:47 +01:00
|
|
|
|
lea ebx,[MConst+8*ebx]
|
2011-09-09 22:55:11 +02:00
|
|
|
|
fmul qword [EBX] ;㬭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD>
|
|
|
|
|
.NoShifts:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD
|
|
|
|
|
fbstp [Data_BCD]
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>९<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov AX,word [Data_BCD + 8]
|
|
|
|
|
cmp AX,0FFFFh ;"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮<EFBFBD>" <EFBFBD><EFBFBD>९<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
je .Overflow
|
|
|
|
|
; <EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ASCII-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov AL, byte [Data_BCD + 9]
|
|
|
|
|
and AL,AL
|
|
|
|
|
jz .NoSign
|
|
|
|
|
mov AL,'-'
|
|
|
|
|
stosb
|
|
|
|
|
.NoSign:
|
|
|
|
|
; <EFBFBD><EFBFBD>ᯠ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ASCII
|
2011-10-01 11:54:26 +02:00
|
|
|
|
mov ebx,8 ;ᬥ饭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-09-09 22:55:11 +02:00
|
|
|
|
mov ecx,9 ;<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>
|
|
|
|
|
mov DX,18
|
|
|
|
|
sub DX,[NumberSymbolsAD]
|
|
|
|
|
js .Error ;<EFBFBD>訡<EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭠<EFBFBD>
|
|
|
|
|
jz .Error ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㫥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.NextPair:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD>冷<EFBFBD>
|
2011-10-01 11:54:26 +02:00
|
|
|
|
mov AL, byte [ebx + Data_BCD]
|
2011-09-09 22:55:11 +02:00
|
|
|
|
mov AH,AL
|
|
|
|
|
; <EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ASCII <EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ࠤ<EFBFBD>
|
|
|
|
|
shr AL,4
|
|
|
|
|
add AL,'0'
|
|
|
|
|
stosb
|
|
|
|
|
dec DX
|
|
|
|
|
jnz .N0
|
|
|
|
|
mov AL,'.'
|
|
|
|
|
stosb
|
|
|
|
|
.N0: ; <EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ASCII <EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ࠤ<EFBFBD>
|
|
|
|
|
mov AL,AH
|
|
|
|
|
and AL,0Fh
|
|
|
|
|
add AL,'0'
|
|
|
|
|
stosb
|
|
|
|
|
dec DX
|
|
|
|
|
jnz .N1
|
|
|
|
|
mov AL,'.'
|
|
|
|
|
stosb
|
|
|
|
|
.N1:
|
|
|
|
|
dec BX
|
|
|
|
|
loop .NextPair
|
|
|
|
|
mov AL,0
|
|
|
|
|
stosb
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD>㫨 <EFBFBD><EFBFBD>
|
|
|
|
|
mov EDI, Data_String
|
|
|
|
|
mov ESI, Data_String
|
|
|
|
|
; <EFBFBD>ய<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp byte [ESI],'-'
|
|
|
|
|
jne .N2
|
|
|
|
|
inc ESI
|
|
|
|
|
inc EDI
|
|
|
|
|
.N2: ; <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> 1 (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮<EFBFBD> <EFBFBD><EFBFBD>窨)
|
|
|
|
|
mov ecx,18+1+1
|
|
|
|
|
; <EFBFBD>ய<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD>㫨
|
|
|
|
|
.N3:
|
|
|
|
|
cmp byte [ESI],'0'
|
|
|
|
|
jne .N4
|
|
|
|
|
cmp byte [ESI+1],'.'
|
|
|
|
|
je .N4
|
|
|
|
|
inc ESI
|
|
|
|
|
loop .N3
|
|
|
|
|
; <EFBFBD>訡<EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jmp .Error
|
|
|
|
|
; <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>
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.N4: rep movsb
|
|
|
|
|
jmp .End
|
|
|
|
|
; <EFBFBD>訡<EFBFBD><EFBFBD>
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.Error:
|
|
|
|
|
mov AL,'E'
|
|
|
|
|
stosb
|
|
|
|
|
mov AL,'R'
|
|
|
|
|
stosb
|
|
|
|
|
mov AL,'R'
|
|
|
|
|
stosb
|
|
|
|
|
xor AL,AL
|
|
|
|
|
stosb
|
|
|
|
|
jmp .End
|
|
|
|
|
; <EFBFBD><EFBFBD>९<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD>來<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⪨
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.Overflow:
|
|
|
|
|
mov AL,'#'
|
|
|
|
|
stosb
|
|
|
|
|
xor AL,AL
|
|
|
|
|
stosb
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>楤<EFBFBD><EFBFBD><EFBFBD>
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.End:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;****************************************************
|
|
|
|
|
;* <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> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, "<EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD>" <EFBFBD><EFBFBD>ଠ<EFBFBD>) *
|
|
|
|
|
;* <EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* Data_String - <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCII. *
|
|
|
|
|
;* <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* Data_Double - <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;****************************************************
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
String_to_DoubleFloat:
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> Data_BCD
|
|
|
|
|
mov dword [Data_BCD],0
|
|
|
|
|
mov dword [Data_BCD+4],0
|
|
|
|
|
mov word [Data_BCD+8],0
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov [Data_Sign],0
|
2019-03-21 21:08:47 +01:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᨬ <EFBFBD> esi 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|
|
|
|
mov esi, Data_String
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; <EFBFBD>ய<EFBFBD>᪠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>। <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx,64 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>横<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.ShiftIgnore:
|
|
|
|
|
lodsb
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,' '
|
|
|
|
|
jne .ShiftIgnoreEnd
|
|
|
|
|
loop .ShiftIgnore
|
|
|
|
|
jmp .Error
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.ShiftIgnoreEnd:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD>塞 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'-'
|
2011-09-09 22:55:11 +02:00
|
|
|
|
jne .Positive
|
|
|
|
|
mov [Data_Sign],80h
|
|
|
|
|
lodsb
|
|
|
|
|
.Positive:
|
|
|
|
|
mov [Data_Flag],0 ;<EFBFBD>ਧ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>窨
|
2019-03-21 21:08:47 +01:00
|
|
|
|
xor edx,edx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>窨
|
2011-09-09 22:55:11 +02:00
|
|
|
|
mov ecx,18 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD> ࠧ<EFBFBD>冷<EFBFBD>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.ASCIItoBCDConversion:
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'.' ;<EFBFBD><EFBFBD>窠?
|
2011-09-09 22:55:11 +02:00
|
|
|
|
jne .NotDot
|
|
|
|
|
cmp [Data_Flag],0 ;<EFBFBD><EFBFBD>窠 <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砫<EFBFBD><EFBFBD><EFBFBD>?
|
2019-03-21 21:08:47 +01:00
|
|
|
|
jne .Error ;<EFBFBD> <EFBFBD><EFBFBD>窠 㦥 <EFBFBD>뫠
|
2011-09-09 22:55:11 +02:00
|
|
|
|
mov [Data_Flag],1
|
|
|
|
|
lodsb
|
2019-03-21 21:08:47 +01:00
|
|
|
|
or al,al ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>?
|
|
|
|
|
jnz .NotDot
|
2011-09-09 22:55:11 +02:00
|
|
|
|
jmp .ASCIItoBCDConversionEnd
|
2017-12-10 18:34:39 +01:00
|
|
|
|
align 4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.NotDot:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 1 <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 [Data_Flag],0
|
|
|
|
|
jnz .Figures
|
2019-03-21 21:08:47 +01:00
|
|
|
|
inc edx
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.Figures:
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'e'
|
|
|
|
|
je .exp_form
|
|
|
|
|
cmp al,'E'
|
|
|
|
|
jne @f
|
|
|
|
|
.exp_form:
|
|
|
|
|
call string_ExpForm ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD> ..e..
|
|
|
|
|
or al,al
|
|
|
|
|
jnz .Error
|
|
|
|
|
jmp .ASCIItoBCDConversionEnd
|
|
|
|
|
@@:
|
2011-09-09 22:55:11 +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>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'0'
|
2011-09-09 22:55:11 +02:00
|
|
|
|
jb .Error
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'9'
|
2011-09-09 22:55:11 +02:00
|
|
|
|
ja .Error
|
|
|
|
|
; <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> BCD
|
2019-03-21 21:08:47 +01:00
|
|
|
|
and al,15 ;ᨬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0-9 <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
or byte [Data_BCD],al
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; <EFBFBD><EFBFBD>ઠ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp byte [esi],0
|
2011-09-09 22:55:11 +02:00
|
|
|
|
je .ASCIItoBCDConversionEnd
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD <EFBFBD><EFBFBD> 4 ࠧ<EFBFBD>鸞 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; (ᤢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訥 2 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2019-03-21 21:08:47 +01:00
|
|
|
|
mov ax,word [Data_BCD+6]
|
|
|
|
|
shld word [Data_BCD+8],ax,4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; (ᤢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> 4 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2019-03-21 21:08:47 +01:00
|
|
|
|
mov eax,dword [Data_BCD]
|
|
|
|
|
shld dword [Data_BCD+4],eax,4
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; (ᤢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訥 4 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
shl dword [Data_BCD],4
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㦠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>騩 ᨬ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> AL
|
|
|
|
|
lodsb
|
2019-03-21 21:08:47 +01:00
|
|
|
|
loop .ASCIItoBCDConversion ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⠢<EFBFBD><EFBFBD><EFBFBD> dec ecx, jnz ...
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; <EFBFBD> 19-<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>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp al,'.'
|
2011-09-09 22:55:11 +02:00
|
|
|
|
jne .NotDot2
|
2019-03-21 21:08:47 +01:00
|
|
|
|
inc ecx ;<EFBFBD>ய<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>窨 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>祭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>讣<EFBFBD> <EFBFBD><EFBFBD>
|
2011-09-09 22:55:11 +02:00
|
|
|
|
lodsb
|
|
|
|
|
.NotDot2:
|
2019-03-21 21:08:47 +01:00
|
|
|
|
or al,al ;<EFBFBD><EFBFBD>९<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD>來<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⪨?
|
|
|
|
|
jz .ASCIItoBCDConversionEnd
|
|
|
|
|
align 4
|
|
|
|
|
.Error: ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>訡<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fldz ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD>⥪ ᮯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fstp [Data_Double]
|
|
|
|
|
jmp .End
|
2011-09-09 22:55:11 +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> BCD <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.ASCIItoBCDConversionEnd:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-03-21 21:08:47 +01:00
|
|
|
|
mov al,[Data_Sign]
|
|
|
|
|
mov byte [Data_BCD+9],al
|
2011-09-09 22:55:11 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ॣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fninit
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <EFBFBD> ᮯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> BCD-<EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD>
|
|
|
|
|
fbld [Data_BCD]
|
2019-03-21 21:08:47 +01: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>
|
|
|
|
|
lea ebx,[ecx+edx-18]
|
|
|
|
|
cmp ebx,0
|
|
|
|
|
jle .NoMul ;<EFBFBD> <EFBFBD><EFBFBD> e-..
|
|
|
|
|
dec ebx
|
|
|
|
|
jz .NoDiv ;<EFBFBD> <EFBFBD><EFBFBD> e+0
|
|
|
|
|
dec ebx
|
|
|
|
|
lea ebx,[MConst+8*ebx]
|
2019-03-23 09:31:59 +01:00
|
|
|
|
cmp ebx,MConst.end
|
|
|
|
|
jl @f
|
|
|
|
|
ffree st0
|
|
|
|
|
fincstp
|
|
|
|
|
jmp .Error ;<EFBFBD> <EFBFBD>祭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>讥 <EFBFBD><EFBFBD> e+**
|
|
|
|
|
@@:
|
2019-03-21 21:08:47 +01:00
|
|
|
|
fmul qword [ebx] ;㬭<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> e+..)
|
|
|
|
|
jmp .NoDiv
|
|
|
|
|
.NoMul:
|
|
|
|
|
neg ebx
|
|
|
|
|
lea ebx,[MConst+8*ebx]
|
2019-03-23 09:31:59 +01:00
|
|
|
|
cmp ebx,MConst.end
|
|
|
|
|
jl @f
|
|
|
|
|
ffree st0
|
|
|
|
|
fincstp
|
|
|
|
|
jmp .Error ;<EFBFBD> <EFBFBD>祭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쪮<EFBFBD> <EFBFBD><EFBFBD> e-**
|
|
|
|
|
@@:
|
2019-03-21 21:08:47 +01:00
|
|
|
|
fdiv qword [ebx] ;ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD>
|
|
|
|
|
.NoDiv: ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮<EFBFBD> <EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD>
|
|
|
|
|
fstp [Data_Double]
|
2011-09-09 22:55:11 +02:00
|
|
|
|
.End:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
2019-03-21 21:08:47 +01:00
|
|
|
|
;output:
|
|
|
|
|
; eax - 1 if error
|
|
|
|
|
; edx += size
|
|
|
|
|
align 4
|
|
|
|
|
proc string_ExpForm uses ebx
|
|
|
|
|
mov [Data_Sign_Exp],0
|
|
|
|
|
xor eax,eax
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al,'+'
|
|
|
|
|
jne @f
|
|
|
|
|
lodsb
|
|
|
|
|
@@:
|
|
|
|
|
cmp al,'-'
|
|
|
|
|
jne @f
|
|
|
|
|
inc [Data_Sign_Exp]
|
|
|
|
|
lodsb
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
xor ebx,ebx
|
|
|
|
|
.cycle0:
|
|
|
|
|
cmp al,0
|
|
|
|
|
je .cycle0end
|
|
|
|
|
cmp al,9
|
|
|
|
|
je .cycle0end
|
|
|
|
|
cmp al,10
|
|
|
|
|
je .cycle0end
|
|
|
|
|
cmp al,13
|
|
|
|
|
je .cycle0end
|
|
|
|
|
cmp al,' '
|
|
|
|
|
je .cycle0end
|
|
|
|
|
cmp al,'0'
|
|
|
|
|
jb .Error
|
|
|
|
|
cmp al,'9'
|
|
|
|
|
ja .Error
|
|
|
|
|
|
|
|
|
|
imul ebx,10
|
|
|
|
|
and eax,15 ;ᨬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0-9 <EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
add ebx,eax
|
|
|
|
|
lodsb
|
|
|
|
|
jmp .cycle0
|
|
|
|
|
.cycle0end:
|
|
|
|
|
|
2019-03-23 09:31:59 +01:00
|
|
|
|
cmp ebx,328 ;308 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ࠧ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>⥯<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> double + 20 - <EFBFBD><EFBFBD> ࠧ<EFBFBD>冷<EFBFBD> <EFBFBD> BCD
|
|
|
|
|
ja .Error
|
2019-03-21 21:08:47 +01:00
|
|
|
|
cmp [Data_Sign_Exp],0
|
|
|
|
|
je @f
|
|
|
|
|
neg ebx
|
|
|
|
|
@@:
|
|
|
|
|
cmp [Data_Flag],0 ;<EFBFBD><EFBFBD>窠 <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砫<EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jne @f
|
|
|
|
|
dec edx
|
|
|
|
|
@@:
|
|
|
|
|
add edx,ebx
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
jmp @f
|
|
|
|
|
.Error:
|
|
|
|
|
xor eax,eax
|
|
|
|
|
inc eax
|
|
|
|
|
@@:
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2011-09-09 22:55:11 +02:00
|
|
|
|
align 4
|
2017-12-10 18:34:39 +01:00
|
|
|
|
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
|
2011-09-09 22:55:11 +02:00
|
|
|
|
mov esi,dword[str2]
|
|
|
|
|
stdcall str_len,esi
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
inc ecx
|
|
|
|
|
mov edi,dword[str1]
|
|
|
|
|
stdcall str_len,edi
|
|
|
|
|
add edi,eax
|
|
|
|
|
cld
|
|
|
|
|
repne movsb
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;output:
|
|
|
|
|
; eax = strlen
|
|
|
|
|
align 4
|
|
|
|
|
proc str_len, str1:dword
|
|
|
|
|
mov eax,[str1]
|
|
|
|
|
@@:
|
|
|
|
|
cmp byte[eax],0
|
|
|
|
|
je @f
|
|
|
|
|
inc eax
|
|
|
|
|
jmp @b
|
|
|
|
|
@@:
|
|
|
|
|
sub eax,[str1]
|
|
|
|
|
ret
|
2017-12-10 18:34:39 +01:00
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
proc String_crop_0 uses eax ebx ecx edi
|
|
|
|
|
mov edi,Data_String
|
|
|
|
|
mov al,'.'
|
|
|
|
|
mov ecx,32
|
|
|
|
|
repne scasb
|
|
|
|
|
mov ebx,edi
|
|
|
|
|
mov edi,Data_String
|
|
|
|
|
xor al,al
|
|
|
|
|
mov ecx,32
|
|
|
|
|
repne scasb
|
|
|
|
|
cmp ebx,edi
|
|
|
|
|
jg .end_f
|
|
|
|
|
dec edi
|
|
|
|
|
.cycle0:
|
|
|
|
|
dec edi
|
|
|
|
|
cmp edi,Data_String
|
|
|
|
|
jle .end_f
|
|
|
|
|
cmp byte[edi],'0'
|
|
|
|
|
jne .cycle0end
|
|
|
|
|
mov byte[edi],0
|
|
|
|
|
jmp .cycle0
|
|
|
|
|
.cycle0end:
|
|
|
|
|
cmp byte[edi],'.'
|
|
|
|
|
jne .end_f
|
|
|
|
|
mov byte[edi],0
|
|
|
|
|
.end_f:
|
|
|
|
|
ret
|
2011-09-09 22:55:11 +02:00
|
|
|
|
endp
|