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 20... Line 20...
20
               dd     memsize                 ; memory for app
20
               dd     memsize                 ; memory for app
21
               dd     memsize - 1024          ; esp
21
               dd     memsize - 1024          ; esp
22
               dd     PARAMS , 0x0            ; I_Param , I_Icon
22
               dd     PARAMS , 0x0            ; I_Param , I_Icon
Line 23... Line 23...
23
 
23
 
-
 
24
include 'lang.inc'
-
 
25
include '..\..\..\macros.inc'
24
include 'lang.inc'
26
 
Line 25... Line 27...
25
START:                          ; start of execution
27
START:                          ; start of execution
26
 
28
 
Line 27... Line 29...
27
    cmp     [PARAMS], byte 0
29
    cmp     [PARAMS], byte 0
Line -... Line 30...
-
 
30
    jne     check_parameters
28
    jne     check_parameters
31
 
Line 29... Line 32...
29
 
32
no_params:
Line 30... Line 33...
30
no_params:
33
 
31
 
34
  red:
Line 32... Line 35...
32
    call draw_window            ; at first, draw the window
35
    call draw_window            ; at first, draw the window
33
 
36
 
34
still:
37
still:
35
 
-
 
36
    mov  eax,10                 ; wait here for event
-
 
37
    int  0x40
38
 
38
 
-
 
39
    cmp  eax,1                  ; redraw request ?
-
 
40
    je   red
-
 
41
    cmp  eax,2                  ; key in buffer ?
-
 
42
    je   key
-
 
43
    cmp  eax,3                  ; button in buffer ?
-
 
Line 44... Line 39...
44
    je   button
39
    mov  eax,10                 ; wait here for event
45
 
40
    mcall
46
    jmp  still
41
 
47
 
42
    cmp  eax,1                  ; redraw request ?
Line 48... Line 43...
48
  red:                          ; redraw
43
    jz   red
49
    call draw_window
44
    cmp  eax,2                  ; key in buffer ?
50
    jmp  still
45
    jnz  button
Line 51... Line 46...
51
 
46
 
Line 52... Line 47...
52
  key:                          ; key
47
  key:                          ; key
53
    mov  eax,2                  ; just read it and ignore
48
    mov  al,2                  ; just read it and ignore
54
    int  0x40
49
    mcall
55
    jmp  still
50
    jmp  still
56
 
51
 
Line 57... Line 52...
57
  button:                       ; button
52
  button:                       ; button
58
    mov  eax,17                 ; get id
53
    mov  al,17                 ; get id
Line 280... Line 275...
280
 
275
 
Line 281... Line 276...
281
read_stack_setup:
276
read_stack_setup:
282
 
277
 
283
    mov  eax,52
278
    mov  eax,52
284
    mov  ebx,0
279
    mov  ebx,0
Line 285... Line 280...
285
    int  0x40
280
    mcall
286
    mov  [config],eax
281
    mov  [config],eax
287
 
282
 
288
    mov  eax,52
283
    mov  eax,52
Line 289... Line 284...
289
    mov  ebx,1
284
    mov  ebx,1
290
    int  0x40
285
    mcall
291
    mov  dword [ip_address],eax
286
    mov  dword [ip_address],eax
292
 
287
 
Line 293... Line 288...
293
    mov  eax,52
288
    mov  eax,52
294
    mov  ebx,9
289
    mov  ebx,9
295
    int  0x40
290
    mcall
296
    mov  dword [gateway_ip],eax
291
    mov  dword [gateway_ip],eax
Line 297... Line 292...
297
 
292
 
298
    mov  eax,52
293
    mov  eax,52
299
    mov  ebx,10
294
    mov  ebx,10
300
    int  0x40
295
    mcall
Line 301... Line 296...
301
    mov  dword [subnet_mask],eax
296
    mov  dword [subnet_mask],eax
302
 
297
 
303
    mov  eax,52
298
    mov  eax,52
Line 343... Line 338...
343
    mov  [config],eax
338
    mov  [config],eax
Line 344... Line 339...
344
 
339
 
345
    mov  eax,52
340
    mov  eax,52
346
    mov  ebx,3
341
    mov  ebx,3
347
    mov  ecx,dword [ip_address]
342
    mov  ecx,dword [ip_address]
Line 348... Line 343...
348
    int  0x40
343
    mcall
349
 
344
 
350
    mov  eax,52
345
    mov  eax,52
351
    mov  ebx,11
346
    mov  ebx,11
Line 352... Line 347...
352
    mov  ecx,dword [gateway_ip]
347
    mov  ecx,dword [gateway_ip]
353
    int  0x40
348
    mcall
354
 
349
 
355
    mov  eax,52
350
    mov  eax,52
Line 356... Line 351...
356
    mov  ebx,12
351
    mov  ebx,12
357
    mov  ecx,dword [subnet_mask]
352
    mov  ecx,dword [subnet_mask]
358
    int  0x40
353
    mcall
359
 
354
 
Line 360... Line 355...
360
    mov  eax,52
355
    mov  eax,52
361
    mov  ebx,14
356
    mov  ebx,14
362
    mov  ecx,dword [dns_ip]
357
    mov  ecx,dword [dns_ip]
363
    int  0x40
358
    mcall
Line 364... Line 359...
364
 
359
 
365
    mov  eax,52
360
    mov  eax,52
Line 388... Line 383...
388
    call print_text
383
    call print_text
Line 389... Line 384...
389
 
384
 
390
    mov  edi,string
385
    mov  edi,string
391
  f11:
386
  f11:
392
    mov  eax,10
387
    mov  eax,10
393
    int  0x40
388
    mcall
394
    cmp  eax,2
389
    cmp  eax,2
395
    jne  read_done
390
    jne  read_done
396
    mov  eax,2
391
    mov  eax,2
397
    int  0x40
392
    mcall
398
    shr  eax,8
393
    shr  eax,8
399
    cmp  eax,13
394
    cmp  eax,13
400
    je   read_done
395
    je   read_done
401
    cmp  eax,8
396
    cmp  eax,8
Line 440... Line 435...
440
    imul bx,6
435
    imul bx,6
441
    mov  ecx,[string_y]
436
    mov  ecx,[string_y]
442
    shl  ecx,16
437
    shl  ecx,16
443
    mov  cx,8
438
    mov  cx,8
444
    mov  edx,0xffffff
439
    mov  edx,0xffffff
445
    int  0x40
440
    mcall
Line 446... Line 441...
446
 
441
 
447
    mov  eax,4
442
    mov  eax,4
448
    mov  ebx,[string_x]
443
    mov  ebx,[string_x]
449
    shl  ebx,16
444
    shl  ebx,16
450
    add  ebx,[string_y]
445
    add  ebx,[string_y]
451
    mov  ecx,0x000000
446
    mov  ecx,0x000000
452
    mov  edx,string
447
    mov  edx,string
453
    mov  esi,[string_length]
448
    mov  esi,[string_length]
Line 454... Line 449...
454
    int  0x40
449
    mcall
455
 
450
 
Line 469... Line 464...
469
 
464
 
Line 470... Line 465...
470
draw_window:
465
draw_window:
471
 
466
 
472
    mov  eax,12                    ; function 12:tell os about windowdraw
467
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 473... Line 468...
473
    mov  ebx,1                     ; 1, start of draw
468
    mov  ebx,1                     ; 1, start of draw
474
    int  0x40
469
    mcall
475
 
470
 
476
                                   ; DRAW WINDOW
471
                                   ; DRAW WINDOW
477
    mov  eax,0                     ; function 0 : define and draw window
472
    mov  eax,0                     ; function 0 : define and draw window
478
    mov  ebx,100*65536+330         ; [x start] *65536 + [x size]
473
    mov  ebx,100*65536+330         ; [x start] *65536 + [x size]
479
    mov  ecx,100*65536+157         ; [y start] *65536 + [y size]
474
    mov  ecx,100*65536+157         ; [y start] *65536 + [y size]
Line 480... Line 475...
480
    mov  edx,0x13ffffff            ; color of work area RRGGBB,8->color gl
475
    mov  edx,0x13ffffff            ; color of work area RRGGBB,8->color gl
481
    mov  edi,header                ; WINDOW LABEL
476
    mov  edi,title                ; WINDOW LABEL
482
    int  0x40
477
    mcall
483
 
478
 
484
                                   
479
                                   
485
    mov  eax,8                     ; BUTTON : READ SETUP
480
    mov  eax,8                     ; BUTTON : READ SETUP
Line 486... Line 481...
486
    mov  ebx,90*65536+65
481
    mov  ebx,90*65536+65
487
    mov  ecx,127*65536+12
482
    mov  ecx,127*65536+12
488
    mov  edx,2
483
    mov  edx,2
489
    mov  esi,[button_color]
484
    mov  esi,[button_color]
490
    int  0x40
485
    mcall
Line 491... Line 486...
491
 
486
 
492
    ;mov  eax,8                     ; BUTTON : APPLY SETUP
487
    ;mov  eax,8                     ; BUTTON : APPLY SETUP
493
    mov  ebx,163*65536+65
488
    mov  ebx,163*65536+65
494
    mov  ecx,127*65536+12
489
    mov  ecx,127*65536+12
495
    mov  edx,3
490
    mov  edx,3
496
    int  0x40
491
    mcall
497
 
492
 
498
    ;mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
493
    ;mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
499
    mov  ebx,29*65536+8
494
    mov  ebx,29*65536+8
500
    mov  ecx,39*65536+8
495
    mov  ecx,39*65536+8
Line 511... Line 506...
511
    add  ebx,31*65536+39
506
    add  ebx,31*65536+39
512
    mov  eax,4
507
    mov  eax,4
513
    mov  ecx,0xffffff
508
    mov  ecx,0xffffff
514
    mov  edx,xx
509
    mov  edx,xx
515
    mov  esi,1
510
    mov  esi,1
516
    int  0x40
511
    mcall
Line 517... Line 512...
517
 
512
 
518
    mov  eax,8                    ; BUTTONS 21-22 : SERVER / MANUAL IP
513
    mov  eax,8                    ; BUTTONS 21-22 : SERVER / MANUAL IP
519
    mov  ebx,143*65536+8
514
    mov  ebx,143*65536+8
520
    mov  ecx,69*65536+8
515
    mov  ecx,69*65536+8
521
    mov  edx,21
516
    mov  edx,21
522
    mov  esi,[button_color]
517
    mov  esi,[button_color]
523
    int  0x40
518
    mcall
524
    ;mov  eax,8
519
    ;mov  eax,8
525
    mov  ebx,143*65536+8
520
    mov  ebx,143*65536+8
526
    mov  ecx,79*65536+8
521
    mov  ecx,79*65536+8
527
    mov  edx,22
522
    mov  edx,22
528
    int  0x40
523
    mcall
529
    mov  ebx,[assigned]           ; PRINT SELECTED SERVER/MANUAL 'X'
524
    mov  ebx,[assigned]           ; PRINT SELECTED SERVER/MANUAL 'X'
530
    not  ebx
525
    not  ebx
531
    and  ebx,1
526
    and  ebx,1
532
    imul ebx,10
527
    imul ebx,10
533
    add  ebx,145*65536+69
528
    add  ebx,145*65536+69
534
    mov  eax,4
529
    mov  eax,4
535
    mov  ecx,0xffffff
530
    mov  ecx,0xffffff
536
    mov  edx,xx
531
    mov  edx,xx
537
    mov  esi,1
532
    mov  esi,1
Line 538... Line 533...
538
    int  0x40
533
    mcall
539
 
534
 
540
    mov  eax,47                   ; COM ADDRESS
535
    mov  eax,47                   ; COM ADDRESS
541
    mov  ebx,3*65536+1*256
536
    mov  ebx,3*65536+1*256
542
    mov  ecx,[com_add]
537
    mov  ecx,[com_add]
543
    mov  edx,272*65536+40
538
    mov  edx,272*65536+40
Line 544... Line 539...
544
    mov  esi,0x000000
539
    mov  esi,0x000000
545
    int  0x40
540
    mcall
546
 
541
 
547
    ;mov  eax,47                   ; COM IRQ
542
    ;mov  eax,47                   ; COM IRQ
548
    mov  ebx,1*65536+1*256
543
    mov  ebx,1*65536+1*256
549
    mov  ecx,[com_irq]
544
    mov  ecx,[com_irq]
Line 550... Line 545...
550
    mov  edx,(266+3*6)*65536+50
545
    mov  edx,(266+3*6)*65536+50
551
    mov  esi,0x000000
546
    mov  esi,0x000000
552
    int  0x40
547
    mcall
553
 
548
 
554
    mov  edi,ip_address
549
    mov  edi,ip_address
555
    mov  edx,205*65536+80
550
    mov  edx,205*65536+80
556
    mov  esi,0x000000
551
    mov  esi,0x000000
557
    mov  ebx,3*65536
552
    mov  ebx,3*65536
558
  ipdisplay:
553
  ipdisplay:
559
    ;mov  eax,47
554
    ;mov  eax,47
560
    movzx ecx,byte [edi]
555
    movzx ecx,byte [edi]
561
    int  0x40
556
    mcall
Line 569... Line 564...
569
    mov  esi,0x000000
564
    mov  esi,0x000000
570
    mov  ebx,3*65536
565
    mov  ebx,3*65536
571
  gipdisplay:
566
  gipdisplay:
572
    ;mov  eax,47
567
    ;mov  eax,47
573
    movzx ecx,byte [edi]
568
    movzx ecx,byte [edi]
574
    int  0x40
569
    mcall
575
    add  edx,6*4*65536
570
    add  edx,6*4*65536
576
    inc  edi
571
    inc  edi
577
    cmp  edi,gateway_ip+4
572
    cmp  edi,gateway_ip+4
578
    jb   gipdisplay
573
    jb   gipdisplay
Line 582... Line 577...
582
    mov  esi,0x000000
577
    mov  esi,0x000000
583
    mov  ebx,3*65536
578
    mov  ebx,3*65536
584
  sipdisplay:
579
  sipdisplay:
585
    ;mov  eax,47
580
    ;mov  eax,47
586
    movzx ecx,byte [edi]
581
    movzx ecx,byte [edi]
587
    int  0x40
582
    mcall
588
    add  edx,6*4*65536
583
    add  edx,6*4*65536
589
    inc  edi
584
    inc  edi
590
    cmp  edi,subnet_mask+4
585
    cmp  edi,subnet_mask+4
591
    jb   sipdisplay
586
    jb   sipdisplay
Line 595... Line 590...
595
    mov  esi,0x000000
590
    mov  esi,0x000000
596
    mov  ebx,3*65536
591
    mov  ebx,3*65536
597
  dipdisplay:
592
  dipdisplay:
598
    ;mov  eax,47
593
    ;mov  eax,47
599
    movzx ecx,byte [edi]
594
    movzx ecx,byte [edi]
600
    int  0x40
595
    mcall
601
    add  edx,6*4*65536
596
    add  edx,6*4*65536
602
    inc  edi
597
    inc  edi
603
    cmp  edi,dns_ip+4
598
    cmp  edi,dns_ip+4
604
    jb   dipdisplay
599
    jb   dipdisplay
Line 607... Line 602...
607
    mov  eax,8                     ; BUTTON 5 : SET PORT
602
    mov  eax,8                     ; BUTTON 5 : SET PORT
608
    mov  ebx,299*65536+8
603
    mov  ebx,299*65536+8
609
    mov  ecx,39*65536+8
604
    mov  ecx,39*65536+8
610
    mov  edx,5
605
    mov  edx,5
611
    mov  esi,[button_color]
606
    mov  esi,[button_color]
612
    int  0x40
607
    mcall
613
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
608
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
614
    mov  ebx,299*65536+8
-
 
615
    mov  ecx,49*65536+8
609
    mov  ecx,49*65536+8
616
    mov  edx,6
610
    mov  edx,6
617
    int  0x40
611
    mcall
618
    ;mov  eax,8                     ; BUTTON 7 : SET IP
612
    ;mov  eax,8                     ; BUTTON 7 : SET IP
619
    mov  ebx,299*65536+8
-
 
620
    mov  ecx,79*65536+8
613
    mov  ecx,79*65536+8
621
    mov  edx,7
614
    mov  edx,7
622
    int  0x40
615
    mcall
Line 623... Line 616...
623
 
616
 
624
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
617
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
625
    mov  ebx,299*65536+8
618
    mov  ebx,299*65536+8
626
    mov  ecx,89*65536+8
619
    mov  ecx,89*65536+8
627
    mov  edx,8
620
    mov  edx,8
Line 628... Line 621...
628
    int  0x40
621
    mcall
629
 
-
 
630
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
622
 
631
    mov  ebx,299*65536+8
623
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
632
    mov  ecx,99*65536+8
624
    mov  ecx,99*65536+8
Line 633... Line 625...
633
    mov  edx,9
625
    mov  edx,9
634
    int  0x40
-
 
635
 
626
    mcall
636
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
627
 
637
    mov  ebx,299*65536+8
628
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
Line 638... Line 629...
638
    mov  ecx,109*65536+8
629
    mov  ecx,109*65536+8
639
    mov  edx,10
630
    mov  edx,10
640
    int  0x40
631
    mcall
641
 
632
 
Line 648... Line 639...
648
    cmp  [edx],byte 'w'
639
    cmp  [edx],byte 'w'
649
    jne  nowhite
640
    jne  nowhite
650
    mov  ecx,0xeeeeee
641
    mov  ecx,0xeeeeee
651
   nowhite:
642
   nowhite:
652
    inc  edx
643
    inc  edx
653
    int  0x40
644
    mcall
654
    add  ebx,10
645
    add  ebx,10
655
    add  edx,49
646
    add  edx,49
656
    cmp  [edx],byte 'x'
647
    cmp  [edx],byte 'x'
657
    jne  newline
648
    jne  newline
Line 658... Line 649...
658
 
649
 
659
    mov  eax,12                    ; function 12:tell os about windowdraw
650
    mov  eax,12                    ; function 12:tell os about windowdraw
660
    mov  ebx,2                     ; 2, end of draw
651
    mov  ebx,2                     ; 2, end of draw
Line 661... Line 652...
661
    int  0x40
652
    mcall
Line 662... Line 653...
662
 
653
 
Line 673... Line 664...
673
 
664
 
Line 674... Line 665...
674
boot_set_settings:
665
boot_set_settings:
675
 
666
 
676
    mov  eax,52
667
    mov  eax,52
677
    mov  ebx,0
668
    mov  ebx,0
Line 678... Line 669...
678
    int  0x40
669
    mcall
679
    mov  [config],eax
670
    mov  [config],eax
680
 
671
 
Line 688... Line 679...
688
    mov  [com_add],eax
679
    mov  [com_add],eax
Line 689... Line 680...
689
 
680
 
Line 690... Line 681...
690
    call apply_stack_setup
681
    call apply_stack_setup
691
   
682
   
Line 692... Line 683...
692
    mov  eax,-1                 ; close this program
683
    mov  eax,-1                 ; close this program
Line 693... Line 684...
693
    int  0x40
684
    mcall
Line 711... Line 702...
711
 
702
 
Line 712... Line 703...
712
xx: db 'x' ;<- END MARKER, DONT DELETE
703
xx: db 'x' ;<- END MARKER, DONT DELETE
Line 713... Line 704...
713
 
704
 
Line 714... Line 705...
714
button_color dd  0x2254b9
705
button_color dd  0x2254b9
Line 715... Line 706...
715
 
706