Subversion Repositories Kolibri OS

Rev

Rev 205 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 485
Line 10... Line 10...
10
;    ‘ ©â: www.shade.msu.ru/~msu-se/home.html
10
;    ‘ ©â: www.shade.msu.ru/~msu-se/home.html
11
;    „®à ¡®âª , ®â« ¤ª  ¨ ®¯â¨¬¨§ æ¨ï.
11
;    „®à ¡®âª , ®â« ¤ª  ¨ ®¯â¨¬¨§ æ¨ï.
12
;
12
;
13
;    Š®¬¯¨«¨àã¥âìáï Fasm'®¬ ¤«ï Œ¥­ãí⎑
13
;    Š®¬¯¨«¨àã¥âìáï Fasm'®¬ ¤«ï Œ¥­ãí⎑
14
include 'lang.inc'
14
include 'lang.inc'
15
macro diff16 title,l2
-
 
16
 {
-
 
17
  local s,d,l1
-
 
18
  s = l2
-
 
19
  display title,': 0x'
-
 
20
  repeat 8
-
 
21
   d = 48 + s shr ((8-%) shl 2) and $0F
15
include '..\..\..\..\macros.inc'
22
   if d > 57
-
 
23
    d = d + 65-57-1
-
 
24
   end if
-
 
25
   display d
-
 
26
  end repeat
-
 
27
  display 13,10
-
 
28
 }    
-
 
Line 29... Line 16...
29
 
16
 
Line 30... Line 17...
30
use32
17
use32
Line 31... Line 18...
31
 
18
 
32
                org     0x0
19
                org     0x0
33
 
20
 
34
  db     'MENUET01'  ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
21
  db     'MENUET01'  ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
35
  dd     0x01        ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
22
  dd     0x01        ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
36
  dd     START       ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
23
  dd     START       ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
37
  dd     I_END       ; à §¬¥à ¯à®£à ¬¬ë
24
  dd     I_END       ; à §¬¥à ¯à®£à ¬¬ë
38
  dd     0x100000    ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
25
  dd     0x4000      ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
Line 39... Line 26...
39
  dd     0x100000    ;  ¤à¥á ¢¥à設ë áâíª 
26
  dd     0x4000      ;  ¤à¥á ¢¥à設ë áâíª 
Line -... Line 27...
-
 
27
  dd     0x0         ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
40
  dd     0x0         ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
28
  dd     0x0         ; § à¥§¥à¢¨à®¢ ­®
Line 41... Line 29...
41
  dd     0x0         ; § à¥§¥à¢¨à®¢ ­®
29
 
Line 42... Line 30...
42
 
30
START:                                  ;  ç «® ¢ë¯®«­¥­¨ï ¯à®£à ¬¬ë
43
START:                                  ;  ç «® ¢ë¯®«­¥­¨ï ¯à®£à ¬¬ë
31
 
44
 
-
 
Line 45... Line 32...
45
        call draw_window            ; ‘¯¥à¢  ¯¥à¥à¨á㥬 ®ª­®
32
red:
46
 
33
        call draw_window            ; ‘¯¥à¢  ¯¥à¥à¨á㥬 ®ª­®
47
still:
34
 
48
 
-
 
49
    mov  eax,23                 ; Ž¦¨¤ ¥¬ ᮡë⨩
-
 
50
    mov  ebx,1
35
still:
51
    int  0x40
-
 
52
 
-
 
53
    cmp  eax,1                  ; ‡ ¯à®á ­  ¯¥à¥à¨á®¢ªã ?
-
 
54
    jz   red
-
 
55
    cmp  eax,2                  ; ­ ¦ â  ª« ¢¨è¨ ?
-
 
56
    jz   key
-
 
Line 57... Line 36...
57
    cmp  eax,3                  ; ­ ¦ â  ª­®¯ª  ?
36
 
58
    jz   button
37
    mov  eax,10                 ; Ž¦¨¤ ¥¬ ᮡë⨩
59
 
38
    mcall
60
    jmp  still
39
 
Line 61... Line 40...
61
 
40
    cmp  eax,1                  ; ‡ ¯à®á ­  ¯¥à¥à¨á®¢ªã ?
62
red:
41
    jz   red
63
    call draw_window
42
    cmp  eax,2                  ; ­ ¦ â  ª« ¢¨è¨ ?
Line 64... Line 43...
64
    jmp  still
43
    jnz   button
65
 
44
 
66
key:
45
key:
67
    mov  eax,2
46
    mov  eax,2
Line 68... Line 47...
68
    int  0x40
47
    mcall
Line 69... Line 48...
69
    jmp  still
48
    jmp  still
70
 
49
 
Line 354... Line 333...
354
 
333
 
Line 355... Line 334...
355
draw_window:
334
draw_window:
356
 
335
 
357
    mov eax,12               ; function 12:tell os about windowdraw
336
    mov eax,12               ; function 12:tell os about windowdraw
358
    mov ebx,1                      ; 1, start of draw
337
    mov ebx,1                      ; 1, start of draw
359
    int 0x40
338
    mcall
360
                                   ; DRAW WINDOW
339
                                   ; DRAW WINDOW
361
    mov  eax,0                     ; function 0 : define and draw window
340
    mov  eax,0                     ; function 0 : define and draw window
362
    mov  ebx,100*65536+230         ; [x start] *65536 + [x size]
341
    mov  ebx,100*65536+230         ; [x start] *65536 + [x size]
363
    mov  ecx,60*65536+100          ; [y start] *65536 + [y size]
-
 
364
    mov  edx,0x03ffffff            ; color of work area RRGGBB
342
    mov  ecx,60*65536+100          ; [y start] *65536 + [y size]
365
    mov  esi,0x80aabbcc            ; color of grab bar  RRGGBB,8->color gl
343
    mov  edx,0x13ffffff            ; color of work area RRGGBB
-
 
344
    mov  edi,title                 ; WINDOW LABEL
Line 366... Line -...
366
    mov  edi,0x00aabbcc            ; color of frames    RRGGBB
-
 
367
    int  0x40
-
 
368
 
-
 
369
                                   ; WINDOW LABEL
-
 
370
    mov  eax,4                     ; function 4 : write text to window
-
 
371
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
372
    mov  ecx,0x00ffffff            ; color of text RRGGBB
-
 
373
    mov  edx,labeltext             ; pointer to text beginning
345
    mcall
374
    mov  esi,lte-labeltext         ; text length
346
 
375
    int  0x40
347
                                   
376
                   ; ¨á㥬 ª­®¯ªã ¤«ï £¥­¥à æ¨¨
348
                   ; ¨á㥬 ª­®¯ªã ¤«ï £¥­¥à æ¨¨
377
    mov  eax,8                     ; function 8 : define and draw button
349
    mov  eax,8                     ; function 8 : define and draw button
378
    mov  ebx,20*65536+80           ; [x start] *65536 + [x size]
350
    mov  ebx,20*65536+80           ; [x start] *65536 + [x size]
379
    mov  ecx,34*65536+14           ; [y start] *65536 + [y size]
351
    mov  ecx,34*65536+14           ; [y start] *65536 + [y size]
Line 380... Line 352...
380
    mov  edx,2                     ; button id
352
    mov  edx,2                     ; button id
381
    mov  esi,0x5588dd              ; button color RRGGBB
353
    mov  esi,0x5588dd              ; button color RRGGBB
382
    int  0x40
354
    mcall
383
    
355
    
384
                                   ;  §¢ ­¨¥ ­  ª­®¯ªã
356
                                   ;  §¢ ­¨¥ ­  ª­®¯ªã
385
    mov  eax,4                     ; function 4 : write text to window
357
    mov  eax,4                     ; function 4 : write text to window
386
    mov  ebx,23*65536+38           ; [x start] *65536 + [y start]
358
    mov  ebx,23*65536+38           ; [x start] *65536 + [y start]
Line 387... Line -...
387
    mov  ecx,0x000000              ; color of text RRGGBB
-
 
388
    mov  edx,gen_txt               ; pointer to text beginning
359
    mov  ecx,0x000000              ; color of text RRGGBB
389
    mov  esi,gen_len-gen_txt       ; text length
360
    mov  edx,gen_txt               ; pointer to text beginning
390
    int  0x40
361
    mov  esi,gen_len-gen_txt       ; text length
391
 
362
    mcall
392
    mov  eax,4               ; draw info text with function 4
363
 
393
    mov  ebx,20*65536+70
364
    mov  ebx,20*65536+70
394
    mov  ecx,0x000000
365
    mov  ecx,0x000000
395
    mov  edx,[text]
366
    mov  edx,[text]
Line 396... Line 367...
396
    xor  eax,eax
367
    xor  eax,eax
397
    mov  al, [textlen]
368
    mov  al, [textlen]
398
    mov  esi,eax
369
    mov  esi,eax
Line 399... Line 370...
399
    mov  eax,4
370
    mov  eax,4
Line 400... Line 371...
400
    int  0x40
371
    mcall
Line 401... Line 372...
401
 
372
 
402
    mov  eax,12                    ; function 12:tell os about windowdraw
-
 
Line 403... Line 373...
403
    mov  ebx,2                     ; 2, end of draw
373
    mov  eax,12                    ; function 12:tell os about windowdraw
404
    int  0x40
374
    mov  ebx,2                     ; 2, end of draw
Line 405... Line 375...
405
 
375
    mcall