Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 131
Line 14... Line 14...
14
   
14
   
Line 15... Line 15...
15
use32
15
use32
Line 16... Line 16...
16
   
16
   
17
                org     0x0
17
                org     0x0
18
   
18
   
19
                db      'MENUET00'              ; 8 byte id
19
                db      'MENUET01'              ; 8 byte id
20
                dd      38                      ; required os
20
                dd      1                       ; header version
21
                dd      START                   ; program start
21
                dd      START                   ; program start
-
 
22
                dd      I_END                   ; program image size
Line 22... Line 23...
22
                dd      I_END                   ; program image size
23
                dd      mem                     ; required amount of memory
23
                dd      0x100000                ; required amount of memory
24
                dd      mem                     ; stack pointer
Line 24... Line 25...
24
                dd      0x00000000              ; reserved=no extended header
25
                dd      0, 0                    ; param, icon
Line 35... Line 36...
35
    mov  esi,dword [remote_ip]   ; node IP
36
    mov  esi,dword [remote_ip]   ; node IP
36
    int  0x40
37
    int  0x40
Line 37... Line 38...
37
   
38
   
Line -... Line 39...
-
 
39
    mov  [socketNum], eax
38
    mov  [socketNum], eax
40
 
Line 39... Line 41...
39
   
41
red: 
Line 40... Line 42...
40
    call draw_window            ; at first, draw the window
42
    call draw_window            ; at first, draw the window
41
   
-
 
42
still:
43
   
Line 43... Line 44...
43
   
44
still:
44
    mov  eax,23                 ; wait here for event
45
   
45
    mov  ebx,1
-
 
46
    int  0x40
46
    mov  eax,10                 ; wait here for event
47
   
-
 
48
    cmp  eax,1                  ; redraw request ?
47
    int  0x40
49
    jz   red
-
 
50
    cmp  eax,2                  ; key in buffer ?
-
 
51
    jz   key
-
 
52
    cmp  eax,3                  ; button in buffer ?
-
 
53
    jz   button
-
 
54
   
-
 
Line 55... Line 48...
55
    jmp  still
48
 
56
   
49
    dec  eax
57
red:
50
    jz   red
58
    call draw_window
51
    dec  eax
Line 59... Line 52...
59
    jmp  still
52
    jnz  button
60
   
53
 
61
key:
54
key:
Line 62... Line 55...
62
    mov  eax,2
55
    mov  al,2
63
    int  0x40
56
    int  0x40
64
    jmp  still
57
    jmp  still
65
   
58
   
66
button:
59
button:
67
    mov  eax,17
60
    mov  al,17
68
    int  0x40
61
    int  0x40
69
   
62
   
70
    cmp  ah,1                  ; button id=1 ?
63
    dec  ah                    ; button id=1 ?
71
    jnz  noclose
-
 
72
    mov  eax, 53
64
    jnz  noclose
73
    mov  ebx, 1
-
 
74
    mov  ecx, [socketNum]
-
 
75
    int  0x40
-
 
76
    mov  eax,-1
-
 
77
    int  0x40
-
 
Line 78... Line 65...
78
  noclose:
65
    mov  eax, 53
79
   
66
    mov  ebx, 1
80
    cmp  ah,2                  ; SEND CODE ?
67
    mov  ecx, [socketNum]
81
    je   send_xcode
68
    int  0x40
82
   
69
    mov  eax,-1
Line 83... Line 70...
83
 
70
    int  0x40
Line 84... Line -...
84
    jmp  still
-
 
85
   
-
 
86
   
-
 
87
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
88
;;                                              ;;
-
 
89
;;           SEND CODE TO REMOTE                ;;
-
 
90
;;                                              ;;
71
  noclose:
91
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
72
; it was not close button, so it must be send code button
92
   
73
 
93
send_xcode:
74
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94
 
75
;;                                              ;;
95
  mov  esi,send_data              ; header
76
;;           SEND CODE TO REMOTE                ;;
Line 96... Line 77...
96
  mov  edi,I_END
77
;;                                              ;;
Line 122... Line 103...
122
                                   ; DRAW WINDOW
103
                                   ; DRAW WINDOW
123
    mov  eax,0                     ; function 0 : define and draw window
104
    mov  eax,0                     ; function 0 : define and draw window
124
    mov  ebx,100*65536+250         ; [x start] *65536 + [x size]
105
    mov  ebx,100*65536+250         ; [x start] *65536 + [x size]
125
    mov  ecx,60*65536+150          ; [y start] *65536 + [y size]
106
    mov  ecx,60*65536+150          ; [y start] *65536 + [y size]
126
    mov  edx,0x03ffffff            ; color of work area RRGGBB
107
    mov  edx,0x03ffffff            ; color of work area RRGGBB
127
    mov  esi,0x80aabbcc            ; color of grab bar  RRGGBB,8->color gl
-
 
128
    mov  edi,0x00aabbcc            ; color of frames    RRGGBB
-
 
129
    int  0x40
108
    int  0x40
Line 130... Line 109...
130
   
109
   
131
                                   ; WINDOW LABEL
110
                                   ; WINDOW LABEL
132
    mov  eax,4                     ; function 4 : write text to window
111
    mov  eax,4                     ; function 4 : write text to window
Line 141... Line 120...
141
    mov  ecx,47*65536+13
120
    mov  ecx,47*65536+13
142
    mov  edx,2
121
    mov  edx,2
143
    mov  esi,0x667788
122
    mov  esi,0x667788
144
    int  0x40
123
    int  0x40
Line 145... Line -...
145
   
-
 
146
    cld
124
   
147
    mov  ebx,25*65536+50           ; draw info text with function 4
125
    mov  ebx,25*65536+50           ; draw info text with function 4
148
    mov  ecx,0x000000
126
    mov  ecx,0x000000
149
    mov  edx,text
127
    mov  edx,text
150
    mov  esi,40
128
    mov  esi,40
151
  newline:
129
  newline:
152
    mov  eax,4
130
    mov  eax,4
153
    int  0x40
131
    int  0x40
154
    add  ebx,16
132
    add  ebx,16
155
    add  edx,40
133
    add  edx,esi
156
    cmp  [edx],byte 'x'
134
    cmp  [edx],byte 'x'
Line 157... Line 135...
157
    jnz  newline
135
    jnz  newline
158
   
136
   
Line 163... Line 141...
163
    ret
141
    ret
Line 164... Line 142...
164
   
142
   
Line 165... Line 143...
165
   
143
   
166
; DATA AREA
144
; DATA AREA
167
   
145
   
168
   
146
if lang eq ru   
169
text:
147
text:
170
    db '        ®á« âì á®®¡é¥­¨¥               '
148
    db '        ®á« âì á®®¡é¥­¨¥               '
171
    db '                                        '
149
    db '                                        '
172
    db ' ‹®ª «ì­ë©  ¤à¥á : 192.168.0.1          '
150
    db ' ‹®ª «ì­ë©  ¤à¥á : 192.168.0.1          '
173
    db ' “¤ «ñ­­ë©  ¤à¥á : 192.168.0.2          '
151
    db ' “¤ «ñ­­ë©  ¤à¥á : 192.168.0.2          '
-
 
152
    db '’¥ªáâ ¨  ¤à¥á ¢ ª®­æ¥ ¨á室­¨ª          '
-
 
153
    db 'x' ; <- END MARKER, DONT DELETE
-
 
154
else
-
 
155
text:
-
 
156
    db '          Send message                  '
-
 
157
    db '                                        '
-
 
158
    db ' Local  address : 192.168.0.1           '
-
 
159
    db ' Remote address : 192.168.0.2           '
Line 174... Line 160...
174
    db '’¥ªáâ ¨  ¤à¥á ¢ ª®­æ¥ ¨á室­¨ª          '
160
    db 'Text and address in end of source       '
175
    db 'x <- END MARKER, DONT DELETE            '
161
    db 'x' ; <- END MARKER, DONT DELETE
Line 176... Line -...
176
   
-
 
177
   
-
 
178
labeltext:  db  'NetSend(Client)'  ;
162
end if   
Line 179... Line -...
179
lte:
-
 
180
   
-
 
181
socketNum   dd  0x0
163
   
182
   
164
labeltext:  db  'NetSend(Client)'  ;
Line 183... Line 165...
183
remote_ip  db  192,168,1,2
165
lte:
-
 
166
   
-
 
167
remote_ip  db  192,168,1,2
Line -... Line 168...
-
 
168
   
Line 184... Line -...
184
   
-
 
185
picture_position dd 0x0
-
 
186
   
-
 
187
send_data   db  'à¨¢¥â,íâ® â¥áâ!Hello,this is a test!'
169
send_data   db  'à¨¢¥â,íâ® â¥áâ!Hello,this is a test!'
Line 188... Line 170...
188
end_message:
170
end_message: