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 485
Line 14... Line 14...
14
                dd      START                   ; program start
14
                dd      START                   ; program start
15
                dd      I_END                   ; program image size
15
                dd      I_END                   ; program image size
16
                dd      0x100000                ; required amount of memory
16
                dd      0x100000                ; required amount of memory
17
                dd      0x00000000              ; reserved=no extended header
17
                dd      0x00000000              ; reserved=no extended header
18
   include 'lang.inc'
18
   include 'lang.inc'
19
   include 'macros.inc'
19
   include '..\..\..\macros.inc'
Line 20... Line 20...
20
   
20
   
21
START:                          ; start of execution
21
START:                          ; start of execution
Line 22... Line 22...
22
    call draw_window            ; at first, draw the window
22
    call draw_window            ; at first, draw the window
23
   
23
   
24
still:
24
still:
25
    mov  eax,23                 ; wait here for event
25
    mov  eax,23                 ; wait here for event
Line 26... Line 26...
26
    mov  ebx,200				; Time out after 2s
26
    mov  ebx,200				; Time out after 2s
27
    int  0x40
27
    mcall
28
   
28
   
29
    cmp  eax,1                  ; redraw request ?
29
    cmp  eax,1                  ; redraw request ?
Line 36... Line 36...
36
	; read the stack status data, and write it to the screen buffer
36
	; read the stack status data, and write it to the screen buffer
Line 37... Line 37...
37
 
37
 
38
	mov		eax, 53
38
	mov		eax, 53
39
	mov		ebx, 255
39
	mov		ebx, 255
40
	mov		ecx, 200
40
	mov		ecx, 200
Line 41... Line 41...
41
	int		0x40
41
	mcall
42
 
42
 
43
	push    eax		
43
	push    eax		
Line 44... Line 44...
44
	mov		ebx, text + 24
44
	mov		ebx, text + 24
45
	call	printhex
45
	call	printhex
46
 
46
 
47
	mov		eax, 53
47
	mov		eax, 53
Line 48... Line 48...
48
	mov		ebx, 255
48
	mov		ebx, 255
49
	mov		ecx, 201
49
	mov		ecx, 201
Line 92... Line 92...
92
 
92
 
93
	; select the arp table entry (in edx)
93
	; select the arp table entry (in edx)
94
	mov		eax, 53
94
	mov		eax, 53
95
	mov		ebx, 255
95
	mov		ebx, 255
96
	mov		ecx, 202
96
	mov		ecx, 202
Line 97... Line 97...
97
	int		0x40
97
	mcall
98
	
98
	
99
	; Read the IP address
99
	; Read the IP address
100
	mov		eax, 53
100
	mov		eax, 53
101
	mov		ebx, 255
101
	mov		ebx, 255
Line 102... Line 102...
102
	mov		ecx, 203
102
	mov		ecx, 203
103
	int		0x40
103
	mcall
104
	
104
	
Line 122... Line 122...
122
	; Now display the 6 byte MAC
122
	; Now display the 6 byte MAC
123
	push		ebx
123
	push		ebx
124
	mov		eax, 53
124
	mov		eax, 53
125
	mov		ebx, 255
125
	mov		ebx, 255
126
	mov		ecx, 204
126
	mov		ecx, 204
127
	int		0x40
127
	mcall
128
	pop		ebx
128
	pop		ebx
Line 129... Line 129...
129
		
129
		
Line 130... Line 130...
130
	mov		ecx, eax
130
	mov		ecx, eax
Line 177... Line 177...
177
 
177
 
178
	push		ebx
178
	push		ebx
179
	mov		eax, 53
179
	mov		eax, 53
180
	mov		ebx, 255
180
	mov		ebx, 255
181
	mov		ecx, 205
181
	mov		ecx, 205
182
	int		0x40
182
	mcall
Line 183... Line 183...
183
	pop		ebx
183
	pop		ebx
Line 184... Line 184...
184
	
184
	
Line 211... Line 211...
211
	inc		ebx
211
	inc		ebx
212
	push		ebx
212
	push		ebx
213
	mov		eax, 53
213
	mov		eax, 53
214
	mov		ebx, 255
214
	mov		ebx, 255
215
	mov		ecx, 206
215
	mov		ecx, 206
216
	int		0x40
216
	mcall
217
	pop		ebx
217
	pop		ebx
Line 218... Line 218...
218
	
218
	
Line 219... Line 219...
219
	mov		ecx, eax
219
	mov		ecx, eax
Line 245... Line 245...
245
	inc		ebx
245
	inc		ebx
246
	push		ebx
246
	push		ebx
247
	mov		eax, 53
247
	mov		eax, 53
248
	mov		ebx, 255
248
	mov		ebx, 255
249
	mov		ecx, 207
249
	mov		ecx, 207
250
	int		0x40
250
	mcall
251
	pop		ebx
251
	pop		ebx
Line 252... Line 252...
252
	
252
	
Line 253... Line 253...
253
	mov		ecx, eax
253
	mov		ecx, eax
Line 287... Line 287...
287
    call draw_window
287
    call draw_window
288
    jmp  still
288
    jmp  still
Line 289... Line 289...
289
   
289
   
290
key:                          	; Keys are not valid at this part of the
290
key:                          	; Keys are not valid at this part of the
291
    mov  eax,2                  ; loop. Just read it and ignore
291
    mov  eax,2                  ; loop. Just read it and ignore
292
    int  0x40
292
    mcall
Line 293... Line 293...
293
    jmp  still
293
    jmp  still
294
   
294
   
295
button:                       	; button
295
button:                       	; button
Line 296... Line 296...
296
    mov  eax,17                 ; get id
296
    mov  eax,17                 ; get id
297
    int  0x40
297
    mcall
Line 298... Line 298...
298
   
298
   
299
    cmp  ah,1                   ; button id=1 ?
299
    cmp  ah,1                   ; button id=1 ?
Line 300... Line 300...
300
    jnz  still
300
    jnz  still
Line 337... Line 337...
337
   
337
   
Line 338... Line 338...
338
draw_window:
338
draw_window:
339
   
339
   
340
    mov  eax,12                    ; function 12:tell os about windowdraw
340
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 341... Line 341...
341
    mov  ebx,1                     ; 1, start of draw
341
    mov  ebx,1                     ; 1, start of draw
342
    int  0x40
342
    mcall
343
   
343
   
344
                                   ; DRAW WINDOW
344
                                   ; DRAW WINDOW
345
    mov  eax,0                     ; function 0 : define and draw window
345
    mov  eax,0                     ; function 0 : define and draw window
346
    mov  ebx,100*65536+280         ; [x start] *65536 + [x size]
-
 
347
    mov  ecx,100*65536+270         ; [y start] *65536 + [y size]
346
    mov  ebx,100*65536+280         ; [x start] *65536 + [x size]
348
    mov  edx,0x03224466            ; color of work area RRGGBB
347
    mov  ecx,100*65536+270         ; [y start] *65536 + [y size]
349
    mov  esi,0x00334455            ; color of grab bar  RRGGBB,8->color gl
348
    mov  edx,0x13224466            ; color of work area RRGGBB
350
    mov  edi,0x00ddeeff            ; color of frames    RRGGBB
-
 
351
    int  0x40
-
 
352
   
-
 
353
                                   ; WINDOW LABEL
-
 
354
    mov  eax,4                     ; function 4 : write text to window
-
 
355
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
356
    mov  ecx,0x00ffffff            ; color of text RRGGBB
-
 
Line 357... Line 349...
357
    mov  edx,labelt                ; pointer to text beginning
349
    mov  edi,title                 ; WINDOW LABEL
358
    mov  esi,labellen-labelt       ; text length
350
    mcall
-
 
351
   
359
    int  0x40
352
                                   
360
   
353
   	; Re-draw the screen text
361
   	; Re-draw the screen text
354
    cld
362
    cld
355
    mov  eax,4
363
    mov  ebx,25*65536+35           ; draw info text with function 4
356
    mov  ebx,25*65536+35           ; draw info text with function 4
364
    mov  ecx,0xffffff
357
    mov  ecx,0xffffff
365
    mov  edx,text
-
 
366
    mov  esi,40
358
    mov  edx,text
367
  newline:
359
    mov  esi,40
368
    mov  eax,4
360
  newline:
369
    int  0x40
361
    mcall
Line 370... Line 362...
370
    add  ebx,16
362
    add  ebx,16
371
    add  edx,40
363
    add  edx,40
372
    cmp  [edx],byte 'x'
364
    cmp  [edx],byte 'x'
Line 373... Line 365...
373
    jnz  newline
365
    jnz  newline
Line 374... Line 366...
374
   
366
   
375
   
367
   
Line 424... Line 416...
424
 
416
 
425
blank:
417
blank:
Line 426... Line -...
426
 	  db ' xxx.xxx.xxx.xxx xxxxxxxxxxxx xxxx xxxx '
-
 
427
 
418
 	  db ' xxx.xxx.xxx.xxx xxxxxxxxxxxx xxxx xxxx '
428
 
-
 
Line 429... Line 419...
429
labelt:
419
 
Line 430... Line 420...
430
    db   'ARP Table ( First 10 Entries )'
420