Subversion Repositories Kolibri OS

Rev

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

Rev 474 Rev 485
Line 21... Line 21...
21
                dd      I_END                   ; program image size
21
                dd      I_END                   ; program image size
22
                dd      0x200000                ; required amount of memory
22
                dd      0x200000                ; required amount of memory
23
                dd      0xffff0
23
                dd      0xffff0
24
                dd      0,0
24
                dd      0,0
Line 25... Line 25...
25
 
25
 
Line 26... Line 26...
26
include 'macros.inc'
26
include '..\..\..\macros.inc'
Line 27... Line 27...
27
 
27
 
28
save_file:
28
save_file:
Line 36... Line 36...
36
   sub  eax,0x100000
36
   sub  eax,0x100000
37
   mov  ebx,files
37
   mov  ebx,files
38
   mov  [ebx+12],eax
38
   mov  [ebx+12],eax
Line 39... Line 39...
39
 
39
 
40
   mov  eax,70
40
   mov  eax,70
Line 41... Line 41...
41
   int  0x40
41
   mcall
Line 42... Line 42...
42
 
42
 
Line 43... Line 43...
43
   ret
43
   ret
Line 44... Line 44...
44
 
44
 
45
 
45
 
46
START:                          ; start of execution
46
START:                          ; start of execution
Line 47... Line 47...
47
 
47
 
48
    mov  [file_start],0x100000
48
    mov  [file_start],0x100000
49
 
49
 
50
    mov  eax,70
50
    mov  eax,70
Line 70... Line 70...
70
    imul eax,11
70
    imul eax,11
71
    mov  [pos],eax
71
    mov  [pos],eax
Line 72... Line 72...
72
 
72
 
73
    mov  ebp,0
73
    mov  ebp,0
-
 
74
    mov  edx,I_END
-
 
75
 
74
    mov  edx,I_END
76
redraw:
Line 75... Line 77...
75
    call draw_window            ; at first, draw the window
77
    call draw_window            ; at first, draw the window
Line 76... Line 78...
76
 
78
 
Line 77... Line 79...
77
still:
79
still:
78
 
80
 
79
    inc  [cursor_on_off]
81
    inc  [cursor_on_off]
Line 80... Line 82...
80
 
82
 
81
    mov  eax,5
83
    mov  eax,5
Line 82... Line 84...
82
    mov  ebx,1
84
    mov  ebx,1
83
    int  0x40
85
    mcall
84
 
86
 
85
    mov  eax,11                 ; wait here for event
87
    mov  eax,11                 ; wait here for event
Line 128... Line 130...
128
    mov  eax,53
130
    mov  eax,53
129
    mov  ebx,7
131
    mov  ebx,7
130
    mov  ecx,[socket]
132
    mov  ecx,[socket]
131
    mov  edx,6
133
    mov  edx,6
132
    mov  esi,r220
134
    mov  esi,r220
133
    int  0x40
135
    mcall
134
    mov  [header_sent],1
136
    mov  [header_sent],1
Line 135... Line 137...
135
 
137
 
Line 136... Line -...
136
    jmp  still
-
 
137
 
-
 
138
 
-
 
139
 
-
 
140
redraw:                         ; redraw
-
 
141
 
-
 
142
    call draw_window
-
 
143
    jmp  still
138
    jmp  still
Line 144... Line 139...
144
 
139
 
145
 
140
 
Line 146... Line 141...
146
button:                         ; button
141
button:                         ; button
147
 
142
 
148
    mov  eax,17                 ; get id
143
    mov  eax,17                 ; get id
149
    int  0x40
144
    mcall
150
 
145
 
Line 151... Line 146...
151
    cmp  ah,1                   ; close program
146
    cmp  ah,1                   ; close program
Line 152... Line 147...
152
    jne  noclose
147
    jne  noclose
Line 166... Line 161...
166
    pusha
161
    pusha
Line 167... Line 162...
167
 
162
 
168
    mov  eax,53
163
    mov  eax,53
169
    mov  ebx,6
164
    mov  ebx,6
170
    mov  ecx,[socket]
165
    mov  ecx,[socket]
Line 171... Line 166...
171
    int  0x40
166
    mcall
Line 172... Line 167...
172
 
167
 
173
    mov  [status],eax
168
    mov  [status],eax
Line 181... Line 176...
181
 
176
 
182
    mov  eax,13
177
    mov  eax,13
183
    mov  ebx,360*65536+30
178
    mov  ebx,360*65536+30
184
    mov  ecx,151*65536+10
179
    mov  ecx,151*65536+10
185
    mov  edx,0xffffff
180
    mov  edx,0xffffff
Line 186... Line 181...
186
    int  0x40
181
    mcall
187
 
182
 
188
    pop  ecx
183
    pop  ecx
189
    mov  eax,47
184
    mov  eax,47
190
    mov  ebx,3*65536
185
    mov  ebx,3*65536
Line 191... Line 186...
191
    mov  edx,360*65536+151
186
    mov  edx,360*65536+151
192
    mov  esi,0x000000
187
    mov  esi,0x000000
Line 193... Line 188...
193
 
188
 
Line 194... Line 189...
194
    cmp  [server_active],0
189
    cmp  [server_active],0
Line 195... Line 190...
195
    je   no_print
190
    je   no_print
Line 206... Line 201...
206
socket_commands:
201
socket_commands:
Line 207... Line 202...
207
 
202
 
208
    cmp  ah,22       ; open socket
203
    cmp  ah,22       ; open socket
209
    jnz  tst3
204
    jnz  tst3
210
    mov  eax,3
205
    mov  eax,3
Line 211... Line 206...
211
    int  0x40
206
    mcall
Line 212... Line 207...
212
 
207
 
213
    mov  [server_active],1
208
    mov  [server_active],1
214
 
209
 
215
    mov  eax,53
210
    mov  eax,53
216
    mov  ebx,5
211
    mov  ebx,5
217
    mov  ecx,25     ; local port # - http
212
    mov  ecx,25     ; local port # - http
218
    mov  edx,0      ; no remote port specified
213
    mov  edx,0      ; no remote port specified
219
    mov  esi,0      ; no remote ip specified
214
    mov  esi,0      ; no remote ip specified
Line 220... Line 215...
220
    mov  edi,0      ; PASSIVE open
215
    mov  edi,0      ; PASSIVE open
221
    int  0x40
216
    mcall
Line 228... Line 223...
228
    cmp  ah,24     ; close socket
223
    cmp  ah,24     ; close socket
229
    jnz  no_24
224
    jnz  no_24
230
    mov  eax,53
225
    mov  eax,53
231
    mov  ebx,8
226
    mov  ebx,8
232
    mov  ecx,[socket]
227
    mov  ecx,[socket]
233
    int  0x40
228
    mcall
234
    mov  [header_sent],0
229
    mov  [header_sent],0
235
    mov  [mail_rp],0
230
    mov  [mail_rp],0
236
    mov  [server_active],0
231
    mov  [server_active],0
Line 237... Line 232...
237
 
232
 
Line 244... Line 239...
244
 
239
 
Line 245... Line 240...
245
 
240
 
246
key:
241
key:
Line 247... Line 242...
247
 
242
 
Line 347... Line 342...
347
    mov  eax,53
342
    mov  eax,53
348
    mov  ebx,7
343
    mov  ebx,7
349
    mov  ecx,[socket]
344
    mov  ecx,[socket]
350
    mov  edx,6
345
    mov  edx,6
351
    mov  esi,r354
346
    mov  esi,r354
352
    int  0x40
347
    mcall
353
    mov  [cmd],0
348
    mov  [cmd],0
354
    popa
349
    popa
355
    ret
350
    ret
Line 356... Line 351...
356
 
351
 
Line 361... Line 356...
361
    mov  eax,53
356
    mov  eax,53
362
    mov  ebx,7
357
    mov  ebx,7
363
    mov  ecx,[socket]
358
    mov  ecx,[socket]
364
    mov  edx,6
359
    mov  edx,6
365
    mov  esi,r250
360
    mov  esi,r250
366
    int  0x40
361
    mcall
367
    mov  [cmd],0
362
    mov  [cmd],0
368
    popa
363
    popa
369
    ret
364
    ret
370
  nomrp0:
365
  nomrp0:
Line 388... Line 383...
388
    mov  eax,53
383
    mov  eax,53
389
    mov  ebx,7
384
    mov  ebx,7
390
    mov  ecx,[socket]
385
    mov  ecx,[socket]
391
    mov  edx,6
386
    mov  edx,6
392
    mov  esi,r221
387
    mov  esi,r221
393
    int  0x40
388
    mcall
394
    mov  [cmd],0
389
    mov  [cmd],0
Line 395... Line 390...
395
 
390
 
396
    mov  eax,5
391
    mov  eax,5
397
    mov  ebx,5
392
    mov  ebx,5
Line 398... Line 393...
398
    int  0x40
393
    mcall
399
 
394
 
400
    mov  eax,53
395
    mov  eax,53
401
    mov  ebx,8
396
    mov  ebx,8
Line 402... Line 397...
402
    mov  ecx,[socket]
397
    mov  ecx,[socket]
403
    int  0x40
398
    mcall
404
 
399
 
Line 405... Line 400...
405
    mov  eax,5
400
    mov  eax,5
406
    mov  ebx,5
401
    mov  ebx,5
407
    int  0x40
402
    mcall
408
 
403
 
Line 409... Line 404...
409
    mov  eax,53
404
    mov  eax,53
410
    mov  ebx,8
405
    mov  ebx,8
Line 411... Line 406...
411
    mov  ecx,[socket]
406
    mov  ecx,[socket]
Line 412... Line 407...
412
    int  0x40
407
    mcall
413
 
408
 
414
    mov  [header_sent],0
409
    mov  [header_sent],0
Line 415... Line 410...
415
    mov  [mail_rp],0
410
    mov  [mail_rp],0
416
 
411
 
417
    call save_file
412
    call save_file
418
 
413
 
419
    mov  eax,5
414
    mov  eax,5
420
    mov  ebx,20
415
    mov  ebx,20
421
    int  0x40
416
    mcall
422
 
417
 
Line 423... Line 418...
423
    mov  eax,53
418
    mov  eax,53
424
    mov  ebx,5
419
    mov  ebx,5
425
    mov  ecx,25     ; local port # - http
420
    mov  ecx,25     ; local port # - http
Line 440... Line 435...
440
    mov  eax,53
435
    mov  eax,53
441
    mov  ebx,7
436
    mov  ebx,7
442
    mov  ecx,[socket]
437
    mov  ecx,[socket]
443
    mov  edx,6
438
    mov  edx,6
444
    mov  esi,r250
439
    mov  esi,r250
445
    int  0x40
440
    mcall
446
    mov  [cmd],0
441
    mov  [cmd],0
447
    popa
442
    popa
448
    ret
443
    ret
449
  nodot:
444
  nodot:
Line 594... Line 589...
594
read_incoming_byte:
589
read_incoming_byte:
Line 595... Line 590...
595
 
590
 
596
    mov  eax, 53
591
    mov  eax, 53
597
    mov  ebx, 2
592
    mov  ebx, 2
598
    mov  ecx, [socket]
593
    mov  ecx, [socket]
Line 599... Line 594...
599
    int  0x40
594
    mcall
Line 600... Line 595...
600
 
595
 
601
    mov  ecx,-1
596
    mov  ecx,-1
Line 602... Line 597...
602
 
597
 
603
    cmp  eax,0
598
    cmp  eax,0
604
    je   no_more_data
599
    je   no_more_data
605
 
600
 
Line 606... Line 601...
606
    mov  eax, 53
601
    mov  eax, 53
Line 607... Line 602...
607
    mov  ebx, 3
602
    mov  ebx, 3
Line 620... Line 615...
620
 
615
 
Line 621... Line 616...
621
    pusha
616
    pusha
622
 
617
 
623
    mov  eax,12
618
    mov  eax,12
Line 624... Line 619...
624
    mov  ebx,1
619
    mov  ebx,1
Line 625... Line 620...
625
    int  0x40
620
    mcall
626
 
621
 
627
    mov  [old_status],300
622
    mov  [old_status],300
628
 
623
 
629
    mov  eax,0                     ; draw window
624
    mov  eax,0                     ; draw window
630
    mov  ebx,5*65536+400
625
    mov  ebx,5*65536+400
Line 631... Line 626...
631
    mov  ecx,5*65536+200
626
    mov  ecx,5*65536+200
632
    mov  edx,0x13ffffff
627
    mov  edx,0x13ffffff
633
    mov  edi,labelt
628
    mov  edi,title
634
    int  0x40
629
    mcall
635
 
630
 
636
    mov  eax,8                     ; button: open socket
631
    mov  eax,8                     ; button: open socket
Line 637... Line 632...
637
    mov  ebx,23*65536+22
632
    mov  ebx,23*65536+22
638
    mov  ecx,169*65536+10
633
    mov  ecx,169*65536+10
639
    mov  edx,22
-
 
640
    mov  esi,0x55aa55
634
    mov  edx,22
641
    int  0x40
635
    mov  esi,0x55aa55
642
 
636
    mcall
Line 643... Line 637...
643
    mov  eax,8                     ; button: close socket
637
 
644
    mov  ebx,265*65536+22
638
 ;   mov  eax,8                     ; button: close socket
645
    mov  ecx,169*65536+10
639
    mov  ebx,265*65536+22
646
    mov  edx,24
640
    mov  edx,24
647
    mov  esi,0xaa5555
641
    mov  esi,0xaa5555
Line -... Line 642...
-
 
642
    mcall
648
    int  0x40
643
 
649
 
644
    mov  eax,38                    ; line
650
    mov  eax,38                    ; line
645
    mov  ebx,5*65536+395
651
    mov  ebx,5*65536+395
646
    mov  ecx,108*65536+108
652
    mov  ecx,108*65536+108
647
    mov  edx,0x000000
653
    mov  edx,0x000000
648
    mcall
654
    int  0x40
-
 
655
 
649
 
656
    mov  ebx,5*65536+123          ; info text
650
    mov  eax,4
657
    mov  ecx,0x000000
651
    mov  ebx,5*65536+123          ; info text
658
    mov  edx,text
652
    mov  ecx,0x000000
Line 659... Line 653...
659
    mov  esi,70
653
    mov  edx,text
660
  newline:
654
    mov  esi,70
Line 661... Line 655...
661
    mov  eax,4
655
  newline:
662
    int  0x40
656
    mcall
663
    add  ebx,12
657
    add  ebx,12
Line 664... Line 658...
664
    add  edx,70
658
    add  edx,70
Line 665... Line 659...
665
    cmp  [edx],byte 'x'
659
    cmp  [edx],byte 'x'
Line 696... Line 690...
696
    mov   eax,13
690
    mov   eax,13
697
    mov   ebx,10*65536
691
    mov   ebx,10*65536
698
    mov   bx,word [rxs]
692
    mov   bx,word [rxs]
699
    imul  bx,6
693
    imul  bx,6
700
    mov   edx,0xffffff
694
    mov   edx,0xffffff
701
    int   0x40
695
    mcall
702
    popa
696
    popa
703
    push  ecx
697
    push  ecx
704
    mov   eax,4
698
    mov   eax,4
705
    mov   ecx,0
699
    mov   ecx,0
706
    cmp   [edx],word '* '
700
    cmp   [edx],word '* '
Line 715... Line 709...
715
  no_light_blue:
709
  no_light_blue:
716
    cmp   [edx],byte '#'
710
    cmp   [edx],byte '#'
717
    jne   no_blue
711
    jne   no_blue
718
    mov   ecx,0x00ff00
712
    mov   ecx,0x00ff00
719
  no_blue:
713
  no_blue:
720
    int   0x40
714
    mcall
721
    add   edx,[rxs]
715
    add   edx,[rxs]
722
    add   ebx,10
716
    add   ebx,10
723
    pop   ecx
717
    pop   ecx
724
    loop  dct
718
    loop  dct
Line 733... Line 727...
733
db '   Incoming mails are written to /rd/1/smtps.txt                      '
727
db '   Incoming mails are written to /rd/1/smtps.txt                      '
734
db '   The file can be fetched with TinyServer and a Html-browser.        '
728
db '   The file can be fetched with TinyServer and a Html-browser.        '
735
db '   Timeout is set to 15 seconds.                                      '
729
db '   Timeout is set to 15 seconds.                                      '
736
db '                                                                      '
730
db '                                                                      '
737
db '        Open SMTP server port 25                Close SMTP            '
731
db '        Open SMTP server port 25                Close SMTP            '
738
 
-
 
739
db 'x' ; <- END MARKER, DONT DELETE
732
db 'x' ; <- END MARKER, DONT DELETE
Line 740... Line 733...
740
 
733
 
Line 828... Line 821...
828
scroll      dd  1
821
scroll      dd  1
829
            dd  8
822
            dd  8
Line 830... Line 823...
830
 
823
 
Line 831... Line 824...
831
numtext     db  '                     '
824
numtext     db  '                     '
Line 832... Line 825...
832
 
825