Subversion Repositories Kolibri OS

Rev

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

Rev 331 Rev 485
Line 15... Line 15...
15
 dd	I_END+0x10000 ; esp
15
 dd	I_END+0x10000 ; esp
16
 dd	0x0 , 0x0     ; I_Param , I_Path
16
 dd	0x0 , 0x0     ; I_Param , I_Path
Line 17... Line 17...
17
 
17
 
18
 
18
 
Line 19... Line 19...
19
include 'lang.inc'
19
include 'lang.inc'
Line 20... Line 20...
20
include 'macros.inc'
20
include '..\..\..\macros.inc'
21
 
21
 
Line 35... Line 35...
35
still:
35
still:
36
    ; check connection status
36
    ; check connection status
37
    mov  eax,53
37
    mov  eax,53
38
    mov  ebx,6
38
    mov  ebx,6
39
    mov  ecx,[socket]
39
    mov  ecx,[socket]
40
    int  0x40
40
    mcall
Line 41... Line 41...
41
 
41
 
42
    mov     ebx, [socket_status]
42
    mov     ebx, [socket_status]
Line 43... Line 43...
43
    mov     [socket_status], eax
43
    mov     [socket_status], eax
44
 
44
 
Line -... Line 45...
-
 
45
    cmp     eax, ebx
45
    cmp     eax, ebx
46
    je	    waitev
Line 46... Line 47...
46
    je	    waitev
47
 
47
 
48
red:
48
    call    draw_window
49
    call    draw_window
49
 
50
 
Line 50... Line 51...
50
waitev:
51
waitev:
51
    mov  eax,23 		; wait here for event
52
    mov  eax,23 		; wait here for event
52
    mov  ebx,20
53
    mov  ebx,20
53
    int  0x40
54
    mcall
Line 62... Line 63...
62
    ; any data from the socket?
63
    ; any data from the socket?
Line 63... Line 64...
63
 
64
 
64
    mov     eax, 53
65
    mov     eax, 53
65
    mov     ebx, 2
66
    mov     ebx, 2
66
    mov     ecx, [socket]
67
    mov     ecx, [socket]
67
    int     0x40
68
    mcall
68
    cmp     eax, 0
69
    cmp     eax, 0
Line 69... Line 70...
69
    jne      read_input
70
    jne      read_input
Line 75... Line 76...
75
 
76
 
76
    push ecx
77
    push ecx
77
    mov     eax, 53
78
    mov     eax, 53
78
    mov     ebx, 3
79
    mov     ebx, 3
79
    mov     ecx, [socket]
80
    mov     ecx, [socket]
80
    int     0x40
81
    mcall
Line 81... Line 82...
81
    pop  ecx
82
    pop  ecx
Line 82... Line 83...
82
 
83
 
83
    call    handle_data
84
    call    handle_data
84
 
85
 
85
    push    ecx
86
    push    ecx
86
    mov     eax, 53
87
    mov     eax, 53
87
    mov     ebx, 2
88
    mov     ebx, 2
88
    mov     ecx, [socket]
89
    mov     ecx, [socket]
Line 89... Line 90...
89
    int     0x40
90
    mcall
Line 131... Line 132...
131
    mov     edx, 3
132
    mov     edx, 3
132
    mov     eax,53
133
    mov     eax,53
133
    mov     ebx,7
134
    mov     ebx,7
134
    mov     ecx,[socket]
135
    mov     ecx,[socket]
135
    mov     esi, telnetrep
136
    mov     esi, telnetrep
136
    int     0x40
137
    mcall
137
    ret
138
    ret
Line 138... Line 139...
138
 
139
 
139
hd001:
140
hd001:
140
    cmp  bl,13				; BEGINNING OF LINE
141
    cmp  bl,13				; BEGINNING OF LINE
Line 198... Line 199...
198
  noeaxz:
199
  noeaxz:
199
    mov  [pos],eax
200
    mov  [pos],eax
200
  newdata:
201
  newdata:
201
    ret
202
    ret
Line 202... Line -...
202
 
-
 
203
 
-
 
204
  red:				; REDRAW WINDOW
-
 
205
    call draw_window
-
 
206
    jmp  still
-
 
207
 
203
 
208
  key:				; KEY
204
  key:				; KEY
209
    mov  eax,2			; send to modem
205
    mov  eax,2			; send to modem
Line 210... Line 206...
210
    int  0x40
206
    mcall
211
 
207
 
212
    mov     ebx, [socket_status]
208
    mov     ebx, [socket_status]
Line 244... Line 240...
244
 
240
 
Line 245... Line 241...
245
    jmp  still
241
    jmp  still
246
 
242
 
247
  button:			; BUTTON
243
  button:			; BUTTON
248
    mov  eax,17
244
    mov  eax,17
249
    int  0x40
245
    mcall
Line 250... Line 246...
250
    cmp  ah,1			; CLOSE PROGRAM
246
    cmp  ah,1			; CLOSE PROGRAM
251
    jne  noclose
247
    jne  noclose
252
 
248
 
253
    mov  eax,53
249
    mov  eax,53
Line 254... Line 250...
254
    mov  ebx,8
250
    mov  ebx,8
255
    mov  ecx,[socket]
251
    mov  ecx,[socket]
256
    int  0x40
252
    mcall
257
 
253
 
258
     mov  eax,-1
254
     or   eax,-1
Line 259... Line 255...
259
     int  0x40
255
     mcall
Line 374... Line 370...
374
tm_000:
370
tm_000:
375
    mov     eax,53
371
    mov     eax,53
376
    mov     ebx,7
372
    mov     ebx,7
377
    mov     ecx,[socket]
373
    mov     ecx,[socket]
378
    mov     esi, tx_buff
374
    mov     esi, tx_buff
379
    int  0x40
375
    mcall
380
    pop     bx
376
    pop     bx
381
    mov     al, [echo]
377
    mov     al, [echo]
382
    cmp     al, 0
378
    cmp     al, 0
383
    je	    tm_001
379
    je	    tm_001
Line 403... Line 399...
403
 
399
 
404
disconnect:
400
disconnect:
405
    mov  eax,53
401
    mov  eax,53
406
    mov  ebx,8
402
    mov  ebx,8
407
    mov  ecx,[socket]
403
    mov  ecx,[socket]
408
    int  0x40
404
    mcall
Line 409... Line 405...
409
    ret
405
    ret
Line 418... Line 414...
418
getlp:
414
getlp:
419
 inc	 ecx
415
 inc	 ecx
420
 push ecx
416
 push ecx
421
 mov	 eax, 53
417
 mov	 eax, 53
422
 mov	 ebx, 9
418
 mov	 ebx, 9
423
 int	 0x40
419
 mcall
424
 pop	 ecx
420
 pop	 ecx
425
 cmp	 eax, 0   ; is this local port in use?
421
 cmp	 eax, 0   ; is this local port in use?
426
 jz  getlp	; yes - so try next
422
 jz  getlp	; yes - so try next
Line 427... Line 423...
427
 
423
 
Line 435... Line 431...
435
    shl     edx, 8
431
    shl     edx, 8
436
    mov     dl, [ip_address]
432
    mov     dl, [ip_address]
437
    mov     esi, edx
433
    mov     esi, edx
438
    movzx   edx, word [port]	  ; telnet port id
434
    movzx   edx, word [port]	  ; telnet port id
439
    mov     edi,1      ; active open
435
    mov     edi,1      ; active open
440
    int     0x40
436
    mcall
441
    mov     [socket], eax
437
    mov     [socket], eax
Line 442... Line 438...
442
 
438
 
Line 443... Line 439...
443
    popa
439
    popa
Line 455... Line 451...
455
 
451
 
Line 456... Line 452...
456
    pusha
452
    pusha
457
 
453
 
458
    mov  eax,12
454
    mov  eax,12
Line 459... Line 455...
459
    mov  ebx,1
455
    mov  ebx,1
460
    int  0x40
456
    mcall
461
 
457
 
462
    xor  eax,eax		     ; DRAW WINDOW
458
    xor  eax,eax		     ; DRAW WINDOW
463
    mov  ebx,100*65536+491 + 8 +15
459
    mov  ebx,100*65536+491 + 8 +15
464
    mov  ecx,100*65536+270 + 20     ; 20 for status bar
460
    mov  ecx,100*65536+270 + 20     ; 20 for status bar
Line 465... Line 461...
465
    mov  edx,0x13000000
461
    mov  edx,0x13000000
466
    mov  edi,labelt
462
    mov  edi,title
467
    int  0x40
463
    mcall
468
 
464
 
469
    ; draw status bar
465
    ; draw status bar
470
    mov     eax, 13
466
    mov     eax, 13
Line 471... Line 467...
471
    mov     ebx, 4*65536+484 + 8 +15
467
    mov     ebx, 4*65536+484 + 8 +15
472
    mov     ecx, 270*65536 + 3
468
    mov     ecx, 270*65536 + 3
473
    mov     edx, 0x00557799
469
    mov     edx, 0x00557799
474
    int     0x40
470
    mcall
475
 
471
 
476
    mov  eax,8			   ; BUTTON 2: SET IP
472
    mov  eax,8			   ; BUTTON 2: SET IP
Line 477... Line 473...
477
    mov  ebx,4*65536+70
473
    mov  ebx,4*65536+70
478
    mov  ecx,273*65536+12
474
    mov  ecx,273*65536+12
479
    mov     esi, 0x00557799
475
    mov     esi, 0x00557799
480
    mov  edx,2
476
    mov  edx,2
481
    int  0x40
477
    mcall
482
 
478
 
Line -... Line 479...
-
 
479
    mov  eax,4			   ; Button text
483
    mov  eax,4			   ; Button text
480
    mov  ebx,6*65536+276
484
    mov  ebx,6*65536+276
481
    mov  ecx,0x00ffffff
485
    mov  ecx,0x00ffffff
482
    mov  edx,setipt
486
    mov  edx,setipt
483
    mov  esi,setiplen-setipt
487
    mov  esi,setiplen-setipt
484
    mcall
488
    int  0x40
-
 
489
 
485
 
490
 
486
 
491
    mov  edi,ip_address 	    ; display IP address
487
    mov  eax,47
492
    mov  edx,78*65536+276
488
    mov  edi,ip_address 	    ; display IP address
493
    mov  esi,0x00ffffff
489
    mov  edx,78*65536+276
494
    mov  ebx,3*65536
490
    mov  esi,0x00ffffff
Line 495... Line 491...
495
  ipdisplay:
491
    mov  ebx,3*65536
496
    mov  eax,47
492
  ipdisplay:
497
    movzx ecx,byte [edi]
493
    movzx ecx,byte [edi]
498
    int  0x40
494
    mcall
499
    add  edx,6*4*65536
495
    add  edx,6*4*65536
500
    inc  edi
496
    inc  edi
Line 501... Line 497...
501
    cmp  edi,ip_address+4
497
    cmp  edi,ip_address+4
502
    jb	 ipdisplay
498
    jb	 ipdisplay
503
 
499
 
504
    mov  eax,8			   ; BUTTON 3: SET PORT
500
    mov  eax,8			   ; BUTTON 3: SET PORT
505
    mov  ebx,173*65536+38
501
    mov  ebx,173*65536+38
506
    mov  ecx,273*65536+12
502
    mov  ecx,273*65536+12
Line 507... Line 503...
507
    mov  edx,3
503
    mov  edx,3
508
    mov     esi, 0x00557799
504
    mov     esi, 0x00557799
509
    int  0x40
505
    mcall
510
 
506
 
511
    mov  eax,4			   ; Button text
507
    mov  eax,4			   ; Button text
512
    mov  ebx,178*65536+276
508
    mov  ebx,178*65536+276
Line 513... Line 509...
513
    mov  ecx,0x00ffffff
509
    mov  ecx,0x00ffffff
514
    mov  edx,setportt
510
    mov  edx,setportt
515
    mov  esi,setportlen-setportt
511
    mov  esi,setportlen-setportt
516
    int  0x40
512
    mcall
517
 
513
 
518
 
514
 
Line 519... Line 515...
519
    mov  edx,216*65536+276	     ; display port
515
    mov  edx,216*65536+276	     ; display port
520
    mov  esi,0x00ffffff
516
    mov  esi,0x00ffffff
521
    mov  ebx,4*65536
517
    mov  ebx,4*65536
522
    mov  eax,47
518
    mov  eax,47
523
    movzx  ecx,word [port]
519
    movzx  ecx,word [port]
524
    int  0x40
520
    mcall
Line 525... Line 521...
525
 
521
 
526
    mov  eax,8			   ; BUTTON 4: Connect
522
    mov  eax,8			   ; BUTTON 4: Connect
527
    mov  ebx,250*65536+50
523
    mov  ebx,250*65536+50
528
    mov  ecx,273*65536+12
524
    mov  ecx,273*65536+12
529
    mov     esi, 0x00557799
525
    mov     esi, 0x00557799
530
    mov  edx,4
526
    mov  edx,4
Line 531... Line 527...
531
    int     0x40
527
    mcall
532
 
528
 
533
    mov  eax,4			   ; Button text
529
    mov  eax,4			   ; Button text
534
    mov  ebx,255*65536+276
530
    mov  ebx,255*65536+276
535
    mov  ecx,0x00ffffff
531
    mov  ecx,0x00ffffff
536
    mov  edx,cont
532
    mov  edx,cont
Line 537... Line 533...
537
    mov  esi,conlen-cont
533
    mov  esi,conlen-cont
538
    int  0x40
534
    mcall
539
 
535
 
Line 564... Line 560...
564
pcon:
560
pcon:
Line 565... Line 561...
565
 
561
 
566
    mov  eax,4			   ; status text
562
    mov  eax,4			   ; status text
567
    mov  ebx,380*65536+276
563
    mov  ebx,380*65536+276
568
    mov  ecx,0x00ffffff
564
    mov  ecx,0x00ffffff
Line 569... Line 565...
569
    int  0x40
565
    mcall
570
 
566
 
571
 
567
 
572
    mov  eax,8			   ; BUTTON 6: echo
568
    mov  eax,8			   ; BUTTON 6: echo
573
    mov  ebx,460*65536+50
569
    mov  ebx,460*65536+50
574
    mov  ecx,273*65536+12
570
    mov  ecx,273*65536+12
Line 575... Line 571...
575
    mov  edx,6
571
    mov  edx,6
576
    mov     esi, 0x00557799
572
    mov     esi, 0x00557799
577
    int     0x40
573
    mcall
578
 
574
 
Line 586... Line 582...
586
 
582
 
587
peo:
583
peo:
588
    mov  eax,4			   ; Button text
584
    mov  eax,4			   ; Button text
589
    mov  ebx,463*65536+276
585
    mov  ebx,463*65536+276
590
    mov  ecx,0x00ffffff
586
    mov  ecx,0x00ffffff
Line 591... Line 587...
591
    int  0x40
587
    mcall
592
 
588
 
593
 
589
 
Line 599... Line 595...
599
 
595
 
Line 600... Line 596...
600
    call draw_text
596
    call draw_text
601
 
597
 
602
    mov  eax,12
598
    mov  eax,12
Line 603... Line 599...
603
    mov  ebx,2
599
    mov  ebx,2
Line 604... Line 600...
604
    int  0x40
600
    mcall
Line 634... Line 630...
634
    mov     ebx, eax
630
    mov     ebx, eax
635
    add     ebx, 6
631
    add     ebx, 6
636
    shl     ebx, 16
632
    shl     ebx, 16
637
    mov     bx, 6
633
    mov     bx, 6
638
    mov     eax, 13
634
    mov     eax, 13
639
    int     0x40
635
    mcall
640
    popa
636
    popa
Line 641... Line 637...
641
 
637
 
Line 642... Line 638...
642
    ; draw character
638
    ; draw character
Line 650... Line 646...
650
    pop  bx
646
    pop  bx
651
    add  bx,26
647
    add  bx,26
652
    mov  eax,4
648
    mov  eax,4
653
    mov  edx,esi
649
    mov  edx,esi
654
    mov  esi,1
650
    mov  esi,1
655
    int  0x40
651
    mcall
656
    popa
652
    popa
Line 657... Line 653...
657
 
653
 
Line 658... Line 654...
658
  noletter:
654
  noletter:
Line 681... Line 677...
681
    call print_text
677
    call print_text
Line 682... Line 678...
682
 
678
 
683
    mov  edi,string
679
    mov  edi,string
684
  f11:
680
  f11:
685
    mov  eax,10
681
    mov  eax,10
686
    int  0x40
682
    mcall
687
    cmp  eax,2
683
    cmp  eax,2
688
    jne  read_done
684
    jne  read_done
689
    mov  eax,2
685
    mov  eax,2
690
    int  0x40
686
    mcall
691
    shr  eax,8
687
    shr  eax,8
692
    cmp  eax,13
688
    cmp  eax,13
693
    je	 read_done
689
    je	 read_done
694
    cmp  eax,8
690
    cmp  eax,8
Line 733... Line 729...
733
    imul bx,6
729
    imul bx,6
734
    mov  ecx,[string_y]
730
    mov  ecx,[string_y]
735
    shl  ecx,16
731
    shl  ecx,16
736
    mov  cx,8
732
    mov  cx,8
737
    mov  edx,0x00000000
733
    mov  edx,0x00000000
738
    int  0x40
734
    mcall
Line 739... Line 735...
739
 
735
 
740
    mov  eax,4
736
    mov  eax,4
741
    mov  ebx,[string_x]
737
    mov  ebx,[string_x]
742
    shl  ebx,16
738
    shl  ebx,16
743
    add  ebx,[string_y]
739
    add  ebx,[string_y]
744
    mov  ecx,0x00ffffff
740
    mov  ecx,0x00ffffff
745
    mov  edx,string
741
    mov  edx,string
746
    mov  esi,[string_length]
742
    mov  esi,[string_length]
Line 747... Line 743...
747
    int  0x40
743
    mcall
748
 
744
 
Line 771... Line 767...
771
socket_status	dd  0x0
767
socket_status	dd  0x0
772
pos		dd  80 * 1
768
pos		dd  80 * 1
773
scroll		dd  1
769
scroll		dd  1
774
		dd  24
770
		dd  24
775
wcolor		dd  0x000000
771
wcolor		dd  0x000000
776
labelt		db  'Telnet v0.1',0
772
title		db  'Telnet v0.1',0
777
setipt		db  'IP Address:    .   .   .'
773
setipt		db  'IP Address:    .   .   .'
778
setiplen:
774
setiplen:
779
setportt	db  'Port:'
775
setportt	db  'Port:'
780
setportlen:
776
setportlen:
781
cont		db  'Connect'
777
cont		db  'Connect'