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 10... Line 10...
10
 dd	I_END+0x10000 ; required memory
10
 dd	I_END+0x10000 ; required memory
11
 dd	I_END+0x10000 ; esp
11
 dd	I_END+0x10000 ; esp
12
 dd	0x0 , 0x0     ; I_Param , I_Path
12
 dd	0x0 , 0x0     ; I_Param , I_Path
Line 13... Line 13...
13
 
13
 
14
include 'lang.inc'
14
include 'lang.inc'
Line 15... Line 15...
15
include 'macros.inc'
15
include '..\..\..\macros.inc'
16
   
16
   
17
START:				; start of execution
17
START:				; start of execution
18
     mov  eax,40		 ; Report events
18
     mov  eax,40		 ; Report events
Line 19... Line 19...
19
     mov  ebx,10000111b 	 ; Stack 8 + defaults
19
     mov  ebx,10000111b 	 ; Stack 8 + defaults
20
     int  0x40
20
     mcall
Line -... Line 21...
-
 
21
   
21
   
22
    mov   dword [prompt], p1
Line 22... Line 23...
22
    mov   dword [prompt], p1
23
    mov  dword [promptlen], p1len - p1
23
    mov  dword [promptlen], p1len - p1
24
 
24
   
25
red:   
Line 25... Line 26...
25
    call draw_window		; at first, draw the window
26
    call draw_window		; at first, draw the window
26
   
27
   
27
still:
28
still:
28
    mov  eax,10 		; wait here for event
29
    mov  eax,10 		; wait here for event
29
    int  0x40
30
    mcall
30
   
31
   
Line 31... Line 32...
31
    cmp  eax,1			; redraw request ?
32
    cmp  eax,1			; redraw request ?
Line 32... Line -...
32
    jz	 red
-
 
33
    cmp  eax,2			; key in buffer ?
-
 
34
    jz	 key
-
 
35
    cmp  eax,3			; button in buffer ?
-
 
36
    jz	 button
33
    jz	 red
37
   
34
    cmp  eax,2			; key in buffer ?
38
    jmp  still
35
    jz	 key
39
   
36
    cmp  eax,3			; button in buffer ?
Line 40... Line 37...
40
red:			       ; redraw
37
    jz	 button
41
    call draw_window
38
   
42
    jmp  still
39
    jmp  still
Line 43... Line 40...
43
   
40
 
44
key:			       ; Keys are not valid at this part of the
41
key:			       ; Keys are not valid at this part of the
Line 61... Line 58...
61
    int   0x40
58
    int   0x40
Line 62... Line 59...
62
   
59
   
Line 63... Line 60...
63
 mov  [socketNum], dword 0
60
 mov  [socketNum], dword 0
64
   
61
   
Line 65... Line 62...
65
   
62
   
66
    mov  eax,0xffffffff 	; close this program
63
    or  eax,-1 	; close this program
67
    int  0x40
64
    mcall
Line 125... Line 122...
125
   
122
   
Line 126... Line 123...
126
    mov  edi,[addr]
123
    mov  edi,[addr]
127
   
124
   
128
  f11:
125
  f11:
129
    mov  eax,10
126
    mov  eax,10
130
    int  0x40
127
    mcall
131
    cmp  eax,2
128
    cmp  eax,2
132
    jz	 fbu
129
    jz	 fbu
133
    jmp  still
130
    jmp  still
134
  fbu:
131
  fbu:
135
    mov  eax,2
132
    mov  eax,2
136
    int  0x40  ; get key
133
    mcall  ; get key
137
    shr  eax,8
134
    shr  eax,8
138
    cmp  eax,8
135
    cmp  eax,8
139
    jnz  nobs
136
    jnz  nobs
Line 168... Line 165...
168
    mov  ebx,103*65536+15*6
165
    mov  ebx,103*65536+15*6
169
    mov  ecx,[ya]
166
    mov  ecx,[ya]
170
    shl  ecx,16
167
    shl  ecx,16
171
    mov  cx,8
168
    mov  cx,8
172
    mov  edx,0x224466
169
    mov  edx,0x224466
173
    int  0x40
170
    mcall
Line 174... Line 171...
174
   
171
   
175
    mov  eax,4
172
    mov  eax,4
176
    mov  ebx,103*65536
173
    mov  ebx,103*65536
177
    add  ebx,[ya]
174
    add  ebx,[ya]
178
    mov  ecx,0xffffff
175
    mov  ecx,0xffffff
179
    mov  edx,[addr]
176
    mov  edx,[addr]
180
    mov  esi,15
177
    mov  esi,15
Line 181... Line 178...
181
    int  0x40
178
    mcall
Line 182... Line 179...
182
   
179
   
Line 355... Line 352...
355
 mov  esi, tftp_filename
352
 mov  esi, tftp_filename
356
    int   0x40
353
    int   0x40
Line 357... Line 354...
357
   
354
   
358
cfr002:
355
cfr002:
359
    mov  eax,10 		; wait here for event
356
    mov  eax,10 		; wait here for event
Line 360... Line 357...
360
    int  0x40
357
    mcall
361
   
358
   
362
    cmp  eax,1			; redraw request ?
359
    cmp  eax,1			; redraw request ?
363
    je	 cfr003
360
    je	 cfr003
Line 425... Line 422...
425
cfr007:
422
cfr007:
Line 426... Line 423...
426
   
423
   
427
 mov  eax, 53
424
 mov  eax, 53
428
 mov  ebx, 2
425
 mov  ebx, 2
429
 mov  ecx, [socketNum]
426
 mov  ecx, [socketNum]
Line 430... Line 427...
430
 int  0x40   ; any more data?
427
 mcall   ; any more data?
431
   
428
   
Line 432... Line 429...
432
 cmp  eax, 0
429
 cmp  eax, 0
433
 je   no_more_data ; no
430
 je   no_more_data ; no
434
   
431
   
435
 mov  eax, 53
432
 mov  eax, 53
Line 436... Line 433...
436
 mov  ebx, 3
433
 mov  ebx, 3
437
 mov  ecx, [socketNum]
434
 mov  ecx, [socketNum]
438
 int  0x40   ; read byte
435
 mcall   ; read byte
439
   
436
   
Line 471... Line 468...
471
 mov  eax, 33
468
 mov  eax, 33
472
 mov  ebx, source
469
 mov  ebx, source
473
 mov  edx, [filesize]
470
 mov  edx, [filesize]
474
 mov  ecx, I_END + 512
471
 mov  ecx, I_END + 512
475
 mov  esi, 0
472
 mov  esi, 0
476
 int  0x40
473
 mcall
Line 477... Line 474...
477
   
474
   
Line 478... Line 475...
478
 jmp  cfrexit
475
 jmp  cfrexit
479
   
476
   
Line 498... Line 495...
498
    call draw_window
495
    call draw_window
499
    jmp  cfr002
496
    jmp  cfr002
Line 500... Line 497...
500
   
497
   
501
cfr004: 			; key pressed
498
cfr004: 			; key pressed
502
    mov  eax,2			; just read it and ignore
499
    mov  eax,2			; just read it and ignore
503
    int  0x40
500
    mcall
Line 504... Line 501...
504
    jmp  cfr002
501
    jmp  cfr002
505
   
502
   
506
cfr005: 		       ; button
503
cfr005: 		       ; button
Line 507... Line 504...
507
    mov  eax,17 		; get id
504
    mov  eax,17 		; get id
508
    int  0x40
505
    mcall
Line 509... Line 506...
509
   
506
   
Line 518... Line 515...
518
    int   0x40
515
    int   0x40
Line 519... Line 516...
519
   
516
   
Line 520... Line 517...
520
 mov  [socketNum], dword 0
517
 mov  [socketNum], dword 0
521
   
518
   
Line 522... Line 519...
522
    mov  eax,-1 		; close this program
519
    mov  eax,-1 		; close this program
Line 523... Line 520...
523
    int  0x40
520
    mcall
524
   
521
   
Line 807... Line 804...
807
   
804
   
Line 808... Line 805...
808
draw_window:
805
draw_window:
809
   
806
   
810
    mov  eax,12 		   ; function 12:tell os about windowdraw
807
    mov  eax,12 		   ; function 12:tell os about windowdraw
Line 811... Line 808...
811
    mov  ebx,1			   ; 1, start of draw
808
    mov  ebx,1			   ; 1, start of draw
812
    int  0x40
809
    mcall
813
   
810
   
814
				   ; DRAW WINDOW
811
				   ; DRAW WINDOW
815
    mov  eax,0			   ; function 0 : define and draw window
812
    mov  eax,0			   ; function 0 : define and draw window
816
    mov  ebx,100*65536+230	   ; [x start] *65536 + [x size]
813
    mov  ebx,100*65536+230	   ; [x start] *65536 + [x size]
817
    mov  ecx,100*65536+170	   ; [y start] *65536 + [y size]
814
    mov  ecx,100*65536+170	   ; [y start] *65536 + [y size]
Line 818... Line 815...
818
    mov  edx,0x13224466 	   ; color of work area RRGGBB
815
    mov  edx,0x13224466 	   ; color of work area RRGGBB
819
    mov  edi,labelt
816
    mov  edi,title
820
    int  0x40
817
    mcall
821
   
818
   
822
    mov  eax,8		    ; COPY BUTTON
819
    mov  eax,8		    ; COPY BUTTON
823
    mov  ebx,20*65536+190
820
    mov  ebx,20*65536+190
Line 824... Line 821...
824
    mov  ecx,79*65536+15
821
    mov  ecx,79*65536+15
825
    mov  edx,2
822
    mov  edx,2
826
    mov  esi,0x557799
823
    mov  esi,0x557799
827
    int  0x40
824
    mcall
828
   
-
 
829
    mov  eax,8		    ; DELETE BUTTON
825
   
Line 830... Line 826...
830
    mov  ebx,20*65536+190
826
 ;   mov  eax,8		    ; DELETE BUTTON
831
    mov  ecx,111*65536+15
827
    mov  ebx,20*65536+190
832
    mov  edx,3
828
    mov  ecx,111*65536+15
833
    mov  esi,0x557799
829
    mov  edx,3
834
    int  0x40
-
 
835
   
830
    mcall
Line 836... Line 831...
836
    mov  eax,8
831
   
837
    mov  ebx,200*65536+10
832
 ;   mov  eax,8
838
    mov  ecx,34*65536+10
833
 ;   mov  ebx,200*65536+10
839
    mov  edx,4
834
    mov  ecx,34*65536+10
840
    mov  esi,0x557799
-
 
841
    int  0x40
835
    mov  edx,4
Line 842... Line 836...
842
   
836
    mcall
843
    mov  eax,8
837
   
844
    mov  ebx,200*65536+10
838
 ;   mov  eax,8
Line 870... Line 864...
870
    mov  ecx,[promptlen]
864
    mov  ecx,[promptlen]
871
    rep  movsb
865
    rep  movsb
Line 872... Line 866...
872
   
866
   
873
    ; Re-draw the screen text
867
    ; Re-draw the screen text
-
 
868
    cld
874
    cld
869
    mov  eax,4
875
    mov  ebx,25*65536+35	   ; draw info text with function 4
870
    mov  ebx,25*65536+35	   ; draw info text with function 4
876
    mov  ecx,0xffffff
871
    mov  ecx,0xffffff
877
    mov  edx,text
872
    mov  edx,text
878
    mov  esi,40
873
    mov  esi,40
879
  newline:
874
  newline:
880
    mov  eax,4
-
 
881
    int  0x40
875
    mcall
882
    add  ebx,16
876
    add  ebx,16
883
    add  edx,40
877
    add  edx,40
884
    cmp  [edx],byte 'x'
878
    cmp  [edx],byte 'x'
Line 885... Line 879...
885
    jnz  newline
879
    jnz  newline
886
   
880
   
887
   
881
   
Line 888... Line 882...
888
    mov  eax,12 		   ; function 12:tell os about windowdraw
882
    mov  eax,12 		   ; function 12:tell os about windowdraw
Line 889... Line 883...
889
    mov  ebx,2			   ; 2, end of draw
883
    mov  ebx,2			   ; 2, end of draw
Line 919... Line 913...
919
    db '                                        '
913
    db '                                        '
920
    db '                                        '
914
    db '                                        '
921
    db 'x' ; <- END MARKER, DONT DELETE
915
    db 'x' ; <- END MARKER, DONT DELETE
Line 922... Line 916...
922
   
916
   
Line 923... Line 917...
923
   
917
   
924
labelt	db   'TFTP Client',0   
918
title	db   'TFTP Client',0