clear code

git-svn-id: svn://kolibrios.org@7674 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2019-08-20 15:22:52 +00:00
parent fefed7d26d
commit 39e98c4dca

View File

@ -10,14 +10,16 @@
; 3) ç¨á«® ¢ ¬ è¨­­®¬ ¢¨¤¥ (float) ¯¥à¥¢¥á⨠¢ áâப®¢ë© ¢¨¤ (5 §­ ª®¢ ¯®á«¥ § ¯ï⮩) ; 3) ç¨á«® ¢ ¬ è¨­­®¬ ¢¨¤¥ (float) ¯¥à¥¢¥á⨠¢ áâப®¢ë© ¢¨¤ (5 §­ ª®¢ ¯®á«¥ § ¯ï⮩)
use32 use32
org 0x0 org 0
db 'MENUET01' db 'MENUET01'
dd 0x01,start,i_end,e_end,e_end,0,sys_path dd 1,start,i_end,e_end,e_end,0,sys_path
include '../../../proc32.inc' include '../../../proc32.inc'
include '../../../macros.inc' include '../../../macros.inc'
include '../../../KOSfuncs.inc'
include '../../../develop/libraries/box_lib/load_lib.mac' include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/info3ds/info_fun_float.inc'
include 'lang.inc' include 'lang.inc'
@use_library @use_library
@ -27,12 +29,12 @@ start:
load_libraries l_libs_start,l_libs_end load_libraries l_libs_start,l_libs_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  ¡¨¡«¨®â¥ª  ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  ¡¨¡«¨®â¥ª 
mov ebp,lib_0 mov ebp,lib_0
cmp dword [ebp+ll_struc_size-4],0 cmp dword[ebp+ll_struc_size-4],0
jz @f jz @f
mcall -1 ;exit not correct mcall SF_TERMINATE_PROCESS
@@: @@:
mcall 40,0x27 mcall SF_SET_EVENTS_MASK,0xC0000027
mcall 48, 3, sys_colors, 40 mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
edit_boxes_set_sys_color edit1,editboxes_end,sys_colors edit_boxes_set_sys_color edit1,editboxes_end,sys_colors
option_boxes_set_sys_color sys_colors,Option_boxes1 option_boxes_set_sys_color sys_colors,Option_boxes1
@ -42,7 +44,7 @@ red:
align 4 align 4
still: still:
mcall 10 ; äã­ªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï mcall SF_WAIT_EVENT
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ? cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
je red ; ¥á«¨ ¤  - ­  ¬¥âªã red je red ; ¥á«¨ ¤  - ­  ¬¥âªã red
@ -55,313 +57,135 @@ still:
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横«  jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
;--------------------------------------------------------------------- align 4
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãॠkey: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall 2 mcall SF_GET_KEY
;cmp ah,13 ;cmp ah,13
stdcall [edit_box_key], dword edit1 stdcall [edit_box_key], edit1
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横«  jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
; Š®«¨ç¥á⢮ §­ ª®¢ ç¨á«  ¯®á«¥ § ¯ï⮩ (1-17) align 4
NumberSymbolsAD DW 5 button:
; Š®­áâ ­âë (10 ¢ á⥯¥­¨ N) mcall SF_GET_BUTTON
MConst DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5 cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
DQ 1.0E6,1.0E7,1.0E8,1.0E9,1.0E10 jne @f
DQ 1.0E11,1.0E12,1.0E13,1.0E14,1.0E15 mcall SF_TERMINATE_PROCESS
DQ 1.0E16,1.0E17,1.0E18,1.0E19,1.0E20 @@:
DQ 1.0E21,1.0E22,1.0E23,1.0E24,1.0E25 cmp ah, 5
DQ 1.0E26,1.0E27,1.0E28,1.0E29,1.0E30 jne @f
DQ 1.0E31,1.0E32,1.0E33,1.0E34,1.0E35 cmp dword[option_group1],opt3
DQ 1.0E36,1.0E37,1.0E38,1.0E39,1.0E40 jne .opt_3_end
DQ 1.0E41,1.0E42,1.0E43,1.0E44,1.0E45 stdcall conv_str_to_int,[edit1.text]
DQ 1.0E46,1.0E47,1.0E48,1.0E49,1.0E50 mov dword[Data_Double],eax
DQ 1.0E51,1.0E52,1.0E53,1.0E54,1.0E55 finit
DQ 1.0E56,1.0E57,1.0E58,1.0E59,1.0E60 fld dword[Data_Double]
DQ 1.0E61,1.0E62,1.0E63,1.0E64,1.0E65 fstp qword[Data_Double]
DQ 1.0E66,1.0E67,1.0E68,1.0E69,1.0E70
DQ 1.0E71,1.0E72,1.0E73,1.0E74,1.0E75 ; Data_Double - ¯à¥®¡à §ã¥¬®¥ ç¨á«®
DQ 1.0E76,1.0E77,1.0E78,1.0E79,1.0E80 mov word[NumberSymbolsAD],8 ; ª®«¨ç¥á⢮ §­ ª®¢ ç¨á«  ¯®á«¥ § ¯ï⮩ (1-17)
DQ 1.0E81,1.0E82,1.0E83,1.0E84,1.0E85 call DoubleFloat_to_String
DQ 1.0E86,1.0E87,1.0E88,1.0E89,1.0E90 call String_crop_0
DQ 1.0E91,1.0E92,1.0E93,1.0E94,1.0E95 mov dword[Data_Double],eax ;¢®ááâ ­ ¢«¨¢ ¥¬ §­ ç¥­¨¥ ¢ ä®à¬ â¥ float
DQ 1.0E96,1.0E97,1.0E98,1.0E99,1.0E100 jmp .opt_all_end
DQ 1.0E101,1.0E102,1.0E103,1.0E104,1.0E105 .opt_3_end:
DQ 1.0E106,1.0E107,1.0E108,1.0E109,1.0E110
DQ 1.0E111,1.0E112,1.0E113,1.0E114,1.0E115 mov esi,string1
DQ 1.0E116,1.0E117,1.0E118,1.0E119,1.0E120 mov edi,Data_String
DQ 1.0E121,1.0E122,1.0E123,1.0E124,1.0E125 cld
DQ 1.0E126,1.0E127,1.0E128 mov ecx,32
; —¨á«® á ¯« ¢ î饩 § ¯ï⮩ ¤¢®©­®© â®ç­®á⨠rep movsb
Data_Double DQ ?
; —¨á«® ¢ BCD-ä®à¬ â¥ call String_to_DoubleFloat
Data_BCD DT ? cmp dword[option_group1],opt1
; ‚ᯮ¬®£ â¥«ì­ë© ä« £ jne .opt_all_end ;¥á«¨ ¢ë¡à ­ float, â® ¯à¥®¡à §ã¥¬ ¨§ à ­¥¥ ¯®«ã祭­®£® double
Data_Flag DB ? finit
; ‡­ ª १ã«ìâ â  (¥á«¨ ­¥ 0 - ®âà¨æ â¥«ì­®¥ ç¨á«®) fld qword[Data_Double] ;ç¨â ¥¬ ¨§ double
Data_Sign DB ? fstp dword[Data_Double] ;  ¢®§¢à é ¥¬ ¢® float
; ‘âப  ¤«ï åà ­¥­¨ï ç¨á«  ¢ ª®¤¥ ASCII .opt_all_end:
Data_String DB 32 DUP (?) jmp red
@@:
jmp still
align 4
mouse:
stdcall [edit_box_mouse], edit1
stdcall [option_box_mouse], Option_boxes1
jmp still
;------------------------------------------------
align 4
draw_window:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx, 0x14000000
or edx, [sys_colors.work]
mcall SF_CREATE_WINDOW, (200 shl 16)+300, (200 shl 16)+175, ,,title
mcall SF_DEFINE_BUTTON, ((300-53) shl 16)+38, (145 shl 16)+15, 5, [sys_colors.work_button] ; ª­®¯ª  Ok
mov ecx, 0x80000000
or ecx, [sys_colors.work_text]
mcall SF_DRAW_TEXT, (15 shl 16) +30,, binstr,
mcall , (15 shl 16) +58,, decstr,
mcall , ((240-56*3) shl 16) +58,, Data_String,
mcall , (15 shl 16) +72,, hexstr,
mcall , (15 shl 16)+150,, numstr,
mov ecx, 0x80000000
or ecx, [sys_colors.work_button_text]
mcall , ((300-42) shl 16)+149, , Okstr,3
cmp dword[option_group1],opt1
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
cmp dword[option_group1],opt3
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
mov ecx, dword[Data_Double+4]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(185 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx, dword[Data_Double+4]
mcall ,(8 shl 16)+512,,(240 shl 16)+30, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+30,
ror ecx, 8
@@:
mov ecx,dword[Data_Double]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(240 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx,dword[Data_Double]
mcall , (8 shl 16)+512,,(240 shl 16)+44, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+44,
ror ecx, 8
mcall SF_DRAW_LINE, (15 shl 16)+300-15, (137 shl 16)+137, [sys_colors.work_graph]
stdcall [edit_box_draw], edit1
stdcall [option_box_draw], Option_boxes1
mcall SF_REDRAW,SSF_END_DRAW
ret
string1 db 32 dup (0) string1 db 32 dup (0)
string1_end: string1_end:
;*******************************************************
;* <20><>…Ž<E280A6><C5BD>€‡Ž<E2809A>ˆ… —ˆ‘‹€ <20>€ž™…‰ ‡€<E280A1>ŸŽ‰ <E28098>ŽŠ“ *
;* —¨á«® ¨¬¥¥â ä®à¬ â á 㤢®¥­­®© â®ç­®áâìî, १ã«ìâ â *
;* ¢ë¤ ¥âáï ¢ ¤¥áïâ¨ç­®¬ ª®¤¥, ¢ "¡ë⮢®¬" ä®à¬ â¥ á *
;* 䨪á¨à®¢ ­­ë¬ ª®«¨ç¥á⢮¬ §­ ª®¢ ¯®á«¥ § ¯ï⮩. *
;* ‚室­ë¥ ¯ à ¬¥âàë: *
;* Data_Double - ¯à¥®¡à §ã¥¬®¥ ç¨á«®; *
;* NumberSymbolsAD - ª®«¨ç¥á⢮ §­ ª®¢ ¯®á«¥ *
;* § ¯ï⮩ (0-17). *
;* ‚ë室­ë¥ ¯ à ¬¥âàë: *
;* Data_String - áâப -१ã«ìâ â. *
;*******************************************************
DoubleFloat_to_String:
pushad
; <20>¥§ã«ìâ â § ¯¨á뢠âì ¢ áâபã Data_String
mov EDI, Data_String
; ‘¤¢¨£ ¥¬ ç¨á«® ¢«¥¢® ­  NumberSymbolsAD
; ¤¥áïâ¨ç­ëå à §à冷¢
fninit ;á¡à®á ᮯà®æ¥áá®à 
fld [Data_Double] ;§ £à㧨âì ç¨á«®
xor ebx,ebx
mov BX,[NumberSymbolsAD]
cmp BX, 0
je .NoShifts ;­¥â æ¨äà ¯®á«¥ § ¯ï⮩
jl .Error ;®è¨¡ª 
dec BX
shl BX, 3 ;㬭®¦ ¥¬ ­  8
add EBX, MConst
fmul qword [EBX] ;㬭®¦¨âì ­  ª®­áâ ­âã
.NoShifts:
; ˆ§¢«¥çì ç¨á«® ¢ ª®¤¥ BCD
fbstp [Data_BCD]
; <20>஢¥à¨âì १ã«ìâ â ­  ¯¥à¥¯®«­¥­¨¥
mov AX,word [Data_BCD + 8]
cmp AX,0FFFFh ;"¤¥áïâ¨ç­®¥" ¯¥à¥¯®«­¥­¨¥?
je .Overflow
; ‚뤥«¨âì §­ ª ç¨á«  ¨ § ¯¨á âì ¥£® ¢ ASCII-ª®¤¥
mov AL, byte [Data_BCD + 9]
and AL,AL
jz .NoSign
mov AL,'-'
stosb
.NoSign:
; <20> á¯ ª®¢ âì ç¨á«® ¢ ª®¤ ASCII
mov ebx,8 ;ᬥ饭¨¥ ¯®á«¥¤­¥© ¯ àë æ¨äà
mov ecx,9 ;áç¥â稪 ¯ à æ¨äà
; Ž¯à¥¤¥«¨âì ¯®§¨æ¨î ¤¥áïâ¨ç­®© â®çª¨ ¢ ç¨á«¥
mov DX,18
sub DX,[NumberSymbolsAD]
js .Error ;®è¨¡ª , ¥á«¨ ®âà¨æ â¥«ì­ ï
jz .Error ;¨«¨ ­ã«¥¢ ï ¯®§¨æ¨ï
.NextPair:
; ‡ £à㧨âì ®ç¥à¥¤­ãî ¯ àã à §à冷¢
mov AL, byte [ebx + Data_BCD]
mov AH,AL
; ‚뤥«¨âì, ¯¥à¥¢¥á⨠¢ ASCII ¨
; á®åà ­¨âì áâ àèãî â¥âà ¤ã
shr AL,4
add AL,'0'
stosb
dec DX
jnz .N0
mov AL,'.'
stosb
.N0: ; ‚뤥«¨âì, ¯¥à¥¢¥á⨠¢ ASCII ¨
; á®åà ­¨âì ¬« ¤èãî â¥âà ¤ã
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
; “¡à âì ­¥§­ ç é¨¥ ­ã«¨ á«¥¢ 
mov EDI, Data_String
mov ESI, Data_String
; <20>யãáâ¨âì §­ ª ç¨á« , ¥á«¨ ®­ ¥áâì
cmp byte [ESI],'-'
jne .N2
inc ESI
inc EDI
.N2: ; ‡ £à㧨âì ¢ áç¥â稪 横«  ª®«¨ç¥á⢮ à §à冷¢
; ç¨á«  ¯«îá 1 (¡ ©â ¤¥áïâ¨ç­®© â®çª¨)
mov ecx,18+1+1
; <20>யãáâ¨âì ­¥§­ ç é¨¥ ­ã«¨
.N3:
cmp byte [ESI],'0'
jne .N4
cmp byte [ESI+1],'.'
je .N4
inc ESI
loop .N3
; Žè¨¡ª  - ­¥â §­ ç é¨å æ¨äà
jmp .Error
; ‘ª®¯¨à®¢ âì §­ ç éãî ç áâì ç¨á«  ¢ ­ ç «® áâப¨
.N4: rep movsb
jmp .End
; Žè¨¡ª 
.Error:
mov AL,'E'
stosb
mov AL,'R'
stosb
mov AL,'R'
stosb
xor AL,AL
stosb
jmp .End
; <20>¥à¥¯®«­¥­¨¥ à §à來®© á¥âª¨
.Overflow:
mov AL,'#'
stosb
xor AL,AL
stosb
; Š®­¥æ ¯à®æ¥¤ãàë
.End:
popad
ret
;****************************************************
;* <20><>…Ž<E280A6><C5BD>€‡Žœ <E28098>ŽŠ“ —ˆ‘‹Ž <20>€ž™…‰ ‡€<E280A1>ŸŽ‰ *
;* (ç¨á«® ¨¬¥¥â ®¡ëç­ë©, "¡ë⮢®©" ä®à¬ â) *
;* ‚室­ë¥ ¯ à ¬¥âàë: *
;* Data_String - ç¨á«® ¢ ª®¤¥ ASCII. *
;* ‚ë室­ë¥ ¯ à ¬¥âàë: *
;* Data_Double - ç¨á«® ¢ ¤¢®¨ç­®¬ ª®¤¥. *
;****************************************************
String_to_DoubleFloat:
pushad
cld
; Žç¨é ¥¬ Data_BCD
mov dword [Data_BCD],0
mov dword [Data_BCD+4],0
mov word [Data_BCD+8],0
; Žç¨é ¥¬ ¡ ©â §­ ª 
mov [Data_Sign],0
; ‡ ­®á¨¬ ¢ SI 㪠§ â¥«ì ­  áâபã
mov ESI, Data_String
; <20>யã᪠¥¬ ¯à®¡¥«ë ¯¥à¥¤ ç¨á«®¬
mov ecx,64 ;§ é¨â  ®â § æ¨ª«¨¢ ­¨ï
.ShiftIgnore:
lodsb
cmp AL,' '
jne .ShiftIgnoreEnd
loop .ShiftIgnore
jmp .Error
.ShiftIgnoreEnd:
; <20>஢¥à塞 §­ ª ç¨á« 
cmp AL,'-'
jne .Positive
mov [Data_Sign],80h
lodsb
.Positive:
mov [Data_Flag],0 ;¯à¨§­ ª ­ «¨ç¨ï â®çª¨
mov DX,0 ;¯®§¨æ¨ï â®çª¨
mov ecx,18 ;¬ ªá. ç¨á«® à §à冷¢
.ASCIItoBCDConversion:
cmp AL,'.' ;â®çª ?
jne .NotDot
cmp [Data_Flag],0 ;â®çª  ­¥ ¢áâà¥ç « áì?
jne .Error
mov [Data_Flag],1
lodsb
cmp AL,0 ;ª®­¥æ áâப¨?
jne .NotDot
jmp .ASCIItoBCDConversionEnd
.NotDot:
; “¢¥«¨ç¨âì ­  1 §­ ç¥­¨¥ ¯®§¨æ¨¨ â®çª¨,
; ¥á«¨ ®­  ¥é¥ ­¥ ¢áâà¥ç « áì
cmp [Data_Flag],0
jnz .Figures
inc DX
.Figures:
; ‘¨¬¢®«ë ç¨á«  ¤®«¦­ë ¡ëâì æ¨äà ¬¨
cmp AL,'0'
jb .Error
cmp AL,'9'
ja .Error
; <20>¨è¥¬ ®ç¥à¥¤­ãî æ¨äàã ¢ ¬« ¤èãî â¥âà ¤ã BCD
and AL,0Fh
or byte [Data_BCD],AL
; <20>஢¥àª  ­  ª®­¥æ áâப¨
cmp byte [ESI],0
je .ASCIItoBCDConversionEnd
; ‘¤¢¨£ ¥¬ BCD ­  4 à §à鸞 ¢«¥¢®
; (ᤢ¨£ ¥¬ áâ à訥 2 ¡ ©â )
mov AX,word [Data_BCD+6]
shld word [Data_BCD+8],AX,4
; (ᤢ¨£ ¥¬ á।­¨¥ 4 ¡ ©â )
mov EAX, dword [Data_BCD]
shld dword [Data_BCD+4],EAX,4
; (ᤢ¨£ ¥¬ ¬« ¤è¨¥ 4 ¡ ©â )
shl dword [Data_BCD],4
; ‡ £à㦠¥¬ á«¥¤ãî騩 ᨬ¢®« ¢ AL
lodsb
loop .ASCIItoBCDConversion
; …᫨ 19-© ᨬ¢®« ­¥ 0 ¨ ­¥ â®çª ,
; â® ®è¨¡ª  ¯¥à¥¯®«­¥­¨ï
cmp AL,'.'
jne .NotDot2
inc ecx
lodsb
.NotDot2:
cmp AL,0
jne .Error ;¯¥à¥¯®«­¥­¨¥ à §à來®© á¥âª¨
; <20><>…Ž<E280A6><C5BD>€‡Žœ —ˆ‘‹Ž ˆ‡ ŠŽ„€ BCD …™…<E2809A><E280A6>Ž… —ˆ‘‹Ž
.ASCIItoBCDConversionEnd:
; ‚¯¨á âì §­ ª ¢ áâ à訩 ¡ ©â
mov AL,[Data_Sign]
mov byte [Data_BCD+9],AL
; ‘¡à®á¨âì ॣ¨áâàë ᮯà®æ¥áá®à 
fninit
; ‡ £à㧨âì ¢ ᮯà®æ¥áá®à ç¨á«® ¢ BCD-ä®à¬ â¥
fbld [Data_BCD]
; ‚ëç¨á«¨âì ­®¬¥à ¤¥«¨â¥«ï
mov EBX,18+1
sub BX,CX
sub BX,DX
cmp EBX,0
je .NoDiv
dec EBX
shl EBX,3 ;㬭®¦ ¥¬ ­  8
add EBX, MConst
fdiv qword [EBX] ;à §¤¥«¨âì ­  ª®­áâ ­âã
.NoDiv:; ‚ë£à㧨âì ç¨á«® ¢ ¤¢®¨ç­®¬ ä®à¬ â¥
fstp [Data_Double]
jmp .End
.Error:; <20>ਠ«î¡®© ®è¨¡ª¥ ®¡­ã«¨âì १ã«ìâ â
fldz ;§ ­¥á⨠­®«ì á á⥪ ᮯà®æ¥áá®à 
fstp [Data_Double]
.End:
popad
ret
;input: ;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥ ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output: ;output:
; eax - ç¨á«® ; eax - ç¨á«®
align 4 align 4
proc conv_str_to_int, buf:dword proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax xor eax,eax
push ebx ecx esi
xor ebx,ebx xor ebx,ebx
mov esi,[buf] mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥« ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
@ -423,124 +247,11 @@ proc conv_str_to_int, buf:dword
sub ecx,eax sub ecx,eax
mov eax,ecx mov eax,ecx
@@: @@:
pop esi ecx ebx
ret ret
endp endp
;---------------------------------------------------------------------
align 4
button:
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
jne @f
mcall -1
@@:
cmp ah, 5
jne @f
cmp dword[option_group1],opt3
jne .opt_3_end
stdcall conv_str_to_int,dword[edit1.text]
mov dword[Data_Double],eax
finit
fld dword[Data_Double]
fstp qword[Data_Double]
; Data_Double - ¯à¥®¡à §ã¥¬®¥ ç¨á«®
; NumberSymbolsAD - ª®«¨ç¥á⢮ §­ ª®¢ ¯®á«¥ § ¯ï⮩ (0-17)
call DoubleFloat_to_String
mov dword[Data_Double],eax ;¢®ááâ ­ ¢«¨¢ ¥¬ §­ ç¥­¨¥ ¢ ä®à¬ â¥ float
jmp .opt_all_end
.opt_3_end:
mov esi,string1
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
cmp dword[option_group1],opt1
jne .opt_all_end ;¥á«¨ ¢ë¡à ­ float, â® ¯à¥®¡à §ã¥¬ ¨§ à ­¥¥ ¯®«ã祭­®£® double
finit
fld qword[Data_Double] ;ç¨â ¥¬ ¨§ double
fstp dword[Data_Double] ;  ¢®§¢à é ¥¬ ¢® float
.opt_all_end:
jmp red
@@:
jmp still
mouse:
stdcall [edit_box_mouse], edit1
stdcall [option_box_mouse], Option_boxes1
jmp still
;------------------------------------------------
align 4
draw_window:
mcall 48, 3, sys_colors, sizeof.system_colors
mcall 12, 1
mov edx, 0x14000000
or edx, [sys_colors.work]
mcall 0, 200*65536+300, 200*65536+175, ,,title
mcall 8, (300-53)*65536+38,145*65536+ 15, 5,[sys_colors.work_button] ; ª­®¯ª  Ok
mov ecx, 0x80000000
or ecx, [sys_colors.work_text]
mcall 4, 15*65536 +30,, binstr,
mcall , 15*65536 +58,, decstr,
mcall , (240-56*3)*65536 +58,, Data_String,
mcall , 15*65536 +72,, hexstr,
mcall , 15*65536+150,, numstr,
mov ecx, 0x80000000
or ecx, [sys_colors.work_button_text]
mcall , (300-42)*65536+149, , Okstr,3
cmp dword[option_group1],opt1
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
cmp dword[option_group1],opt3
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
mov ecx, dword[Data_Double+4]
mcall 47, 8*65536+256,,185*65536+72,[sys_colors.work_text] ; 16-­ ï
mov ecx, dword[Data_Double+4]
mcall ,8*65536+512,,240*65536+30, ; 2-­ ï
ror ecx, 8
mcall ,,,(240-56)*65536+30,
ror ecx, 8
mcall ,,,(240-56*2)*65536+30,
ror ecx, 8
mcall ,,,(240-56*3)*65536+30,
ror ecx, 8
@@:
mov ecx,dword[Data_Double]
mcall 47, 8*65536+256,,240*65536+72,[sys_colors.work_text] ; 16-­ ï
mov ecx,dword[Data_Double]
mcall , 8*65536+512,,240*65536+44, ; 2-­ ï
ror ecx, 8
mcall ,,,(240-56)*65536+44,
ror ecx, 8
mcall ,,,(240-56*2)*65536+44,
ror ecx, 8
mcall ,,,(240-56*3)*65536+44,
ror ecx, 8
mcall 38, 15*65536+300-15, 137*65536+137, [sys_colors.work_graph]
stdcall [edit_box_draw], edit1
stdcall [option_box_draw], Option_boxes1
mcall 12, 2 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
ret
;------------------------------------------------- ;-------------------------------------------------
title db 'string to double 07.09.11',0 title db 'string to double 20.08.19',0
hexstr db 'hex:',0 hexstr db 'hex:',0
decstr db 'dec:',0 decstr db 'dec:',0
binstr db 'bin:',0 binstr db 'bin:',0
@ -549,12 +260,16 @@ if lang eq ru
numstr db '—¨á«®:',0 numstr db '—¨á«®:',0
Okstr db '‚¢®¤',0 Okstr db '‚¢®¤',0
head_f_i: head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 head_f_l db '"‘¨á⥬­ ï ®è¨¡ª ',0
err_msg_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,'" -tE',0
err_msg_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,'" -tW',0
else else
numstr db 'Number:',0 numstr db 'Number:',0
Okstr db 'Ok',0 Okstr db 'Ok',0
head_f_i: head_f_i:
head_f_l db 'System error',0 head_f_l db '"System error',0
err_msg_found_lib_0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,'" -tE',0
err_msg_import_0 db 'Error on load import library ',39,'box_lib',39,'" -tW',0
end if end if
mouse_dd dd 0 mouse_dd dd 0
@ -576,8 +291,7 @@ Option_boxes1 dd opt1, opt2, opt3, 0
system_dir_0 db '/sys/lib/' system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0 lib_name_0 db 'box_lib.obj',0
err_msg_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_msg_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
l_libs_start: l_libs_start:
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\ lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
@ -606,7 +320,8 @@ dd 0,0
i_end: i_end:
sys_colors system_colors sys_colors system_colors
rb 0x400 ;stack align 16
sys_path rb 4096 sys_path rb 4096
library_path rb 4096 library_path rb 4096
rb 0x400 ;stack
e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë