@RB - some optimisations and code refactoring

git-svn-id: svn://kolibrios.org@2510 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-03-27 09:57:38 +00:00
parent a540a71a13
commit 8cdca726a0
3 changed files with 301 additions and 289 deletions

View File

@ -7,223 +7,229 @@
;
; Compile with flat assembler
;
;------------------------------------------------------------------------------
; version: 1.1
; last update: 27/03/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: The program uses only 3404 bytes memory is now.
; Optimisations and code refactoring.
;------------------------------------------------------------------------------
include 'lang.inc'
include '..\..\..\macros.inc'
meos_app_start
code
mov eax, 48 ; ¯®«ãç¨âì á¨á⥬­ë¥ 梥â 
mov ebx, 3
mov ecx, sc ;  ¤à¥á áâàãªâãàë
mov edx, sizeof.system_colors ; ¨ ¥¥ à §¬¥à
mcall
mov eax,40 ; ãáâ ­®¢¨¬ ¬ áªã ᮡë⨩
mov ebx,100000b ; ­ á ¨­â¥à¥áã¥â ⮫쪮 ¬ëèì
mcall
;------------------------------------------------------------------------------
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd IM_END ; size of image
dd I_END ; memory for app
dd stack_area ; esp
dd 0 ; boot parameters
dd 0 ; path
;------------------------------------------------------------------------------
START:
; ¯®«ãç¨âì á¨á⥬­ë¥ 梥â 
mcall 48,3,sc,sizeof.system_colors
; ãáâ ­®¢¨¬ ¬ áªã ᮡë⨩ - ­ á ¨­â¥à¥áã¥â ⮫쪮 ¬ëèì
mcall 40,100000b
;------------------------------------------------------------------------------
align 4
still: ; £« ¢­ë© 横« ®á­®¢­®£® ¯à®æ¥áá 
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
mcall
mcall 37,2 ; ª ª¨¥ ­ ¦ âë ª¯®¯ª¨?
cmp eax,ebx ; ¥á«¨ ­¥ ¯à ¢ ï, ¢®§¢à â
jne still
;--------------------------------------
; íâ® ¤«ï ®â« ¤ª¨ - ¥á«¨ ¬ëèì ¢ â®çª¥ (0;0), § ªà®¥¬áï
; xor ebx,ebx
; mcall 37
; test eax,eax ; ªãàá®à ¢ â®çª¥ (0;0), â.¥. eax = 0
; je exit
;--------------------------------------
; ¯®«ã稬 ç¨á«® ¯à®æ¥áᮢ ¢ á¨á⥬¥
xor ecx,ecx
mcall 9,procinfo
mov eax,37 ; ª ª¨¥ ­ ¦ âë ª¯®¯ª¨?
mov ebx,2
mcall
inc eax ; ⥯¥àì ¢ eax ᮤ¥à¦¨âáï ç¨á«® ¯à®æ¥áᮢ + 1
mov [processes],eax
mov ecx,1
;--------------------------------------
align 4
new_process:
pushad
; ¯®«ã稬 ¨­ä®à¬ æ¨î ® ¯à®æ¥áá¥; ­®¬¥à - ¢ ecx
mcall 9,procinfo
; ª®®à¤¨­ âë ªãàá®à 
xor ebx,ebx
mcall 37
cmp eax,ebx ; ¥á«¨ ­¥ ¯à ¢ ï, ¢®§¢à â
jne still
;---¯®¥å «¨!---
; mov eax,37 ; íâ® ¤«ï ®â« ¤ª¨ - ¥á«¨ ¬ëèì ¢ â®çª¥ (0;0), § ªà®¥¬áï
; xor ebx,ebx
; mcall
; test eax,eax ; ªãàá®à ¢ â®çª¥ (0;0), â.¥. eax = 0
; je exit
mov eax,9 ; ¯®«ã稬 ç¨á«® ¯à®æ¥áᮢ ¢ á¨á⥬¥
mov ebx,procinfo
xor ecx,ecx
mcall
inc eax ; ⥯¥àì ¢ eax ᮤ¥à¦¨âáï ç¨á«® ¯à®æ¥áᮢ + 1
mov [processes],eax
mov ecx,1
new_process:
pushad
mov eax,9 ; ¯®«ã稬 ¨­ä®à¬ æ¨î ® ¯à®æ¥áá¥; ­®¬¥à - ¢ ecx
mov ebx,procinfo
mcall
mov eax,37 ; ª®®à¤¨­ âë ªãàá®à 
xor ebx,ebx
mcall
mov ebx,eax ; eax = cursor_x
shr eax,16 ; ebx = cursor_y
and ebx,0xffff
mov [curx1],eax ; curx1 = cursor_x
mov [cury1],ebx ; cury1 = cursor_y
mov ebx,eax ; eax = cursor_x
shr eax,16 ; ebx = cursor_y
and ebx,0xffff
mov [curx1],eax ; curx1 = cursor_x
mov [cury1],ebx ; cury1 = cursor_y
; \begin{diamond}[18.09.2006]
; ignore minimized windows
test [procinfo.wnd_state], 2
jnz ne_goden
; \end{diamond}[18.09.2006]
mov eax,[procinfo.box.left] ; eax = wnd_x_start
mov ebx,[procinfo.box.top] ; ebx = wnd_y_start
mov eax,[procinfo.box.left] ; eax = wnd_x_start
mov ebx,[procinfo.box.top] ; ebx = wnd_y_start
mov ecx,[procinfo.box.width]
add ecx,eax ; ecx = wnd_x_end
mov edx,[procinfo.box.height]
add edx,ebx ; ecx = wnd_y_end
mov ecx,[procinfo.box.width]
add ecx,eax ; ecx = wnd_x_end
mov edx,[procinfo.box.height]
add edx,ebx ; ecx = wnd_y_end
cmp eax,[curx1] ; wnd_x_start > cursor_x => ªãàá®à «¥¢¥¥ ®ª­ 
jg ne_goden
cmp ecx,[curx1] ; wnd_x_end < cursor_x => ªãàá®à ¯à ¢¥¥ ®ª­ 
jl ne_goden
cmp ebx,[cury1] ; wnd_y_start > cursor_y => ªãàá®à ¢ëè¥ ®ª­ 
jg ne_goden
cmp edx,[cury1] ; wnd_y_end < cursor_y => ªãàá®à ­¨¦¥ ®ª­ 
jl ne_goden
cmp eax,[curx1] ; wnd_x_start > cursor_x => ªãàá®à «¥¢¥¥ ®ª­ 
jg ne_goden
cmp ecx,[curx1] ; wnd_x_end < cursor_x => ªãàá®à ¯à ¢¥¥ ®ª­ 
jl ne_goden
cmp ebx,[cury1] ; wnd_y_start > cursor_y => ªãàá®à ¢ëè¥ ®ª­ 
jg ne_goden
cmp edx,[cury1] ; wnd_y_end < cursor_y => ªãàá®à ­¨¦¥ ®ª­ 
jl ne_goden
;--------------------------------------
align 4
goden: ; ª«¨ª ¡ë« ¢­ãâਠª ª®£®-â® ®ª­ , ¯®í⮬㠭¨ç¥£® ­¥ ¤¥« ¥¬
popad
jmp still
popad
jmp still
;--------------------------------------
align 4
ne_goden: ; ª«¨ª ¡ë« á­ à㦨 à áᬠâਢ ¥¬®£® ®ª­ , ¯®í⮬ã
popad
inc ecx
cmp ecx,[processes]
jl new_process ; «¨¡® ᬮਬ á«¥¤ãî饥 ®ª­®, «¨¡® § ¯ã᪠¥¬ ¬¥­î
popad
inc ecx
cmp ecx,[processes]
jl new_process ; «¨¡® ᬮਬ á«¥¤ãî饥 ®ª­®, «¨¡® § ¯ã᪠¥¬ ¬¥­î
;--------------------------------------
align 4
@@: ; ¯®¤®¦¤ñ¬, ¯®ª  ¯®«ì§®¢ â¥«ì ­¥ ®â¯ãá⨫ ¯à ¢ãî ª­®¯ªã ¬ëè¨
mov eax,37
mov ebx,2 ; äã­ªæ¨ï 37-2:
mcall ; ­ ¦ âë «¨ ª­®¯ª¨ ¬ëè¨?
test eax,ebx ; ¥á«¨ ®â¯ãá⨫, (eax != 2)
jz @f ; ¨¤ñ¬ ¢ ­ ç «® £« ¢­®£® 横« 
mcall 37,2 ; ­ ¦ âë «¨ ª­®¯ª¨ ¬ëè¨?
test eax,ebx ; ¥á«¨ ®â¯ãá⨫, (eax != 2)
jz @f ; ¨¤ñ¬ ¢ ­ ç «® £« ¢­®£® 横« 
mov eax,5 ; ¨­ ç¥
;mov ebx,2 ; ¯®¤®¦¤ñ¬ 2 ¬á
mcall
jmp @b ; ¨ ¯à®¢¥à¨¬ ¬ëèì ®¯ïâì
mcall 68,1 ; ¨­ ç¥ ¯¥à¥ª«î稬áï ­  á«¥¤ãî騩 ¯®â®ª á¨áâ¥¬ë ¨ ª®£¤ 
jmp @b ; ¢ë¯®«­¥­¨¥ ¢¥à­¥âáï í⮬㠯®â®ªã, ¯à®¢¥à¨¬ ¬ëèì ®¯ïâì
;--------------------------------------
align 4
@@:
; ¥á«¨ 㦥 ¡ë«® ®âªàëâ® ¬¥­î, ­ã¦­® ¯®¤®¦¤ âì, ¯®ª  ®­® § ªà®¥âáï:
cmp [menu_opened],0
je @f
mcall 68,1 ; ¯¥à¥ª«î稬áï ­  á«¥¤ãî騩 ¯®â®ª á¨á⥬ë
; ¡®«¥¥ íä䥪⨢­ë© ᯮᮡ § ¤¥à¦ª¨ 祬 mcall 5
jmp @b
;--------------------------------------
align 4
@@:
cmp [menu_opened],0
je @f
mov eax,5
mov ebx,3 ; ¦¤ñ¬ 3 ¬á
mcall
jmp @b
@@:
mov eax,51 ;   ⥯¥àì ¬®¦­® ᬥ«® § ¯ã᪠âì ¯à®æ¥áá (¯®â®ª) ¬¥­î
mov ebx,1 ; ᮧ¤ ñ¬ ¯®â®ª (thread)
mov ecx,start_wnd ; â®çª  ¢å®¤  ¯®â®ª 
mov edx,stack_wnd ; ¢¥à設  áâíª  ¤«ï ¯®â®ª 
mcall
jmp still
;   ⥯¥àì ¬®¦­® ᬥ«® § ¯ã᪠âì ¯à®æ¥áá (¯®â®ª) ¬¥­î
mcall 51,1,start_wnd,stack_wnd
jmp still
;------------------------------------------------------------------------------
align 4
exit_menu: ; ¥á«¨ ¢ë室¨¬ ¨§ ¬¥­î, ­ ¤® § ¯¨á âì ¢ [menu_opened] 0
mov [menu_opened],0
mov [menu_opened],0
;--------------------------------------
align 4
exit: ; á ¬ë ¨¤ñ¬, ª®£¤  ¢ë室¨¬ ¨§ ®á­®¢­®£® ¯à®æ¥áá 
or eax,-1 ; eax = -1
mcall
or eax,-1 ; eax = -1
mcall
;------------------------------------------------------------------------------
; §¤¥áì áâ àâã¥â ¯à®æ¥áá ¬¥­î
;------------------------------------------------------------------------------
align 4
start_wnd:
mov [menu_opened],1
mov eax,40 ; ãáâ ­®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩ ¤«ï í⮣® ¯à®æ¥áá 
mov ebx,100101b ; ¬¥­î + ª­®¯ª¨ + ¯¥à¥à¨á®¢ª 
mcall
mov [menu_opened],1
; ãáâ ­®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩: ¬¥­î + ª­®¯ª¨ + ¯¥à¥à¨á®¢ª 
mcall 40,100101b
;------------------------------------------------------------------------------
align 4
red:
call draw_window
call draw_window
;------------------------------------------------------------------------------
align 4
still2: ; £« ¢­ë© 横« ¯à®æ¥áá  ¬¥­î
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
mov eax,10 ; ¦¤ñ¬ ᮡëâ¨ï
mcall
cmp eax,1 ; ¯¥à¥à¨á®¢ª ?
je red
cmp eax,3 ; ª­®¯ª ?
je button
cmp eax,6 ; ¬ëèì?
je mouse
jmp still2 ; ¢¥à­ñ¬áï ¢ ­ ç «® £« ¢­®£® 横« 
cmp eax,1 ; ¯¥à¥à¨á®¢ª ?
je red
cmp eax,3 ; ª­®¯ª ?
je button
cmp eax,6 ; ¬ëèì?
je mouse
jmp still2 ; ¢¥à­ñ¬áï ¢ ­ ç «® £« ¢­®£® 横« 
;------------------------------------------------------------------------------
align 4
; Ž<><C5BD><EFBFBD>ŽˆŠ Œ›˜ˆ
mouse: ; ª®£¤  ¯®«ì§®¢ â¥«ì ­ ¦¬ñâ ª­®¯ªã ¬ëè¨, § ªà®¥¬áï
mov eax,37
mov ebx,2 ; ª ª¨¥ ª­®¯ª¨ ­ ¦ âë?
mcall
test eax,eax ; ­¨ª ª¨¥? - ⮣¤  ¯à¥ªà á­®! ¢¥à­ñ¬áï ¢ £« ¢­ë© 横«
jz still2
mcall 37,2 ; ª ª¨¥ ª­®¯ª¨ ­ ¦ âë?
test eax,eax ; ­¨ª ª¨¥? - ⮣¤  ¯à¥ªà á­®! ¢¥à­ñ¬áï ¢ £« ¢­ë© 横«
jz still2
mcall 37,0
mcall 37, 0
mov esi, eax
shr esi, 16
movzx edi, ax
mcall 9, procinfo2, -1
mov eax, [procinfo2.box.left]
mcall 9, procinfo, -1
mov eax, [procinfo.box.left]
cmp esi, eax
jl exit_menu
add eax, [procinfo2.box.width]
add eax, [procinfo.box.width]
cmp esi, eax
jge exit_menu
mov eax, [procinfo2.box.top]
mov eax, [procinfo.box.top]
cmp edi, eax
jl exit_menu
add eax, [procinfo2.box.height]
add eax, [procinfo.box.height]
cmp edi, eax
jge exit_menu
jmp still2
;------------------------------------------------------------------------------
align 4
; <20>€†€€ Š<>Ž<EFBFBD>Š€
button:
mov eax,17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
mcall
mcall 17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
sub ah,10 ; áà ¢­¨¢ ¥¬ á 10
jl nofuncbtns ; ¥á«¨ ¬¥­ìè¥ - § ªà뢠¥¬ ¬¥­î
sub ah,10 ; áà ¢­¨¢ ¥¬ á 10
jl nofuncbtns ; ¥á«¨ ¬¥­ìè¥ - § ªà뢠¥¬ ¬¥­î
movzx ebx,ah ; ¯®«ã稫¨ ­®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
mov esi, [startapps + ebx*4]
mov edi, start_info.path
cld
@@:
lodsb
stosb
test al, al
jnz @b
mcall 70, start_info
movzx ebx,ah ; ¯®«ã稫¨ ­®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
mov esi,[startapps + ebx*4]
mov edi,start_info.path
cld
;--------------------------------------
align 4
@@:
lodsb
stosb
test al,al
jnz @b
mcall 70, start_info
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª  ¯à®£à ¬¬  § ¯ãáâ¨âìáï
; mov ebx,1 ;   â® ¥ñ ®ª­® ­¥ ¡ã¤¥â ®âà¨á®¢ ­® (¡ £ ¢ ï¤à¥???)
; mcall ; à áª®¬¬¥­â¨àã©â¥ í⨠áâப¨, ¥á«¨ ã ¢ á ¯à®¡«¥¬ë
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª  ¯à®£à ¬¬  § ¯ãáâ¨âìáï
; mov ebx,1 ;   â® ¥ñ ®ª­® ­¥ ¡ã¤¥â ®âà¨á®¢ ­® (¡ £ ¢ ï¤à¥???)
; mcall ; à áª®¬¬¥­â¨àã©â¥ í⨠áâப¨, ¥á«¨ ã ¢ á ¯à®¡«¥¬ë
; á ®âà¨á®¢ª®©
;--------------------------------------
align 4
nofuncbtns: ; § ªà뢠¥¬ ¬¥­î
jmp exit_menu
jmp exit_menu
;------------------------------------------------------------------------------
_BTNS_ = 6 ; ª®«¨ç¥á⢮ ª­®¯®ª ("¯ã­ªâ®¢ ¬¥­î")
if lang eq ru
@ -237,118 +243,113 @@ else
wnd_x_size = 105 ; è¨à¨­  ®ª­ 
title_pos = 23 shl 16 + 7
end if
;------------------------------------------------------------------------------
;*******************************
;******** <20>ˆ“…Œ ŽŠ<C5BD>Ž ********
;*******************************
draw_window:
mcall 12,1 ; ­ ç¨­ ¥¬ "à¨á®¢ âì"
mov eax,12 ; ­ ç¨­ ¥¬ "à¨á®¢ âì"
mov ebx,1
mcall
mov eax,[curx1] ; ⥪ã騥 ª®®à¤¨­ âë ªãàá®à 
mov [curx],eax ; § ¯¨è¥¬ ¢ ª®®à¤¨­ âë ®ª­ 
mov eax,[cury1]
mov [cury],eax
mov eax,[curx1] ; ⥪ã騥 ª®®à¤¨­ âë ªãàá®à 
mov [curx],eax ; § ¯¨è¥¬ ¢ ª®®à¤¨­ âë ®ª­ 
mov eax,[cury1]
mov [cury],eax
; ⥯¥àì ¡ã¤¥¬ áç¨â âì ª®®à¤¨­ âë ®ª­ , çâ®¡ë ®­® §  ªà © íªà ­  ­¥ ¢ë«¥§«®
mov eax,14 ; ¯®«ã稬 à §¬¥à íªà ­ 
mcall
mov ebx,eax
shr eax,16 ; ¢ eax - x_screen
and ebx,0xffff ; ¢ ebx - y_screen
add eax,-wnd_x_size ; eax = [x_screen - è¨à¨­  ®ª­ ]
add ebx,-_BTNS_*15-21 ; ebx = [y_screen - ¢ëá®â  ®ª­ ]
mcall 14 ; ¯®«ã稬 à §¬¥à íªà ­ 
cmp eax,[curx]
jg .okx ; ¥á«¨ ®ª­® ᫨誮¬ ¡«¨§ª® ª ¯à ¢®¬ã ªà î,
add [curx],-wnd_x_size ; ᤢ¨­¥¬ ¥£® ¢«¥¢® ­  100
.okx:
mov ebx,eax
shr eax,16 ; ¢ eax - x_screen
and ebx,0xffff ; ¢ ebx - y_screen
add eax,-wnd_x_size ; eax = [x_screen - è¨à¨­  ®ª­ ]
add ebx,-_BTNS_*15-21 ; ebx = [y_screen - ¢ëá®â  ®ª­ ]
cmp ebx, [cury]
jg .oky ; ¯® ¢¥à⨪ «¨ â®ç­® â ª¦¥
add [cury], -_BTNS_*15-21
.oky:
cmp eax,[curx]
jg .okx ; ¥á«¨ ®ª­® ᫨誮¬ ¡«¨§ª® ª ¯à ¢®¬ã ªà î,
add [curx],-wnd_x_size ; ᤢ¨­¥¬ ¥£® ¢«¥¢® ­  100
;--------------------------------------
align 4
.okx:
cmp ebx, [cury]
jg .oky ; ¯® ¢¥à⨪ «¨ â®ç­® â ª¦¥
add [cury], -_BTNS_*15-21
;--------------------------------------
align 4
.oky:
xor eax, eax ; äã­ªæ¨ï 0 - ᮧ¤ âì ®ª­®
mov ebx, [curx] ; ebx = [ª®®à¤¨­ â  ¯® x] shl 16 + [è¨à¨­ ]
shl ebx, 16
add ebx, wnd_x_size
mov ecx, [cury] ; ecx = [ª®®à¤¨­ â  ¯® y] shl 16 + [¢ëá®â ]
shl ecx, 16
add ecx, _BTNS_*15+21
mov edx, [sc.work] ; 梥â à ¡®ç¥© ®¡« áâ¨
mov esi, [sc.grab] ; 梥⠧ £®«®¢ª 
or esi, 0x81000000
mov edi, [sc.frame] ; 梥â à ¬ª¨
mcall
xor eax, eax ; äã­ªæ¨ï 0 - ᮧ¤ âì ®ª­®
mov ebx, [curx] ; ebx = [ª®®à¤¨­ â  ¯® x] shl 16 + [è¨à¨­ ]
shl ebx, 16
add ebx, wnd_x_size
mov ecx, [cury] ; ecx = [ª®®à¤¨­ â  ¯® y] shl 16 + [¢ëá®â ]
shl ecx, 16
add ecx, _BTNS_*15+21
mov edx, [sc.work] ; 梥â à ¡®ç¥© ®¡« áâ¨
mov esi, [sc.grab] ; 梥⠧ £®«®¢ª 
or esi, 0x81000000
mov edi, [sc.frame] ; 梥â à ¬ª¨
mcall
mov eax, 4 ; § £®«®¢®ª
mov ebx, title_pos ; [x] shl 16 + [y]
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
or ecx, 0x10000000
mov eax, 4 ; § £®«®¢®ª
mov ebx, title_pos ; [x] shl 16 + [y]
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
or ecx, 0x10000000
; add ecx, -0x333333
push ecx
push ecx
xor edx,edx
push ecx
push ecx
xor edx,edx
;--------------------------------------
align 4
.dec_color:
sub byte [esp+edx], 0x33
jae @f
mov byte [esp+edx], 0
sub byte [esp+edx], 0x33
jae @f
mov byte [esp+edx], 0
;--------------------------------------
align 4
@@:
inc edx
jnp .dec_color
pop ecx
mov edx, title ;  ¤à¥á § £®«®¢ª 
mov esi, title.size ; ¤«¨­  § £®«®¢ª  ("M E N U")
mcall
pop ecx
add ebx, 1 shl 16 ; ᤢ¨­¥¬ ¢¯à ¢® ­  1
mcall
inc edx
jnp .dec_color
pop ecx
mov edx, title ;  ¤à¥á § £®«®¢ª 
mov esi, title.size ; ¤«¨­  § £®«®¢ª  ("M E N U")
mcall
pop ecx
add ebx, 1 shl 16 ; ᤢ¨­¥¬ ¢¯à ¢® ­  1
mcall
mov ebx, 1*65536+wnd_x_size-2 ; ­ ç¨­ ¥¬ ¤¥« âì ª­®¯ª¨
mov ecx, 20*65536+15
mov edx, 10 or 0x40000000 ; ¡¨â 30 ãáâ ­®¢«¥­ => ª­®¯ª  ­¥ à¨áã¥âáï
mov ebx, 1*65536+wnd_x_size-2 ; ­ ç¨­ ¥¬ ¤¥« âì ª­®¯ª¨
mov ecx, 20*65536+15
mov edx, 10 or 0x40000000 ; ¡¨â 30 ãáâ ­®¢«¥­ => ª­®¯ª  ­¥ à¨áã¥âáï
mov edi,_BTNS_ ; ª®«¨ç¥á⢮ ª­®¯®ª (áçñâ稪)
newbtn: ; ­ ç «® 横« 
mov eax,8 ; ᮧ¤ ñ¬ ª­®¯ªã
mcall
mov edi,_BTNS_ ; ª®«¨ç¥á⢮ ª­®¯®ª (áçñâ稪)
;--------------------------------------
align 4
newbtn: ; ­ ç «® 横« 
mcall 8 ; ᮧ¤ ñ¬ ª­®¯ªã
; ¯¨è¥¬ ⥪áâ ­  ª­®¯ª¥
pushad ; ᯠᠥ¬ ॣ¨áâàë
shr ecx, 16
and ebx, 0xffff0000
add ebx, ecx ; ebx = [x] shl 16 + [y];
add ebx, 10*65536+4 ; ebx += ᬥ饭¨¥ ®â­®á¨â¥«ì­® ªà ï ª­®¯ª¨;
mov ecx, [sc.work_text] ; èà¨äâ ¨ 梥â
or ecx, font
add edx, -10 ; edx = ­®¬¥à ª­®¯ª¨;
imul edx, string_length ; edx *= ¤«¨­  áâப¨;
add edx, text ; edx += text; ⥯¥àì ¢ edx  ¤à¥á áâப¨
mov esi, string_length ; ¢ esi - ¤«¨­  áâப¨
mov eax, 4 ; äã­ªæ¨ï 4 - ¢ë¢®¤ ⥪áâ 
mcall
popad
inc edx ; ­®¬¥à ª­®¯ª¨++;
add ecx,15*65536 ; 㢥«¨ç¨¬ ᬥ饭¨¥ ¯® y
dec edi ; 㬥­ì訬 áçñâ稪
jnz newbtn ; ¥á«¨ ­¥ ­®«ì, ¯®¢â®à¨¬ ¢áñ ¥éñ à §
mov eax,12 ; § ª®­ç¨«¨ "à¨á®¢ âì"
mov ebx,2
mcall
ret ; ¢®§¢à â
pushad ; ᯠᠥ¬ ॣ¨áâàë
shr ecx, 16
and ebx, 0xffff0000
add ebx, ecx ; ebx = [x] shl 16 + [y];
add ebx, 10*65536+4 ; ebx += ᬥ饭¨¥ ®â­®á¨â¥«ì­® ªà ï ª­®¯ª¨;
mov ecx, [sc.work_text] ; èà¨äâ ¨ 梥â
or ecx, font
add edx, -10 ; edx = ­®¬¥à ª­®¯ª¨;
imul edx, string_length ; edx *= ¤«¨­  áâப¨;
add edx, text ; edx += text; ⥯¥àì ¢ edx  ¤à¥á áâப¨
mov esi, string_length ; ¢ esi - ¤«¨­  áâப¨
mcall 4
popad
inc edx ; ­®¬¥à ª­®¯ª¨++;
add ecx,15*65536 ; 㢥«¨ç¨¬ ᬥ饭¨¥ ¯® y
dec edi ; 㬥­ì訬 áçñâ稪
jnz newbtn ; ¥á«¨ ­¥ ­®«ì, ¯®¢â®à¨¬ ¢áñ ¥éñ à §
mcall 12,2 ; § ª®­ç¨«¨ "à¨á®¢ âì"
ret ; ¢®§¢à â
;------------------------------------------------------------------------------
align 4
; „€<E2809E><E282AC><20><>Žƒ<C5BD>€ŒŒ
DATA
macro strtbl name, [string]
{
@ -385,37 +386,46 @@ DATA
ru, '<27> áâனª  ãáâனá⢠',\
ru, '<27> áâனª  ¬®­¨â®à  ',\
ru, '<27>à®æ¥ááë '
start_info:
.mode dd 7
dd 0
.params dd 0
dd 0
dd 0
db 0
dd start_info.path
; <20>ˆ<E280A6>ˆˆˆˆ<E280A1>Ž<E2809A><E282AC>… „€<E2809E><E282AC>
UDATA
processes dd ? ; ª®«¨ç¥á⢮ ¯à®æ¥áᮢ ¢ á¨á⥬¥
curx1 dd ? ; ª®®à¤¨­ âë ªãàá®à 
cury1 dd ?
curx dd ? ; ª®®à¤¨­ âë ®ª­  ¬¥­î
cury dd ?
menu_opened db ? ; ®âªàëâ® ¬¥­î ¨«¨ ­¥â? (1-¤ , 0-­¥â)
;------------------------------------------------------------------------------
align 4
start_info.path rb 256
start_info:
.mode dd 7
dd 0
.params dd 0
dd 0
dd 0
db 0
dd start_info.path
;------------------------------------------------------------------------------
IM_END:
align 4
; <20>ˆ<E280A6>ˆˆˆˆ<E280A1>Ž<E2809A><E282AC>… „€<E2809E><E282AC>
processes dd ? ; ª®«¨ç¥á⢮ ¯à®æ¥áᮢ ¢ á¨á⥬¥
curx1 dd ? ; ª®®à¤¨­ âë ªãàá®à 
cury1 dd ?
curx dd ? ; ª®®à¤¨­ âë ®ª­  ¬¥­î
cury dd ?
sc system_colors ; á¨á⥬­ë¥ 梥â 
procinfo process_information ; ¨­ä®à¬ æ¨ï ® ¯à®æ¥áá¥
procinfo2 process_information
rb 1024 ; áâíª ¤«ï ®ª­  ¬¥­î - 墠â¨â ¨ 1 Š¡
align 32
stack_wnd:
MEOS_APP_END
menu_opened db ? ; ®âªàëâ® ¬¥­î ¨«¨ ­¥â? (1-¤ , 0-­¥â)
;------------------------------------------------------------------------------
align 4
start_info.path rb 256
;------------------------------------------------------------------------------
align 4
sc system_colors ; á¨á⥬­ë¥ 梥â 
;------------------------------------------------------------------------------
align 4
procinfo process_information ; ¨­ä®à¬ æ¨ï ® ¯à®æ¥áá¥
;------------------------------------------------------------------------------
align 4
rb 512 ; áâíª ¤«ï ®ª­  ¬¥­î - 墠â¨â ¨ 1 Š¡
stack_wnd:
;------------------------------------------------------------------------------
align 4
rb 512
stack_area:
;------------------------------------------------------------------------------
I_END:
;------------------------------------------------------------------------------
; ŠŽ<C5A0> <20><>Žƒ<C5BD>€ŒŒ
;------------------------------------------------------------------------------

View File

@ -1,5 +1,6 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm @rb.asm @rb
@kpack @rb
@erase lang.inc
@pause

View File

@ -1,5 +1,6 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm @rb.asm @rb
@kpack @rb
@erase lang.inc
@pause