Subversion Repositories Kolibri OS

Rev

Rev 131 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 halyavin 1
lang equ ru ; ru en fr ge fi
2
 
3
;
4
;   Assembler
5
;     SMALL
6
;       CODE
7
;         Libary
8
;
9
;  Ver 0.14 By Pavlushin Evgeni (RUSSIA)
10
;  www.waptap@mail.ru
11
 
12
;Please compile aplications on FASM ver1.54 or higer!!!
13
 
14
;InfoList
15
;0.01 scank,putpix,puttxt
16
;0.02 label,random,colors
17
;0.03 window,startwd,endwd,attributes
18
;0.04 close,delay,scevent ~30.04.2004
19
;0.05 small random, ~04.05.2004
20
;0.06 wtevent ~09.05.2004
21
;0.07 timeevent ~23.05.2004
22
;0.08 txtput ~14.06.2004
23
;0.09 opendialog,savedialog ~20.06.2004
24
;0.10 wordstoreg by halyavin, add at ~30.08.2004
25
; random bug deleted eax is use.
26
;0.11 loadfile from me +puttxt bug del ~07.09.2004
27
;0.12 open/save dialog ~13.09.2004
28
;0.13 dialogs bugs deleted
29
;0.14 drawlbut ~03.10.2004
131 diamond 30
;0.15 extendet label!
31 halyavin 31
 
32
; LOADFILE
33
; (SYNTAX)  LOADFILE 'full_path_to_file',file_load_area,file_temp_area
34
; (SAMPLE)  LOADFILE '/rd/1/clock.bmp',load_area,temp_area
35
 
131 diamond 36
 
31 halyavin 37
macro loadfile file_name,file_load_area,file_temp_area
38
{
39
local open,fileinfo,string
40
    jmp open
41
fileinfo:
42
    dd 0
43
    dd 0
44
    dd 1
45
    dd file_load_area
46
    dd file_temp_area
47
string:
48
    db file_name,0
49
open:
50
    mov  dword [fileinfo+8],1 ; how many blocks to read (1)
51
    mov  eax,58
52
    mov  ebx,fileinfo
53
    int  0x40
54
    mov  eax,[file_load_area+2]
55
    shr  eax,9 ; поделим на 512 и прибавим 1 - получим число блоков
56
    inc  eax
57
    mov  dword [fileinfo+8],eax
58
    mov  eax,58
59
    mov  ebx,fileinfo
60
    int  0x40
61
}
62
 
63
 
131 diamond 64
;macro wordstoreg reg,hiword,loword
65
;{
66
;if  hiword eqtype 0 & loword eqtype 0
67
;    mov  reg,dword hiword*65536+loword
68
;else if hiword eqtype 12 & loword eqtype eax
69
;    mov  reg,dword hiword*65536
70
;    add  reg,dword loword
71
;else if hiword eqtype 12 & loword eqtype [123]
72
;    mov  reg,dword hiword*65536
73
;    add  reg,dword loword
74
;else
75
;    mov  reg,dword hiword
76
;    shl  reg,16
77
;    add  reg,dword loword
78
;end if
79
;}
80
 
81
macro dword2reg reg,doubleword
31 halyavin 82
{
131 diamond 83
if doubleword eq
84
   ; not changes
31 halyavin 85
else
131 diamond 86
   mov reg,dword doubleword
31 halyavin 87
end if
88
}
89
 
131 diamond 90
macro words2reg reg,hiword,lowword
91
{
92
if hiword eq
93
   if lowword eq
94
      ; not changes
95
   else
96
      if lowword eqtype 12
97
         and reg,dword 0xffff0000
98
         add reg,dword lowword
99
      else
100
         and reg,dword 0xffff0000
101
         add reg,dword lowword
102
      end if
103
   end if
104
else
105
   if lowword eq
106
      if hiword eqtype 12
107
         and reg,dword 0x0000ffff
108
         add reg,dword hiword*65536
109
      else
110
         shl reg,16
111
         add reg,dword hiword
112
         ror reg,16
113
      end if
114
   else
115
      if lowword eqtype 12 & hiword eqtype 12
116
         if lowword eq 0 & hiword eq 0
117
               xor reg,reg
118
            else
119
               mov reg,dword hiword*65536+lowword
120
         end if
121
      else
122
         mov reg,dword hiword
123
         shl reg,16
124
         add reg,dword lowword
125
      end if
126
   end if
127
end if
128
}
31 halyavin 129
 
131 diamond 130
 
131
 
132
 
31 halyavin 133
; DRAW BUTTON with label
134
 
135
macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor
136
{
137
local asd,lab
138
    jmp asd
139
lab db  text                 ;arg label
140
asd:
131 diamond 141
    words2reg ebx,x,xs
142
    words2reg ecx,y,ys
31 halyavin 143
    mov edx,id
144
    mov esi,bcolor
145
    mov eax,8
146
    int 0x40
147
 
148
    mov eax,asd-lab          ;calc size
149
    mov ebx,6
150
    mul ebx
151
    mov esi,eax
152
 
153
    mov eax,xs
154
    sub eax,esi
155
    shr eax,1
156
    add eax,x
157
 
158
    mov edx,ys
159
    sub edx,7
160
    shr edx,1
161
    add edx,y
162
 
163
    mov ebx,eax
164
    shl ebx,16
165
    add ebx,edx
166
 
167
    mov ecx,tcolor             ;arg4 color
168
    mov edx,lab
169
    mov esi,asd-lab          ;calc size
170
    mov eax,4
171
    int 0x40
172
}
173
 
174
 
175
macro opendialog redproc,openoff,erroff,path
176
{
177
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc
178
local run_fileinfo, param
179
local getmesloop, loox, mred, mkey, mbutton, mgetmes
180
local dlg_is_work, ready, procinfo
181
;
182
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
183
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
184
;
185
 
186
    cld
187
;;    mov esi,path
188
    mov edi,path
134 diamond 189
    xor eax,eax
190
    mov ecx,(1024+16)/4
191
    rep stosd
31 halyavin 192
 
193
;mov [get_loops],0
194
mov [dlg_pid_get],0
195
 
196
; Get my PID in dec format 4 bytes
197
    mov eax,9
198
    mov ebx,procinfo
199
    mov ecx,-1
200
    int 0x40
201
 
202
; convert eax bin to param dec
203
    mov eax,dword [procinfo+30]  ;offset of myPID
204
    mov edi,param+4-1            ;offset to 4 bytes
205
    mov ecx,4
206
    mov ebx,10
207
    cld
208
new_d:
209
    xor edx,edx
210
    div ebx
211
    add dl,'0'
212
    mov [edi],dl
213
    dec edi
214
    loop new_d
215
 
216
; wirite 1 byte space to param
217
    mov [param+4],byte 32    ;Space for next parametr
218
; and 1 byte type of dialog to param
219
    mov [param+5],byte 'O'   ;Get Open dialog (Use 'S' for Save dialog)
220
 
221
;
222
; STEP2 prepare IPC area for get messages
223
;
224
 
225
; prepare IPC area
226
    mov [path],dword 0
227
    mov [path+4],dword 8
228
 
229
; define IPC memory
230
    mov eax,60
231
    mov ebx,1        ; define IPC
232
    mov ecx,path     ; offset of area
134 diamond 233
    mov edx,1024+16  ; size
31 halyavin 234
    int 0x40
235
 
236
; change wanted events list 7-bit IPC event
237
    mov eax,40
238
    mov ebx,01000111b
239
    int 0x40
240
 
241
;
242
; STEP 3 run SYSTEM XTREE with parameters
243
;
244
 
134 diamond 245
    mov eax,70
31 halyavin 246
    mov ebx,run_fileinfo
247
    int 0x40
248
 
249
    call redproc
250
 
251
    mov [get_loops],0
252
getmesloop:
253
    mov eax,23
254
    mov ebx,50     ;0.5 sec
255
    int 0x40
134 diamond 256
        dec     eax
257
        jz      mred
258
        dec     eax
259
        jz      mkey
260
        dec     eax
261
        jz      mbutton
262
        cmp     al, 7-3
263
        jz      mgetmes
31 halyavin 264
 
265
; Get number of procces
266
    mov ebx,procinfo
267
    mov ecx,-1
268
    mov eax,9
269
    int 0x40
270
    mov ebp,eax
271
 
272
loox:
273
    mov eax,9
274
    mov ebx,procinfo
275
    mov ecx,ebp
276
    int 0x40
277
    mov eax,[DLGPID]
278
    cmp [procinfo+30],eax    ;IF Dialog find
279
    je  dlg_is_work          ;jmp to dlg_is_work
280
    dec ebp
281
    jnz loox
282
 
283
    jmp erroff
284
 
285
dlg_is_work:
286
    cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated
287
    je  erroff                 ;TESTODP2 terminated too
288
 
289
    cmp [dlg_pid_get],dword 1
290
    je  getmesloop
291
    inc [get_loops]
292
    cmp [get_loops],4  ;2 sec if DLG_PID not get, TESTOP2  terminated
293
    jae erroff
294
    jmp getmesloop
295
 
296
mred:
297
    call redproc
298
    jmp  getmesloop
299
mkey:
300
    mov  eax,2
301
    int  0x40                   ; read (eax=2)
302
    jmp  getmesloop
303
mbutton:
304
    mov  eax,17                 ; get id
305
    int  0x40
306
    cmp  ah,1                   ; button id=1 ?
307
    jne  getmesloop
308
    mov  eax,-1                 ; close this program
309
    int  0x40
310
mgetmes:
311
 
312
; If dlg_pid_get then second message get jmp to still
313
    cmp  [dlg_pid_get],dword 1
314
    je   ready
315
 
316
; First message is number of PID SYSXTREE dialog
317
 
318
; convert PID dec to PID bin
319
    movzx eax,byte [path+16]
320
    sub eax,48
321
    imul eax,10
322
    movzx ebx,byte [path+16+1]
323
    add eax,ebx
324
    sub eax,48
325
    imul eax,10
326
    movzx ebx,byte [path+16+2]
327
    add eax,ebx
328
    sub eax,48
329
    imul eax,10
330
    movzx ebx,byte [path+16+3]
331
    add eax,ebx
332
    sub eax,48
333
    mov [DLGPID],eax
334
 
335
; Claear and prepare IPC area for next message
336
    mov [path],dword 0
337
    mov [path+4],dword 8
338
    mov [path+8],dword 0
339
    mov [path+12],dword 0
340
    mov [path+16],dword 0
341
 
342
; Set dlg_pid_get for get next message
343
    mov [dlg_pid_get],dword 1
344
    call redproc   ;show DLG_PID
345
    jmp  getmesloop
346
 
347
ready:
348
;
349
; The second message get
134 diamond 350
; Second message is 1024 bytes path to SAVE/OPEN file
31 halyavin 351
; shl path string on 16 bytes
352
;
353
    cld
354
    mov esi,path+16
355
    mov edi,path
134 diamond 356
    mov ecx,1024/4
357
    rep movsd
31 halyavin 358
    mov [edi],byte 0
359
 
360
    jmp openoff
361
 
362
 
363
; DATA AREA
364
get_loops   dd 0
365
dlg_pid_get dd 0
366
DLGPID      dd 0
367
 
368
param:
369
   dd 0    ; My dec PID
370
   dd 0,0  ; Type of dialog
371
 
372
run_fileinfo:
134 diamond 373
 dd 7
31 halyavin 374
 dd 0
375
 dd param
376
 dd 0
134 diamond 377
 dd 0
31 halyavin 378
;run_filepath
379
 db '/RD/1/SYSXTREE',0
380
 
381
procinfo:
131 diamond 382
times 1024 db 0
31 halyavin 383
}
384
 
385
 
386
macro savedialog redproc,openoff,erroff,path
387
{
388
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc
389
local run_fileinfo, run_filepath, param
390
local getmesloop, loox, mred, mkey, mbutton, mgetmes
391
local dlg_is_work, ready, procinfo
392
;
393
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
394
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
395
;
396
 
397
    cld
398
;;    mov esi,path
399
    mov edi,path
134 diamond 400
    xor eax,eax
401
    mov ecx,(1024+16)/4
402
    rep stosd
31 halyavin 403
 
404
;mov [get_loops],0
405
mov [dlg_pid_get],0
406
 
407
; Get my PID in dec format 4 bytes
408
    mov eax,9
409
    mov ebx,procinfo
410
    mov ecx,-1
411
    int 0x40
412
 
413
; convert eax bin to param dec
414
    mov eax,dword [procinfo+30]  ;offset of myPID
415
    mov edi,param+4-1            ;offset to 4 bytes
416
    mov ecx,4
417
    mov ebx,10
418
    cld
419
new_d:
420
    xor edx,edx
421
    div ebx
422
    add dl,'0'
423
    mov [edi],dl
424
    dec edi
425
    loop new_d
426
 
427
; wirite 1 byte space to param
428
    mov [param+4],byte 32    ;Space for next parametr
429
; and 1 byte type of dialog to param
430
    mov [param+5],byte 'S'   ;Get Open dialog (Use 'S' for Save dialog)
431
 
432
;
433
; STEP2 prepare IPC area for get messages
434
;
435
 
436
; prepare IPC area
437
    mov [path],dword 0
438
    mov [path+4],dword 8
439
 
440
; define IPC memory
441
    mov eax,60
442
    mov ebx,1        ; define IPC
443
    mov ecx,path ; offset of area
134 diamond 444
    mov edx,1024+16      ; size
31 halyavin 445
    int 0x40
446
 
447
; change wanted events list 7-bit IPC event
448
    mov eax,40
449
    mov ebx,01000111b
450
    int 0x40
451
 
452
;
453
; STEP 3 run SYSTEM XTREE with parameters
454
;
455
 
134 diamond 456
    mov eax,70
31 halyavin 457
    mov ebx,run_fileinfo
458
    int 0x40
459
 
460
    call redproc
461
 
462
    mov [get_loops],0
463
getmesloop:
464
    mov eax,23
465
    mov ebx,50     ;0.5 sec
466
    int 0x40
134 diamond 467
        dec     eax
468
        jz      mred
469
        dec     eax
470
        jz      mkey
471
        dec     eax
472
        jz      mbutton
473
        cmp     al, 7-3
474
        jz      mgetmes
31 halyavin 475
 
476
; Get number of procces
477
    mov ebx,procinfo
478
    mov ecx,-1
479
    mov eax,9
480
    int 0x40
481
    mov ebp,eax
482
 
483
loox:
484
    mov eax,9
485
    mov ebx,procinfo
486
    mov ecx,ebp
487
    int 0x40
488
    mov eax,[DLGPID]
489
    cmp [procinfo+30],eax    ;IF Dialog find
490
    je  dlg_is_work          ;jmp to dlg_is_work
491
    dec ebp
492
    jnz loox
493
 
494
    jmp erroff
495
 
496
dlg_is_work:
497
    cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated
498
    je  erroff                 ;TESTODP2 terminated too
499
 
500
    cmp [dlg_pid_get],dword 1
501
    je  getmesloop
502
    inc [get_loops]
503
    cmp [get_loops],4  ;2 sec if DLG_PID not get, TESTOP2  terminated
504
    jae erroff
505
    jmp getmesloop
506
 
507
mred:
508
    call redproc
509
    jmp  getmesloop
510
mkey:
131 diamond 511
    mov  eax,2
31 halyavin 512
    int  0x40                   ; read (eax=2)
513
    jmp  getmesloop
514
mbutton:
515
    mov  eax,17                 ; get id
516
    int  0x40
517
    cmp  ah,1                   ; button id=1 ?
518
    jne  getmesloop
519
    mov  eax,-1                 ; close this program
520
    int  0x40
521
mgetmes:
522
 
523
; If dlg_pid_get then second message get jmp to still
524
    cmp  [dlg_pid_get],dword 1
525
    je   ready
526
 
527
; First message is number of PID SYSXTREE dialog
528
 
529
; convert PID dec to PID bin
530
    movzx eax,byte [path+16]
531
    sub eax,48
532
    imul eax,10
533
    movzx ebx,byte [path+16+1]
534
    add eax,ebx
535
    sub eax,48
536
    imul eax,10
537
    movzx ebx,byte [path+16+2]
538
    add eax,ebx
539
    sub eax,48
540
    imul eax,10
541
    movzx ebx,byte [path+16+3]
542
    add eax,ebx
543
    sub eax,48
544
    mov [DLGPID],eax
545
 
546
; Claear and prepare IPC area for next message
547
    mov [path],dword 0
548
    mov [path+4],dword 8
549
    mov [path+8],dword 0
550
    mov [path+12],dword 0
551
    mov [path+16],dword 0
552
 
553
; Set dlg_pid_get for get next message
554
    mov [dlg_pid_get],dword 1
555
    call redproc   ;show DLG_PID
556
    jmp  getmesloop
557
 
558
ready:
559
;
560
; The second message get
134 diamond 561
; Second message is 1024 bytes path to SAVE/OPEN file
31 halyavin 562
; shl path string on 16 bytes
563
;
564
    cld
565
    mov esi,path+16
566
    mov edi,path
134 diamond 567
    mov ecx,1024/4
568
    rep movsd
31 halyavin 569
    mov [edi],byte 0
570
 
571
    jmp openoff
572
 
573
 
574
; DATA AREA
575
get_loops   dd 0
576
dlg_pid_get dd 0
577
DLGPID      dd 0
578
 
579
param:
131 diamond 580
   dd 0  ; My dec PID
581
   dd 0,0  ; Type of dialog
31 halyavin 582
 
583
run_fileinfo:
134 diamond 584
 dd 7
31 halyavin 585
 dd 0
586
 dd param
587
 dd 0
134 diamond 588
 dd 0
131 diamond 589
;run_filepath:
31 halyavin 590
 db '/RD/1/SYSXTREE',0
591
 
592
procinfo:
131 diamond 593
times 1024 db 0
31 halyavin 594
}
595
 
596
 
597
 
598
 
599
; RANDOM - generate random count (small)
600
; (SYNTAX)  RANDOM MaxCount,OutArgument
601
; (SAMPLE)  RANDOM 10000,eax
602
; ( NOTE )  Maxint<65536 ; use random 65536,eax for more combinations
603
 
604
randomuse = 0
605
 
606
macro random arg1,arg2
607
{
608
local rxproc
609
randomuse = randomuse + 1
610
 
611
      jmp rxproc
612
 
613
if defined randomuse & randomuse = 1
614
randomproc:
615
      jmp rnj
616
rsx1 dw 0x4321
617
rsx2 dw 0x1234
618
rnj:
619
;    mov eax,arg1
620
    push bx
621
    push cx
622
    push dx
623
    push si
624
    push di
625
    mov cx,ax
626
    mov ax,word ptr rsx1
627
    mov bx,word ptr rsx2
628
    mov si,ax
629
    mov di,bx
630
    mov dl,ah
631
    mov ah,al
632
    mov al,bh
633
    mov bh,bl
634
    xor bl,bl
635
    rcr dl,1
636
    rcr ax,1
637
    rcr bx,1
638
    add bx,di
639
    adc ax,si
640
    add bx,0x62e9
641
    adc ax,0x3619
642
    mov word ptr rsx1,bx
643
    mov word ptr rsx2,ax
644
    xor dx,dx
645
    cmp ax,0
646
    je nodiv
647
    cmp cx,0
648
    je nodiv
649
    div cx
650
nodiv:
651
    mov ax,dx
652
    pop di
653
    pop si
654
    pop dx
655
    pop cx
656
    pop bx
657
    and eax,0000ffffh
658
;    mov arg2,0
659
;    mov arg2,eax
660
    ret
661
end if
662
 
663
rxproc:
664
    mov eax,arg1
665
    call randomproc
666
    mov arg2,eax
667
}
668
 
669
macro scank
670
{
671
    mov eax,10
672
    int 0x40
673
}
674
 
675
macro putpix x,y,color
676
{
677
    mov ebx,x
678
    mov ecx,y
679
    mov edx,color
680
    mov eax,1
681
    int 0x40
682
}
683
 
684
macro puttxt x,y,offs,size,color
685
{
686
;    mov ebx,x
687
;    shl ebx,16
688
;    add ebx,y
131 diamond 689
    words2reg ebx,x,y
690
 
691
    dword2reg ecx,color
692
    dword2reg edx,offs
693
    dword2reg esi,size
694
 
695
;    mov ecx,color
696
;    mov edx,offs
697
;    mov esi,size
31 halyavin 698
    mov eax,4
699
    int 0x40
700
}
701
 
702
macro outcount data, x, y, color, numtype
703
{
704
    mov ecx,data
705
    mov ebx,numtype
706
    mov bl,0
707
;    mov edx,x*65536+y
131 diamond 708
    words2reg edx,x,y
31 halyavin 709
    mov esi,color
710
    mov eax,47
711
    int 0x40
712
}
713
 
714
; SCEVENT - Scan event
715
 
716
macro scevent red,key,but
717
{
718
    mov eax,11
719
    int 0x40
720
    dec eax
721
    jz  red
722
    dec eax
723
    jz  key
724
    dec eax
725
    jz  but
726
}
727
 
728
; WTEVENT - Wait event
729
 
730
macro wtevent red,key,but
731
{
732
    mov eax,10
733
    int 0x40
734
    dec eax
735
    jz  red
736
    dec eax
737
    jz  key
738
    dec eax
739
    jz  but
740
}
741
 
742
; TIMEEVENT - Wite for event with timeout
743
 
744
macro timeevent xfps,noevent,red,key,but
745
{
746
    mov eax,23
747
    mov ebx,xfps
748
    int 0x40
749
    cmp eax,0
750
    je  noevent
751
    dec eax
752
    jz  red
753
    dec eax
754
    jz  key
755
    dec eax
756
    jz  but
757
}
758
 
759
 
760
; CLOSE - Close program
761
 
762
macro close
763
{
764
    mov eax,-1
765
    int 0x40
766
}
767
 
768
; DELAY - Create delay 1/100 sec
769
; (SYNTAX)  Delay time
770
; (SAMPLE)  Delay 100   ;delay 2 sec 1/100*200=2 sec
771
 
772
macro delay arg1
773
{
774
    mov eax,5
775
    mov ebx,arg1
776
    int 0x40
777
}
778
 
779
; WINDOW - Draw window
780
; (SYNTAX)  WINDOW Xstart,Ystart,'Text',Color
781
; (SAMPLE)  WINDOW 10,10,640+8,480+24,window_Skinned
782
 
783
macro window arg1,arg2,arg3,arg4,arg5
784
{
785
;    mov ebx,arg1*65536+arg3
786
;    mov ecx,arg2*65536+arg4
131 diamond 787
    words2reg ebx,arg1,arg3
788
    words2reg ecx,arg2,arg4
31 halyavin 789
    mov edx,arg5
790
    mov eax,0
791
    int 0x40
792
}
793
 
794
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
795
{
796
    mov ebx,arg1*65536+arg3
797
    mov ecx,arg2*65536+arg4
798
    mov edx,arg5
799
    mov esi,arg6
800
    mov edi,arg7
801
    mov eax,0
802
    int 0x40
803
}
804
 
805
 
806
; STARTWD - Start of window draw
807
 
808
macro startwd
809
{
810
    mov eax,12
811
    mov ebx,1
812
    int 0x40
813
}
814
 
815
; ENDWD - End window draw
816
 
817
macro endwd
818
{
819
    mov eax,12
820
    mov ebx,2
821
    int 0x40
822
}
823
 
824
; LABEL - Put text to frame
825
; (SYNTAX)  LABEL Xstart,Ystart,'Text',Color
826
; (SAMPLE)  LABEL 10,12,'Hello World!',cl_Green+font_Big
827
 
131 diamond 828
macro glabel arg1,arg2,arg3,arg4
31 halyavin 829
{
830
local asd,lab
831
    jmp asd
832
lab db  arg3                 ;arg label
833
asd:
834
;    mov ebx,arg1             ;arg1=y arg2=x
835
;    shl ebx,16
836
;    add ebx,arg2
131 diamond 837
 
838
   words2reg ebx,arg1,arg2
839
 
840
   dword2reg ecx,arg4
841
 
31 halyavin 842
    mov edx,lab
843
    mov esi,asd-lab          ;calc size
844
    mov eax,4
845
    int 0x40
846
}
847
 
848
;Key's
849
key_Up     equ 178
850
key_Down   equ 177
851
key_Right  equ 179
852
key_Left   equ 176
853
key_Esc    equ 27
854
key_Space  equ 32
855
key_Enter  equ 13
856
key_Bspace equ 8
857
key_F1     equ 50
858
key_F2     equ 51
859
key_F3     equ 52
860
key_F4     equ 53
861
key_F5     equ 54
862
key_F6     equ 55
863
key_F7     equ 56
864
key_F8     equ 57
865
key_F9     equ 48
866
key_F10    equ 49
867
key_F11    equ 68
868
key_F12    equ 255
869
key_Home   equ 180
870
key_End    equ 181
871
key_PgUp   equ 184
872
key_PgDown equ 183
873
 
874
;Attributes
875
 
876
;Window Attributes
877
window_Skinned equ 0x03000000
878
window_Type2   equ 0x02000000
879
window_Type1   equ 0x00000000
880
window_Reserve equ 0x01000000
881
 
882
;Font Attributes
883
font_Big  equ 0x10000000
884
 
885
;Colors
886
cl_White  equ 0x00ffffff
887
cl_Black  equ 0x00000000
888
cl_Grey   equ 0x00888888
889
cl_Red    equ 0x00ff0000
890
cl_Lime   equ 0x0000ff00
891
cl_Green  equ 0x0000af00
892
cl_Blue   equ 0x000000ff
893
cl_Purple equ 0x008080ff
894
cl_Violet equ 0x008040ff
895
cl_Cyan   equ 0x0040e0ff