Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 316 → Rev 317

/programs/develop/examples/cpuspeed/trunk/cpuspeed.asm
38,7 → 38,7
mov [edi],dl
sub edi,1
loop newnum
 
red:
call draw_window ; at first, draw the window
 
still:
55,10 → 55,6
 
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
70,7 → 66,7
 
cmp ah,1 ; button id=1 ?
jnz still
mov eax,-1 ; close this program
or eax,-1 ; close this program
int 0x40
 
 
96,38 → 92,17
mov ebx,100*65536+200 ; [x start] *65536 + [x size]
mov ecx,100*65536+65 ; [y start] *65536 + [y size]
mov edx,[sc.work] ; color of work area RRGGBB,8->color glide
mov esi,[sc.grab] ; color of grab bar RRGGBB,8->color
or esi,0x80000000
mov edi,[sc.frame] ; color of frames RRGGBB
or edx,0x33000000 ; color of grab bar RRGGBB,8->color
mov edi,header ; WINDOW LABEL
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,[sc.grab_text] ; color of text RRGGBB
or ecx,0x10000000
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
; CLOSE BUTTON
mov eax,8 ; function 8 : define and draw button
mov ebx,(200-17)*65536+12 ; [x start] *65536 + [x size]
mov ecx,5*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id
mov esi,[sc.grab_button] ; button color RRGGBB
int 0x40
 
mov ebx,25*65536+35 ; draw info text with function 4
mov ebx,20*65536+14 ; draw info text with function 4
mov ecx,[sc.work_text]
mov edx,text
mov esi,40
newline:
mov esi,24
mov eax,4
int 0x40
add ebx,10
add edx,40
cmp [edx],byte 'x'
jnz newline
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
141,11 → 116,8
 
text:
db 'CPU RUNNING AT MHZ '
db 'x' ; <- END MARKER, DONT DELETE
 
labelt:
db 'CPU SPEED'
labellen:
header db 'CPU SPEED',0
 
I_END:
 
/programs/develop/examples/example/trunk/example.asm
103,43 → 103,24
; ‘Ž‡„€ðŒ ŽŠŽ
; mov eax,0 ; äã­ªæ¨ï 0 : ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª­®
; mov ebx,200*65536+200 ; [x áâ àâ] *65536 + [x à §¬¥à]
; mov ecx,200*65536+100 ; [y áâ àâ] *65536 + [y à §¬¥à]
; mov edx,0x02aabbcc ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
; mov esi,0x805080d0 ; 梥⠯®«®áë § £®«®¢ª  RRGGBB,8->color gl
; mov edi,0x005080d0 ; 梥â à ¬ª¨ RRGGBB
; mov ecx,200*65536+50 ; [y áâ àâ] *65536 + [y à §¬¥à]
; mov edx,0x33aabbcc ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
; mov edi,header ; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ€
; int 0x40
 
mcall 0, <200,200>, <200,50>, 0x02AABBCC, 0x805080D0, 0x005080D0
mcall 0, <200,200>, <200,50>, 0x33AABBCC,,header
 
; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ€
; mov eax,4 ; äã­ªæ¨ï 4 : ­ ¯¨á âì ¢ ®ª­¥ ⥪áâ
; mov ebx,8*65536+8 ; [x] *65536 + [y]
; mov ecx,0x10ddeeff ; èà¨äâ 1 ¨ 梥â ( 0xF0RRGGBB )
; mov edx,header ;  ¤à¥á áâப¨
; mov esi,header.size ; ¨ ¥ñ ¤«¨­ 
; int 0x40
 
mcall 4, <8,8>, 0x10DDEEFF, header, header.size
 
; mov eax,4
; mov ebx,8 shl 16 + 30
; mov ebx,3 shl 16 + 8
; mov ecx,0
; mov edx,message
; mov esi,message.size
; int 0x40
 
mcall 4, <8, 30>, 0, message, message.size
mcall 4, <3, 8>, 0, message, message.size
 
; ŠŽŠ€ ‡€Š›’ˆŸ ŽŠ€
; mov eax,8 ; äã­ªæ¨ï 8 : ®¯à¥¤¥«¨âì ¨ ­ à¨á®¢ âì ª­®¯ªã
; mov ebx,(200-19)*65536+12 ; [x áâ àâ] *65536 + [x à §¬¥à]
; mov ecx,5*65536+12 ; [y áâ àâ] *65536 + [y à §¬¥à]
; mov edx,1 ; ¨¤¥­â¨ä¨ª â®à ª­®¯ª¨ - 1
; mov esi,0x6688dd ; 梥⠪­®¯ª¨ RRGGBB
; int 0x40
 
mcall 8, <200-19, 12>, <5, 12>, 1, 0x6688DD
 
mcall 12, 2 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
; 2, § ª®­ç¨«¨ à¨á®¢ âì