Subversion Repositories Kolibri OS

Rev

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

Rev 484 Rev 485
Line 7... Line 7...
7
;;    Copyright 2002 (c) Ville Turjanmaa             ;;
7
;;    Copyright 2002 (c) Ville Turjanmaa             ;;
8
;;                                                   ;;
8
;;                                                   ;;
9
;;    Compile with FASM for Menuet                   ;;
9
;;    Compile with FASM for Menuet                   ;;
10
;;                                                   ;;
10
;;                                                   ;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
 
-
 
-
 
12
include '..\..\..\macros.inc'
13
version equ '0.1'
13
version equ '0.1'
Line 14... Line 14...
14
 
14
 
Line 15... Line 15...
15
use32
15
use32
Line 28... Line 28...
28
 
28
 
Line 29... Line 29...
29
    mov  [file_start],0x100000
29
    mov  [file_start],0x100000
30
 
30
 
31
    mov  eax,70
31
    mov  eax,70
Line 32... Line 32...
32
    mov  ebx,filel
32
    mov  ebx,filel
33
    int  0x40
33
    mcall
34
 
34
 
35
    test eax,eax
35
    test eax,eax
Line 50... Line 50...
50
    imul eax,11
50
    imul eax,11
51
    mov  [pos],eax
51
    mov  [pos],eax
Line 52... Line 52...
52
 
52
 
53
    mov  ebp,0
53
    mov  ebp,0
-
 
54
    mov  edx,I_END
-
 
55
 
54
    mov  edx,I_END
56
redraw:                         ; redraw
Line 55... Line 57...
55
    call draw_window            ; at first, draw the window
57
    call draw_window            ; at first, draw the window
Line 56... Line 58...
56
 
58
 
57
still:
59
still:
58
 
60
 
Line 59... Line 61...
59
    mov  eax,5
61
    mov  eax,5
60
    mov  ebx,1
62
    mov  ebx,1
Line 61... Line 63...
61
    int  0x40
63
    mcall
62
 
64
 
63
    mov  eax,11                 ; wait here for event
65
    mov  eax,11                 ; wait here for event
64
    int  0x40
66
    mcall
Line 104... Line 106...
104
   mov  eax,[file_start]
106
   mov  eax,[file_start]
105
   sub  eax,0x100000
107
   sub  eax,0x100000
106
   mov  [ebx+12],eax
108
   mov  [ebx+12],eax
Line 107... Line 109...
107
 
109
 
108
   mov  eax,70
110
   mov  eax,70
Line 109... Line 111...
109
   int  0x40
111
   mcall
Line 110... Line 112...
110
 
112
 
Line 148... Line 150...
148
  no2:
150
  no2:
Line 149... Line 151...
149
 
151
 
150
    mov  eax,53
152
    mov  eax,53
151
    mov  ebx,7
153
    mov  ebx,7
152
    mov  ecx,[socket]
154
    mov  ecx,[socket]
153
    int  0x40
155
    mcall
Line 154... Line 156...
154
    mov  [mcounter],0
156
    mov  [mcounter],0
155
 
157
 
Line 173... Line 175...
173
    mov  eax,53
175
    mov  eax,53
174
    mov  ebx,7
176
    mov  ebx,7
175
    mov  ecx,[socket]
177
    mov  ecx,[socket]
176
    mov  edx,14
178
    mov  edx,14
177
    mov  esi,quitc
179
    mov  esi,quitc
178
    int  0x40
180
    mcall
179
    mov  [mcounter],0
181
    mov  [mcounter],0
Line 180... Line 182...
180
 
182
 
181
    mov  eax,5
183
    mov  eax,5
182
    mov  ebx,150
184
    mov  ebx,150
Line 183... Line 185...
183
    int  0x40
185
    mcall
Line 184... Line 186...
184
 
186
 
185
    call read_incoming_data
187
    call read_incoming_data
186
 
188
 
187
    mov  eax,53
189
    mov  eax,53
Line 188... Line 190...
188
    mov  ebx,8
190
    mov  ebx,8
189
    mov  ecx,[socket]
191
    mov  ecx,[socket]
190
    int  0x40
192
    mcall
Line 191... Line 193...
191
 
193
 
192
    mov  eax,5
194
    mov  eax,5
193
    mov  ebx,2
195
    mov  ebx,2
194
    int  0x40
196
    mcall
Line 195... Line 197...
195
 
197
 
Line 196... Line 198...
196
    mov  eax,53
198
    mov  eax,53
Line 207... Line 209...
207
;;
209
;;
208
;;  User input processing
210
;;  User input processing
209
;;
211
;;
Line 210... Line -...
210
 
-
 
211
 
-
 
212
redraw:                         ; redraw
-
 
213
 
-
 
214
    call draw_window
-
 
215
    jmp  still
-
 
216
 
212
 
Line 217... Line 213...
217
 
213
 
218
key:
214
key:
Line 219... Line 215...
219
 
215
 
Line 220... Line 216...
220
    mov  eax,2
216
    mov  eax,2
Line 221... Line 217...
221
    int  0x40
217
    mcall
222
 
218
 
Line 223... Line 219...
223
    jmp  still
219
    jmp  still
224
 
220
 
225
 
221
 
226
button:                         ; button
222
button:                         ; button
227
 
223
 
228
    mov  eax,17                 ; get id
224
    mov  eax,17                 ; get id
229
    int  0x40
225
    mcall
Line 230... Line 226...
230
 
226
 
231
    cmp  ah,60
227
    cmp  ah,60
232
    jne  no_open
228
    jne  no_open
233
        mov     eax, 70
229
        mov     eax, 70
234
        mov     ebx, tinypad_start
230
        mov     ebx, tinypad_start
Line 235... Line 231...
235
        int     0x40
231
        mcall
236
    jmp  still
232
    jmp  still
237
  no_open:
233
  no_open:
Line 268... Line 264...
268
 
264
 
269
    mov  [mcounter],900
265
    mov  [mcounter],900
Line 270... Line 266...
270
    mov  [ccounter],0
266
    mov  [ccounter],0
271
 
267
 
Line 272... Line 268...
272
    mov  eax,3
268
    mov  eax,3
273
    int  0x40
269
    mcall
274
 
270
 
275
    mov  eax,3
271
    mov  eax,3
Line 276... Line 272...
276
    int  0x40
272
    mcall
277
    mov  ecx,eax
273
    mov  ecx,eax
278
    and  ecx,0xffff
274
    and  ecx,0xffff
279
 
275
 
280
    mov  eax,53
276
    mov  eax,53
281
    mov  ebx,5
277
    mov  ebx,5
282
    mov  edx,110
278
    mov  edx,110
Line 283... Line 279...
283
    mov  esi,dword [ip]
279
    mov  esi,dword [ip]
284
    mov  edi,1
280
    mov  edi,1
Line 292... Line 288...
292
    cmp  ah,24     ; close socket
288
    cmp  ah,24     ; close socket
293
    jnz  no_24
289
    jnz  no_24
294
    mov  eax,53
290
    mov  eax,53
295
    mov  ebx,8
291
    mov  ebx,8
296
    mov  ecx,[socket]
292
    mov  ecx,[socket]
297
    int  0x40
293
    mcall
298
    mov  [header_sent],0
294
    mov  [header_sent],0
299
    mov  [mail_rp],0
295
    mov  [mail_rp],0
300
    mov  [server_active],0
296
    mov  [server_active],0
Line 301... Line 297...
301
 
297
 
Line 318... Line 314...
318
    pusha
314
    pusha
Line 319... Line 315...
319
 
315
 
320
    mov  eax,53
316
    mov  eax,53
321
    mov  ebx,6
317
    mov  ebx,6
322
    mov  ecx,[socket]
318
    mov  ecx,[socket]
Line 323... Line 319...
323
    int  0x40
319
    mcall
Line 324... Line 320...
324
 
320
 
325
    mov  [status],eax
321
    mov  [status],eax
Line 333... Line 329...
333
 
329
 
334
    mov  eax,13
330
    mov  eax,13
335
    mov  ebx,200*65536+30
331
    mov  ebx,200*65536+30
336
    mov  ecx,160*65536+10
332
    mov  ecx,160*65536+10
337
    mov  edx,0xffffff
333
    mov  edx,0xffffff
Line 338... Line 334...
338
    int  0x40
334
    mcall
Line 339... Line 335...
339
 
335
 
340
    pop  ecx
336
    pop  ecx
Line 341... Line 337...
341
 
337
 
342
    cmp  [server_active],1
338
    cmp  [server_active],1
343
    jne  nopr
339
    jne  nopr
344
 
340
 
345
    mov  eax,47
341
    mov  eax,47
Line 346... Line 342...
346
    mov  ebx,3*65536
342
    mov  ebx,3*65536
Line 347... Line 343...
347
    mov  edx,200*65536+160
343
    mov  edx,200*65536+160
Line 447... Line 443...
447
 
443
 
Line 448... Line 444...
448
    mov  edi,[addr]
444
    mov  edi,[addr]
449
 
445
 
450
  f11:
446
  f11:
451
    mov  eax,10
447
    mov  eax,10
452
    int  0x40
448
    mcall
453
    cmp  eax,2
449
    cmp  eax,2
454
    jne  read_done
450
    jne  read_done
455
    mov  eax,2
451
    mov  eax,2
456
    int  0x40
452
    mcall
457
    shr  eax,8
453
    shr  eax,8
458
    cmp  eax,13
454
    cmp  eax,13
459
    je   read_done
455
    je   read_done
Line 547... Line 543...
547
    mov  ebx,95*65536+23*6
543
    mov  ebx,95*65536+23*6
548
    mov  ecx,[ya]
544
    mov  ecx,[ya]
549
    shl  ecx,16
545
    shl  ecx,16
550
    mov  cx,9
546
    mov  cx,9
551
    mov  edx,0xffffff
547
    mov  edx,0xffffff
552
    int  0x40
548
    mcall
Line 553... Line 549...
553
 
549
 
554
    cmp  [len],l3
550
    cmp  [len],l3
Line 555... Line 551...
555
    je   noprt
551
    je   noprt
556
 
552
 
557
    mov  eax,4
553
    mov  eax,4
558
    mov  edx,[addr]
554
    mov  edx,[addr]
559
    mov  ebx,95*65536
555
    mov  ebx,95*65536
560
    add  ebx,[ya]
556
    add  ebx,[ya]
561
    mov  ecx,0x000000
557
    mov  ecx,0x000000
Line 562... Line 558...
562
    mov  esi,23
558
    mov  esi,23
Line 563... Line 559...
563
    int  0x40
559
    mcall
564
 
560
 
Line 776... Line 772...
776
read_incoming_byte:
772
read_incoming_byte:
Line 777... Line 773...
777
 
773
 
778
    mov  eax, 53
774
    mov  eax, 53
779
    mov  ebx, 2
775
    mov  ebx, 2
780
    mov  ecx, [socket]
776
    mov  ecx, [socket]
Line 781... Line 777...
781
    int  0x40
777
    mcall
Line 782... Line 778...
782
 
778
 
783
    mov  ecx,-1
779
    mov  ecx,-1
Line 784... Line 780...
784
 
780
 
785
    cmp  eax,0
781
    cmp  eax,0
786
    je   no_more_data
782
    je   no_more_data
787
 
783
 
Line 788... Line 784...
788
    mov  eax, 53
784
    mov  eax, 53
Line 789... Line 785...
789
    mov  ebx, 3
785
    mov  ebx, 3
Line 808... Line 804...
808
 
804
 
Line 809... Line 805...
809
    pusha
805
    pusha
810
 
806
 
811
    mov  eax,12
807
    mov  eax,12
Line 812... Line 808...
812
    mov  ebx,1
808
    mov  ebx,1
813
    int  0x40
809
    mcall
814
 
810
 
815
    mov  eax,0                     ; draw window
811
    mov  eax,0                     ; draw window
816
    mov  ebx,5*65536+435
812
    mov  ebx,5*65536+435
817
    mov  ecx,5*65536+232
813
    mov  ecx,5*65536+232
Line 818... Line 814...
818
    mov  edx,0x13ffffff
814
    mov  edx,0x13ffffff
Line 819... Line 815...
819
    mov  edi,labelt
815
    mov  edi,labelt
820
    int  0x40
816
    mcall
821
 
817
 
822
    mov  [old_status],300
818
    mov  [old_status],300
823
 
819
 
824
    mov  eax,8                     ; button: open socket
820
    mov  eax,8                     ; button: open socket
Line 825... Line 821...
825
    mov  ebx,23*65536+22
821
    mov  ebx,23*65536+22
826
    mov  ecx,155*65536+10
822
    mov  ecx,155*65536+10
827
    mov  edx,22
823
    mov  edx,22
828
    mov  esi,0x44cc44
824
    mov  esi,0x44cc44
829
    int  0x40
825
    mcall
830
 
826
 
Line 831... Line 827...
831
;    mov  eax,8                     ; button: close socket
827
;    mov  eax,8                     ; button: close socket
832
    mov  ebx,295*65536+22
828
    mov  ebx,295*65536+22
833
    mov  ecx,155*65536+10
829
    mov  ecx,155*65536+10
834
    mov  edx,24
830
    mov  edx,24
835
    mov  esi,0xcc4444
831
    mov  esi,0xcc4444
836
    int  0x40
832
    mcall
837
 
833
 
838
;    mov  eax,8                     ; button: text entries
834
;    mov  eax,8                     ; button: text entries
839
    mov  ebx,243*65536+8
835
    mov  ebx,243*65536+8
840
    mov  ecx,180*65536+8
836
    mov  ecx,180*65536+8
841
    mov  edx,51
837
    mov  edx,51
Line 842... Line 838...
842
    mov  esi,0x4488dd
838
    mov  esi,0x4488dd
843
  newi:
839
  newi:
844
    int  0x40
840
    mcall
845
    inc  edx
841
    inc  edx
846
    add  ecx,12*65536
842
    add  ecx,12*65536
847
    cmp  edx,53
843
    cmp  edx,53
Line 848... Line 844...
848
    jbe  newi
844
    jbe  newi
849
 
845
 
850
;    mov  eax,8                     ; open inbox
846
;    mov  eax,8                     ; open inbox
851
    mov  ebx,295*65536+102
847
    mov  ebx,295*65536+102
852
    mov  ecx,190*65536+14
848
    mov  ecx,190*65536+14
Line 853... Line 849...
853
    mov  edx,60
849
    mov  edx,60
854
    mov  esi,0x5577dd
850
    mov  esi,0x5577dd
855
    int  0x40
851
    mcall
856
 
852
 
857
    mov  eax,38                    ; line
853
    mov  eax,38                    ; line
858
    mov  ebx,5*65536+430
854
    mov  ebx,5*65536+430
859
    mov  ecx,114*65536+114
855
    mov  ecx,114*65536+114
860
    mov  edx,0x000000
856
    mov  edx,0x000000
861
    int  0x40
857
    mcall
862
 
858
 
863
    mov  ebx,5*65536+133          ; info text
859
    mov  ebx,5*65536+133          ; info text
Line 864... Line 860...
864
    mov  ecx,0x000000
860
    mov  ecx,0x000000
865
    mov  edx,text
861
    mov  edx,text
Line 866... Line 862...
866
    mov  esi,70
862
    mov  esi,70
867
  newline:
863
  newline:
868
    mov  eax,4
864
    mov  eax,4
Line 869... Line 865...
869
    int  0x40
865
    mcall
Line 870... Line 866...
870
    add  ebx,12
866
    add  ebx,12
Line 900... Line 896...
900
    mov   eax,13
896
    mov   eax,13
901
    mov   ebx,10*65536
897
    mov   ebx,10*65536
902
    mov   bx,word [rxs]
898
    mov   bx,word [rxs]
903
    imul  bx,6
899
    imul  bx,6
904
    mov   edx,0xffffff
900
    mov   edx,0xffffff
905
    int   0x40
901
    mcall
906
    popa
902
    popa
907
    push  ecx
903
    push  ecx
908
    mov   eax,4
904
    mov   eax,4
909
    mov   ecx,0
905
    mov   ecx,0
910
    int   0x40
906
    mcall
911
    add   edx,[rxs]
907
    add   edx,[rxs]
912
    add   ebx,10
908
    add   ebx,10
913
    pop   ecx
909
    pop   ecx
914
    loop  dct
910
    loop  dct