Subversion Repositories Kolibri OS

Rev

Rev 1010 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1010 Rev 1723
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;                                          ;
2
;                                          ;
3
;   Stack Configuration Tool               ;
3
;   Stack Configuration Tool               ;
4
;                                          ;
4
;                                          ;
5
;   Compile with FASM for Menuet           ;
5
;   Compile with FASM for Menuet           ;
6
;                                          ;
6
;                                          ;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8
 
8
 
9
 
9
 
10
memsize = 100000h
10
memsize = 100000h
11
	       org 0
11
	       org 0
12
PARAMS	= memsize - 1024
12
PARAMS	= memsize - 1024
13
 
13
 
14
use32
14
use32
15
 
15
 
16
	       db     'MENUET01'	      ; 8 byte id
16
	       db     'MENUET01'	      ; 8 byte id
17
	       dd     0x01		      ; header version
17
	       dd     0x01		      ; header version
18
	       dd     START		      ; start of code
18
	       dd     START		      ; start of code
19
	       dd     I_END		      ; size of image
19
	       dd     I_END		      ; size of image
20
	       dd     memsize		      ; memory for app
20
	       dd     memsize		      ; memory for app
21
	       dd     memsize - 1024	      ; esp
21
	       dd     memsize - 1024	      ; esp
22
	       dd     PARAMS , 0x0	      ; I_Param , I_Icon
22
	       dd     PARAMS , 0x0	      ; I_Param , I_Icon
23
 
23
 
24
include 'lang.inc'
24
include 'lang.inc'
25
include '../../../macros.inc'
25
include '../../../macros.inc'
26
 
26
 
27
START:				; start of execution
27
START:				; start of execution
28
 
28
 
29
read_stack_setup:
29
read_stack_setup:
30
 
30
 
31
    mov  eax,52
31
    mov  eax,52
32
    mov  ebx,0
32
    mov  ebx,0
33
    mcall
33
    mcall
34
    mov  [config],eax
34
    mov  [config],eax
35
 
35
 
36
    mov  eax,52
36
    mov  eax,52
37
    mov  ebx,1
37
    mov  ebx,1
38
    mcall
38
    mcall
39
    mov  dword [ip_address],eax
39
    mov  dword [ip_address],eax
40
 
40
 
41
    mov  eax,52
41
    mov  eax,52
42
    mov  ebx,9
42
    mov  ebx,9
43
    mcall
43
    mcall
44
    mov  dword [gateway_ip],eax
44
    mov  dword [gateway_ip],eax
45
 
45
 
46
    mov  eax,52
46
    mov  eax,52
47
    mov  ebx,10
47
    mov  ebx,10
48
    mcall
48
    mcall
49
    mov  dword [subnet_mask],eax
49
    mov  dword [subnet_mask],eax
50
 
50
 
51
    mov  eax,52
51
    mov  eax,52
52
    mov  ebx,13
52
    mov  ebx,13
53
    mcall
53
    mcall
54
    mov  dword [dns_ip],eax
54
    mov  dword [dns_ip],eax
55
 
55
 
56
    mov  eax,[config]	; unwrap com IRQ
56
    mov  eax,[config]	; unwrap com IRQ
57
    shr  eax,8
57
    shr  eax,8
58
    and  eax,0xf
58
    and  eax,0xf
59
    mov  [com_irq],eax
59
    mov  [com_irq],eax
60
 
60
 
61
    mov  eax,[config]	; unwrap com PORT
61
    mov  eax,[config]	; unwrap com PORT
62
    shr  eax,16
62
    shr  eax,16
63
    and  eax,0xfff
63
    and  eax,0xfff
64
    mov  [com_add],eax
64
    mov  [com_add],eax
65
 
65
 
66
    mov  eax,[config]	; unwrap IRQ
66
    mov  eax,[config]	; unwrap IRQ
67
    and  eax,0xf
67
    and  eax,0xf
68
    mov  [interface],eax
68
    mov  [interface],eax
69
 
69
 
70
    mov  eax,[config]	; unwrap com PORT
70
    mov  eax,[config]	; unwrap com PORT
71
    shr  eax,7
71
    shr  eax,7
72
    and  eax,1
72
    and  eax,1
73
    mov  [assigned],eax
73
    mov  [assigned],eax
74
 
74
 
75
  red:
75
  red:
76
    call draw_window		; at first, draw the window
76
    call draw_window		; at first, draw the window
77
 
77
 
78
still:
78
still:
79
 
79
 
80
    mov  eax,10 		; wait here for event
80
    mov  eax,10 		; wait here for event
81
    mcall
81
    mcall
82
 
82
 
83
    cmp  eax,1			; redraw request ?
83
    cmp  eax,1			; redraw request ?
84
    jz	 red
84
    jz	 red
85
    cmp  eax,2			; key in buffer ?
85
    cmp  eax,2			; key in buffer ?
86
    jnz  button
86
    jnz  button
87
 
87
 
88
  key:				; key
88
  key:				; key
89
;    mov  al,2                  ; just read it and ignore
89
;    mov  al,2                  ; just read it and ignore
90
    mcall
90
    mcall
91
    jmp  still
91
    jmp  still
92
 
92
 
93
  button:			; button
93
  button:			; button
94
    mov  al,17		       ; get id
94
    mov  al,17		       ; get id
95
    mcall
95
    mcall
96
 
96
 
97
    shr  eax,8
97
    shr  eax,8
98
 
98
 
99
    dec  eax			 ; button id=1 ?
99
    dec  eax			 ; button id=1 ?
100
    jne  noclose
100
    jne  noclose
101
    or	 eax,-1 		; close this program
101
    or	 eax,-1 		; close this program
102
    mcall
102
    mcall
103
  noclose:
103
  noclose:
104
 
104
 
105
    dec  eax
105
    dec  eax
106
    je	 read_stack_setup
106
    je	 read_stack_setup
107
 
107
 
108
    dec  eax
108
    dec  eax
109
    jne  no_apply_stack_setup
109
    jne  no_apply_stack_setup
110
    call apply_stack_setup
110
    call apply_stack_setup
111
    jmp  still
111
    jmp  still
112
 
112
 
113
no_apply_stack_setup:
113
no_apply_stack_setup:
114
    dec  eax		      ; GET COM PORT
114
    dec  eax		      ; GET COM PORT
115
    dec  eax
115
    dec  eax
116
    jne  no_read_comport
116
    jne  no_read_comport
117
    mov  [string_x],272
117
    mov  [string_x],272
118
    mov  [string_y],40
118
    mov  [string_y],40
119
    mov  [string_length],3
119
    mov  [string_length],3
120
    call read_string
120
    call read_string
121
    movzx eax,byte [string]
121
    movzx eax,byte [string]
122
    cmp  eax,'A'
122
    cmp  eax,'A'
123
    jb	 gcp1
123
    jb	 gcp1
124
    sub  eax,'A'-'9'-1
124
    sub  eax,'A'-'9'-1
125
   gcp1:
125
   gcp1:
126
    sub  eax,48
126
    sub  eax,48
127
    shl  eax,8
127
    shl  eax,8
128
    mov  ebx,eax
128
    mov  ebx,eax
129
    movzx eax,byte [string+1]
129
    movzx eax,byte [string+1]
130
    cmp  eax,'A'
130
    cmp  eax,'A'
131
    jb	 gcp2
131
    jb	 gcp2
132
    sub  eax,'A'-'9'-1
132
    sub  eax,'A'-'9'-1
133
   gcp2:
133
   gcp2:
134
    sub  eax,48
134
    sub  eax,48
135
    shl  eax,4
135
    shl  eax,4
136
    add  ebx,eax
136
    add  ebx,eax
137
    movzx eax,byte [string+2]
137
    movzx eax,byte [string+2]
138
    cmp  eax,'A'
138
    cmp  eax,'A'
139
    jb	 gcp3
139
    jb	 gcp3
140
    sub  eax,'A'-'9'-1
140
    sub  eax,'A'-'9'-1
141
   gcp3:
141
   gcp3:
142
    sub  eax,48
142
    sub  eax,48
143
    add  ebx,eax
143
    add  ebx,eax
144
    mov  [com_add],ebx
144
    mov  [com_add],ebx
145
    jmp  red
145
    jmp  red
146
   no_read_comport:
146
   no_read_comport:
147
 
147
 
148
    dec  eax		      ; GET COM IRQ
148
    dec  eax		      ; GET COM IRQ
149
    jne  no_read_comirq
149
    jne  no_read_comirq
150
    mov  [string_x],284
150
    mov  [string_x],284
151
    mov  [string_y],50
151
    mov  [string_y],50
152
    mov  [string_length],1
152
    mov  [string_length],1
153
    call read_string
153
    call read_string
154
    movzx eax,byte [string]
154
    movzx eax,byte [string]
155
    cmp  eax,'A'
155
    cmp  eax,'A'
156
    jb	 gci1
156
    jb	 gci1
157
    sub  eax,'A'-'9'-1
157
    sub  eax,'A'-'9'-1
158
   gci1:
158
   gci1:
159
    sub  eax,48
159
    sub  eax,48
160
    mov  [com_irq],eax
160
    mov  [com_irq],eax
161
    jmp  red
161
    jmp  red
162
    no_read_comirq:
162
    no_read_comirq:
163
 
163
 
164
    dec  eax		      ; GET IP
164
    dec  eax		      ; GET IP
165
    jne  no_read_ip
165
    jne  no_read_ip
166
    mov  [string_x],205
166
    mov  [string_x],205
167
    mov  [string_y],80
167
    mov  [string_y],80
168
    mov  [string_length],15
168
    mov  [string_length],15
169
    call read_string
169
    call read_string
170
    mov   esi,string-1
170
    mov   esi,string-1
171
    mov   edi,ip_address
171
    mov   edi,ip_address
172
   ip0:
172
   ip0:
173
    xor   eax,eax
173
    xor   eax,eax
174
   ip1:
174
   ip1:
175
    inc   esi
175
    inc   esi
176
    cmp   [esi],byte '0'
176
    cmp   [esi],byte '0'
177
    jb	  ip2
177
    jb	  ip2
178
    cmp   [esi],byte '9'
178
    cmp   [esi],byte '9'
179
    jg	  ip2
179
    jg	  ip2
180
    imul  eax,10
180
    imul  eax,10
181
    movzx ebx,byte [esi]
181
    movzx ebx,byte [esi]
182
    sub   ebx,48
182
    sub   ebx,48
183
    add   eax,ebx
183
    add   eax,ebx
184
    jmp   ip1
184
    jmp   ip1
185
   ip2:
185
   ip2:
186
    stosb
186
    stosb
187
    cmp   edi,ip_address+3
187
    cmp   edi,ip_address+3
188
    jbe   ip0
188
    jbe   ip0
189
    jmp   red
189
    jmp   red
190
   no_read_ip:
190
   no_read_ip:
191
 
191
 
192
    dec     eax 		; set gateway ip
192
    dec     eax 		; set gateway ip
193
    jne     no_set_gateway
193
    jne     no_set_gateway
194
 
194
 
195
    mov  [string_x],205
195
    mov  [string_x],205
196
    mov  [string_y],90
196
    mov  [string_y],90
197
    mov  [string_length],15
197
    mov  [string_length],15
198
    call read_string
198
    call read_string
199
    mov   esi,string-1
199
    mov   esi,string-1
200
    mov   edi,gateway_ip
200
    mov   edi,gateway_ip
201
   gip0:
201
   gip0:
202
    xor   eax,eax
202
    xor   eax,eax
203
   gip1:
203
   gip1:
204
    inc   esi
204
    inc   esi
205
    cmp   [esi],byte '0'
205
    cmp   [esi],byte '0'
206
    jb	  gip2
206
    jb	  gip2
207
    cmp   [esi],byte '9'
207
    cmp   [esi],byte '9'
208
    jg	  gip2
208
    jg	  gip2
209
    imul  eax,10
209
    imul  eax,10
210
    movzx ebx,byte [esi]
210
    movzx ebx,byte [esi]
211
    sub   ebx,48
211
    sub   ebx,48
212
    add   eax,ebx
212
    add   eax,ebx
213
    jmp   gip1
213
    jmp   gip1
214
   gip2:
214
   gip2:
215
    stosb
215
    stosb
216
    cmp   edi,gateway_ip+3
216
    cmp   edi,gateway_ip+3
217
    jbe   gip0
217
    jbe   gip0
218
    jmp   red
218
    jmp   red
219
 
219
 
220
  no_set_gateway:
220
  no_set_gateway:
221
 
221
 
222
    dec     eax
222
    dec     eax
223
    jne     no_set_subnet
223
    jne     no_set_subnet
224
 
224
 
225
    mov  [string_x],205
225
    mov  [string_x],205
226
    mov  [string_y],100
226
    mov  [string_y],100
227
    mov  [string_length],15
227
    mov  [string_length],15
228
    call read_string
228
    call read_string
229
    mov   esi,string-1
229
    mov   esi,string-1
230
    mov   edi,subnet_mask
230
    mov   edi,subnet_mask
231
   sip0:
231
   sip0:
232
    xor   eax,eax
232
    xor   eax,eax
233
   sip1:
233
   sip1:
234
    inc   esi
234
    inc   esi
235
    cmp   [esi],byte '0'
235
    cmp   [esi],byte '0'
236
    jb	  sip2
236
    jb	  sip2
237
    cmp   [esi],byte '9'
237
    cmp   [esi],byte '9'
238
    jg	  sip2
238
    jg	  sip2
239
    imul  eax,10
239
    imul  eax,10
240
    movzx ebx,byte [esi]
240
    movzx ebx,byte [esi]
241
    sub   ebx,48
241
    sub   ebx,48
242
    add   eax,ebx
242
    add   eax,ebx
243
    jmp   sip1
243
    jmp   sip1
244
   sip2:
244
   sip2:
245
    stosb
245
    stosb
246
    cmp   edi,subnet_mask+3
246
    cmp   edi,subnet_mask+3
247
    jbe   sip0
247
    jbe   sip0
248
    jmp   red
248
    jmp   red
249
 
249
 
250
  no_set_subnet:
250
  no_set_subnet:
251
    dec     eax
251
    dec     eax
252
    jne     no_set_dns
252
    jne     no_set_dns
253
 
253
 
254
    mov  [string_x],205
254
    mov  [string_x],205
255
    mov  [string_y],110
255
    mov  [string_y],110
256
    mov  [string_length],15
256
    mov  [string_length],15
257
    call read_string
257
    call read_string
258
    mov   esi,string-1
258
    mov   esi,string-1
259
    mov   edi,dns_ip
259
    mov   edi,dns_ip
260
   dip0:
260
   dip0:
261
    xor   eax,eax
261
    xor   eax,eax
262
   dip1:
262
   dip1:
263
    inc   esi
263
    inc   esi
264
    cmp   [esi],byte '0'
264
    cmp   [esi],byte '0'
265
    jb	  dip2
265
    jb	  dip2
266
    cmp   [esi],byte '9'
266
    cmp   [esi],byte '9'
267
    jg	  dip2
267
    jg	  dip2
268
    imul  eax,10
268
    imul  eax,10
269
    movzx ebx,byte [esi]
269
    movzx ebx,byte [esi]
270
    sub   ebx,48
270
    sub   ebx,48
271
    add   eax,ebx
271
    add   eax,ebx
272
    jmp   dip1
272
    jmp   dip1
273
   dip2:
273
   dip2:
274
    stosb
274
    stosb
275
    cmp   edi,dns_ip+3
275
    cmp   edi,dns_ip+3
276
    jbe   dip0
276
    jbe   dip0
277
    jmp   red
277
    jmp   red
278
 
278
 
279
  no_set_dns:
279
  no_set_dns:
280
 
280
 
281
    dec  eax
281
    dec  eax
282
    jb	 no_set_interface
282
    jb	 no_set_interface
283
    cmp  eax,14-11
283
    cmp  eax,14-11
284
    ja	 no_set_interface
284
    ja	 no_set_interface
285
    mov  [interface],eax
285
    mov  [interface],eax
286
    jmp  red
286
    jmp  red
287
   no_set_interface:
287
   no_set_interface:
288
 
288
 
289
    sub  eax,21-11
289
    sub  eax,21-11
290
    jb	 no_ip_sf
290
    jb	 no_ip_sf
291
    cmp  eax,22-21
291
    cmp  eax,22-21
292
    ja	 no_ip_sf
292
    ja	 no_ip_sf
293
    xor  eax,1
293
    xor  eax,1
294
    mov  [assigned],eax
294
    mov  [assigned],eax
295
    jmp  red
295
    jmp  red
296
    no_ip_sf:
296
    no_ip_sf:
297
    jmp  still
297
    jmp  still
298
 
298
 
299
apply_stack_setup:
299
apply_stack_setup:
300
 
300
 
301
    mov  eax,[com_irq]
301
    mov  eax,[com_irq]
302
    shl  eax,8
302
    shl  eax,8
303
    mov  ebx,[com_add]
303
    mov  ebx,[com_add]
304
    shl  ebx,16
304
    shl  ebx,16
305
    add  eax,ebx
305
    add  eax,ebx
306
    add  eax,[interface]
306
    add  eax,[interface]
307
    mov  ebx,[assigned]
307
    mov  ebx,[assigned]
308
    shl  ebx,7
308
    shl  ebx,7
309
    add  eax,ebx
309
    add  eax,ebx
310
    mov  [config],eax
310
    mov  [config],eax
311
 
311
 
312
    mov  eax,52
312
    mov  eax,52
313
    mov  ebx,3
313
    mov  ebx,3
314
    mov  ecx,dword [ip_address]
314
    mov  ecx,dword [ip_address]
315
    mcall
315
    mcall
316
 
316
 
317
    mov  eax,52
317
    mov  eax,52
318
    mov  ebx,11
318
    mov  ebx,11
319
    mov  ecx,dword [gateway_ip]
319
    mov  ecx,dword [gateway_ip]
320
    mcall
320
    mcall
321
 
321
 
322
    mov  eax,52
322
    mov  eax,52
323
    mov  ebx,12
323
    mov  ebx,12
324
    mov  ecx,dword [subnet_mask]
324
    mov  ecx,dword [subnet_mask]
325
    mcall
325
    mcall
326
 
326
 
327
    mov  eax,52
327
    mov  eax,52
328
    mov  ebx,14
328
    mov  ebx,14
329
    mov  ecx,dword [dns_ip]
329
    mov  ecx,dword [dns_ip]
330
    mcall
330
    mcall
331
 
331
 
332
    mov  eax,52
332
    mov  eax,52
333
    mov  ebx,2
333
    mov  ebx,2
334
    mov  ecx,[config]
334
    mov  ecx,[config]
335
    mcall
335
    mcall
336
 
336
 
337
    ret
337
    ret
338
 
338
 
339
 
339
 
340
string_length  dd    16
340
string_length  dd    16
341
string_x       dd    200
341
string_x       dd    200
342
string_y       dd    60
342
string_y       dd    60
343
 
343
 
344
string	       db    '________________'
344
string	       db    '________________'
345
 
345
 
346
 
346
 
347
read_string:
347
read_string:
348
 
348
 
349
    mov  edi,string
349
    mov  edi,string
350
    mov  eax,'_'
350
    mov  eax,'_'
351
    mov  ecx,[string_length]
351
    mov  ecx,[string_length]
352
    cld
352
    cld
353
    rep  stosb
353
    rep  stosb
354
    call print_text
354
    call print_text
355
 
355
 
356
    mov  edi,string
356
    mov  edi,string
357
  f11:
357
  f11:
358
    mov  eax,10
358
    mov  eax,10
359
    mcall
359
    mcall
360
    cmp  eax,2
360
    cmp  eax,2
361
    jne  read_done
361
    jne  read_done
362
;    mov  eax,2
362
;    mov  eax,2
363
    mcall
363
    mcall
364
    shr  eax,8
364
    shr  eax,8
365
    cmp  eax,13
365
    cmp  eax,13
366
    je	 read_done
366
    je	 read_done
367
    cmp  eax,8
367
    cmp  eax,8
368
    jnz  nobsl
368
    jnz  nobsl
369
    cmp  edi,string
369
    cmp  edi,string
370
    jz	 f11
370
    jz	 f11
371
    sub  edi,1
371
    sub  edi,1
372
    mov  [edi],byte '_'
372
    mov  [edi],byte '_'
373
    call print_text
373
    call print_text
374
    jmp  f11
374
    jmp  f11
375
  nobsl:
375
  nobsl:
376
    cmp  eax,dword 31
376
    cmp  eax,dword 31
377
    jbe  f11
377
    jbe  f11
378
    cmp  eax,dword 95
378
    cmp  eax,dword 95
379
    jb	 keyok
379
    jb	 keyok
380
    sub  eax,32
380
    sub  eax,32
381
  keyok:
381
  keyok:
382
    mov  [edi],al
382
    mov  [edi],al
383
    call print_text
383
    call print_text
384
 
384
 
385
    inc  edi
385
    inc  edi
386
    mov  esi,string
386
    mov  esi,string
387
    add  esi,[string_length]
387
    add  esi,[string_length]
388
    cmp  esi,edi
388
    cmp  esi,edi
389
    jnz  f11
389
    jnz  f11
390
 
390
 
391
  read_done:
391
  read_done:
392
 
392
 
393
print_text:
393
print_text:
394
 
394
 
395
    pusha
395
    pusha
396
 
396
 
397
    mov  eax,13
397
    mov  eax,13
398
    mov  ebx,[string_x]
398
    mov  ebx,[string_x]
399
    shl  ebx,16
399
    shl  ebx,16
400
    add  ebx,[string_length]
400
    add  ebx,[string_length]
401
    imul bx,6
401
    imul bx,6
402
    mov  ecx,[string_y]
402
    mov  ecx,[string_y]
403
    shl  ecx,16
403
    shl  ecx,16
404
    mov  cx,8
404
    mov  cx,8
405
    mov  edx,0xffffff
405
    mov  edx,0xffffff
406
    mcall
406
    mcall
407
 
407
 
408
    mov  eax,4
408
    mov  eax,4
409
    mov  ebx,[string_x]
409
    mov  ebx,[string_x]
410
    shl  ebx,16
410
    shl  ebx,16
411
    add  ebx,[string_y]
411
    add  ebx,[string_y]
412
    mov  ecx,0x000000
412
    mov  ecx,0x000000
413
    mov  edx,string
413
    mov  edx,string
414
    mov  esi,[string_length]
414
    mov  esi,[string_length]
415
    mcall
415
    mcall
416
 
416
 
417
    popa
417
    popa
418
    ret
418
    ret
419
 
419
 
420
 
420
 
421
 
421
 
422
 
422
 
423
 
423
 
424
 
424
 
425
 
425
 
426
;   *********************************************
426
;   *********************************************
427
;   *******  WINDOW DEFINITIONS AND DRAW ********
427
;   *******  WINDOW DEFINITIONS AND DRAW ********
428
;   *********************************************
428
;   *********************************************
429
 
429
 
430
 
430
 
431
draw_window:
431
draw_window:
432
 
432
 
433
    mov  eax,12 		   ; function 12:tell os about windowdraw
433
    mov  eax,12 		   ; function 12:tell os about windowdraw
434
    mov  ebx,1			   ; 1, start of draw
434
    mov  ebx,1			   ; 1, start of draw
435
    mcall
435
    mcall
436
 
436
 
437
				   ; DRAW WINDOW
437
				   ; DRAW WINDOW
438
    mov  eax,0			   ; function 0 : define and draw window
438
    mov  eax,0			   ; function 0 : define and draw window
439
    mov  ebx,100*65536+330	   ; [x start] *65536 + [x size]
439
    mov  ebx,100*65536+330	   ; [x start] *65536 + [x size]
440
    mov  ecx,100*65536+157	   ; [y start] *65536 + [y size]
440
    mov  ecx,100*65536+157	   ; [y start] *65536 + [y size]
441
    mov  edx,0x14ffffff 	   ; color of work area RRGGBB,8->color gl
441
    mov  edx,0x14ffffff 	   ; color of work area RRGGBB,8->color gl
442
    mov  edi,title		  ; WINDOW LABEL
442
    mov  edi,title		  ; WINDOW LABEL
443
    mcall
443
    mcall
444
 
444
 
445
 
445
 
446
    mov  eax,8			   ; BUTTON : READ SETUP
446
    mov  eax,8			   ; BUTTON : READ SETUP
447
    mov  ebx,90*65536+65
447
    mov  ebx,90*65536+65
448
    mov  ecx,127*65536+12
448
    mov  ecx,127*65536+12
449
    mov  edx,2
449
    mov  edx,2
450
    mov  esi,[button_color]
450
    mov  esi,[button_color]
451
    mcall
451
    mcall
452
 
452
 
453
    ;mov  eax,8                     ; BUTTON : APPLY SETUP
453
    ;mov  eax,8                     ; BUTTON : APPLY SETUP
454
    mov  ebx,163*65536+65
454
    mov  ebx,163*65536+65
455
    mov  ecx,127*65536+12
455
    mov  ecx,127*65536+12
456
    mov  edx,3
456
    mov  edx,3
457
    mcall
457
    mcall
458
 
458
 
459
    ;mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
459
    ;mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
460
    mov  ebx,29*65536+8
460
    mov  ebx,29*65536+8
461
    mov  ecx,39*65536+8
461
    mov  ecx,39*65536+8
462
    mov  edx,11
462
    mov  edx,11
463
  interface_select:
463
  interface_select:
464
    mcall
464
    mcall
465
    add  ecx,10*65536
465
    add  ecx,10*65536
466
    inc  edx
466
    inc  edx
467
    cmp  edx,11+4
467
    cmp  edx,11+4
468
    jb	 interface_select
468
    jb	 interface_select
469
 
469
 
470
    mov  ebx,[interface]	   ; PRINT SELECTED INTERFACE 'X'
470
    mov  ebx,[interface]	   ; PRINT SELECTED INTERFACE 'X'
471
    imul ebx,10
471
    imul ebx,10
472
    add  ebx,31*65536+39
472
    add  ebx,31*65536+39
473
    mov  eax,4
473
    mov  eax,4
474
    mov  ecx,0xffffff
474
    mov  ecx,0xffffff
475
    mov  edx,xx
475
    mov  edx,xx
476
    mov  esi,1
476
    mov  esi,1
477
    mcall
477
    mcall
478
 
478
 
479
    mov  eax,8			  ; BUTTONS 21-22 : SERVER / MANUAL IP
479
    mov  eax,8			  ; BUTTONS 21-22 : SERVER / MANUAL IP
480
    mov  ebx,143*65536+8
480
    mov  ebx,143*65536+8
481
    mov  ecx,69*65536+8
481
    mov  ecx,69*65536+8
482
    mov  edx,21
482
    mov  edx,21
483
    mov  esi,[button_color]
483
    mov  esi,[button_color]
484
    mcall
484
    mcall
485
    ;mov  eax,8
485
    ;mov  eax,8
486
    mov  ebx,143*65536+8
486
    mov  ebx,143*65536+8
487
    mov  ecx,79*65536+8
487
    mov  ecx,79*65536+8
488
    mov  edx,22
488
    mov  edx,22
489
    mcall
489
    mcall
490
    mov  ebx,[assigned] 	  ; PRINT SELECTED SERVER/MANUAL 'X'
490
    mov  ebx,[assigned] 	  ; PRINT SELECTED SERVER/MANUAL 'X'
491
    not  ebx
491
    not  ebx
492
    and  ebx,1
492
    and  ebx,1
493
    imul ebx,10
493
    imul ebx,10
494
    add  ebx,145*65536+69
494
    add  ebx,145*65536+69
495
    mov  eax,4
495
    mov  eax,4
496
    mov  ecx,0xffffff
496
    mov  ecx,0xffffff
497
    mov  edx,xx
497
    mov  edx,xx
498
    mov  esi,1
498
    mov  esi,1
499
    mcall
499
    mcall
500
 
500
 
501
    mov  eax,47 		  ; COM ADDRESS
501
    mov  eax,47 		  ; COM ADDRESS
502
    mov  ebx,3*65536+1*256
502
    mov  ebx,3*65536+1*256
503
    mov  ecx,[com_add]
503
    mov  ecx,[com_add]
504
    mov  edx,272*65536+40
504
    mov  edx,272*65536+40
505
    mov  esi,0x000000
505
    mov  esi,0x000000
506
    mcall
506
    mcall
507
 
507
 
508
    ;mov  eax,47                   ; COM IRQ
508
    ;mov  eax,47                   ; COM IRQ
509
    mov  ebx,1*65536+1*256
509
    mov  ebx,1*65536+1*256
510
    mov  ecx,[com_irq]
510
    mov  ecx,[com_irq]
511
    mov  edx,(266+3*6)*65536+50
511
    mov  edx,(266+3*6)*65536+50
512
    mov  esi,0x000000
512
    mov  esi,0x000000
513
    mcall
513
    mcall
514
 
514
 
515
    mov  edi,ip_address
515
    mov  edi,ip_address
516
    mov  edx,205*65536+80
516
    mov  edx,205*65536+80
517
    mov  esi,0x000000
517
    mov  esi,0x000000
518
    mov  ebx,3*65536
518
    mov  ebx,3*65536
519
  ipdisplay:
519
  ipdisplay:
520
    ;mov  eax,47
520
    ;mov  eax,47
521
    movzx ecx,byte [edi]
521
    movzx ecx,byte [edi]
522
    mcall
522
    mcall
523
    add  edx,6*4*65536
523
    add  edx,6*4*65536
524
    inc  edi
524
    inc  edi
525
    cmp  edi,ip_address+4
525
    cmp  edi,ip_address+4
526
    jb	 ipdisplay
526
    jb	 ipdisplay
527
 
527
 
528
    mov  edi,gateway_ip
528
    mov  edi,gateway_ip
529
    mov  edx,205*65536+90
529
    mov  edx,205*65536+90
530
    mov  esi,0x000000
530
    mov  esi,0x000000
531
    mov  ebx,3*65536
531
    mov  ebx,3*65536
532
  gipdisplay:
532
  gipdisplay:
533
    ;mov  eax,47
533
    ;mov  eax,47
534
    movzx ecx,byte [edi]
534
    movzx ecx,byte [edi]
535
    mcall
535
    mcall
536
    add  edx,6*4*65536
536
    add  edx,6*4*65536
537
    inc  edi
537
    inc  edi
538
    cmp  edi,gateway_ip+4
538
    cmp  edi,gateway_ip+4
539
    jb	 gipdisplay
539
    jb	 gipdisplay
540
 
540
 
541
    mov  edi,subnet_mask
541
    mov  edi,subnet_mask
542
    mov  edx,205*65536+100
542
    mov  edx,205*65536+100
543
    mov  esi,0x000000
543
    mov  esi,0x000000
544
    mov  ebx,3*65536
544
    mov  ebx,3*65536
545
  sipdisplay:
545
  sipdisplay:
546
    ;mov  eax,47
546
    ;mov  eax,47
547
    movzx ecx,byte [edi]
547
    movzx ecx,byte [edi]
548
    mcall
548
    mcall
549
    add  edx,6*4*65536
549
    add  edx,6*4*65536
550
    inc  edi
550
    inc  edi
551
    cmp  edi,subnet_mask+4
551
    cmp  edi,subnet_mask+4
552
    jb	 sipdisplay
552
    jb	 sipdisplay
553
 
553
 
554
    mov  edi,dns_ip
554
    mov  edi,dns_ip
555
    mov  edx,205*65536+110
555
    mov  edx,205*65536+110
556
    mov  esi,0x000000
556
    mov  esi,0x000000
557
    mov  ebx,3*65536
557
    mov  ebx,3*65536
558
  dipdisplay:
558
  dipdisplay:
559
    ;mov  eax,47
559
    ;mov  eax,47
560
    movzx ecx,byte [edi]
560
    movzx ecx,byte [edi]
561
    mcall
561
    mcall
562
    add  edx,6*4*65536
562
    add  edx,6*4*65536
563
    inc  edi
563
    inc  edi
564
    cmp  edi,dns_ip+4
564
    cmp  edi,dns_ip+4
565
    jb	 dipdisplay
565
    jb	 dipdisplay
566
 
566
 
567
 
567
 
568
    mov  eax,8			   ; BUTTON 5 : SET PORT
568
    mov  eax,8			   ; BUTTON 5 : SET PORT
569
    mov  ebx,299*65536+8
569
    mov  ebx,299*65536+8
570
    mov  ecx,39*65536+8
570
    mov  ecx,39*65536+8
571
    mov  edx,5
571
    mov  edx,5
572
    mov  esi,[button_color]
572
    mov  esi,[button_color]
573
    mcall
573
    mcall
574
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
574
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
575
    mov  ecx,49*65536+8
575
    mov  ecx,49*65536+8
576
    inc  edx
576
    inc  edx
577
    mcall
577
    mcall
578
    ;mov  eax,8                     ; BUTTON 7 : SET IP
578
    ;mov  eax,8                     ; BUTTON 7 : SET IP
579
    mov  ecx,79*65536+8
579
    mov  ecx,79*65536+8
580
    inc  edx
580
    inc  edx
581
    mcall
581
    mcall
582
 
582
 
583
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
583
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
584
    mov  ebx,299*65536+8
584
    mov  ebx,299*65536+8
585
    mov  ecx,89*65536+8
585
    mov  ecx,89*65536+8
586
    inc  edx
586
    inc  edx
587
    mcall
587
    mcall
588
 
588
 
589
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
589
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
590
    mov  ecx,99*65536+8
590
    mov  ecx,99*65536+8
591
    inc  edx
591
    inc  edx
592
    mcall
592
    mcall
593
 
593
 
594
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
594
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
595
    mov  ecx,109*65536+8
595
    mov  ecx,109*65536+8
596
    inc  edx
596
    inc  edx
597
    mcall
597
    mcall
598
 
598
 
599
    mov  ebx,31*65536+40	   ; draw info text with function 4
599
    mov  ebx,31*65536+40	   ; draw info text with function 4
600
    mov  edx,text
600
    mov  edx,text
601
    mov  esi,49
601
    mov  esi,49
602
    mov  eax,4
602
    mov  eax,4
603
  newline:
603
  newline:
604
    mov  ecx,0x224466
604
    mov  ecx,0x224466
605
    cmp  [edx],byte 'w'
605
    cmp  [edx],byte 'w'
606
    jne  nowhite
606
    jne  nowhite
607
    mov  ecx,0xeeeeee
607
    mov  ecx,0xeeeeee
608
   nowhite:
608
   nowhite:
609
    inc  edx
609
    inc  edx
610
    mcall
610
    mcall
611
    add  ebx,10
611
    add  ebx,10
612
    add  edx,49
612
    add  edx,49
613
    cmp  [edx],byte 'x'
613
    cmp  [edx],byte 'x'
614
    jne  newline
614
    jne  newline
615
 
615
 
616
    mov  eax,12 		   ; function 12:tell os about windowdraw
616
    mov  eax,12 		   ; function 12:tell os about windowdraw
617
    mov  ebx,2			   ; 2, end of draw
617
    mov  ebx,2			   ; 2, end of draw
618
    mcall
618
    mcall
619
 
619
 
620
    ret
620
    ret
621
 
621
 
622
 
622
 
623
; DATA AREA
623
; DATA AREA
624
 
624
 
625
if lang eq ru
625
if lang eq ru
626
title	   db  ' áâனª  á¥â¥¢®£® á⥪ ',0
626
title	   db  ' áâனª  á¥â¥¢®£® á⥪ ',0
627
text:
627
text:
628
    db '   ¥ ªâ¨¢­ë©      Œ®¤¥¬ ­  Com-¯®àâã: 0x     <   '
628
    db '   ¥ ªâ¨¢­ë©      Œ®¤¥¬ ­  Com-¯®àâã: 0x     <   '
629
    db '   Slip            à¥à뢠­¨¥ ¬®¤¥¬ :    0x   <   '
629
    db '   Slip            à¥à뢠­¨¥ ¬®¤¥¬ :    0x   <   '
630
    db '   PPP                                            '
630
    db '   PPP                                            '
631
    db '   „à ©¢¥à ¯ ª¥â®¢    IP server ­ §­ ç¥­­ë©       '
631
    db '   „à ©¢¥à ¯ ª¥â®¢    IP ­ §­ ç ¥âáï á¥à¢¥à®¬     '
632
    db '   (Ethernet)         ”¨ªá.      .   .   .    <   '
632
    db '   (Ethernet)         ”¨ªá.:     .   .   .    <   '
633
    db '                      ˜«î§:      .   .   .    <   '
633
    db '                      ˜«î§:      .   .   .    <   '
634
    db '                      ®¤á¥âì:   .   .   .    <   '
634
    db '                      ®¤á¥âì:   .   .   .    <   '
635
    db '                      DNS IP:    .   .   .    <   '
635
    db '                      DNS IP:    .   .   .    <   '
636
    db '                                                  '
636
    db '                                                  '
637
    db 'w            —¨â âì     à¨¬¥­¨âì                 '
637
    db 'w            —¨â âì     à¨¬¥­¨âì                 '
638
 
638
 
639
elseif lang eq nl
639
else if lang eq nl
640
title	   db  'Netwerk configuratie',0
640
title	   db  'Netwerk configuratie',0
641
text:
641
text:
642
    db '   Niet actief      Modem Com Poort:   0x     <   '
642
    db '   Niet actief      Modem Com Poort:   0x     <   '
643
    db '   Slip             Modem Com Irq:       0x   <   '
643
    db '   Slip             Modem Com Irq:       0x   <   '
644
    db '   PPP                                            '
644
    db '   PPP                                            '
645
    db '   Pakket Driver      Door IP-server toegekend    '
645
    db '   Pakket Driver      Door IP-server toegekend    '
646
    db '   (Ethernet)         Vast IP:   .   .   .    <   '
646
    db '   (Ethernet)         Vast IP:   .   .   .    <   '
647
    db '                      Gateway:   .   .   .    <   '
647
    db '                      Gateway:   .   .   .    <   '
648
    db '                      Subnet:    .   .   .    <   '
648
    db '                      Subnet:    .   .   .    <   '
649
    db '                      DNS IP:    .   .   .    <   '
649
    db '                      DNS IP:    .   .   .    <   '
650
    db '                                                  '
650
    db '                                                  '
651
    db 'w            Vernieuw   Toepassen                 '
651
    db 'w            Vernieuw   Toepassen                 '
-
 
652
 
-
 
653
else if lang eq ua
-
 
654
title	   db  ' « èâ㢠­­ï ¬¥à¥¦i'
-
 
655
text:
-
 
656
    db '   ¥ ªâ¨¢­¨©      Œ®¤¥¬ ­  Com-¯®àâã  0x     <   '
-
 
657
    db '   Slip            Com-¯®àâ ¬®¤¥¬ :      0x   <   '
-
 
658
    db '   PPP                                            '
-
 
659
    db '   „à ©¢¥à ¯ ª¥âi¢    IP ¯à¨§­ ç óâìáï á¥à¢¥à®¬   '
-
 
660
    db '   (Ethernet)         ”iªá.:     .   .   .    <   '
-
 
661
    db '                      Œ àèàãâ:   .   .   .    <   '
-
 
662
    db '                      Œ áª :     .   .   .    <   '
-
 
663
    db '                      DNS IP     .   .   .    <   '
-
 
664
    db '                                                  '
-
 
665
    db 'w           à®ç¨â â¨  ‡ áâ®á㢠⨠               '
652
 
666
 
653
else
667
else
654
title	   db  'Stack configuration',0
668
title	   db  'Stack configuration',0
655
text:
669
text:
656
    db '   Not active       Modem Com Port:    0x     <   '
670
    db '   Not active       Modem Com Port:    0x     <   '
657
    db '   Slip             Modem Com Irq:       0x   <   '
671
    db '   Slip             Modem Com Irq:       0x   <   '
658
    db '   PPP                                            '
672
    db '   PPP                                            '
659
    db '   Packet Driver      IP server assigned          '
673
    db '   Packet Driver      IP server assigned          '
660
    db '   (Ethernet)         Fixed:     .   .   .    <   '
674
    db '   (Ethernet)         Fixed:     .   .   .    <   '
661
    db '                      Gateway:   .   .   .    <   '
675
    db '                      Gateway:   .   .   .    <   '
662
    db '                      Subnet:    .   .   .    <   '
676
    db '                      Subnet:    .   .   .    <   '
663
    db '                      DNS IP:    .   .   .    <   '
677
    db '                      DNS IP:    .   .   .    <   '
664
    db '                                                  '
678
    db '                                                  '
665
    db 'w             READ        APPLY                   '
679
    db 'w             READ        APPLY                   '
666
    end if
680
    end if
667
 
681
 
668
xx: db 'x' ;<- END MARKER, DONT DELETE
682
xx: db 'x' ;<- END MARKER, DONT DELETE
669
 
683
 
670
button_color dd  0x2254b9
684
button_color dd  0x2254b9
671
 
685
 
672
 
686
 
673
 
687
 
674
ip_address  dd ?
688
ip_address  dd ?
675
gateway_ip  dd ?
689
gateway_ip  dd ?
676
subnet_mask dd ?
690
subnet_mask dd ?
677
dns_ip	    dd ?
691
dns_ip	    dd ?
678
 
692
 
679
 
693
 
680
com_irq     dd	    ?	; irq for slip/ppp
694
com_irq     dd	    ?	; irq for slip/ppp
681
com_add     dd	    ?	; com port address for slip/ppp
695
com_add     dd	    ?	; com port address for slip/ppp
682
interface   dd	    ?	; not active,slip,ppp,packet driver
696
interface   dd	    ?	; not active,slip,ppp,packet driver
683
assigned    dd	    ?	; get ip from server
697
assigned    dd	    ?	; get ip from server
684
 
698
 
685
config	    dd	    ?
699
config	    dd	    ?
686
 
700
 
687
I_END:
701
I_END: