Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 485 → Rev 205

/programs/develop/examples/md5/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm md5.asm md5
@erase lang.inc
@pause
/programs/develop/examples/md5/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm md5.asm md5
@erase lang.inc
@pause
/programs/develop/examples/md5/trunk/md5.asm
12,7 → 12,20
;
; Š®¬¯¨«¨àã¥âìáï Fasm'®¬ ¤«ï Œ¥­ãí⎑
include 'lang.inc'
include '..\..\..\..\macros.inc'
macro diff16 title,l2
{
local s,d,l1
s = l2
display title,': 0x'
repeat 8
d = 48 + s shr ((8-%) shl 2) and $0F
if d > 57
d = d + 65-57-1
end if
display d
end repeat
display 13,10
}
 
use32
 
22,39 → 35,47
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
dd 0x4000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd 0x4000 ;  ¤à¥á ¢¥à設ë áâíª 
dd 0x100000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd 0x100000 ;  ¤à¥á ¢¥à設ë áâíª 
dd 0x0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
dd 0x0 ; § à¥§¥à¢¨à®¢ ­®
 
START: ;  ç «® ¢ë¯®«­¥­¨ï ¯à®£à ¬¬ë
 
red:
call draw_window ; ‘¯¥à¢  ¯¥à¥à¨á㥬 ®ª­®
 
still:
 
mov eax,10 ; Ž¦¨¤ ¥¬ ᮡë⨩
mcall
mov eax,23 ; Ž¦¨¤ ¥¬ ᮡë⨩
mov ebx,1
int 0x40
 
cmp eax,1 ; ‡ ¯à®á ­  ¯¥à¥à¨á®¢ªã ?
jz red
cmp eax,2 ; ­ ¦ â  ª« ¢¨è¨ ?
jnz button
jz key
cmp eax,3 ; ­ ¦ â  ª­®¯ª  ?
jz button
 
jmp still
 
red:
call draw_window
jmp still
 
key:
mov eax,2
mcall
int 0x40
jmp still
 
button:
mov eax,17
mcall
int 0x40
 
cmp ah,1 ; id ª­®¯ª¨ = 1 ?
jnz noclose
or eax,-1
mcall
mov eax,-1
int 0x40
 
noclose:
 
335,16 → 356,23
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+230 ; [x start] *65536 + [x size]
mov ecx,60*65536+100 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
; ¨á㥬 ª­®¯ªã ¤«ï £¥­¥à æ¨¨
mov eax,8 ; function 8 : define and draw button
mov ebx,20*65536+80 ; [x start] *65536 + [x size]
351,7 → 379,7
mov ecx,34*65536+14 ; [y start] *65536 + [y size]
mov edx,2 ; button id
mov esi,0x5588dd ; button color RRGGBB
mcall
int 0x40
;  §¢ ­¨¥ ­  ª­®¯ªã
mov eax,4 ; function 4 : write text to window
359,8 → 387,9
mov ecx,0x000000 ; color of text RRGGBB
mov edx,gen_txt ; pointer to text beginning
mov esi,gen_len-gen_txt ; text length
mcall
int 0x40
 
mov eax,4 ; draw info text with function 4
mov ebx,20*65536+70
mov ecx,0x000000
mov edx,[text]
368,17 → 397,18
mov al, [textlen]
mov esi,eax
mov eax,4
mcall
int 0x40
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
;Ž¡« áâì ¤ ­­ëå
 
title db 'MD5 Generator',0
labeltext: db 'MD5 Generator'
lte:
 
text: dd 0
textlen: dd 0